# HG changeset patch # User hgs # Date 1284967147 -10800 # Node ID 3ac3aaebaee5b2a7906ee595aacd7be84f4e3af8 # Parent e4f038c420f77b986832507293afaa64e6f38b02 201037 diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/examples/batterywidgetplugin/batterywidgetplugin.pro --- a/homescreenapp/examples/batterywidgetplugin/batterywidgetplugin.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/examples/batterywidgetplugin/batterywidgetplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -46,6 +46,8 @@ DEPLOYMENT += plugins \ widgetResources + + MMP_RULES += SMPSAFE } win32: { diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/examples/contentpublishclient/contentpublishclient.pro --- a/homescreenapp/examples/contentpublishclient/contentpublishclient.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/examples/contentpublishclient/contentpublishclient.pro Mon Sep 20 10:19:07 2010 +0300 @@ -43,6 +43,8 @@ DEPLOYMENT += testwallpaperimages + MMP_RULES += SMPSAFE + } else { error("Only Symbian supported!") } \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/examples/helloworldwidgetplugin/helloworldwidgetplugin.pro --- a/homescreenapp/examples/helloworldwidgetplugin/helloworldwidgetplugin.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/examples/helloworldwidgetplugin/helloworldwidgetplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -49,6 +49,8 @@ BLD_INF_RULES.prj_exports += \ "./rom/helloworldwidgetplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(helloworldwidgetplugin.iby)" + + MMP_RULES += SMPSAFE } win32: { diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/examples/localisedhellowidgetplugin/localisedhellowidgetplugin.pro --- a/homescreenapp/examples/localisedhellowidgetplugin/localisedhellowidgetplugin.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/examples/localisedhellowidgetplugin/localisedhellowidgetplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -53,6 +53,8 @@ BLD_INF_RULES.prj_exports += \ "./rom/localisedhellowidgetplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(localisedhellowidgetplugin.iby)" \ "./rom/localisedhellowidgetpluginresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(localisedhellowidgetpluginresources.iby)" + + MMP_RULES += SMPSAFE } win32: { diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/examples/localisedhellowidgetplugin/sis/localisedhellowidgetplugin.pkg --- a/homescreenapp/examples/localisedhellowidgetplugin/sis/localisedhellowidgetplugin.pkg Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/examples/localisedhellowidgetplugin/sis/localisedhellowidgetplugin.pkg Mon Sep 20 10:19:07 2010 +0300 @@ -41,5 +41,5 @@ "/epoc32/data/z/private/20022F35/import/widgetregistry/20022F80/localisedhellowidgetplugin.png" - "!:/private/20022F35/import/widgetregistry/20022F80/localisedhellowidgetplugin.png" "/epoc32/data/z/resource/qt/translations/localisedhellowidgetplugin.qm" - "!:/resource/qt/translations/localisedhellowidgetplugin.qm" "/epoc32/data/z/resource/qt/translations/localisedhellowidgetplugin_fi.qm" - "!:/resource/qt/translations/localisedhellowidgetplugin_fi.qm" +"/epoc32/data/z/resource/qt/translations/localisedhellowidgetplugin_en.qm" - "!:/resource/qt/translations/localisedhellowidgetplugin_en.qm" "/epoc32/data/z/resource/qt/translations/localisedhellowidgetplugin_en_us.qm" - "!:/resource/qt/translations/localisedhellowidgetplugin_en_us.qm" -"/epoc32/data/z/resource/qt/translations/localisedhellowidgetplugin_en_gb.qm" - "!:/resource/qt/translations/localisedhellowidgetplugin_en_gb.qm" diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/examples/minibrowserwidgetplugin/minibrowserwidgetplugin.pro --- a/homescreenapp/examples/minibrowserwidgetplugin/minibrowserwidgetplugin.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/examples/minibrowserwidgetplugin/minibrowserwidgetplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -48,6 +48,8 @@ DEPLOYMENT += plugins \ widgetResources + + MMP_RULES += SMPSAFE } win32: { diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/conf/confml/CI_homescreendb.confml --- a/homescreenapp/hsapplication/conf/confml/CI_homescreendb.confml Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsapplication/conf/confml/CI_homescreendb.confml Mon Sep 20 10:19:07 2010 +0300 @@ -117,7 +117,9 @@ isSnapEffectsEnabledtrue sceneTypePageWallpapers bounceAnimationEasingCurveLinear - pageChangeAnimationEasingCurveLinear + pageChangeAnimationEasingCurveLinear + widgetOrganizerAnchorDistance5 + widgetOrganizerSearchSequenceSearchRowByRow diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/conf/confml/homescreendb.confml --- a/homescreenapp/hsapplication/conf/confml/homescreendb.confml Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsapplication/conf/confml/homescreendb.confml Mon Sep 20 10:19:07 2010 +0300 @@ -1,5 +1,5 @@ - + @@ -117,7 +117,9 @@ isSnapEffectsEnabledtrue sceneTypePageWallpapers bounceAnimationEasingCurveLinear - pageChangeAnimationEasingCurveLinear + pageChangeAnimationEasingCurveLinear + widgetOrganizerAnchorDistance5 + widgetOrganizerSearchSequenceSearchRowByRow diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/hsapplication.pro --- a/homescreenapp/hsapplication/hsapplication.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsapplication/hsapplication.pro Mon Sep 20 10:19:07 2010 +0300 @@ -27,8 +27,6 @@ fute:DEFINES += FUTE -new_short:DEFINES += HSWIDGETORGANIZER_ALGORITHM - DEPENDPATH += . \ ./inc \ ./src @@ -58,9 +56,11 @@ include(hsapplication_exports_to_rom.pri) CONFIG += service - LIBS += -lxqservice -lxqserviceutil -lXQKeyCapture -lxqtelephonyservice + LIBS += -lxqservice -lxqserviceutil -lXQKeyCapture SERVICE.FILE = ipc_service_conf.xml + + MMP_RULES += SMPSAFE } !symbian: { diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/inc/hsstatemachine.h --- a/homescreenapp/hsapplication/inc/hsstatemachine.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsapplication/inc/hsstatemachine.h Mon Sep 20 10:19:07 2010 +0300 @@ -54,7 +54,6 @@ private: Q_DISABLE_COPY(HsStateMachine) - void startDialer(); void registerAnimations(); void createStatePublisher(); void createContentServiceParts(); @@ -71,11 +70,10 @@ private: HsContentService *mContentService; - bool mHomeScreenActive; - bool mIdleStateActive; + bool mHomeScreenActive; + bool mIdleStateActive; bool mEndKeyCaptured; - bool mSendKeyCaptured; - + QValueSpacePublisher *mPublisher; #ifdef Q_OS_SYMBIAN diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/resource/resource_emulator/homescreen.db Binary file homescreenapp/hsapplication/resource/resource_emulator/homescreen.db has changed diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/resource/resource_win/homescreen.db Binary file homescreenapp/hsapplication/resource/resource_win/homescreen.db has changed diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/src/hsstatemachine.cpp --- a/homescreenapp/hsapplication/src/hsstatemachine.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsapplication/src/hsstatemachine.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -46,13 +46,6 @@ #include "hstest_global.h" #include "hswidgetpositioningonwidgetmove.h" -#ifdef Q_OS_SYMBIAN -#include -#include -#include -#include -#endif // Q_OS_SYMBIAN - QTM_USE_NAMESPACE #define hbApp qobject_cast(qApp) @@ -87,7 +80,6 @@ mHomeScreenActive(false), mIdleStateActive(false), mEndKeyCaptured(false), - mSendKeyCaptured(false), mPublisher(NULL) #ifdef Q_OS_SYMBIAN ,keyCapture() @@ -110,14 +102,13 @@ HsWidgetPositioningOnOrientationChange::setInstance( new HsAdvancedWidgetPositioningOnOrientationChange); -#ifdef HSWIDGETORGANIZER_ALGORITHM - HsWidgetPositioningOnWidgetAdd::setInstance( - new HsWidgetOrganizer); -#else - HsWidgetPositioningOnWidgetAdd::setInstance( - new HsAnchorPointInBottomRight); -#endif - + + HsWidgetPositioningOnWidgetAdd *widgetOrganizer = + new HsWidgetOrganizer(HSCONFIGURATION_GET(snapGap), + HSCONFIGURATION_GET(widgetOrganizerSearchSequence)); + + HsWidgetPositioningOnWidgetAdd::setInstance(widgetOrganizer); + HsWidgetPositioningOnWidgetMove::setInstance( new HsSnapToLines); @@ -178,83 +169,14 @@ } bool result = QStateMachine::eventFilter(watched, event); - + if (event->type() == QEvent::KeyPress ) { - QKeyEvent* ke = static_cast(event); - int key = ke->key(); - - if (key == Qt::Key_Home ) { - result = true; - } - else if (key == Qt::Key_Yes ) { - result = true; - if (mSendKeyCaptured == false && mHomeScreenActive == true) { - mSendKeyCaptured = true; - startDialer(); - } - } + QKeyEvent* ke = static_cast(event); + result = (ke->key() == Qt::Key_Home); } return result; } -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT -/*! - \fn void HsStateMachine::startDialer() - Starts Dialer application -*/ -void HsStateMachine::startDialer() - { - // copy-paste code from dialer widget -#ifdef Q_OS_SYMBIAN - qDebug("HsStateMachine::startDialer()"); - - QList calls; - QScopedPointer callInfo(XQCallInfo::create()); - callInfo->getCalls(calls); - QList args; - QString service; - QString interface; - QString operation; - - if (0 < calls.count()) { - qDebug("HS: call ongoing, bring Telephone to foreground"); - service = "phoneui"; - interface = "com.nokia.symbian.IStart"; - operation = "start(int)"; - int openDialer(0); - args << openDialer; - } else { - qDebug("HS: no calls, open Dialer"); - service = "logs"; - interface = "com.nokia.symbian.ILogsView"; - operation = "show(QVariantMap)"; - QVariantMap map; - map.insert("view_index", QVariant(int(LogsServices::ViewAll))); - map.insert("show_dialpad", QVariant(true)); - map.insert("dialpad_text", QVariant(QString())); - args.append(QVariant(map)); - } - - XQApplicationManager appManager; - QScopedPointer request(appManager.create(service, interface, operation, false)); - if (request == NULL) { - return; - } - request->setArguments(args); - XQRequestInfo info; - info.setForeground(true); - request->setInfo(info); - bool ret = request->send(); - qDebug("HS: request sent successfully:", ret); -#endif -} - -#ifdef COVERAGE_MEASUREMENT -#pragma CTC ENDSKIP -#endif //COVERAGE_MEASUREMENT - /*! Registers framework animations. */ @@ -420,6 +342,13 @@ idleState, collectionStates[0]); idleState->addTransition(idleToCollectionTransition); } + // show after install is opened from applibrary via idlestate + if (collectionStates.count()) { + HsMenuEventTransition *idleToCollectionTransition = + new HsMenuEventTransition(HsMenuEvent::OpenCollectionFromAppLibrary, + idleState, collectionStates[0]); + idleState->addTransition(idleToCollectionTransition); + } guiRootState->setInitialState(loadSceneState); setInitialState(guiRootState); @@ -454,7 +383,6 @@ mPublisher->setValue(HsStatePSKeySubPath, EHomeScreenApplicationBackground | EHomeScreenApplicationLibraryViewActive); captureEndKey(false); } - mSendKeyCaptured = false; } /*! @@ -499,9 +427,16 @@ void HsStateMachine::activityRequested(const QString &name) { if (name == Hs::groupAppLibRecentView) { - this->postEvent( - HsMenuEventFactory::createOpenCollectionEvent(0, - Hs::collectionDownloadedTypeName)); + if (mHomeScreenActive) { + this->postEvent( + HsMenuEventFactory::createOpenCollectionEvent(0, + Hs::collectionDownloadedTypeName)); + } + else { + this->postEvent( + HsMenuEventFactory::createOpenCollectionFromAppLibraryEvent(0, + Hs::collectionDownloadedTypeName)); + } } else if (name == Hs::activityHsIdleView) { emit event_toIdle(); } else if (name == Hs::activityAppLibMainView) { diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/installs_symbian.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/installs_symbian.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,21 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +export.sources = ./../mockstateplugins/resource/*.xml +export.path = ./hsresources/plugins/stateplugins +pluginstub.sources = ./../mockstateplugins/qmakepluginstubs/mockstateplugins.dll +pluginstub.path = ./hsresources/plugins/stateplugins +DEPLOYMENT += export pluginstub diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/installs_win32.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,34 @@ +# +# 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: +# + +testfiles.path = ../../../../../../bin/hstests/ +testfiles.files = ./debug/t_hsdefaultruntimeplugin.exe + +mockdll.path = ../../../../../../bin/hstests/hsresources/plugins/stateplugins +mockdll.files += ./debug/hsresources/plugins/stateplugins/*.dll \ + ./debug/hsresources/plugins/stateplugins/*.xml + +compos.path = ../../../../../../bin/hstests/ +compos.files = ../../../../../../bin/debug/hsdomainmodel.dll \ + ../../../../../../bin/debug/hsutils.dll \ + ../../../../../../bin/debug/caclient.dll + +compos2.path = ./debug +compos2.files = ../../../../../../bin/debug/hsdomainmodel.dll \ + ../../../../../../bin/debug/hsutils.dll \ + ../../../../../../bin/debug/caclient.dll + +INSTALLS += testfiles mockdll compos compos2 diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/inc/mockapplibrarystate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/inc/mockapplibrarystate.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include + +class MockAppLibraryState: public QState +{ + +Q_OBJECT + +public: + + MockAppLibraryState(QState* parent = 0):QState(parent) + { + + } + +signals: + void toHomescreenState(); +}; + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/inc/mockbackuprestorestate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/inc/mockbackuprestorestate.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include + +class MockBackupRestoreState: public QState +{ + Q_OBJECT + +public: + MockBackupRestoreState(QState* parent = 0) : QState(parent) {} + +signals: + void event_loadScene(); + +}; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/inc/mockidlestate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/inc/mockidlestate.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include + +class MockIdleState: public QState +{ + +Q_OBJECT + +public: + + MockIdleState(QState* parent = 0):QState(parent) + { + + } + +signals: + void menuEvent(); + +}; + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/inc/mockloadscenestate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/inc/mockloadscenestate.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include + +class MockLoadSceneState: public QState +{ + +Q_OBJECT + +public: + + MockLoadSceneState(QState* parent = 0):QState(parent) + { + + } + +signals: + void idleEvent(); +}; + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/inc/mockmenuworkerstate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/inc/mockmenuworkerstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include + +class MockMenuWorkerState: public QState +{ + +Q_OBJECT + +public: + + MockMenuWorkerState(QState* parent = 0):QState(parent) + { + + } +}; + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/inc/mockrootstate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/inc/mockrootstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include + +class MockRootState: public QState +{ + Q_OBJECT + +public: + MockRootState(QState* parent = 0) : QState(parent) + { + + } + +signals: + void event_backupRestore(); + +}; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/inc/mockstateplugins.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/inc/mockstateplugins.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Mocked runtime provider. +* +*/ + +#ifndef MOCKSTATEPLUGINS_H +#define MOCKSTATEPLUGINS_H + +#include +#include + +QTM_USE_NAMESPACE + +class MockStatePlugins : public QObject, public QServicePluginInterface +{ + Q_OBJECT + Q_INTERFACES(QtMobility::QServicePluginInterface) + +public: + QObject *createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session); +}; + +#endif //MOCKSTATEPLUGINS_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/installs_win32.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,21 @@ +# +# 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: +# + +testfiles.path = ../t_hsapplicationexe/debug/hsresources/plugins/stateplugins +testfiles.files += ./debug/*.dll \ + ./resource/*.xml + +INSTALLS += testfiles diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/mockstateplugins.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/mockstateplugins.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,18 @@ +# +# 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/*.h +SOURCES += ./src/*.cpp diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/mockstateplugins.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/mockstateplugins.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,43 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +CONFIG += plugin mobility +MOBILITY = serviceframework + +#DEFINES += HSRUNTIMEMODEL_TEST + +DEPENDPATH += .\ + ./src \ + ./inc + +INCLUDEPATH += .\ + ./inc + +symbian: { + +CONFIG += symbian_test + +TARGET.UID3 = 0x20022F4C +TARGET.CAPABILITY = CAP_APPLICATION AllFiles +TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB +TARGET.EPOCALLOWDLLDATA=1 + +MMP_RULES += SMPSAFE +} + +include(mockstateplugins.pri) +win32:include(installs_win32.pri) \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/resource/mockstateplugins.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/resource/mockstateplugins.xml Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,42 @@ + + + mockstateplugins + mockstateplugins + Mocked Homescreen State Plugins + + com.nokia.homescreen.state.HsLoadSceneState + 1.1 + Mocked test implementation for homescreen's state + + + + com.nokia.homescreen.state.HsIdleState + 1.1 + Mocked test implementation for homescreen's state + + + + com.nokia.homescreen.state.HsAppLibraryState + 1.1 + Mocked test implementation for homescreen's state + + + + com.nokia.homescreen.state.HsMenuWorkerState + 1.1 + Mocked test implementation for homescreen's state + + + + com.nokia.homescreen.state.HsRootState + 1.1 + Mocked test implementation for homescreen's state + + + + com.nokia.homescreen.state.HsBackupRestoreState + 1.1 + Mocked test implementation for homescreen's state + + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/src/mockstateplugins.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/mockstateplugins/src/mockstateplugins.cpp Mon Sep 20 10:19: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: Mocked runtime plugin. +* +*/ + +#include +#include +#include + +#include "mockstateplugins.h" +#include "mockloadscenestate.h" +#include "mockidlestate.h" +#include "mockapplibrarystate.h" +#include "mockmenuworkerstate.h" +#include "mockrootstate.h" +#include "mockbackuprestorestate.h" + +QObject *MockStatePlugins::createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session) +{ + Q_UNUSED(context); + Q_UNUSED(session); + + if (descriptor.interfaceName() == "com.nokia.homescreen.state.HsLoadSceneState") { + return new MockLoadSceneState(); + } else if (descriptor.interfaceName() == "com.nokia.homescreen.state.HsIdleState") { + return new MockIdleState(); + } else if (descriptor.interfaceName() == "com.nokia.homescreen.state.HsAppLibraryState") { + return new MockAppLibraryState(); + } else if (descriptor.interfaceName() == "com.nokia.homescreen.state.HsMenuWorkerState") { + return new MockMenuWorkerState(); + } else if (descriptor.interfaceName() == "com.nokia.homescreen.state.HsRootState") { + return new MockRootState(); + } else if (descriptor.interfaceName() == "com.nokia.homescreen.state.HsBackupRestoreState") { + return new MockBackupRestoreState(); + } else { + return 0; + } +} + +Q_EXPORT_PLUGIN2(mockstateplugins, MockStatePlugins) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/sis/t_hsapplication.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/sis/t_hsapplication.pkg Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,40 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; + +; Language +&EN + +; SIS header: name, uid, version +#{"t_hsapplication"},(0x20022F5F),1,0,0 + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Supports S60 5th Edition +[0x1028315F], 0, 0, 0, {"S60ProductID"} + +; HS application's unittest +"/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" + +;Mocked test plugin +"/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" diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/sis/t_hsapplication_sisx.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/sis/t_hsapplication_sisx.bat Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,30 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem +@echo off + +if exist t_hsapplication.sisx del t_hsapplication.sisx + +makesis t_hsapplication.pkg +signsis t_hsapplication.sis t_hsapplication.sisx ../../../../internal/sis/rd.cer ../../../../internal/sis/rd-key.pem + +if exist t_hsapplication.sisx ( +echo t_hsapplication.sisx creation SUCCEEDED +del t_hsapplication.sis +) + +if not exist t_hsapplication.sisx ( +echo t_hsapplication.sisx creation FAILED +) \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplication.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplication.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,21 @@ +# +# 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 = mockstateplugins \ + t_hsapplicationexe + +CONFIG += ordered diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/inc/t_hsapplication.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/inc/t_hsapplication.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Test class for homescreen::core +* +*/ + + +#include + +class HbMainWindow; + +/** +* @test Test class for homescreen::hsapplication modules. +*/ +class t_hsapplication : public QObject +{ + Q_OBJECT + +private slots: + + /** + * initialize + */ + void initTestCase(); + void cleanupTestCase(); + +#ifdef Q_OS_SYMBIAN + /** + * hsrecoverymanager.cpp + */ + void testHsRecoveryManagerConstruction(); + void testHsRecoveryManagerCrashCount(); + void testHsRecoveryManagerRestoreRomDatabase(); + void testHsRecoveryManagerExecute(); +#endif + + /** + * hshomescreen.cpp + */ + void testCreateHomescreen(); + void testHomescreenStart(); + void testHomescreenStop(); + void testOnRuntimeStarted(); + void testOnRuntimeStopped(); + void testEventFilter(); + + /** + * hshomescreenclientserviceprovider.cpp + */ +#ifdef Q_OS_SYMBIAN + void testCreateClientServiceProvider(); + void testAddWidget(); + void testSetWallpaper(); + void testWidgetComponentDescriptor(); + void testWidgetUninstalled(); +#endif + + /** + * HsStateMachine + */ + void testConstruction(); + void testStartStop(); + void testOnIdleStateEntered(); + void testOnIdleStateExited(); + void testRuntimeEventFilter(); + void testActivityRequested(); + +private: + HbMainWindow *mWindow; +}; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/installs_symbian.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/installs_symbian.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,20 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +export.sources = ./../mockstateplugins/resource/*.xml +export.path = ./hsresources/plugins/stateplugins +pluginstub.sources = ./../mockstateplugins/qmakepluginstubs/mockstateplugins.dll +pluginstub.path = ./hsresources/plugins/stateplugins +DEPLOYMENT += export pluginstub \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/installs_win32.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,34 @@ +# +# 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: +# + +testexe.path = ../../../../../../bin/hstests/ +testexe.files = ./debug/t_hsapplicationexe.exe + +mockdll.path = ../../../../../../bin/hstests/hsresources/plugins/stateplugins +mockdll.files += ./debug/hsresources/plugins/stateplugins/*.dll \ + ./debug/hsresources/plugins/stateplugins/*.xml + +compos.path = ../../../../../../bin/hstests/ +compos.files = ../../../../../../bin/debug/hsdomainmodel.dll \ + ../../../../../../bin/debug/hsutils.dll \ + ../../../../../../bin/debug/caclient.dll + +compos2.path = ./debug +compos2.files = ../../../../../../bin/debug/hsdomainmodel.dll \ + ../../../../../../bin/debug/hsutils.dll \ + ../../../../../../bin/debug/caclient.dll + +INSTALLS += testexe mockdll compos compos2 diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hsconfiguration_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hsconfiguration_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,132 @@ +/* +* 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 "hsconfiguration.h" + +HsConfiguration::HsConfiguration(QObject *parent) + : QObject(parent), + mBounceEffect(20), + mPageChangeAnimationDuration(200), + mPageChangeZoneAnimationDuration(800), + mPageChangeZoneReverseAnimationDuration(200), + mPageRemovedAnimationDuration(200), + mNewPageAddedAnimationDuration(200), + mWidgetDragEffectDuration(200), + mWidgetDropEffectDuration(200), + mDefaultPageId(1), + mMaximumPageCount(8), + mIsShortcutLabelVisible(true), + mBounceFeedbackEffectDistance(3), + mPageChangeZoneWidth(60), + mPageIndicatorSpacing(8), + mMaximumWidgetHeight(39), + mMaximumWidgetWidth(48), + mMinimumWidgetHeight(8.75), + mMinimumWidgetWidth(8.75), + mPageChangePanDistance(17.91), + mPageChangeFeedbackEffect(HbFeedback::Sensitive), + mWidgetPickFeedbackEffect(HbFeedback::ItemPick), + mWidgetDropFeedbackEffect(HbFeedback::ItemDrop), + mWidgetRepositionFeedbackEffect(HbFeedback::BounceEffect), + mWidgetOverTrashbinFeedbackEffect(HbFeedback::ItemMoveOver), + mWidgetDropToTrashbinFeedbackEffect(HbFeedback::ItemDrop), + mShortcutWidgetTapFeedbackEffect(HbFeedback::BasicItem), + mWidgetMoveBlockedFeedbackEffect(HbFeedback::Basic), + mClockWidgetTapFeedbackEffect(HbFeedback::BasicItem), + mWidgetSnappingFeedbackEffect(HbFeedback::ItemMoveOver), + mIsSnapEnabled(true), + mSnapTimeout(100), + mSnapForce(30), + mSnapGap(6), + mPageMargin(0), + mSnapLineFadeInDuration(200), + mSnapLineFadeOutDuration(100), + mIsSnapEffectsEnabled(true), + mSceneType(PageWallpapers), + mBounceAnimationEasingCurve(QEasingCurve::Linear), + mPageChangeAnimationEasingCurve(QEasingCurve::Linear) +{ +} + +HsConfiguration::~HsConfiguration() +{ +} + +QSizeF HsConfiguration::minimumWidgetSizeInUnits() const +{ + return QSizeF(mMinimumWidgetWidth, mMinimumWidgetHeight); +} + +QSizeF HsConfiguration::maximumWidgetSizeInUnits() const +{ + return QSizeF(mMaximumWidgetWidth, mMaximumWidgetHeight); +} + +QSizeF HsConfiguration::minimumWidgetSizeInPixels() const +{ + HbDeviceProfile profile; + qreal factor = profile.unitValue(); + return factor * minimumWidgetSizeInUnits(); +} + +QSizeF HsConfiguration::maximumWidgetSizeInPixels() const +{ + HbDeviceProfile profile; + qreal factor = profile.unitValue(); + return factor * maximumWidgetSizeInUnits(); +} + +bool HsConfiguration::load() +{ + return true; +} + +bool HsConfiguration::importFromFile(const QString &path) +{ + Q_UNUSED(path); + return true; +} + +bool HsConfiguration::exportToFile(const QString &path) +{ + Q_UNUSED(path); + return true; +} + +HsConfiguration *HsConfiguration::instance() +{ + return mInstance; +} + +HsConfiguration *HsConfiguration::takeInstance() +{ + HsConfiguration *instance = mInstance; + mInstance = 0; + return instance; +} + +void HsConfiguration::setInstance(HsConfiguration *instance) +{ + if (mInstance != instance) { + delete mInstance; + mInstance = instance; + } +} + +HsConfiguration *HsConfiguration::mInstance(0); diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hscontentservice_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hscontentservice_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "hscontentservice.h" + +HsContentService::HsContentService(QObject *parent): QObject(parent) {} + +HsContentService::~HsContentService() {} + +HsContentService *HsContentService::instance() { + static HsContentService service; + return &service; +} +bool HsContentService::createWidget(const QVariantHash ¶ms) +{ + Q_UNUSED(params); + return true; +} + +HsWidgetHost *HsContentService::createWidgetForPreview(const QVariantHash ¶ms) +{ + Q_UNUSED(params); + return 0; +} + +bool HsContentService::addWidget(const QString &uri, const QVariantHash &preferences, + const QVariant &homescreenData) +{ + Q_UNUSED(preferences); + Q_UNUSED(homescreenData); + if (!uri.isEmpty()) { + return true; + } else { + return false; + } +} + +void HsContentService::emitWidgetRemoved(const QString &uri, const QVariantHash &preferences) +{ + Q_UNUSED(uri); + Q_UNUSED(preferences); +} + +void HsContentService::widgetStartFaulted() +{ +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hsgui_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hsgui_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,140 @@ +/* +* 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: +* +*/ + +#include +#include +#include +#include +#include + +#include "hsgui.h" +#include "hsscene.h" +#include "hsconfiguration.h" + +namespace { + const char gApplicationLibraryIconName[] = "qtg_mono_applications_all"; +} + +/*! + \class HsGui + \ingroup group_hsdomainmodel + \brief Represents a view in the framework. + HsGui includes common UI components for Home screen. +*/ + +HsGui *HsGui::mInstance(0); + +struct HsGuiImpl +{ + HbView *mIdleView; + HbMainWindow *mWindow; + HbAction *mNavigationAction; +}; + + + +HsGui::~HsGui() +{ + if (mImpl->mNavigationAction) { + delete mImpl->mNavigationAction; + } + + delete mImpl; +} + +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() +{ + +} + +void HsGui::cleanupIdleUi() +{ + if (mImpl->mIdleView) { + mImpl->mIdleView->setNavigationAction(0); + delete mImpl->mNavigationAction; + mImpl->mNavigationAction = 0; + + mImpl->mWindow->removeView(mImpl->mIdleView); + delete mImpl->mIdleView; + mImpl->mIdleView = 0; + + // This gets deleted when mImpl->mIdleView is deleted + // so just nullify. + } + +} + +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; +} + +QRectF HsGui::layoutRect() const +{ + return mImpl->mWindow->layoutRect(); +} + +void HsGui::show() +{ + mImpl->mWindow->raise(); + mImpl->mWindow->show(); +} + +HsGui::HsGui(QObject *parent): + QObject(parent),mImpl(new HsGuiImpl) +{ + mImpl->mIdleView = 0; + mImpl->mNavigationAction = 0; + + mImpl->mWindow = hbInstance->allMainWindows().first(); + connect(mImpl->mWindow, SIGNAL(orientationChanged(Qt::Orientation)), + SIGNAL(orientationChanged(Qt::Orientation))); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hspage_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hspage_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,457 @@ +/* +* 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 "hsdomainmodeldatastructures.h" +#include "hsgui.h" +#include "hspage.h" +#include "hspagevisual.h" +#include "hspagetoucharea.h" +#include "hspagenewwidgetlayout.h" +#include "hsscene.h" +#include "hswidgethost.h" +#include "hswidgethostvisual.h" +#include "hswallpaper.h" +#include "hswidgetpositioningonwidgetadd.h" +#include "hswidgetpositioningonorientationchange.h" +#include "hsconfiguration.h" + + +/*! + \class HsPage + \ingroup group_hsdomainmodel + \brief Represents a page in the framework. + HsPage contains group of widgets. HsPage can have a wallpaper. +*/ + +/*! + Constructor. + + \a parent Owner. + \a aFlags Window flags. +*/ +HsPage::HsPage(QObject* parent) + : QObject(parent), + mDatabaseId(-1), + mPageVisual(new HsPageVisual), + mWallpaper(0), + mRemovable(true), + mPageMargin(0.0) +{ + //Page margin + mPageMargin = HSCONFIGURATION_GET(pageMargin); + connect(HsConfiguration::instance(), SIGNAL(propertyChanged(QString)), SLOT(onPageMarginChanged(QString))); +} + +/*! + Destructor. +*/ +HsPage::~HsPage() +{ + delete mWallpaper; +} + +/*! + Returns the database id. +*/ +int HsPage::databaseId() const +{ + return mDatabaseId; +} + +/*! + Sets the database id to \a id. +*/ +void HsPage::setDatabaseId(int id) +{ + mDatabaseId = id; +} + +/*! + Loads widgets. +*/ +bool HsPage::load() +{ + if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) { + mWallpaper = new HsPageWallpaper(this); + } + + HsWidgetHost *widget = new HsWidgetHost(-1); + mWidgets.append(widget); + connectWidget(widget); + widget->setPage(this); + widget->visual()->setParentItem(this->visual()); + widget->startWidget(); + return true; +} + +/*! + Return wallpaper. +*/ +HsWallpaper *HsPage::wallpaper() const +{ + return mWallpaper; +} +/*! + Add given existing \a widgetHost to a page. Returns true if successful +*/ +bool HsPage::addExistingWidget(HsWidgetHost *widgetHost) +{ + if (!widgetHost) { + return false; + } + + if (mWidgets.contains(widgetHost)) { + return true; + } + + if (!widgetHost->setPage(this)) { + return false; + } + + connectWidget(widgetHost); + mWidgets << widgetHost; + widgetHost->visual()->setParentItem(this->visual()); + + return true; + } + +/*! + Remove given \a widgetHost from a page. Widget is not deleted. + Returns true if successful +*/ +bool HsPage::removeWidget(HsWidgetHost *widgetHost) +{ + if (!widgetHost || !widgetHost->setPage(0)) { + return false; + } + + disconnectWidget(widgetHost); + mWidgets.removeOne(widgetHost); + 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. +*/ +QList HsPage::newWidgets() +{ + return mNewWidgets; +} + +/*! + Adds new widget into a page. Returns true if successfull. +*/ +bool HsPage::addNewWidget(HsWidgetHost* widgetHost, const QPointF &touchPoint) +{ + Q_UNUSED(touchPoint) + if (!widgetHost || mWidgets.contains(widgetHost)) { + return false; + } + + if (mNewWidgets.contains(widgetHost)) { + return true; + } + + HsWidgetPresentationData presentation; + presentation.orientation = Qt::Vertical; + if (!widgetHost->getPresentation(presentation)) { + presentation.orientation = Qt::Vertical; + presentation.setPos(QPointF()); + presentation.zValue = 0; + widgetHost->savePresentation(presentation); + } + + widgetHost->visual()->hide(); + widgetHost->visual()->setPos(presentation.x, presentation.y); + widgetHost->visual()->setZValue(presentation.zValue); + + connectWidget(widgetHost); + mNewWidgets << widgetHost; + + return true; +} + +/*! + Layouts all the new widgets +*/ +void HsPage::layoutNewWidgets() +{ + if (mNewWidgets.isEmpty()) { + return; + } + + updateZValues(); + HsWidgetHost *widget = 0; + for (int i = 0; i < mNewWidgets.count(); ++i) { + widget = mNewWidgets.at(i); +//Not used in mock newWidgetLayout->addItem(widget); + widget->setPage(this); + widget->visual()->setParentItem(visual()); + widget->showWidget(); + widget->visual()->show(); + } + mWidgets << mNewWidgets; + mNewWidgets.clear(); +} + +/*! + Clears new widgets list and resets layout. +*/ +void HsPage::resetNewWidgets() +{ + mNewWidgets.clear(); +} + +/*! + Remove page and all it's contained widgets from database +*/ +bool HsPage::deleteFromDatabase() +{ + //Not used in mock + return true; +} + +/*! + Return list of widgets belonging to a page +*/ +QList HsPage::widgets() const +{ + return mWidgets; +} + +/*! + Returns true if the page can be removed. Otherwise, + returns false. +*/ +bool HsPage::isRemovable() const +{ + return mRemovable; +} + +/*! + Sets removable flag to \a removable. +*/ +void HsPage::setRemovable(bool removable) +{ + mRemovable = removable; +} + +/*! + Return true if page is default page. +*/ +bool HsPage::isDefaultPage() const +{ + return mDatabaseId == HSCONFIGURATION_GET(defaultPageId); +} + +/*! + Return true if page is active page. +*/ +bool HsPage::isActivePage() const +{ + return this == HsScene::instance()->activePage(); +} + +/*! + Create page into database and return instance of a new page. +*/ +HsPage *HsPage::createInstance(const HsPageData &pageData) +{ + Q_UNUSED(pageData); + HsPage *page = new HsPage; + return page; +} + +/*! + 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(Qt::Vertical); +} + +/*! + Returns rect of rectangular where widgets are allowed to be placed in the page. +*/ +QRectF HsPage::contentGeometry(Qt::Orientation orientation) +{ + QRectF pageRect = QRectF(0, 0, 360.0, 640.0); + + //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(Qt::Vertical); +} + +/*! + 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; +} + +/*! + Calls onShow() for contained widgets. +*/ +void HsPage::showWidgets() +{ +} + +/*! + Calls onHide() for contained widgets. +*/ +void HsPage::hideWidgets() +{ +} + +/*! + Propagate online state to widgets. +*/ +void HsPage::setOnline(bool online) +{ + foreach (HsWidgetHost *widget, mNewWidgets) { + widget->setOnline(online); + } + foreach (HsWidgetHost *widget, mWidgets) { + widget->setOnline(online); + } +} + +/*! + Update widgets z-values and persist those. Active widget has top most + z-value. +*/ +void HsPage::updateZValues() +{ +} + +/*! + Return this page's index. +*/ +int HsPage::pageIndex() +{ + return HsScene::instance()->pages().indexOf(this); +} +/*! + Utility to connect widget signals to page. +*/ +void HsPage::connectWidget(HsWidgetHost *widget) +{ + connect(widget, SIGNAL(finished()), SLOT(onWidgetFinished())); + connect(widget, SIGNAL(faulted()), SLOT(onWidgetFaulted())); + connect(widget, SIGNAL(resized()), SLOT(onWidgetResized())); + connect(widget, SIGNAL(available()), SLOT(onWidgetAvailable())); + connect(widget, SIGNAL(unavailable()), SLOT(onWidgetUnavailable())); +} +/*! + Disconnect widget signals from page +*/ +void HsPage::disconnectWidget(HsWidgetHost *widget) +{ + widget->disconnect(this); +} +/*! + Disconnect and remove widget +*/ +void HsPage::onWidgetFinished() +{ + HsWidgetHost *widget = qobject_cast(sender()); + + // It can be in new widget list if we haven't layouted it yet + // or layouted new widget and widget list + if (!mNewWidgets.removeOne(widget)) { + mWidgets.removeOne(widget); + } + + disconnectWidget(widget); + widget->remove(); +} +/*! + Remove widget if it faulted +*/ +void HsPage::onWidgetFaulted() +{ + onWidgetFinished(); +} + +/*! + Calculates new widget position on page when widget size changes. If page has layout then there are new widgets + and we use layout to calculate new widget positions. +*/ +void HsPage::onWidgetResized() +{ +} +/*! + Show widget if it came available +*/ +void HsPage::onWidgetAvailable() +{ +} +/*! + Update internal bookkeeping and hide widget +*/ +void HsPage::onWidgetUnavailable() +{ +} + +/*! + 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) +{ + Q_UNUSED(orientation) +} + +void HsPage::onPageMarginChanged(const QString &value) +{ + Q_UNUSED(value) +} + +HsPageVisual *HsPage::visual() const +{ + return mPageVisual; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hspagevisual_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hspagevisual_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,74 @@ +/* +* 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 "hsscene.h" +#include "hspage.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) +{ +} + +/*! + Destructor. +*/ +HsPageVisual::~HsPageVisual() +{ +} + +int HsPageVisual::pageIndex() const +{ + QList pages = HsScene::instance()->pages(); + for (int i = 0; i < pages.count(); ++i) { + if (pages.at(i)->visual() == this) { + return i; + } + } + return -1; +} + +void HsPageVisual::setGeometry(const QRectF &rect) +{ + HbWidget::setGeometry(rect); +} + +/*! + Create touch area for page. +*/ +void HsPageVisual::setupTouchArea() +{ +} + + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hsscene_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hsscene_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,183 @@ +/* +* 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 "hsdomainmodeldatastructures.h" +#include "hsscene.h" +#include "hspage.h" +#include "hswidgethost.h" +#include "hswallpaper.h" +#include "hsconfiguration.h" + +HsScene::~HsScene() +{ + delete mWallpaper; + qDeleteAll(mPages); +} + +int HsScene::databaseId() const +{ + return mDatabaseId; +} + +bool HsScene::load() +{ + return true; +} + +HsWallpaper *HsScene::wallpaper() const +{ + return mWallpaper; +} + +QList HsScene::pages() const +{ + return mPages; +} + +bool HsScene::addPage(HsPage *page) +{ + if (!page) { + return false; + } + + if (mPages.contains(page)) { + return true; + } + + mPages << page; + return true; +} + +bool HsScene::removePage(HsPage *page) +{ + if (!page) { + return false; + } + return mPages.removeOne(page); +} + +bool HsScene::setActivePage(HsPage *page) +{ + if (!page) { + return false; + } + + if (!mPages.contains(page)) { + return false; + } + + mActivePage = page; + return true; +} + +bool HsScene::setActivePageIndex(int index) +{ + if (index < 0 || mPages.count() <= index) { + return false; + } + return setActivePage(mPages[index]); +} + +HsPage *HsScene::activePage() const +{ + return mActivePage; +} + +int HsScene::activePageIndex() const +{ + return mPages.indexOf(mActivePage); +} + +void HsScene::setActiveWidget(HsWidgetHost *widget) +{ + mActiveWidget = widget; +} + +HsWidgetHost *HsScene::activeWidget() const +{ + return mActiveWidget; +} + +void HsScene::setOnline(bool online) +{ + mIsOnline = online; + foreach (HsPage *page, mPages) { + page->setOnline(online); + } +} + +bool HsScene::isOnline()const +{ + return mIsOnline; +} + +/*! + Singleton. +*/ +HsScene *HsScene::instance() +{ + return mInstance; +} + +HsScene *HsScene::takeInstance() +{ + HsScene *instance = mInstance; + mInstance = 0; + return instance; +} + +void HsScene::setInstance(HsScene *instance) +{ + if (mInstance != instance) { + delete mInstance; + mInstance = instance; + } +} + +/*! + Listens for application background/foreground changes. +*/ +bool HsScene::eventFilter(QObject *watched, QEvent *event) +{ + switch (event->type()) { + case QEvent::ApplicationActivate: + mActivePage->showWidgets(); + break; + case QEvent::ApplicationDeactivate: + mActivePage->hideWidgets(); + break; + default: + break; + } + return QObject::eventFilter(watched, event); +} + +HsScene::HsScene(QObject *parent) + : QObject(parent), + mDatabaseId(-1), + mWallpaper(0), + mActivePage(0), + mActiveWidget(0), + mIsOnline(true) +{ +} + +/*! + Points to the scene instance. +*/ +HsScene *HsScene::mInstance = 0; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hsspinnerdialog_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hsspinnerdialog_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,61 @@ +/* +* 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: +* Spinner dialog shown when setting new background image +* +*/ + +#include "hsspinnerdialog.h" + +/*! + \internal + \class HsSpinnerDialog + \ingroup group_hsutils + \brief Spinner dialog, used when background image is changed. By default dialog is created with Qt::WA_DeleteOnClose attribute so dialog + is automatically deleted when closed. + +*/ + +/*! + \internal + Constructor. + + \a parent Owner. +*/ +HsSpinnerDialog::HsSpinnerDialog(QGraphicsItem *parent) +: HbDialog(parent) +{ +} + +/*! + \internal +*/ +HsSpinnerDialog::~HsSpinnerDialog() +{ +} + +/*! + \internal +*/ +void HsSpinnerDialog::start() +{ +} + +/*! + \internal +*/ +void HsSpinnerDialog::stop() +{ +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hswallpaper_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hswallpaper_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,216 @@ +/* +* 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: +* +*/ + +#include +#include + +#include + +#include "hswallpaper.h" +#include "hsscene.h" +#include "hspage.h" + +/*! + +*/ + +/*! + +*/ +HsWallpaper::HsWallpaper(QGraphicsItem *parent) + : HbWidget(parent), + mIsDefaultImage(false), + mIconItem(0) +{ + setFlag(ItemHasNoContents); + setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored); + + mIconItem = new HbIconItem(); + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout; + layout->setContentsMargins(0, 0, 0, 0); + layout->addItem(mIconItem); + setLayout(layout); +} + +/*! + +*/ +HsWallpaper::~HsWallpaper() +{ +} + +/*! + +*/ +void HsWallpaper::setImage(const QString &path) +{ + if (!path.isEmpty()) { + emit imageSet(); + } else { + emit imageSetFailed(); + } +} + +void HsWallpaper::setImages(const QString &portraitFileName, const QString &landscapeFileName) +{ + Q_UNUSED(portraitFileName) + Q_UNUSED(landscapeFileName) + emit imageSet(); +} + +/*! + +*/ +void HsWallpaper::setDefaultImage() +{ +} + +/*! + +*/ +void HsWallpaper::remove() +{ + mPortraitImagePath.clear(); + mLandscapeImagePath.clear(); +} + +/*! + +*/ +bool HsWallpaper::setExistingImage() +{ + return true; +} + +QString HsWallpaper::rootDirectory() const +{ + return QString(); +} + +/*! + +*/ +void HsWallpaper::onLoaderFinished() +{ + emit imageSet(); +} + +/*! + +*/ +void HsWallpaper::onLoaderFailed() +{ + emit imageSetFailed(); +} + +/*! + +*/ +void HsWallpaper::updateIconItem(Qt::Orientation orientation) +{ + Q_UNUSED(orientation); +} + +/*! + +*/ +HsSceneWallpaper::HsSceneWallpaper(HsScene *scene, QGraphicsItem *parent) + : HsWallpaper(parent), + mScene(0) +{ + setScene(scene); +} + +/*! + +*/ +HsSceneWallpaper::~HsSceneWallpaper() +{ +} + +/*! + +*/ +void HsSceneWallpaper::setScene(HsScene *scene) +{ + Q_UNUSED(scene); +} + +/*! + +*/ +QString HsSceneWallpaper::wallpaperDirectory() const +{ + return QString(); +} + +/*! + +*/ +QVariantHash HsSceneWallpaper::createTargets(const QString &sourcePath) +{ + Q_UNUSED(sourcePath); + return QVariantHash(); +} + +/*! + PAGE +*/ +HsPageWallpaper::HsPageWallpaper(HsPage *page, QGraphicsItem *parent) + : HsWallpaper(parent), + mPage(0) +{ + setPage(page); +} + +/*! + +*/ +HsPageWallpaper::~HsPageWallpaper() +{ +} + +/*! + +*/ +void HsPageWallpaper::setPage(HsPage *page) +{ + if (!page) { + return; + } + + mPage = page; + mId = page->databaseId(); +} + +/*! + +*/ +QString HsPageWallpaper::wallpaperDirectory() const +{ + return QString(); +} + +/*! + +*/ +QVariantHash HsPageWallpaper::createTargets(const QString &sourcePath) +{ + Q_UNUSED(sourcePath); + return QVariantHash(); +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hswidgetcomponent_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hswidgetcomponent_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "hswidgetcomponent.h" + +/*! + +*/ +HsWidgetComponent::~HsWidgetComponent() +{ +} + +/*! + +*/ +QString HsWidgetComponent::rootPath() const +{ + return mRootPath; +} + +/*! + +*/ +QString HsWidgetComponent::uri() const +{ + return mUri; +} + + +bool HsWidgetComponent::isAvailable() const +{ + return true; +} +/*! + +*/ +HsWidgetComponent::HsWidgetComponent(const QString &uri, QObject *parent) + : QObject(parent), + mUri(uri), + mState(Available) +{ +} + + +/*! + +*/ +void HsWidgetComponent::resolveRootPathAndTranslationFilename() +{ +} + +/*! + +*/ +void HsWidgetComponent::installTranslator() +{ +} + +/*! + +*/ +void HsWidgetComponent::uninstallTranslator() +{ +} + +void HsWidgetComponent::emitAboutToUninstall() +{ + if (mState == Available) { + mState = Uninstalling; + emit aboutToUninstall(); + } +} +void HsWidgetComponent::emitUninstalled() +{ + if (mState == Uninstalling) { + mState = Available; + emit uninstalled(); + } +} +void HsWidgetComponent::emitUpdated() +{ + if (mState == Uninstalling) { + mState = Available; + emit updated(); + } +} +void HsWidgetComponent::emitUnavailable() +{ + if (mState == Available) { + mState = Unavailable; + emit unavailable(); + } +} +void HsWidgetComponent::emitAvailable() +{ + if (mState == Unavailable) { + mState = Available; + emit available(); + } +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hswidgetcomponentregistry_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hswidgetcomponentregistry_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "hswidgetcomponentregistry.h" +#include "hswidgetcomponent.h" +#include "hswidgetcomponentdescriptor.h" +#include "caentry.h" +#include "hsscene.h" + +#include +#include + +HsWidgetComponentRegistry *HsWidgetComponentRegistry::mInstance = 0; + + +/*! + +*/ +HsWidgetComponentRegistry* HsWidgetComponentRegistry::instance() +{ + if (!mInstance) { + mInstance = new HsWidgetComponentRegistry; + mInstance->setParent(QCoreApplication::instance()); + } + return mInstance; +} + +/*! + +*/ +HsWidgetComponentRegistry::~HsWidgetComponentRegistry() +{ + qDeleteAll(mRegistry); +} + +/*! +*/ +HsWidgetComponent *HsWidgetComponentRegistry::component(const QString &uri) +{ + return new HsWidgetComponent(uri); +} + +/*! +*/ +void HsWidgetComponentRegistry::uninstallComponent(const HsWidgetComponentDescriptor &componentDescriptor) +{ + Q_UNUSED(componentDescriptor); +} + +/*! + +*/ +HsWidgetComponentRegistry::HsWidgetComponentRegistry(QObject *parent) + : QObject(parent) +{ +} + +/*! + +*/ +void HsWidgetComponentRegistry::handleEntryAdded(const CaEntry &entry, const QString &uri) +{ + Q_UNUSED(entry); + Q_UNUSED(uri); +} + +/*! +*/ +void HsWidgetComponentRegistry::handleEntryRemoved(const CaEntry &entry, const QString &uri) +{ + Q_UNUSED(entry); + Q_UNUSED(uri); +} + +/*! + +*/ +void HsWidgetComponentRegistry::handleEntryUpdated(const CaEntry &entry, const QString &uri) +{ + Q_UNUSED(entry); + Q_UNUSED(uri); +} + +/*! + +*/ +void HsWidgetComponentRegistry::registerService(const CaEntry &entry, const QString& uri, bool reset) +{ + Q_UNUSED(entry); + Q_UNUSED(uri); + Q_UNUSED(reset); +} + +/*! + +*/ +void HsWidgetComponentRegistry::onEntryChanged(const CaEntry &entry, ChangeType changeType) +{ + Q_UNUSED(entry); + Q_UNUSED(changeType); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hswidgethost_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hswidgethost_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,247 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include + +#include + +#include "hsscene.h" +#include "hspage.h" +#include "hswidgethost.h" +#include "hswidgethostvisual.h" +#include "hswidgettoucharea.h" + +HsWidgetHost::HsWidgetHost(int databaseId, QObject *parent) + : QObject(parent), + mDatabaseId(databaseId), + mVisual(new HsWidgetHostVisual), + mStateMachine(0), + mWidget(0), + mPage(0), + mComponent(0), + mIsFinishing(false) +{ +} + +HsWidgetHost::~HsWidgetHost() +{ +} + +HsWidgetHost *HsWidgetHost::createInstance(HsWidgetData &widgetData, + const QVariantHash &preferences) +{ + Q_UNUSED(widgetData); + Q_UNUSED(preferences); + return 0; +} + +int HsWidgetHost::databaseId() const +{ + return mDatabaseId; +} + +bool HsWidgetHost::setPage(HsPage *page) +{ + mPage = page; + return true; +} + +HsPage *HsWidgetHost::page() const +{ + return mPage; +} + +bool HsWidgetHost::loadPresentation() +{ + return true; +} + +bool HsWidgetHost::loadPresentation(Qt::Orientation orientation) +{ + Q_UNUSED(orientation); + return true; +} + +bool HsWidgetHost::savePresentation() +{ + return true; +} + +bool HsWidgetHost::savePresentation(Qt::Orientation orientation) +{ + Q_UNUSED(orientation); + return true; +} + +bool HsWidgetHost::savePresentation(HsWidgetPresentationData &presentation) +{ + Q_UNUSED(presentation); + return true; +} + +bool HsWidgetHost::getPresentation(HsWidgetPresentationData &presentation) +{ + Q_UNUSED(presentation); + return true; +} + +bool HsWidgetHost::removePresentation(Qt::Orientation orientation) +{ + Q_UNUSED(orientation); + return true; +} + +void HsWidgetHost::startWidget(bool show) +{ + if (show) { + emit event_startAndShow(); + } else { + emit event_startAndHide(); + } +} + +void HsWidgetHost::showWidget() +{ + emit event_show(); +} + +void HsWidgetHost::hideWidget() +{ + emit event_hide(); +} + +void HsWidgetHost::setOnline(bool online) +{ + Q_UNUSED(online); +} + +void HsWidgetHost::remove() +{ +} + +void HsWidgetHost::close() +{ +} + +void HsWidgetHost::startDragEffect() +{ +} + +void HsWidgetHost::startDropEffect() +{ +} + +void HsWidgetHost::setupStates() +{ +} + +bool HsWidgetHost::setProperty(const char *name, QMetaProperty &property) +{ + Q_UNUSED(name); + Q_UNUSED(property); + return true; +} + +bool HsWidgetHost::setMethod(const char *signature, QMetaMethod &method) +{ + Q_UNUSED(signature); + Q_UNUSED(method); + return true; +} + +bool HsWidgetHost::hasSignal(const char *signature) +{ + Q_UNUSED(signature); + return true; +} + +bool HsWidgetHost::setPreferencesToWidget() +{ + return true; +} + +void HsWidgetHost::action_connectComponent() +{ +} + +void HsWidgetHost::action_disconnectComponent() +{ +} + +void HsWidgetHost::action_load() +{ +} + +void HsWidgetHost::action_unload() +{ +} + +void HsWidgetHost::action_initialize() +{ +} + +void HsWidgetHost::action_uninitialize() +{ +} + +void HsWidgetHost::action_show() +{ +} + +void HsWidgetHost::action_hide() +{ +} + +void HsWidgetHost::action_finished() +{ + emit finished(); +} + +void HsWidgetHost::action_faulted() +{ + emit faulted(); +} + +void HsWidgetHost::action_remove() +{ +} + +void HsWidgetHost::action_notifyRemove() +{ +} + +void HsWidgetHost::onFinished() +{ + mIsFinishing = true; + emit event_finished(); +} + +void HsWidgetHost::onError() +{ + mIsFinishing = true; + emit event_faulted(); +} + +void HsWidgetHost::onSetPreferences(const QStringList &names) +{ + Q_UNUSED(names); +} + +HsWidgetHostVisual *HsWidgetHost::visual() const +{ + return mVisual; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hswidgethostvisual_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/hswidgethostvisual_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,176 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#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() +{ +} + +/*! + Starts the drop effect. +*/ +void HsWidgetHostVisual::startDropEffect() +{ +} +/*! + \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) +{ + return HbWidget::eventFilter(watched, event); +} + +/*! + Reimplemented from HbWidget for pan gesture handling. +*/ +void HsWidgetHostVisual::gestureEvent(QGestureEvent *event) +{ +} + +/*! + \fn HsWidgetHostVisual::mousePressEvent(QGraphicsSceneMouseEvent *) + Reimplemented from QGraphicsItem for eating all mouse presses. +*/ + +/*! + Configures the touch are for this widget host. +*/ +void HsWidgetHostVisual::setupTouchArea() +{ +} + +/*! + Configures the effects for this widget host. +*/ +void HsWidgetHostVisual::setupEffects() +{ +} + + +/*! + Resizes this widget host to the given \a size. +*/ +void HsWidgetHostVisual::setNewSize(const QSizeF &size) +{ +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/t_hsapplication.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/t_hsapplication.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,71 @@ +/* +* 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: Main test class for hsutils library. +* +*/ + + +#include +#include +#include +#include "t_hsapplication.h" + +QTM_USE_NAMESPACE + +const QString xmlPath = "./hsresources/plugins/stateplugins/"; +const QString mockedStatePluginsXml = "mockstateplugins.xml"; + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::initTestCase() +{ + //Let's add mocked test service to default interface implementation + //before testcases are run. This trick is needed especially in Symbian side + //since default runtime is also seen due to exported resources for hsapplication. + QApplication::addLibraryPath(QDir(xmlPath).absolutePath()); + QServiceManager manager; + qDebug() << "t_hsapplication::initTestCase addService:" << manager.addService(xmlPath + mockedStatePluginsXml); + + qDebug() << "setInterfaceDefault(HsLoadSceneState): " << manager.setInterfaceDefault("mockstateplugins", "com.nokia.homescreen.state.HsLoadSceneState"); + qDebug() << "setInterfaceDefault(HsIdleState): " << manager.setInterfaceDefault("mockstateplugins", "com.nokia.homescreen.state.HsIdleState"); + qDebug() << "setInterfaceDefault(HsAppLibraryState): " << manager.setInterfaceDefault("mockstateplugins", "com.nokia.homescreen.state.HsAppLibraryState"); + qDebug() << "setInterfaceDefault(HsMenuWorkerState): " << manager.setInterfaceDefault("mockstateplugins", "com.nokia.homescreen.state.HsMenuWorkerState"); + qDebug() << "setInterfaceDefault(HsRootState): " << manager.setInterfaceDefault("mockstateplugins", "com.nokia.homescreen.state.HsRootState"); + qDebug() << "setInterfaceDefault(HsBackupRestoreState): " << manager.setInterfaceDefault("mockstateplugins", "com.nokia.homescreen.state.HsBackupRestoreState"); + + HbInstance::instance(); + mWindow = new HbMainWindow; + #ifndef NFT +// QDir::setCurrent("C:/hsresources/testresources"); + #else +// QDir::setCurrent("Z:/hsresources/testresources"); + #endif +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::cleanupTestCase() +{ + QServiceManager manager; + manager.removeService("mockstateplugins"); + QApplication::removeLibraryPath(xmlPath); + + delete mWindow; + mWindow = 0; +} + +QTEST_MAIN(t_hsapplication) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/t_hsrecoverymanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/t_hsrecoverymanager.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,56 @@ +/* +* 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 "t_hsapplication.h" +#include "hsrecoverymanager.h" + +const TInt KPSCategoryUid(0x20022F36); +const TInt KPSCrashCountKey(1); +const int KResetCrashCountInterval(60000); + +void t_hsapplication::testHsRecoveryManagerConstruction() +{ + HsRecoveryManager rm; + QVERIFY(rm.mTimer.isSingleShot()); + QCOMPARE(rm.mTimer.interval(), KResetCrashCountInterval); +} + +void t_hsapplication::testHsRecoveryManagerCrashCount() +{ + TInt storedCount = 0; + RProperty::Get(TUid::Uid(KPSCategoryUid), KPSCrashCountKey, storedCount); + + HsRecoveryManager rm; + rm.resetCrashCount(); + QCOMPARE(rm.crashCount(), 0); + + RProperty::Set(TUid::Uid(KPSCategoryUid), KPSCrashCountKey, storedCount); +} + +void t_hsapplication::testHsRecoveryManagerRestoreRomDatabase() +{ + HsRecoveryManager rm; + rm.restoreRomDatabase(); +} + +void t_hsapplication::testHsRecoveryManagerExecute() +{ + HsRecoveryManager rm; + rm.execute(); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/t_hsstatemachine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/t_hsstatemachine.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Main test class for test library. +* +*/ + +#include +#include +#include +#include + +#include "t_hsapplication.h" +#include "hsstatemachine.h" +#include "hsapp_defs.h" +#include + +QTM_USE_NAMESPACE + +const QString xmlPath = "./hsresources/plugins/stateplugins/"; +const QString mockedStatePluginsXml = "mockstateplugins.xml"; + + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testConstruction() +{ + HsStateMachine* rt = new HsStateMachine(); + QVERIFY(rt); + QVERIFY(rt->mContentService); + delete rt; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testStartStop() +{ + HsStateMachine* rt = new HsStateMachine(); + QObject::connect(rt, SIGNAL(event_exit()), rt, SIGNAL(finished()), Qt::QueuedConnection); + QSignalSpy startSpy(rt, SIGNAL(started())); + QSignalSpy stopSpy(rt,SIGNAL(stopped())); + rt->start(); + qApp->processEvents(); + rt->stop(); + qApp->processEvents(); + + QVERIFY(startSpy.count()); + QVERIFY(stopSpy.count()); + + delete rt; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testOnIdleStateEntered() +{ + HsStateMachine rt; + rt.onIdleStateEntered(); + QVERIFY(rt.mIdleStateActive); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testOnIdleStateExited() +{ + HsStateMachine rt; + rt.onIdleStateExited(); + QVERIFY(!rt.mIdleStateActive); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testRuntimeEventFilter() +{ + HsStateMachine rt; + QVERIFY(!rt.eventFilter(0,&QEvent(QEvent::ActionAdded))); + + QEvent *e = new QEvent(QEvent::ApplicationActivate); + QVERIFY(!rt.eventFilter(0,e)); + + rt.onIdleStateEntered(); + + delete e; + + e = new QEvent(QEvent::ApplicationDeactivate); + QVERIFY(!rt.eventFilter(0,e)); + delete e; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testActivityRequested() +{ + HsStateMachine rt; + rt.activityRequested(QString()); + rt.activityRequested(Hs::groupAppLibRecentView); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/testhomescreen.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/testhomescreen.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,96 @@ +/* +* 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: Main test class for hsutils library. +* +*/ + + +#include "t_hsapplication.h" +#include "hshomescreen.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testCreateHomescreen() +{ + HsHomeScreen hs; + QVERIFY(hs.mRuntime); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testHomescreenStart() +{ + + { + HsHomeScreen hs; + QSignalSpy spy(&hs,SIGNAL(exit())); + hs.start(); + qApp->processEvents(); + QVERIFY(spy.count() == 0); + } +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testHomescreenStop() +{ + { + //Improves coverage test: return at the beginning of the stop() + HsHomeScreen hs; + hs.stop(); + } + + { + HsHomeScreen hs; + hs.start(); + qApp->processEvents(); + hs.stop(); + } +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testOnRuntimeStarted() +{ + HsHomeScreen hs; + hs.onRuntimeStarted(); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testOnRuntimeStopped() +{ + HsHomeScreen hs; + QSignalSpy spy(&hs,SIGNAL(exit())); + hs.onRuntimeStopped(); + QVERIFY(spy.count() == 1); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testEventFilter() +{ + HsHomeScreen hs; + QVERIFY(!hs.eventFilter(0,&QEvent(QEvent::ActionAdded))); + + QEvent *e = new QEvent(QEvent::Close); + QVERIFY(hs.eventFilter(0,e)); + delete e; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/testhomescreenclientserviceprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/src/testhomescreenclientserviceprovider.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,102 @@ +/* +* 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 test class for HsHomeScreenClientServiceProvider library. +* +*/ + +#include +#include "t_hsapplication.h" +#include "hshomescreenclientserviceprovider.h" +#include "hswallpaper.h" +#include "hsscene.h" +#include "hspage.h" +#include "hsconfiguration.h" +#include "hswidgetcomponentdescriptor.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testCreateClientServiceProvider() +{ + HsHomeScreenClientServiceProvider *provider = new HsHomeScreenClientServiceProvider(); + QVERIFY(provider); + delete provider; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testAddWidget() +{ + HsHomeScreenClientServiceProvider *provider = new HsHomeScreenClientServiceProvider(); + QVERIFY(provider); + + QVERIFY(!provider->addWidget(QString(), QVariantHash())); + QVERIFY(provider->addWidget(QString("NotEmpty"), QVariantHash())); + + delete provider; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testSetWallpaper() +{ + HsConfiguration::setInstance(new HsConfiguration); + HsScene *scene = new HsScene; + HsScene::setInstance(scene); + HsPage *page = new HsPage; + page->load(); + scene->addPage(page); + scene->setActivePage(page); + + HsHomeScreenClientServiceProvider *provider = new HsHomeScreenClientServiceProvider(); + QVERIFY(provider); + + provider->setWallpaper(QString()); + QVERIFY(provider->mWallpaper); + + provider->setWallpaper("default_portrait.png"); + QVERIFY(provider->mWallpaper); + + delete provider; + delete scene; +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testWidgetComponentDescriptor() +{ + HsHomeScreenClientServiceProvider *provider = new HsHomeScreenClientServiceProvider(); + QVERIFY(provider); + + QVERIFY(provider->widgetComponentDescriptor(QVariantHash()).description().isEmpty()); + + delete provider; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplication::testWidgetUninstalled() +{ + HsHomeScreenClientServiceProvider *provider = new HsHomeScreenClientServiceProvider(); + QVERIFY(provider); + + QVERIFY(provider->widgetUninstalled(QVariantHash())); + + delete provider; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/t_hsapplicationexe.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/t_hsapplicationexe.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,78 @@ +# +# 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: +# + + +win32:{ + HEADERS += ./inc/t_hsapplication.h \ + ../../../inc/hshomescreen.h \ + ../../../inc/hsstatemachine.h + + SOURCES += ./src/t_hsapplication.cpp \ + ./src/testhomescreen.cpp \ + ./src/t_hsstatemachine.cpp \ + ../../../src/hshomescreen.cpp \ + ../../../src/hsstatemachine.cpp +} + +symbian:{ + HEADERS += ./inc/*.h \ + ./../../../inc/hshomescreenclientserviceprovider.h \ + ./../../../inc/hshomescreen.h \ + ./../../../inc/hsstatemachine.h \ + ./../../../inc/hsrecoverymanager.h \ + ./../../../../hsdomainmodel/inc/hsdatabase.h \ + ./../../../../hsdomainmodel/inc/hsbackuprestoreobserver.h \ + ./../../../../hsdomainmodel/inc/hsbackuprestoreobserver_p.h \ + ./../../../../hsdomainmodel/inc/hsshortcutservice.h \ + ./../../../../hsdomainmodel/inc/hsshortcutservice_p.h \ + ./../../../../hsdomainmodel/inc/hswidgetcomponentdescriptor.h \ + ./../../../../hsdomainmodel/inc/hscontentservice.h \ + ./../../../../hsdomainmodel/inc/hsconfiguration.h \ + ./../../../../hsdomainmodel/inc/hsgui.h \ + ./../../../../hsdomainmodel/inc/hspage.h \ + ./../../../../hsdomainmodel/inc/hspagevisual.h \ + ./../../../../hsdomainmodel/inc/hspagetoucharea.h \ + ./../../../../hsdomainmodel/inc/hsscene.h \ + ./../../../../hsdomainmodel/inc/hswallpaper.h \ + ./../../../../hsdomainmodel/inc/hswidgetcomponent.h \ + ./../../../../hsdomainmodel/inc/hswidgetcomponentregistry.h \ + ./../../../../hsdomainmodel/inc/hswidgethost.h \ + ./../../../../hsdomainmodel/inc/hswidgethostvisual.h \ + ./../../../../hsdomainmodel/inc/hswidgettoucharea.h \ + ./../../../../hsdomainmodel/inc/hsbackuprestoreactivecallback.h \ + ./../../../../hsutils/inc/hsspinnerdialog.h \ + ./../../../../hsutils/inc/hssnapline.h + + SOURCES += ./src/*.cpp \ + ./../../../src/hshomescreenclientserviceprovider.cpp \ + ./../../../src/hshomescreen.cpp \ + ./../../../src/hsstatemachine.cpp \ + ./../../../src/hsrecoverymanager.cpp \ + ./../../../../hsdomainmodel/src/hswidgetcomponentdescriptor.cpp \ + ./../../../../hsdomainmodel/src/hspagetoucharea.cpp \ + ./../../../../hsdomainmodel/src/hswidgettoucharea.cpp \ + ./../../../../hsdomainmodel/src/hsshortcutservice.cpp \ + ./../../../../hsdomainmodel/src/hsdatabase.cpp \ + ./../../../../hsdomainmodel/src/hsbackuprestoreobserver.cpp \ + ./../../../../hsdomainmodel/src/hsbackuprestoreactivecallback.cpp \ + ./../../../../hsdomainmodel/src/hswidgetpositioningonwidgetadd.cpp \ + ./../../../../hsutils/src/hsmenueventfactory.cpp \ + ./../../../../hsutils/src/hswidgetpositioningonorientationchange.cpp \ + ./../../../../hsutils/src/hswidgetpositioningonwidgetmove.cpp \ + ./../../../../hsutils/src/hsmenueventtransition.cpp \ + ./../../../../hsutils/src/hsmenuevent.cpp \ + ./../../../../hsutils/src/hssnapline.cpp +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/t_hsapplicationexe.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/t_hsapplication/t_hsapplicationexe/t_hsapplicationexe.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,89 @@ +# +# 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 = app + +CONFIG(debug, debug|release) { + LIBS += -L../../../../../../bin/debug -lhsdomainmodel + LIBS += -L../../../../../../bin/debug -lhsutils + DESTDIR = debug + +} +else { + LIBS += -L../../../../../../bin/release -lhsdomainmodel + LIBS += -L../../../../../../bin/release -lhsutils + DESTDIR = release +} + +CONFIG += debug_and_release \ + console \ + hb \ + mobility + +MOBILITY = serviceframework publishsubscribe + +QT += testlib \ + xml \ + sql + +DEFINES += HOMESCREEN_TEST \ + HSDOMAINMODEL_TEST \ + HSUTILS_TEST + +coverage:DEFINES += COVERAGE_MEASUREMENT + +DEPENDPATH += .\ + ./src \ + ../../../src \ + ../../../inc + +INCLUDEPATH += .\ + ./inc \ + ../../../inc \ + ../../../../inc \ + ../../../../hsutils/inc \ + ../../../../hsdomainmodel/inc + +win32: { + INCLUDEPATH += ../../../../../../homescreensrv/homescreensrv_plat/homescreen_information_api/inc +} + +symbian: { + CONFIG += symbian_test + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + SYMBIAN_PLATFORMS = WINSCW ARMV5 + + TARGET.UID3 = 0x20022F5F + TARGET.CAPABILITY = CAP_APPLICATION AllFiles + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB + + INCLUDEPATH += $${EPOCROOT}sf/mw/homescreensrv/homescreensrv_plat/contentstorage_api \ + $${EPOCROOT}sf/mw/homescreensrv/contentstorage/caclient/inc \ + $${EPOCROOT}sf/mw/homescreensrv/contentstorage/caclient/stub/inc + LIBS += -lxqservice -lxqserviceutil -lXQKeyCapture -labclient -lxqsettingsmanager + + include(installs_symbian.pri) + + MMP_RULES += SMPSAFE +} + +include(t_hsapplicationexe.pri) + +win32:include(installs_win32.pri) +symbian:include(installs_symbian.pri) + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplication/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplication/tsrc/tsrc.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,24 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs +SUBDIRS = t_hsapplication + +CONFIG += ordered + +symbian: { + CONFIG += symbian_test +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplicationlauncher/group/hsapplicationlauncher.mmp --- a/homescreenapp/hsapplicationlauncher/group/hsapplicationlauncher.mmp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsapplicationlauncher/group/hsapplicationlauncher.mmp Mon Sep 20 10:19:07 2010 +0300 @@ -47,4 +47,5 @@ LANG SC +SMPSAFE diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplicationlauncher/src/hsapplicationlauncher.cpp --- a/homescreenapp/hsapplicationlauncher/src/hsapplicationlauncher.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsapplicationlauncher/src/hsapplicationlauncher.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -235,7 +235,7 @@ // From CActive. // ----------------------------------------------------------------------------- // -TInt CHsLaunch::RunError( TInt aError ) +TInt CHsLaunch::RunError( TInt /*aError*/ ) { /* Shutdown. This application * will be restarted by startup sw. */ diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplicationlauncher/tsrc/t_hsapplicationlauncher/inc/t_hsapplicationlauncher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/tsrc/t_hsapplicationlauncher/inc/t_hsapplicationlauncher.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,68 @@ +/* +* 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: Test class for hsapplicationlauncher +* +*/ + +#include + +/** +* @test Test class for homescreen::hsapplicationlauncher modules. +*/ +class t_hsapplicationlauncher : public QObject +{ + Q_OBJECT + +private slots: + + /** + * initialize + */ + void initTestCase(); + void cleanupTestCase(); + + /** + * hsapplicationlauncher.cpp + */ + void testActivate(); + void testRunL(); + void testInitProcessMonitorL(); + void testDoCancel(); + void testShutdownApp(); + void testRunError(); + void testListeningLanguageSelection(); + void testHandleNotifyInt(); + void testStartHomeScreen(); + void testProcessEnded(); + void testProcessMonitoringError(); + void testSystemShutdownEvent(); + void testIsLanguageSelectedL(); + + /** + * hsprocessmonitor.cpp + */ + void testProcessMonitorRunL(); + void testProcessMonitorDoCancel(); + void testProcessMonitorRunError(); + + /** + * hsshutdownmonitor.cpp + */ + void testShutDownMonitorRunL(); + void testShutDownMonitorDoCancel(); + void testShutDownMonitorRunError(); + + +private: +}; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplicationlauncher/tsrc/t_hsapplicationlauncher/sis/t_hsapplicationlauncher.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/tsrc/t_hsapplicationlauncher/sis/t_hsapplicationlauncher.pkg Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,35 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; + +; Language +&EN + +; SIS header: name, uid, version +#{"t_hsapplicationlauncher"},(0x20022F6E),1,0,0 + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Supports S60 5th Edition +[0x1028315F], 0, 0, 0, {"S60ProductID"} + +; HS application's unittest +"/epoc32/release/armv5/urel/t_hsapplicationlauncher.exe" - "c:/sys/bin/t_hsapplicationlauncher.exe" +"/epoc32/data/z/private/10003a3f/import/apps/t_hsapplicationlauncher_reg.rsc" - "c:/private/10003a3f/import/apps/t_hsapplicationlauncher_reg.rsc" +"/epoc32/data/z/resource/apps/t_hsapplicationlauncher.rsc" - "c:/resource/apps/t_hsapplicationlauncher.rsc" diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplicationlauncher/tsrc/t_hsapplicationlauncher/sis/t_hsapplicationlauncher_sisx.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/tsrc/t_hsapplicationlauncher/sis/t_hsapplicationlauncher_sisx.bat Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,30 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem +@echo off + +if exist t_hsapplicationlauncher.sisx del t_hsapplicationlauncher.sisx + +makesis t_hsapplicationlauncher.pkg +signsis t_hsapplicationlauncher.sis t_hsapplicationlauncher.sisx ../../../../internal/sis/rd.cer ../../../../internal/sis/rd-key.pem + +if exist t_hsapplicationlauncher.sisx ( +echo t_hsapplicationlauncher.sisx creation SUCCEEDED +del t_hsapplicationlauncher.sis +) + +if not exist t_hsapplicationlauncher.sisx ( +echo t_hsapplicationlauncher.sisx creation FAILED +) \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplicationlauncher/tsrc/t_hsapplicationlauncher/src/rprocess_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/tsrc/t_hsapplicationlauncher/src/rprocess_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,80 @@ +/* +* 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: +* +*/ + +#include "e32std.h" + +TInt RProcess::Create(const TDesC& aFileName,const TDesC& aCommand,TOwnerType aType) +{ + return KErrNone; +} + +TInt RProcess::Open(const TDesC &aName,TOwnerType aType) +{ + return KErrNone; +} + +TInt RProcess::Open(TProcessId aId,TOwnerType aType) +{ + return KErrNone; +} + +void RProcess::Resume() +{ +} + +TExitType RProcess::ExitType() const +{ + return TExitType(); +} + +TUidType RProcess::Type() const +{ + return TUidType(); +} + +TProcessId RProcess::Id() const +{ + return 0; +} + +void RProcess::Rendezvous(TRequestStatus& aStatus) const +{ + aStatus = KRequestPending; + return; +} + +TInt RProcess::RendezvousCancel(TRequestStatus& aStatus) const +{ + return KErrNone; +} + +void RProcess::Rendezvous(TInt aReason) +{ + +} + +TVendorId RProcess::VendorId() const +{ + TVendorId vi(0); + return vi; +} + +void User::WaitForRequest(TRequestStatus& aStatus) +{ + aStatus = KErrNone; + return; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplicationlauncher/tsrc/t_hsapplicationlauncher/src/rssmstateawaresession_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/tsrc/t_hsapplicationlauncher/src/rssmstateawaresession_mock.cpp Mon Sep 20 10:19: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: +* +*/ + +#include +#include +#include +#include + +static TSsmState iState(ESsmNormal, ESsmNormalSubState); + +RSsmStateAwareSession::RSsmStateAwareSession() +{ + +} + +TInt RSsmStateAwareSession::Connect(TDmDomainId aId) +{ + TDmDomainId value = aId; + return KErrNone; +} + +TSsmState RSsmStateAwareSession::State() const +{ + return iState; +} + +void RSsmStateAwareSession::AcknowledgeAndRequestStateNotification(TInt aError, TRequestStatus& aStatus) +{ + (void)aError; + TRequestStatus* stat = &aStatus; + User::RequestComplete( stat, KErrNone); +} + +void RSsmStateAwareSession::AcknowledgeStateNotification(TInt aError) +{ + (void)aError; +} + +void RSsmStateAwareSession::Close() +{ + +} + +void RSsmStateAwareSession::RequestStateNotification(TRequestStatus& aStatus) +{ + TRequestStatus* stat = &aStatus; + User::RequestComplete( stat, KErrNone); +} + +void RSsmStateAwareSession::RequestStateNotificationCancel() +{ +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplicationlauncher/tsrc/t_hsapplicationlauncher/src/t_hsapplicationlauncher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/tsrc/t_hsapplicationlauncher/src/t_hsapplicationlauncher.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,346 @@ +/* +* 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 test class for hsapplicationlauncher library. +* +*/ + +#include +#include +#include "t_hsapplicationlauncher.h" +#include "hsapplicationlauncher.h" + +const TInt KPSCategoryUid(0x20022F36); +const TInt KPSCrashCountKey(1); + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::initTestCase() +{ +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::cleanupTestCase() +{ +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testActivate() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testRunL() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + hsApplicationLauncher->RunL(); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testInitProcessMonitorL() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + hsApplicationLauncher->InitProcessMonitorL(0); + QVERIFY(hsApplicationLauncher->iProcessMonitor); + hsApplicationLauncher->InitProcessMonitorL(0); + QVERIFY(hsApplicationLauncher->iProcessMonitor); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testDoCancel() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + hsApplicationLauncher->InitProcessMonitorL(0); + hsApplicationLauncher->DoCancel(); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testShutdownApp() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + hsApplicationLauncher->ShutdownApp(KErrGeneral); + QVERIFY(hsApplicationLauncher->iApplicationReturnValue == KErrGeneral); + QCOMPARE(hsApplicationLauncher->ApplicationReturnValue(), KErrGeneral); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testRunError() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + hsApplicationLauncher->RunError(KErrGeneral); + QVERIFY(hsApplicationLauncher->iApplicationReturnValue == KErrGeneral); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testListeningLanguageSelection() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + hsApplicationLauncher->StartListeningLanguageSelectionL(); + QVERIFY(hsApplicationLauncher->iCenRepNotifyHandler); + hsApplicationLauncher->StopListeningLanguageSelection(); + QVERIFY(!hsApplicationLauncher->iCenRepNotifyHandler); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testHandleNotifyInt() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + hsApplicationLauncher->StartListeningLanguageSelectionL(); + hsApplicationLauncher->HandleNotifyInt(0x00000007, 1); + QVERIFY(!hsApplicationLauncher->iCenRepNotifyHandler); + hsApplicationLauncher->HandleNotifyInt(0x00000008, 1); + QVERIFY(!hsApplicationLauncher->iCenRepNotifyHandler); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testStartHomeScreen() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + hsApplicationLauncher->StartHomeScreen(); + QVERIFY(hsApplicationLauncher->iProcessMonitor); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testProcessEnded() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + + TExitCategoryName panicString; + hsApplicationLauncher->ProcessEnded(EExitPanic, KErrNone, panicString); + TInt crashCount = 0; + RProperty::Get(TUid::Uid(KPSCategoryUid), KPSCrashCountKey, crashCount); + QVERIFY(crashCount == 1); + + if(hsApplicationLauncher->IsActive()) + { + hsApplicationLauncher->Cancel(); + } + + hsApplicationLauncher->ProcessEnded(EExitKill, KErrGeneral, panicString); + RProperty::Get(TUid::Uid(KPSCategoryUid), KPSCrashCountKey, crashCount); + QVERIFY(crashCount == 2); + + if(hsApplicationLauncher->IsActive()) + { + hsApplicationLauncher->Cancel(); + } + + hsApplicationLauncher->ProcessEnded(EExitTerminate, KErrGeneral, panicString); + RProperty::Get(TUid::Uid(KPSCategoryUid), KPSCrashCountKey, crashCount); + QVERIFY(crashCount == 2); + + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testProcessMonitoringError() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + hsApplicationLauncher->ProcessMonitoringError(KErrGeneral); + QVERIFY(hsApplicationLauncher->iApplicationReturnValue == KErrGeneral); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testSystemShutdownEvent() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + hsApplicationLauncher->SystemShutdownEvent(); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testIsLanguageSelectedL() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + hsApplicationLauncher->StartListeningLanguageSelectionL(); + TBool languageSelected = ETrue; + TRAP(errNo, languageSelected = hsApplicationLauncher->IsLanguageSelectedL()); + QCOMPARE(errNo, KErrNone); +#if defined( __WINS__ ) + QVERIFY(languageSelected == EFalse); +#else + QVERIFY(languageSelected); +#endif + hsApplicationLauncher->StopListeningLanguageSelection(); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testProcessMonitorRunL() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + hsApplicationLauncher->InitProcessMonitorL(0); + hsApplicationLauncher->iProcessMonitor->RunL(); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testProcessMonitorDoCancel() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + hsApplicationLauncher->InitProcessMonitorL(0); + hsApplicationLauncher->iProcessMonitor->DoCancel(); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testProcessMonitorRunError() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + hsApplicationLauncher->InitProcessMonitorL(0); + hsApplicationLauncher->iProcessMonitor->RunError(KErrGeneral); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testShutDownMonitorRunL() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + QVERIFY(hsApplicationLauncher->iShutdownMonitor); + if(hsApplicationLauncher->iShutdownMonitor->IsActive()) + { + hsApplicationLauncher->iShutdownMonitor->Cancel(); + } + hsApplicationLauncher->iShutdownMonitor->RunL(); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testShutDownMonitorDoCancel() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + QVERIFY(hsApplicationLauncher->iShutdownMonitor); + hsApplicationLauncher->iShutdownMonitor->DoCancel(); + delete hsApplicationLauncher; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsapplicationlauncher::testShutDownMonitorRunError() +{ + CHsLaunch *hsApplicationLauncher = 0; + TRAPD(errNo, hsApplicationLauncher = CHsLaunch::NewL()); + QCOMPARE(errNo, KErrNone); + hsApplicationLauncher->Activate(); + QVERIFY(hsApplicationLauncher->iShutdownMonitor); + errNo = hsApplicationLauncher->iShutdownMonitor->RunError(KErrGeneral); + QCOMPARE(errNo, KErrGeneral); + delete hsApplicationLauncher; +} + +QTEST_MAIN(t_hsapplicationlauncher) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplicationlauncher/tsrc/t_hsapplicationlauncher/t_hsapplicationlauncher.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/tsrc/t_hsapplicationlauncher/t_hsapplicationlauncher.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,21 @@ +# +# 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/*.h \ + ../../inc/*.h +SOURCES += ./src/*.cpp \ + ../../src/*.cpp diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplicationlauncher/tsrc/t_hsapplicationlauncher/t_hsapplicationlauncher.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/tsrc/t_hsapplicationlauncher/t_hsapplicationlauncher.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,60 @@ +# +# 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 = app + +CONFIG(debug, debug|release) { + DESTDIR = ./debug +} else { + DESTDIR = ./release +} + +CONFIG += debug_and_release \ + console + +QT += testlib + +CONFIG(debug, debug|release) { + DESTDIR = ./debug +} else { + DESTDIR = ./release +} + +DEFINES += HOMESCREEN_TEST + +coverage:DEFINES += COVERAGE_MEASUREMENT + +DEPENDPATH += .\ + ./src \ + ./inc \ + ../../inc + +INCLUDEPATH += .\ + ./inc \ + ../../inc + +symbian: { + CONFIG += symbian_test + CONFIG -= symbian_i18n + SYMBIAN_PLATFORMS = WINSCW ARMV5 + TARGET.UID3 = 0x20022F6E + TARGET.CAPABILITY = CAP_APPLICATION AllFiles + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB + LIBS+= -lssmcmn -lcentralrepository -lcenrepnotifhandler + MMP_RULES += SMPSAFE +} + +include(t_hsapplicationlauncher.pri) \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsapplicationlauncher/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsapplicationlauncher/tsrc/tsrc.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,24 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs + +CONFIG += ordered + +symbian: { + SUBDIRS = t_hsapplicationlauncher + CONFIG += symbian_test +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/bwins/hsdomainmodelu.def --- a/homescreenapp/hsdomainmodel/bwins/hsdomainmodelu.def Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsdomainmodel/bwins/hsdomainmodelu.def Mon Sep 20 10:19:07 2010 +0300 @@ -1,663 +1,690 @@ EXPORTS ?trUtf8@HsScene@@SA?AVQString@@PBD0H@Z @ 1 NONAME ; class QString HsScene::trUtf8(char const *, char const *, int) ?staticMetaObject@HsPageVisual@@2UQMetaObject@@B @ 2 NONAME ; struct QMetaObject const HsPageVisual::staticMetaObject - ?metaObject@HsConfiguration@@UBEPBUQMetaObject@@XZ @ 3 NONAME ; struct QMetaObject const * HsConfiguration::metaObject(void) const - ?aboutToUninstall@HsWidgetComponent@@IAEXXZ @ 4 NONAME ; void HsWidgetComponent::aboutToUninstall(void) - ??_EHsWidgetData@@QAE@I@Z @ 5 NONAME ; HsWidgetData::~HsWidgetData(unsigned int) - ?metaObject@HsHostedWidgetFactory@@UBEPBUQMetaObject@@XZ @ 6 NONAME ; struct QMetaObject const * HsHostedWidgetFactory::metaObject(void) const - ?pageChangeZoneAnimationDuration@HsConfiguration@@QBEHXZ @ 7 NONAME ; int HsConfiguration::pageChangeZoneAnimationDuration(void) const - ?takeInstance@HsHostedWidgetFactory@@SAPAV1@XZ @ 8 NONAME ; class HsHostedWidgetFactory * HsHostedWidgetFactory::takeInstance(void) - ?widgetDropEffectDuration@HsConfiguration@@QBEHXZ @ 9 NONAME ; int HsConfiguration::widgetDropEffectDuration(void) const - ?setMaximumPageCount@HsConfiguration@@QAEXH@Z @ 10 NONAME ; void HsConfiguration::setMaximumPageCount(int) - ?qt_metacast@HsShortcutService@@UAEPAXPBD@Z @ 11 NONAME ; void * HsShortcutService::qt_metacast(char const *) - ?propertyChanged@HsConfiguration@@IAEXABVQString@@@Z @ 12 NONAME ; void HsConfiguration::propertyChanged(class QString const &) - ?showWidget@HsWidgetHost@@QAEXXZ @ 13 NONAME ; void HsWidgetHost::showWidget(void) - ?setInstance@HsConfiguration@@SAXPAV1@@Z @ 14 NONAME ; void HsConfiguration::setInstance(class HsConfiguration *) - ?isActivePage@HsPage@@QBE_NXZ @ 15 NONAME ; bool HsPage::isActivePage(void) const - ?hidden@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 16 NONAME ; class QString HsWidgetComponentDescriptor::hidden(void) const - ?cancel@HsWallpaperLoader@@QAEXXZ @ 17 NONAME ; void HsWallpaperLoader::cancel(void) - ?metaObject@HsShortcutService@@UBEPBUQMetaObject@@XZ @ 18 NONAME ; struct QMetaObject const * HsShortcutService::metaObject(void) const - ?instance@HsBackupRestoreObserver@@SAPAV1@XZ @ 19 NONAME ; class HsBackupRestoreObserver * HsBackupRestoreObserver::instance(void) - ??1HsWidgetHostVisual@@UAE@XZ @ 20 NONAME ; HsWidgetHostVisual::~HsWidgetHostVisual(void) - ?load@HsPage@@QAE_NXZ @ 21 NONAME ; bool HsPage::load(void) - ?setSnapEnabled@HsConfiguration@@QAEX_N@Z @ 22 NONAME ; void HsConfiguration::setSnapEnabled(bool) - ?clockWidgetTapFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 23 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::clockWidgetTapFeedbackEffect(void) const - ?readyForBUR@HsBackupRestoreObserver@@QAEXXZ @ 24 NONAME ; void HsBackupRestoreObserver::readyForBUR(void) - ?handleEntryUpdated@HsWidgetComponentRegistry@@AAEXABVCaEntry@@ABVQString@@@Z @ 25 NONAME ; void HsWidgetComponentRegistry::handleEntryUpdated(class CaEntry const &, class QString const &) - ?instance@HsShortcutService@@SAPAV1@PAVQStateMachine@@@Z @ 26 NONAME ; class HsShortcutService * HsShortcutService::instance(class QStateMachine *) - ?staticMetaObject@HsDatabase@@2UQMetaObject@@B @ 27 NONAME ; struct QMetaObject const HsDatabase::staticMetaObject - ??1HsSceneWallpaper@@UAE@XZ @ 28 NONAME ; HsSceneWallpaper::~HsSceneWallpaper(void) - ?setActivePageIndex@HsScene@@QAE_NH@Z @ 29 NONAME ; bool HsScene::setActivePageIndex(int) - ??1HsContentService@@UAE@XZ @ 30 NONAME ; HsContentService::~HsContentService(void) - ?widgetPreference@HsDatabase@@QAE_NHABVQString@@AAVQVariant@@@Z @ 31 NONAME ; bool HsDatabase::widgetPreference(int, class QString const &, class QVariant &) - ?tr@HsBackupRestoreObserver@@SA?AVQString@@PBD0H@Z @ 32 NONAME ; class QString HsBackupRestoreObserver::tr(char const *, char const *, int) - ?setOnline@HsScene@@QAEX_N@Z @ 33 NONAME ; void HsScene::setOnline(bool) - ?updateIconItem@HsWallpaper@@AAEXW4Orientation@Qt@@@Z @ 34 NONAME ; void HsWallpaper::updateIconItem(enum Qt::Orientation) - ?getStaticMetaObject@HsWidgetComponentRegistry@@SAABUQMetaObject@@XZ @ 35 NONAME ; struct QMetaObject const & HsWidgetComponentRegistry::getStaticMetaObject(void) - ?trUtf8@HsPageWallpaper@@SA?AVQString@@PBD0@Z @ 36 NONAME ; class QString HsPageWallpaper::trUtf8(char const *, char const *) - ??0HsWidgetComponentRegistry@@AAE@PAVQObject@@@Z @ 37 NONAME ; HsWidgetComponentRegistry::HsWidgetComponentRegistry(class QObject *) - ?NewL@CHsBURActiveCallback@@SAPAV1@PAVHsBackupRestoreObserver@@@Z @ 38 NONAME ; class CHsBURActiveCallback * CHsBURActiveCallback::NewL(class HsBackupRestoreObserver *) - ?action_unload@HsWidgetHost@@AAEXXZ @ 39 NONAME ; void HsWidgetHost::action_unload(void) - ?visualModel@HsWidgetHostVisual@@QBEPAVHsWidgetHost@@XZ @ 40 NONAME ; class HsWidgetHost * HsWidgetHostVisual::visualModel(void) const - ?tr@HsBackupRestoreObserver@@SA?AVQString@@PBD0@Z @ 41 NONAME ; class QString HsBackupRestoreObserver::tr(char const *, char const *) - ?setMinimumWidgetWidth@HsConfiguration@@QAEXM@Z @ 42 NONAME ; void HsConfiguration::setMinimumWidgetWidth(float) - ?event_show@HsWidgetHost@@IAEXXZ @ 43 NONAME ; void HsWidgetHost::event_show(void) - ?setBounceAnimationEasingCurve@HsConfiguration@@QAEXW4Type@QEasingCurve@@@Z @ 44 NONAME ; void HsConfiguration::setBounceAnimationEasingCurve(enum QEasingCurve::Type) - ?wallpaperDirectory@HsSceneWallpaper@@MBE?AVQString@@XZ @ 45 NONAME ; class QString HsSceneWallpaper::wallpaperDirectory(void) const - ?setWidgetMoveBlockedFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 46 NONAME ; void HsConfiguration::setWidgetMoveBlockedFeedbackEffect(enum HbFeedback::InstantEffect) - ?imageSetFailed@HsWallpaper@@IAEXXZ @ 47 NONAME ; void HsWallpaper::imageSetFailed(void) - ?trUtf8@HsWidgetHostVisual@@SA?AVQString@@PBD0@Z @ 48 NONAME ; class QString HsWidgetHostVisual::trUtf8(char const *, char const *) - ?setSnapForce@HsConfiguration@@QAEXM@Z @ 49 NONAME ; void HsConfiguration::setSnapForce(float) - ??0HsWidgetData@@QAE@XZ @ 50 NONAME ; HsWidgetData::HsWidgetData(void) - ?event_backupRestoreCompleted@HsBackupRestoreObserver@@IAEXXZ @ 51 NONAME ; void HsBackupRestoreObserver::event_backupRestoreCompleted(void) - ?staticMetaObject@HsWidgetHostVisual@@2UQMetaObject@@B @ 52 NONAME ; struct QMetaObject const HsWidgetHostVisual::staticMetaObject - ?setActivePage@HsScene@@QAE_NPAVHsPage@@@Z @ 53 NONAME ; bool HsScene::setActivePage(class HsPage *) - ?setSceneX@HsIdleWidget@@QAEXM@Z @ 54 NONAME ; void HsIdleWidget::setSceneX(float) - ?qt_metacast@HsContentService@@UAEPAXPBD@Z @ 55 NONAME ; void * HsContentService::qt_metacast(char const *) - ?qt_metacall@HsContentService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 56 NONAME ; int HsContentService::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@HsSceneWallpaper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 57 NONAME ; int HsSceneWallpaper::qt_metacall(enum QMetaObject::Call, int, void * *) - ?widgets@HsContentService@@QAE_NABVQString@@ABV?$QHash@VQString@@VQVariant@@@@AAH@Z @ 58 NONAME ; bool HsContentService::widgets(class QString const &, class QHash const &, int &) - ?createWidget@HsHostedWidgetFactory@@QAEPAVQObject@@ABVQString@@@Z @ 59 NONAME ; class QObject * HsHostedWidgetFactory::createWidget(class QString const &) - ?metaObject@HsDatabase@@UBEPBUQMetaObject@@XZ @ 60 NONAME ; struct QMetaObject const * HsDatabase::metaObject(void) const - ?contentGeometry@HsPage@@QAE?AVQRectF@@W4Orientation@Qt@@@Z @ 61 NONAME ; class QRectF HsPage::contentGeometry(enum Qt::Orientation) - ?exportToFile@HsConfiguration@@QAE_NABVQString@@@Z @ 62 NONAME ; bool HsConfiguration::exportToFile(class QString const &) - ?widgetStartFaulted@HsContentService@@AAEXXZ @ 63 NONAME ; void HsContentService::widgetStartFaulted(void) - ??_EHsWidgetHostVisual@@UAE@I@Z @ 64 NONAME ; HsWidgetHostVisual::~HsWidgetHostVisual(unsigned int) - ?setPageChangePanDistance@HsConfiguration@@QAEXM@Z @ 65 NONAME ; void HsConfiguration::setPageChangePanDistance(float) - ?qt_metacast@HsSceneWallpaper@@UAEPAXPBD@Z @ 66 NONAME ; void * HsSceneWallpaper::qt_metacast(char const *) - ?metaObject@HsWallpaperLoader@@UBEPBUQMetaObject@@XZ @ 67 NONAME ; struct QMetaObject const * HsWallpaperLoader::metaObject(void) const - ?action_finished@HsWidgetHost@@AAEXXZ @ 68 NONAME ; void HsWidgetHost::action_finished(void) - ?widget@HsWidgetHostVisual@@QAEPAVQObject@@XZ @ 69 NONAME ; class QObject * HsWidgetHostVisual::widget(void) - ?visual@HsWidgetHost@@QBEPAVHsWidgetHostVisual@@XZ @ 70 NONAME ; class HsWidgetHostVisual * HsWidgetHost::visual(void) const - ?pageChangeFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 71 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::pageChangeFeedbackEffect(void) const - ??0HsWallpaperLoader@@QAE@PAVQObject@@@Z @ 72 NONAME ; HsWallpaperLoader::HsWallpaperLoader(class QObject *) - ?trUtf8@HsShortcutService@@SA?AVQString@@PBD0H@Z @ 73 NONAME ; class QString HsShortcutService::trUtf8(char const *, char const *, int) - ?maximumWidgetWidth@HsConfiguration@@QBEMXZ @ 74 NONAME ; float HsConfiguration::maximumWidgetWidth(void) const - ?metaObject@HsContentService@@UBEPBUQMetaObject@@XZ @ 75 NONAME ; struct QMetaObject const * HsContentService::metaObject(void) const - ?setScene@HsSceneWallpaper@@QAEXPAVHsScene@@@Z @ 76 NONAME ; void HsSceneWallpaper::setScene(class HsScene *) - ?onPageMarginChanged@HsPage@@AAEXABVQString@@@Z @ 77 NONAME ; void HsPage::onPageMarginChanged(class QString const &) - ?finished@HsWidgetHost@@IAEXXZ @ 78 NONAME ; void HsWidgetHost::finished(void) - ?pagePanStarted@HsScene@@IAEXPAVQGestureEvent@@@Z @ 79 NONAME ; void HsScene::pagePanStarted(class QGestureEvent *) - ?addPage@HsScene@@QAE_NPAVHsPage@@@Z @ 80 NONAME ; bool HsScene::addPage(class HsPage *) - ?controlLayer@HsIdleWidget@@QBEPAVHbWidget@@XZ @ 81 NONAME ; class HbWidget * HsIdleWidget::controlLayer(void) const - ?qt_metacall@HsWidgetHost@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 82 NONAME ; int HsWidgetHost::qt_metacall(enum QMetaObject::Call, int, void * *) - ?configuration@HsDatabase@@QAE_NAAV?$QHash@VQString@@VQVariant@@@@@Z @ 83 NONAME ; bool HsDatabase::configuration(class QHash &) - ?tr@HsContentService@@SA?AVQString@@PBD0@Z @ 84 NONAME ; class QString HsContentService::tr(char const *, char const *) - ?mInstance@HsHostedWidgetFactory@@0PAV1@A @ 85 NONAME ; class HsHostedWidgetFactory * HsHostedWidgetFactory::mInstance - ?setInstance@HsHostedWidgetFactory@@SAPAV1@PAV1@@Z @ 86 NONAME ; class HsHostedWidgetFactory * HsHostedWidgetFactory::setInstance(class HsHostedWidgetFactory *) - ?staticMetaObject@HsScene@@2UQMetaObject@@B @ 87 NONAME ; struct QMetaObject const HsScene::staticMetaObject - ?setMaximumWidgetWidth@HsConfiguration@@QAEXM@Z @ 88 NONAME ; void HsConfiguration::setMaximumWidgetWidth(float) - ?scene@HsDatabase@@QAE_NAAVHsSceneData@@@Z @ 89 NONAME ; bool HsDatabase::scene(class HsSceneData &) - ?resetNewWidgets@HsPage@@QAEXXZ @ 90 NONAME ; void HsPage::resetNewWidgets(void) - ?tr@HsScene@@SA?AVQString@@PBD0@Z @ 91 NONAME ; class QString HsScene::tr(char const *, char const *) - ?tr@HsPage@@SA?AVQString@@PBD0@Z @ 92 NONAME ; class QString HsPage::tr(char const *, char const *) - ?emitAvailable@HsWidgetComponent@@AAEXXZ @ 93 NONAME ; void HsWidgetComponent::emitAvailable(void) - ?getStaticMetaObject@HsDatabase@@SAABUQMetaObject@@XZ @ 94 NONAME ; struct QMetaObject const & HsDatabase::getStaticMetaObject(void) - ?contentRect@HsPage@@QAE?AVQRectF@@XZ @ 95 NONAME ; class QRectF HsPage::contentRect(void) - ?tr@HsPageVisual@@SA?AVQString@@PBD0@Z @ 96 NONAME ; class QString HsPageVisual::tr(char const *, char const *) - ?setIconUri@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 97 NONAME ; void HsWidgetComponentDescriptor::setIconUri(class QString const &) - ?orientationChanged@HsGui@@IAEXW4Orientation@Qt@@@Z @ 98 NONAME ; void HsGui::orientationChanged(enum Qt::Orientation) - ?widgetAdded@HsContentService@@IAEXABVQString@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 99 NONAME ; void HsContentService::widgetAdded(class QString const &, class QHash const &) - ?staticMetaObject@HsWallpaperLoaderThread@@2UQMetaObject@@B @ 100 NONAME ; struct QMetaObject const HsWallpaperLoaderThread::staticMetaObject - ?databaseName@HsDatabase@@QBE?AVQString@@XZ @ 101 NONAME ; class QString HsDatabase::databaseName(void) const - ?setPageChangeAnimationEasingCurve@HsConfiguration@@QAEXW4Type@QEasingCurve@@@Z @ 102 NONAME ; void HsConfiguration::setPageChangeAnimationEasingCurve(enum QEasingCurve::Type) - ?setPageChangeZoneAnimationDuration@HsConfiguration@@QAEXH@Z @ 103 NONAME ; void HsConfiguration::setPageChangeZoneAnimationDuration(int) - ?qt_metacast@HsIdleWidget@@UAEPAXPBD@Z @ 104 NONAME ; void * HsIdleWidget::qt_metacast(char const *) - ?executeCollectionAction@HsShortcutService@@QAEXHABVQString@@@Z @ 105 NONAME ; void HsShortcutService::executeCollectionAction(int, class QString const &) - ?widgets@HsDatabase@@QAE_NABVQString@@ABV?$QHash@VQString@@VQVariant@@@@AAH@Z @ 106 NONAME ; bool HsDatabase::widgets(class QString const &, class QHash const &, int &) - ?qt_metacast@HsWallpaperLoaderThread@@UAEPAXPBD@Z @ 107 NONAME ; void * HsWallpaperLoaderThread::qt_metacast(char const *) - ?pageCrawlingAnimation@HsGui@@QAEPAVHsPropertyAnimationWrapper@@XZ @ 108 NONAME ; class HsPropertyAnimationWrapper * HsGui::pageCrawlingAnimation(void) - ?setSceneType@HsConfiguration@@QAEXW4SceneType@1@@Z @ 109 NONAME ; void HsConfiguration::setSceneType(enum HsConfiguration::SceneType) - ?layoutNewWidgets@HsPage@@QAEXXZ @ 110 NONAME ; void HsPage::layoutNewWidgets(void) - ?matchWidgetPreferences@HsDatabase@@AAE_NABV?$QHash@VQString@@VQVariant@@@@ABV?$QMultiMap@VQString@@V1@@@@Z @ 111 NONAME ; bool HsDatabase::matchWidgetPreferences(class QHash const &, class QMultiMap const &) - ?tr@HsWidgetHostVisual@@SA?AVQString@@PBD0@Z @ 112 NONAME ; class QString HsWidgetHostVisual::tr(char const *, char const *) - ?targetSize@HsWallpaperLoaderThread@@QBE?AVQSize@@XZ @ 113 NONAME ; class QSize HsWallpaperLoaderThread::targetSize(void) const - ?trUtf8@HsWallpaperLoader@@SA?AVQString@@PBD0H@Z @ 114 NONAME ; class QString HsWallpaperLoader::trUtf8(char const *, char const *, int) - ?event_remove@HsWidgetHost@@IAEXXZ @ 115 NONAME ; void HsWidgetHost::event_remove(void) - ?startDropEffect@HsWidgetHost@@QAEXXZ @ 116 NONAME ; void HsWidgetHost::startDropEffect(void) - ?trUtf8@HsWidgetComponentRegistry@@SA?AVQString@@PBD0@Z @ 117 NONAME ; class QString HsWidgetComponentRegistry::trUtf8(char const *, char const *) - ?event_close@HsWidgetHost@@IAEXXZ @ 118 NONAME ; void HsWidgetHost::event_close(void) - ??1HsWallpaperLoader@@UAE@XZ @ 119 NONAME ; HsWallpaperLoader::~HsWallpaperLoader(void) - ?mInstance@HsBackupRestoreObserver@@0PAV1@A @ 120 NONAME ; class HsBackupRestoreObserver * HsBackupRestoreObserver::mInstance - ?connectWidget@HsPage@@AAEXPAVHsWidgetHost@@@Z @ 121 NONAME ; void HsPage::connectWidget(class HsWidgetHost *) - ?setShortcutLabelVisible@HsConfiguration@@QAEX_N@Z @ 122 NONAME ; void HsConfiguration::setShortcutLabelVisible(bool) - ?sceneLayer@HsIdleWidget@@QBEPAVHbWidget@@XZ @ 123 NONAME ; class HbWidget * HsIdleWidget::sceneLayer(void) const - ?trUtf8@HsWallpaperLoaderThread@@SA?AVQString@@PBD0@Z @ 124 NONAME ; class QString HsWallpaperLoaderThread::trUtf8(char const *, char const *) - ?qt_metacast@HsScene@@UAEPAXPBD@Z @ 125 NONAME ; void * HsScene::qt_metacast(char const *) - ??1HsWidgetHost@@UAE@XZ @ 126 NONAME ; HsWidgetHost::~HsWidgetHost(void) - ?uninstallComponent@HsWidgetComponentRegistry@@QAEXABVHsWidgetComponentDescriptor@@@Z @ 127 NONAME ; void HsWidgetComponentRegistry::uninstallComponent(class HsWidgetComponentDescriptor const &) - ?action_notifyRemove@HsWidgetHost@@AAEXXZ @ 128 NONAME ; void HsWidgetHost::action_notifyRemove(void) - ?open@HsDatabase@@QAE_NXZ @ 129 NONAME ; bool HsDatabase::open(void) - ?idleWidget@HsGui@@QBEPAVHsIdleWidget@@XZ @ 130 NONAME ; class HsIdleWidget * HsGui::idleWidget(void) const - ?pageMargin@HsConfiguration@@QBEMXZ @ 131 NONAME ; float HsConfiguration::pageMargin(void) const - ?failed@HsWallpaperLoader@@IAEXXZ @ 132 NONAME ; void HsWallpaperLoader::failed(void) - ?setPos@HsWidgetPresentationData@@QAEXABVQPointF@@@Z @ 133 NONAME ; void HsWidgetPresentationData::setPos(class QPointF const &) - ?isSnapEffectsEnabled@HsConfiguration@@QBE_NXZ @ 134 NONAME ; bool HsConfiguration::isSnapEffectsEnabled(void) const - ?trUtf8@HsWallpaperLoaderThread@@SA?AVQString@@PBD0H@Z @ 135 NONAME ; class QString HsWallpaperLoaderThread::trUtf8(char const *, char const *, int) - ?setSourcePath@HsWallpaperLoaderThread@@QAEXABVQString@@@Z @ 136 NONAME ; void HsWallpaperLoaderThread::setSourcePath(class QString const &) - ?tr@HsGui@@SA?AVQString@@PBD0@Z @ 137 NONAME ; class QString HsGui::tr(char const *, char const *) - ?disconnectWidget@HsPage@@AAEXPAVHsWidgetHost@@@Z @ 138 NONAME ; void HsPage::disconnectWidget(class HsWidgetHost *) - ?setOnline@HsPage@@QAEX_N@Z @ 139 NONAME ; void HsPage::setOnline(bool) - ?tr@HsDatabase@@SA?AVQString@@PBD0@Z @ 140 NONAME ; class QString HsDatabase::tr(char const *, char const *) - ?onLoaderFailed@HsWallpaper@@AAEXXZ @ 141 NONAME ; void HsWallpaper::onLoaderFailed(void) - ?trUtf8@HsScene@@SA?AVQString@@PBD0@Z @ 142 NONAME ; class QString HsScene::trUtf8(char const *, char const *) - ?uninstallTranslator@HsWidgetComponent@@AAEXXZ @ 143 NONAME ; void HsWidgetComponent::uninstallTranslator(void) - ?setGeometry@HsIdleWidget@@UAEXABVQRectF@@@Z @ 144 NONAME ; void HsIdleWidget::setGeometry(class QRectF const &) - ?updateZValues@HsPage@@QAEXXZ @ 145 NONAME ; void HsPage::updateZValues(void) - ?tr@HsShortcutService@@SA?AVQString@@PBD0H@Z @ 146 NONAME ; class QString HsShortcutService::tr(char const *, char const *, int) - ?pos@HsWidgetPresentationData@@QBE?AVQPointF@@XZ @ 147 NONAME ; class QPointF HsWidgetPresentationData::pos(void) const - ?getStaticMetaObject@HsBackupRestoreObserver@@SAABUQMetaObject@@XZ @ 148 NONAME ; struct QMetaObject const & HsBackupRestoreObserver::getStaticMetaObject(void) - ?trUtf8@HsPageVisual@@SA?AVQString@@PBD0@Z @ 149 NONAME ; class QString HsPageVisual::trUtf8(char const *, char const *) - ?action_show@HsWidgetHost@@AAEXXZ @ 150 NONAME ; void HsWidgetHost::action_show(void) - ?pageLayer@HsIdleWidget@@QBEPAVHbWidget@@XZ @ 151 NONAME ; class HbWidget * HsIdleWidget::pageLayer(void) const - ?setSnapGap@HsConfiguration@@QAEXM@Z @ 152 NONAME ; void HsConfiguration::setSnapGap(float) - ?trUtf8@HsHostedWidgetFactory@@SA?AVQString@@PBD0@Z @ 153 NONAME ; class QString HsHostedWidgetFactory::trUtf8(char const *, char const *) - ?setActiveWidget@HsScene@@QAEXPAVHsWidgetHost@@@Z @ 154 NONAME ; void HsScene::setActiveWidget(class HsWidgetHost *) - ?transaction@HsDatabase@@QAE_NXZ @ 155 NONAME ; bool HsDatabase::transaction(void) - ?snapForce@HsConfiguration@@QBEMXZ @ 156 NONAME ; float HsConfiguration::snapForce(void) const - ?isOnline@HsScene@@QBE_NXZ @ 157 NONAME ; bool HsScene::isOnline(void) const - ??0HsWidgetPresentationData@@QAE@XZ @ 158 NONAME ; HsWidgetPresentationData::HsWidgetPresentationData(void) - ?tr@HsShortcutService@@SA?AVQString@@PBD0@Z @ 159 NONAME ; class QString HsShortcutService::tr(char const *, char const *) - ?metaObject@HsWidgetComponent@@UBEPBUQMetaObject@@XZ @ 160 NONAME ; struct QMetaObject const * HsWidgetComponent::metaObject(void) const - ?setConnectionName@HsDatabase@@QAEXABVQString@@@Z @ 161 NONAME ; void HsDatabase::setConnectionName(class QString const &) - ?qt_metacall@HsGui@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 162 NONAME ; int HsGui::qt_metacall(enum QMetaObject::Call, int, void * *) - ?metaObject@HsWallpaper@@UBEPBUQMetaObject@@XZ @ 163 NONAME ; struct QMetaObject const * HsWallpaper::metaObject(void) const - ?removeWidget@HsPage@@QAE_NPAVHsWidgetHost@@@Z @ 164 NONAME ; bool HsPage::removeWidget(class HsWidgetHost *) - ?trUtf8@HsPageVisual@@SA?AVQString@@PBD0H@Z @ 165 NONAME ; class QString HsPageVisual::trUtf8(char const *, char const *, int) - ?tr@HsWallpaperLoaderThread@@SA?AVQString@@PBD0@Z @ 166 NONAME ; class QString HsWallpaperLoaderThread::tr(char const *, char const *) - ?qt_metacall@HsWallpaper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 167 NONAME ; int HsWallpaper::qt_metacall(enum QMetaObject::Call, int, void * *) - ?onWidgetUnavailable@HsPage@@AAEXXZ @ 168 NONAME ; void HsPage::onWidgetUnavailable(void) - ?mInstance@HsDatabase@@0PAV1@A @ 169 NONAME ; class HsDatabase * HsDatabase::mInstance - ?available@HsWidgetComponent@@IAEXXZ @ 170 NONAME ; void HsWidgetComponent::available(void) - ?tr@HsSceneWallpaper@@SA?AVQString@@PBD0@Z @ 171 NONAME ; class QString HsSceneWallpaper::tr(char const *, char const *) - ?trUtf8@HsPage@@SA?AVQString@@PBD0@Z @ 172 NONAME ; class QString HsPage::trUtf8(char const *, char const *) - ?trUtf8@HsWidgetHostVisual@@SA?AVQString@@PBD0H@Z @ 173 NONAME ; class QString HsWidgetHostVisual::trUtf8(char const *, char const *, int) - ?hideWidgets@HsPage@@QAEXXZ @ 174 NONAME ; void HsPage::hideWidgets(void) - ?trUtf8@HsWidgetHost@@SA?AVQString@@PBD0H@Z @ 175 NONAME ; class QString HsWidgetHost::trUtf8(char const *, char const *, int) - ?qt_metacall@HsHostedWidgetFactory@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 176 NONAME ; int HsHostedWidgetFactory::qt_metacall(enum QMetaObject::Call, int, void * *) - ??0HsScene@@QAE@PAVQObject@@@Z @ 177 NONAME ; HsScene::HsScene(class QObject *) - ?getStaticMetaObject@HsPageVisual@@SAABUQMetaObject@@XZ @ 178 NONAME ; struct QMetaObject const & HsPageVisual::getStaticMetaObject(void) - ?pagePanUpdated@HsScene@@IAEXPAVQGestureEvent@@@Z @ 179 NONAME ; void HsScene::pagePanUpdated(class QGestureEvent *) - ?showTrashBin@HsIdleWidget@@QAEXXZ @ 180 NONAME ; void HsIdleWidget::showTrashBin(void) - ?qt_metacast@HsWidgetHost@@UAEPAXPBD@Z @ 181 NONAME ; void * HsWidgetHost::qt_metacast(char const *) - ?trUtf8@HsWallpaperLoader@@SA?AVQString@@PBD0@Z @ 182 NONAME ; class QString HsWallpaperLoader::trUtf8(char const *, char const *) - ?qt_metacall@HsWidgetComponentRegistry@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 183 NONAME ; int HsWidgetComponentRegistry::qt_metacall(enum QMetaObject::Call, int, void * *) - ?setMaximumWidgetHeight@HsConfiguration@@QAEXM@Z @ 184 NONAME ; void HsConfiguration::setMaximumWidgetHeight(float) - ?qt_metacall@HsPageVisual@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 185 NONAME ; int HsPageVisual::qt_metacall(enum QMetaObject::Call, int, void * *) - ?instance@HsConfiguration@@SAPAV1@XZ @ 186 NONAME ; class HsConfiguration * HsConfiguration::instance(void) - ?tr@HsWallpaperLoader@@SA?AVQString@@PBD0H@Z @ 187 NONAME ; class QString HsWallpaperLoader::tr(char const *, char const *, int) - ??_EHsConfiguration@@UAE@I@Z @ 188 NONAME ; HsConfiguration::~HsConfiguration(unsigned int) - ?metaObject@HsPage@@UBEPBUQMetaObject@@XZ @ 189 NONAME ; struct QMetaObject const * HsPage::metaObject(void) const - ?activePageIndex@HsScene@@QBEHXZ @ 190 NONAME ; int HsScene::activePageIndex(void) const - ?qt_metacast@HsWidgetHostVisual@@UAEPAXPBD@Z @ 191 NONAME ; void * HsWidgetHostVisual::qt_metacast(char const *) - ?hideHorizontalSnapLine@HsIdleWidget@@QAEXXZ @ 192 NONAME ; void HsIdleWidget::hideHorizontalSnapLine(void) - ?minimumWidgetWidth@HsConfiguration@@QBEMXZ @ 193 NONAME ; float HsConfiguration::minimumWidgetWidth(void) const - ?setWidgetPreferences@HsDatabase@@QAE_NHABV?$QHash@VQString@@VQVariant@@@@@Z @ 194 NONAME ; bool HsDatabase::setWidgetPreferences(int, class QHash const &) - ?orientation@HsGui@@QAE?AW4Orientation@Qt@@XZ @ 195 NONAME ; enum Qt::Orientation HsGui::orientation(void) - ?deleteWidget@HsDatabase@@QAE_NH@Z @ 196 NONAME ; bool HsDatabase::deleteWidget(int) - ?widgetOverTrashbinFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 197 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::widgetOverTrashbinFeedbackEffect(void) const - ?deleteFromDatabase@HsPage@@QAE_NXZ @ 198 NONAME ; bool HsPage::deleteFromDatabase(void) - ?setWidgetPresentation@HsDatabase@@QAE_NABVHsWidgetPresentationData@@@Z @ 199 NONAME ; bool HsDatabase::setWidgetPresentation(class HsWidgetPresentationData const &) - ?takeInstance@HsGui@@SAPAV1@XZ @ 200 NONAME ; class HsGui * HsGui::takeInstance(void) - ??0HsConfiguration@@QAE@PAVQObject@@@Z @ 201 NONAME ; HsConfiguration::HsConfiguration(class QObject *) - ?setDefaultImage@HsWallpaper@@QAEXXZ @ 202 NONAME ; void HsWallpaper::setDefaultImage(void) - ?setupTouchArea@HsPageVisual@@AAEXXZ @ 203 NONAME ; void HsPageVisual::setupTouchArea(void) - ?trUtf8@HsWidgetComponent@@SA?AVQString@@PBD0H@Z @ 204 NONAME ; class QString HsWidgetComponent::trUtf8(char const *, char const *, int) - ?setWidget@HsWidgetHostVisual@@QAEXPAVQObject@@@Z @ 205 NONAME ; void HsWidgetHostVisual::setWidget(class QObject *) - ?importFromFile@HsConfiguration@@QAE_NABVQString@@@Z @ 206 NONAME ; bool HsConfiguration::importFromFile(class QString const &) - ?page@HsDatabase@@QAE_NAAVHsPageData@@@Z @ 207 NONAME ; bool HsDatabase::page(class HsPageData &) - ??_EHsPage@@UAE@I@Z @ 208 NONAME ; HsPage::~HsPage(unsigned int) - ?instance@HsHostedWidgetFactory@@SAPAV1@XZ @ 209 NONAME ; class HsHostedWidgetFactory * HsHostedWidgetFactory::instance(void) - ?staticMetaObject@HsPage@@2UQMetaObject@@B @ 210 NONAME ; struct QMetaObject const HsPage::staticMetaObject - ?widgetDropFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 211 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::widgetDropFeedbackEffect(void) const - ?pageChangeZoneReverseAnimationDuration@HsConfiguration@@QBEHXZ @ 212 NONAME ; int HsConfiguration::pageChangeZoneReverseAnimationDuration(void) const - ?createWidget@HsContentService@@QAE_NABV?$QHash@VQString@@VQVariant@@@@@Z @ 213 NONAME ; bool HsContentService::createWidget(class QHash const &) - ?setVersion@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 214 NONAME ; void HsWidgetComponentDescriptor::setVersion(class QString const &) - ?getStaticMetaObject@HsWallpaperLoader@@SAABUQMetaObject@@XZ @ 215 NONAME ; struct QMetaObject const & HsWallpaperLoader::getStaticMetaObject(void) - ?mInstance@HsWidgetComponentRegistry@@0PAV1@A @ 216 NONAME ; class HsWidgetComponentRegistry * HsWidgetComponentRegistry::mInstance - ?staticMetaObject@HsWidgetHost@@2UQMetaObject@@B @ 217 NONAME ; struct QMetaObject const HsWidgetHost::staticMetaObject - ?qt_metacast@HsPageVisual@@UAEPAXPBD@Z @ 218 NONAME ; void * HsPageVisual::qt_metacast(char const *) - ?qt_metacall@HsShortcutService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 219 NONAME ; int HsShortcutService::qt_metacall(enum QMetaObject::Call, int, void * *) - ?setImages@HsWallpaper@@QAEXABVQString@@0@Z @ 220 NONAME ; void HsWallpaper::setImages(class QString const &, class QString const &) - ??1HsPageWallpaper@@UAE@XZ @ 221 NONAME ; HsPageWallpaper::~HsPageWallpaper(void) - ?startDropEffect@HsWidgetHostVisual@@QAEXXZ @ 222 NONAME ; void HsWidgetHostVisual::startDropEffect(void) - ?activeWidget@HsScene@@QBEPAVHsWidgetHost@@XZ @ 223 NONAME ; class HsWidgetHost * HsScene::activeWidget(void) const - ?widgets@HsDatabase@@QAE_NABVQString@@AAV?$QList@VHsWidgetData@@@@@Z @ 224 NONAME ; bool HsDatabase::widgets(class QString const &, class QList &) - ?rootDirectory@HsWallpaper@@IBE?AVQString@@XZ @ 225 NONAME ; class QString HsWallpaper::rootDirectory(void) const - ?tr@HsContentService@@SA?AVQString@@PBD0H@Z @ 226 NONAME ; class QString HsContentService::tr(char const *, char const *, int) - ??0HsDatabase@@QAE@PAVQObject@@@Z @ 227 NONAME ; HsDatabase::HsDatabase(class QObject *) - ?eventFilter@HsWidgetHostVisual@@MAE_NPAVQObject@@PAVQEvent@@@Z @ 228 NONAME ; bool HsWidgetHostVisual::eventFilter(class QObject *, class QEvent *) - ?tr@HsWidgetHost@@SA?AVQString@@PBD0@Z @ 229 NONAME ; class QString HsWidgetHost::tr(char const *, char const *) - ?remove@HsWallpaper@@QAEXXZ @ 230 NONAME ; void HsWallpaper::remove(void) - ?idleView@HsGui@@QBEPAVHbView@@XZ @ 231 NONAME ; class HbView * HsGui::idleView(void) const - ??1HsPageVisual@@UAE@XZ @ 232 NONAME ; HsPageVisual::~HsPageVisual(void) - ?widgetMoveBlockedFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 233 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::widgetMoveBlockedFeedbackEffect(void) const - ?widgetPickFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 234 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::widgetPickFeedbackEffect(void) const - ?widgetSnappingFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 235 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::widgetSnappingFeedbackEffect(void) const - ?load@HsScene@@QAE_NXZ @ 236 NONAME ; bool HsScene::load(void) - ?trUtf8@HsSceneWallpaper@@SA?AVQString@@PBD0H@Z @ 237 NONAME ; class QString HsSceneWallpaper::trUtf8(char const *, char const *, int) - ?tr@HsConfiguration@@SA?AVQString@@PBD0@Z @ 238 NONAME ; class QString HsConfiguration::tr(char const *, char const *) - ?widgetRepositionFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 239 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::widgetRepositionFeedbackEffect(void) const - ?onError@HsWidgetHost@@AAEXXZ @ 240 NONAME ; void HsWidgetHost::onError(void) - ?cleanup@HsWallpaperLoader@@AAEXXZ @ 241 NONAME ; void HsWallpaperLoader::cleanup(void) - ?targets@HsWallpaperLoader@@QBE?AV?$QHash@VQString@@VQVariant@@@@XZ @ 242 NONAME ; class QHash HsWallpaperLoader::targets(void) const - ??0HsShortcutService@@AAE@PAVQStateMachine@@PAVQObject@@@Z @ 243 NONAME ; HsShortcutService::HsShortcutService(class QStateMachine *, class QObject *) - ?hideVerticalSnapLine@HsIdleWidget@@QAEXXZ @ 244 NONAME ; void HsIdleWidget::hideVerticalSnapLine(void) - ?setActivePage@HsIdleWidget@@QAEXH@Z @ 245 NONAME ; void HsIdleWidget::setActivePage(int) - ?setSnapLineFadeOutDuration@HsConfiguration@@QAEXH@Z @ 246 NONAME ; void HsConfiguration::setSnapLineFadeOutDuration(int) - ?polishEvent@HsIdleWidget@@MAEXXZ @ 247 NONAME ; void HsIdleWidget::polishEvent(void) - ?tr@HsPageWallpaper@@SA?AVQString@@PBD0H@Z @ 248 NONAME ; class QString HsPageWallpaper::tr(char const *, char const *, int) - ?widgetDropToTrashbinFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 249 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::widgetDropToTrashbinFeedbackEffect(void) const - ?staticMetaObject@HsPageWallpaper@@2UQMetaObject@@B @ 250 NONAME ; struct QMetaObject const HsPageWallpaper::staticMetaObject - ?onWidgetFinished@HsPage@@AAEXXZ @ 251 NONAME ; void HsPage::onWidgetFinished(void) - ?onThreadFinished@HsWallpaperLoader@@AAEXXZ @ 252 NONAME ; void HsWallpaperLoader::onThreadFinished(void) - ?tr@HsWidgetComponentRegistry@@SA?AVQString@@PBD0H@Z @ 253 NONAME ; class QString HsWidgetComponentRegistry::tr(char const *, char const *, int) - ?loadControlLayer@HsIdleWidget@@AAEXXZ @ 254 NONAME ; void HsIdleWidget::loadControlLayer(void) - ?action_initialize@HsWidgetHost@@AAEXXZ @ 255 NONAME ; void HsWidgetHost::action_initialize(void) - ?sceneX@HsIdleWidget@@QBEMXZ @ 256 NONAME ; float HsIdleWidget::sceneX(void) const - ?action_load@HsWidgetHost@@AAEXXZ @ 257 NONAME ; void HsWidgetHost::action_load(void) - ?connectionName@HsDatabase@@QBE?AVQString@@XZ @ 258 NONAME ; class QString HsDatabase::connectionName(void) const - ?snapLineFadeInDuration@HsConfiguration@@QBEHXZ @ 259 NONAME ; int HsConfiguration::snapLineFadeInDuration(void) const - ?setMethod@HsWidgetHost@@AAE_NPBDAAVQMetaMethod@@@Z @ 260 NONAME ; bool HsWidgetHost::setMethod(char const *, class QMetaMethod &) - ?setInstance@HsDatabase@@SAXPAV1@@Z @ 261 NONAME ; void HsDatabase::setInstance(class HsDatabase *) - ??0HsWallpaper@@QAE@PAVQGraphicsItem@@@Z @ 262 NONAME ; HsWallpaper::HsWallpaper(class QGraphicsItem *) - ?setSnapEffectsEnabled@HsConfiguration@@QAEX_N@Z @ 263 NONAME ; void HsConfiguration::setSnapEffectsEnabled(bool) - ?newPageAddedAnimationDuration@HsConfiguration@@QBEHXZ @ 264 NONAME ; int HsConfiguration::newPageAddedAnimationDuration(void) const - ?getStaticMetaObject@HsWallpaperLoaderThread@@SAABUQMetaObject@@XZ @ 265 NONAME ; struct QMetaObject const & HsWallpaperLoaderThread::getStaticMetaObject(void) - ?commit@HsDatabase@@QAE_NXZ @ 266 NONAME ; bool HsDatabase::commit(void) - ?trUtf8@HsDatabase@@SA?AVQString@@PBD0@Z @ 267 NONAME ; class QString HsDatabase::trUtf8(char const *, char const *) - ?mousePressEvent@HsWidgetHostVisual@@MAEXPAVQGraphicsSceneMouseEvent@@@Z @ 268 NONAME ; void HsWidgetHostVisual::mousePressEvent(class QGraphicsSceneMouseEvent *) - ?tr@HsWidgetComponent@@SA?AVQString@@PBD0H@Z @ 269 NONAME ; class QString HsWidgetComponent::tr(char const *, char const *, int) - ?backupRestoreStarted@HsBackupRestoreObserver@@QAEXXZ @ 270 NONAME ; void HsBackupRestoreObserver::backupRestoreStarted(void) - ?qt_metacast@HsPageWallpaper@@UAEPAXPBD@Z @ 271 NONAME ; void * HsPageWallpaper::qt_metacast(char const *) - ?trUtf8@HsWidgetHost@@SA?AVQString@@PBD0@Z @ 272 NONAME ; class QString HsWidgetHost::trUtf8(char const *, char const *) - ?setDefaultPageId@HsConfiguration@@QAEXH@Z @ 273 NONAME ; void HsConfiguration::setDefaultPageId(int) - ?metaObject@HsWidgetHostVisual@@UBEPBUQMetaObject@@XZ @ 274 NONAME ; struct QMetaObject const * HsWidgetHostVisual::metaObject(void) const - ?installTranslator@HsWidgetComponent@@AAEXXZ @ 275 NONAME ; void HsWidgetComponent::installTranslator(void) - ?bounceAnimationEasingCurve@HsConfiguration@@QBE?AW4Type@QEasingCurve@@XZ @ 276 NONAME ; enum QEasingCurve::Type HsConfiguration::bounceAnimationEasingCurve(void) const - ??_EHsIdleWidget@@UAE@I@Z @ 277 NONAME ; HsIdleWidget::~HsIdleWidget(unsigned int) - ?qt_metacall@HsWidgetComponent@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 278 NONAME ; int HsWidgetComponent::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@HsConfiguration@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 279 NONAME ; int HsConfiguration::qt_metacall(enum QMetaObject::Call, int, void * *) - ?cleanupIdleUi@HsGui@@QAEXXZ @ 280 NONAME ; void HsGui::cleanupIdleUi(void) - ?setWidgetOverTrashbinFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 281 NONAME ; void HsConfiguration::setWidgetOverTrashbinFeedbackEffect(enum HbFeedback::InstantEffect) - ?handleEntryAdded@HsWidgetComponentRegistry@@AAEXABVCaEntry@@ABVQString@@@Z @ 282 NONAME ; void HsWidgetComponentRegistry::handleEntryAdded(class CaEntry const &, class QString const &) - ?setProperty@HsWidgetHost@@AAE_NPBDAAVQMetaProperty@@@Z @ 283 NONAME ; bool HsWidgetHost::setProperty(char const *, class QMetaProperty &) - ?pagePanFinished@HsScene@@IAEXPAVQGestureEvent@@@Z @ 284 NONAME ; void HsScene::pagePanFinished(class QGestureEvent *) - ?minimumWidgetSizeInUnits@HsConfiguration@@QBE?AVQSizeF@@XZ @ 285 NONAME ; class QSizeF HsConfiguration::minimumWidgetSizeInUnits(void) const - ??0HsBackupRestoreObserver@@AAE@PAVQObject@@@Z @ 286 NONAME ; HsBackupRestoreObserver::HsBackupRestoreObserver(class QObject *) - ?setClockWidgetTapFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 287 NONAME ; void HsConfiguration::setClockWidgetTapFeedbackEffect(enum HbFeedback::InstantEffect) - ??1HsPage@@UAE@XZ @ 288 NONAME ; HsPage::~HsPage(void) - ?databaseId@HsWidgetHost@@QBEHXZ @ 289 NONAME ; int HsWidgetHost::databaseId(void) const - ?setInstallationPath@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 290 NONAME ; void HsWidgetComponentDescriptor::setInstallationPath(class QString const &) - ?staticMetaObject@HsHostedWidgetFactory@@2UQMetaObject@@B @ 291 NONAME ; struct QMetaObject const HsHostedWidgetFactory::staticMetaObject - ?setTitle@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 292 NONAME ; void HsWidgetComponentDescriptor::setTitle(class QString const &) - ?qt_metacall@HsPageWallpaper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 293 NONAME ; int HsPageWallpaper::qt_metacall(enum QMetaObject::Call, int, void * *) - ?setWidgetSnappingFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 294 NONAME ; void HsConfiguration::setWidgetSnappingFeedbackEffect(enum HbFeedback::InstantEffect) - ?setWidgetDragEffectDuration@HsConfiguration@@QAEXH@Z @ 295 NONAME ; void HsConfiguration::setWidgetDragEffectDuration(int) - ?widgetPresentation@HsDatabase@@QAE_NAAVHsWidgetPresentationData@@@Z @ 296 NONAME ; bool HsDatabase::widgetPresentation(class HsWidgetPresentationData &) - ?pageChangePanDistance@HsConfiguration@@QBEMXZ @ 297 NONAME ; float HsConfiguration::pageChangePanDistance(void) const - ?mInstance@HsContentService@@0PAV1@A @ 298 NONAME ; class HsContentService * HsContentService::mInstance - ??0HsWidgetComponent@@AAE@ABVQString@@PAVQObject@@@Z @ 299 NONAME ; HsWidgetComponent::HsWidgetComponent(class QString const &, class QObject *) - ?startDragEffect@HsWidgetHostVisual@@QAEXXZ @ 300 NONAME ; void HsWidgetHostVisual::startDragEffect(void) - ?insertPage@HsIdleWidget@@QAEXHPAVHsPage@@@Z @ 301 NONAME ; void HsIdleWidget::insertPage(int, class HsPage *) - ?onOrientationChanged@HsPage@@AAEXW4Orientation@Qt@@@Z @ 302 NONAME ; void HsPage::onOrientationChanged(enum Qt::Orientation) - ?adjustedWidgetPosition@HsPage@@QAE?AVQPointF@@ABVQRectF@@@Z @ 303 NONAME ; class QPointF HsPage::adjustedWidgetPosition(class QRectF const &) - ?staticMetaObject@HsWallpaperLoader@@2UQMetaObject@@B @ 304 NONAME ; struct QMetaObject const HsWallpaperLoader::staticMetaObject - ?widgetTapStarted@HsScene@@IAEXVQPointF@@PAVHsWidgetHost@@@Z @ 305 NONAME ; void HsScene::widgetTapStarted(class QPointF, class HsWidgetHost *) - ?widgetDragEffectDuration@HsConfiguration@@QBEHXZ @ 306 NONAME ; int HsConfiguration::widgetDragEffectDuration(void) const - ?tr@HsHostedWidgetFactory@@SA?AVQString@@PBD0H@Z @ 307 NONAME ; class QString HsHostedWidgetFactory::tr(char const *, char const *, int) - ?navigateToApplibrary@HsGui@@IAEXXZ @ 308 NONAME ; void HsGui::navigateToApplibrary(void) - ?load@HsConfiguration@@QAE_NXZ @ 309 NONAME ; bool HsConfiguration::load(void) - ?createInstance@HsPage@@SAPAV1@ABVHsPageData@@@Z @ 310 NONAME ; class HsPage * HsPage::createInstance(class HsPageData const &) - ?widgetPreferences@HsDatabase@@QAE_NHAAV?$QHash@VQString@@VQVariant@@@@@Z @ 311 NONAME ; bool HsDatabase::widgetPreferences(int, class QHash &) - ?removePage@HsScene@@QAE_NPAVHsPage@@@Z @ 312 NONAME ; bool HsScene::removePage(class HsPage *) - ?hideWidget@HsWidgetHost@@QAEXXZ @ 313 NONAME ; void HsWidgetHost::hideWidget(void) - ?close@HsDatabase@@QAEXXZ @ 314 NONAME ; void HsDatabase::close(void) - ?maximumPageCount@HsConfiguration@@QBEHXZ @ 315 NONAME ; int HsConfiguration::maximumPageCount(void) const - ?action_faulted@HsWidgetHost@@AAEXXZ @ 316 NONAME ; void HsWidgetHost::action_faulted(void) - ?setServiceXml@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 317 NONAME ; void HsWidgetComponentDescriptor::setServiceXml(class QString const &) - ?getStaticMetaObject@HsWidgetHost@@SAABUQMetaObject@@XZ @ 318 NONAME ; struct QMetaObject const & HsWidgetHost::getStaticMetaObject(void) - ??0HsWidgetData@@QAE@ABV0@@Z @ 319 NONAME ; HsWidgetData::HsWidgetData(class HsWidgetData const &) - ?installationPath@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 320 NONAME ; class QString HsWidgetComponentDescriptor::installationPath(void) const - ?showHorizontalSnapLine@HsIdleWidget@@QAEXABVQLineF@@@Z @ 321 NONAME ; void HsIdleWidget::showHorizontalSnapLine(class QLineF const &) - ??_EHsPageVisual@@UAE@I@Z @ 322 NONAME ; HsPageVisual::~HsPageVisual(unsigned int) - ?setWidgetDropEffectDuration@HsConfiguration@@QAEXH@Z @ 323 NONAME ; void HsConfiguration::setWidgetDropEffectDuration(int) - ?pageRemovedAnimationDuration@HsConfiguration@@QBEHXZ @ 324 NONAME ; int HsConfiguration::pageRemovedAnimationDuration(void) const - ?onFinished@HsWidgetHost@@AAEXXZ @ 325 NONAME ; void HsWidgetHost::onFinished(void) - ?rollback@HsDatabase@@QAE_NXZ @ 326 NONAME ; bool HsDatabase::rollback(void) - ?widget@HsDatabase@@QAE_NAAVHsWidgetData@@@Z @ 327 NONAME ; bool HsDatabase::widget(class HsWidgetData &) - ?description@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 328 NONAME ; class QString HsWidgetComponentDescriptor::description(void) const - ?mInstance@HsShortcutService@@0PAV1@A @ 329 NONAME ; class HsShortcutService * HsShortcutService::mInstance - ?pageIndicator@HsIdleWidget@@QBEPAVHsPageIndicator@@XZ @ 330 NONAME ; class HsPageIndicator * HsIdleWidget::pageIndicator(void) const - ?setShortcutWidgetTapFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 331 NONAME ; void HsConfiguration::setShortcutWidgetTapFeedbackEffect(enum HbFeedback::InstantEffect) - ?wallpaperDirectory@HsPageWallpaper@@MBE?AVQString@@XZ @ 332 NONAME ; class QString HsPageWallpaper::wallpaperDirectory(void) const - ?qt_metacast@HsWidgetComponent@@UAEPAXPBD@Z @ 333 NONAME ; void * HsWidgetComponent::qt_metacast(char const *) - ?metaObject@HsWallpaperLoaderThread@@UBEPBUQMetaObject@@XZ @ 334 NONAME ; struct QMetaObject const * HsWallpaperLoaderThread::metaObject(void) const - ?setTargetSize@HsWallpaperLoaderThread@@QAEXABVQSize@@@Z @ 335 NONAME ; void HsWallpaperLoaderThread::setTargetSize(class QSize const &) - ?removePage@HsIdleWidget@@QAEXH@Z @ 336 NONAME ; void HsIdleWidget::removePage(int) - ?tr@HsWallpaper@@SA?AVQString@@PBD0H@Z @ 337 NONAME ; class QString HsWallpaper::tr(char const *, char const *, int) - ?defaultPageId@HsConfiguration@@QBEHXZ @ 338 NONAME ; int HsConfiguration::defaultPageId(void) const - ?setSourcePath@HsWallpaperLoader@@QAEXABVQString@@@Z @ 339 NONAME ; void HsWallpaperLoader::setSourcePath(class QString const &) - ?metaObject@HsGui@@UBEPBUQMetaObject@@XZ @ 340 NONAME ; struct QMetaObject const * HsGui::metaObject(void) const - ?pageChangeAnimationEasingCurve@HsConfiguration@@QBE?AW4Type@QEasingCurve@@XZ @ 341 NONAME ; enum QEasingCurve::Type HsConfiguration::pageChangeAnimationEasingCurve(void) const - ?wallpaper@HsPage@@QBEPAVHsWallpaper@@XZ @ 342 NONAME ; class HsWallpaper * HsPage::wallpaper(void) const - ??0HsPageVisual@@QAE@PAVQGraphicsItem@@@Z @ 343 NONAME ; HsPageVisual::HsPageVisual(class QGraphicsItem *) - ?trUtf8@HsWidgetComponent@@SA?AVQString@@PBD0@Z @ 344 NONAME ; class QString HsWidgetComponent::trUtf8(char const *, char const *) - ?event_backupRestoreStarted@HsBackupRestoreObserver@@IAEXXZ @ 345 NONAME ; void HsBackupRestoreObserver::event_backupRestoreStarted(void) - ?version@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 346 NONAME ; class QString HsWidgetComponentDescriptor::version(void) const - ?action_disconnectComponent@HsWidgetHost@@AAEXXZ @ 347 NONAME ; void HsWidgetHost::action_disconnectComponent(void) - ?scene@HsSceneWallpaper@@QBEPAVHsScene@@XZ @ 348 NONAME ; class HsScene * HsSceneWallpaper::scene(void) const - ?mInstance@HsConfiguration@@0PAV1@A @ 349 NONAME ; class HsConfiguration * HsConfiguration::mInstance - ?newWidgets@HsPage@@QAE?AV?$QList@PAVHsWidgetHost@@@@XZ @ 350 NONAME ; class QList HsPage::newWidgets(void) - ??0HsHostedWidgetFactory@@AAE@PAVQObject@@@Z @ 351 NONAME ; HsHostedWidgetFactory::HsHostedWidgetFactory(class QObject *) - ?trUtf8@HsContentService@@SA?AVQString@@PBD0@Z @ 352 NONAME ; class QString HsContentService::trUtf8(char const *, char const *) - ?emitUpdated@HsWidgetComponent@@AAEXXZ @ 353 NONAME ; void HsWidgetComponent::emitUpdated(void) - ?emitUninstalled@HsWidgetComponent@@AAEXXZ @ 354 NONAME ; void HsWidgetComponent::emitUninstalled(void) - ?tr@HsConfiguration@@SA?AVQString@@PBD0H@Z @ 355 NONAME ; class QString HsConfiguration::tr(char const *, char const *, int) - ??0HsSceneWallpaper@@QAE@PAVHsScene@@PAVQGraphicsItem@@@Z @ 356 NONAME ; HsSceneWallpaper::HsSceneWallpaper(class HsScene *, class QGraphicsItem *) - ?createTargets@HsPageWallpaper@@MAE?AV?$QHash@VQString@@VQVariant@@@@ABVQString@@@Z @ 357 NONAME ; class QHash HsPageWallpaper::createTargets(class QString const &) - ?mInstance@HsGui@@0PAV1@A @ 358 NONAME ; class HsGui * HsGui::mInstance - ?pageChangeZoneWidth@HsConfiguration@@QBEMXZ @ 359 NONAME ; float HsConfiguration::pageChangeZoneWidth(void) const - ?qt_metacast@HsGui@@UAEPAXPBD@Z @ 360 NONAME ; void * HsGui::qt_metacast(char const *) - ?setInstance@HsGui@@SAPAV1@PAV1@@Z @ 361 NONAME ; class HsGui * HsGui::setInstance(class HsGui *) - ?tr@HsPageWallpaper@@SA?AVQString@@PBD0@Z @ 362 NONAME ; class QString HsPageWallpaper::tr(char const *, char const *) - ?maximumWidgetSizeInPixels@HsConfiguration@@QBE?AVQSizeF@@XZ @ 363 NONAME ; class QSizeF HsConfiguration::maximumWidgetSizeInPixels(void) const - ??_EHsBackupRestoreObserver@@UAE@I@Z @ 364 NONAME ; HsBackupRestoreObserver::~HsBackupRestoreObserver(unsigned int) - ??1HsScene@@UAE@XZ @ 365 NONAME ; HsScene::~HsScene(void) - ?pageWallpaperLayer@HsIdleWidget@@QBEPAVHbWidget@@XZ @ 366 NONAME ; class HbWidget * HsIdleWidget::pageWallpaperLayer(void) const - ?deleteWidgetPresentation@HsDatabase@@QAE_NHW4Orientation@Qt@@@Z @ 367 NONAME ; bool HsDatabase::deleteWidgetPresentation(int, enum Qt::Orientation) - ?getStaticMetaObject@HsWidgetComponent@@SAABUQMetaObject@@XZ @ 368 NONAME ; struct QMetaObject const & HsWidgetComponent::getStaticMetaObject(void) - ?addExistingWidget@HsPage@@QAE_NPAVHsWidgetHost@@@Z @ 369 NONAME ; bool HsPage::addExistingWidget(class HsWidgetHost *) - ?qt_metacast@HsWidgetComponentRegistry@@UAEPAXPBD@Z @ 370 NONAME ; void * HsWidgetComponentRegistry::qt_metacast(char const *) - ?close@HsWidgetHost@@QAEXXZ @ 371 NONAME ; void HsWidgetHost::close(void) - ?action_remove@HsWidgetHost@@AAEXXZ @ 372 NONAME ; void HsWidgetHost::action_remove(void) - ?trUtf8@HsWallpaper@@SA?AVQString@@PBD0H@Z @ 373 NONAME ; class QString HsWallpaper::trUtf8(char const *, char const *, int) - ?activePage@HsScene@@QBEPAVHsPage@@XZ @ 374 NONAME ; class HsPage * HsScene::activePage(void) const - ?bounceEffect@HsConfiguration@@QBEHXZ @ 375 NONAME ; int HsConfiguration::bounceEffect(void) const - ?setupIdleUi@HsGui@@QAEXXZ @ 376 NONAME ; void HsGui::setupIdleUi(void) - ?pages@HsDatabase@@QAE_NAAV?$QList@VHsPageData@@@@@Z @ 377 NONAME ; bool HsDatabase::pages(class QList &) - ?savePresentation@HsWidgetHost@@QAE_NXZ @ 378 NONAME ; bool HsWidgetHost::savePresentation(void) - ?pageChangeAnimation@HsGui@@QAEPAVHsPropertyAnimationWrapper@@XZ @ 379 NONAME ; class HsPropertyAnimationWrapper * HsGui::pageChangeAnimation(void) - ?takeInstance@HsScene@@SAPAV1@XZ @ 380 NONAME ; class HsScene * HsScene::takeInstance(void) - ?rootPath@HsWidgetComponent@@QBE?AVQString@@XZ @ 381 NONAME ; class QString HsWidgetComponent::rootPath(void) const - ?event_startAndHide@HsWidgetHost@@IAEXXZ @ 382 NONAME ; void HsWidgetHost::event_startAndHide(void) - ?qt_metacast@HsWallpaperLoader@@UAEPAXPBD@Z @ 383 NONAME ; void * HsWallpaperLoader::qt_metacast(char const *) - ?startDragEffect@HsWidgetHost@@QAEXXZ @ 384 NONAME ; void HsWidgetHost::startDragEffect(void) - ??1HsDatabase@@UAE@XZ @ 385 NONAME ; HsDatabase::~HsDatabase(void) - ??1HsWidgetComponent@@UAE@XZ @ 386 NONAME ; HsWidgetComponent::~HsWidgetComponent(void) - ?metaObject@HsSceneWallpaper@@UBEPBUQMetaObject@@XZ @ 387 NONAME ; struct QMetaObject const * HsSceneWallpaper::metaObject(void) const - ?createInstance@HsWidgetHost@@SAPAV1@AAVHsWidgetData@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 388 NONAME ; class HsWidgetHost * HsWidgetHost::createInstance(class HsWidgetData &, class QHash const &) - ?setupEffects@HsWidgetHostVisual@@AAEXXZ @ 389 NONAME ; void HsWidgetHostVisual::setupEffects(void) - ?trUtf8@HsGui@@SA?AVQString@@PBD0@Z @ 390 NONAME ; class QString HsGui::trUtf8(char const *, char const *) - ?setPage@HsPageWallpaper@@QAEXPAVHsPage@@@Z @ 391 NONAME ; void HsPageWallpaper::setPage(class HsPage *) - ?shape@HsWidgetHostVisual@@UBE?AVQPainterPath@@XZ @ 392 NONAME ; class QPainterPath HsWidgetHostVisual::shape(void) const - ?deletePage@HsDatabase@@QAE_NH@Z @ 393 NONAME ; bool HsDatabase::deletePage(int) - ?savePresentation@HsWidgetHost@@QAE_NAAVHsWidgetPresentationData@@@Z @ 394 NONAME ; bool HsWidgetHost::savePresentation(class HsWidgetPresentationData &) - ?tr@HsWallpaperLoaderThread@@SA?AVQString@@PBD0H@Z @ 395 NONAME ; class QString HsWallpaperLoaderThread::tr(char const *, char const *, int) - ?resized@HsWidgetHostVisual@@IAEXXZ @ 396 NONAME ; void HsWidgetHostVisual::resized(void) - ?page@HsWidgetHost@@QBEPAVHsPage@@XZ @ 397 NONAME ; class HsPage * HsWidgetHost::page(void) const - ?qt_metacast@HsWallpaper@@UAEPAXPBD@Z @ 398 NONAME ; void * HsWallpaper::qt_metacast(char const *) - ?staticMetaObject@HsWidgetComponent@@2UQMetaObject@@B @ 399 NONAME ; struct QMetaObject const HsWidgetComponent::staticMetaObject - ?setRemovable@HsPage@@QAEX_N@Z @ 400 NONAME ; void HsPage::setRemovable(bool) - ?showVerticalSnapLine@HsIdleWidget@@QAEXABVQLineF@@@Z @ 401 NONAME ; void HsIdleWidget::showVerticalSnapLine(class QLineF const &) - ?staticMetaObject@HsIdleWidget@@2UQMetaObject@@B @ 402 NONAME ; struct QMetaObject const HsIdleWidget::staticMetaObject - ?widgetRemoved@HsContentService@@IAEXABVQString@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 403 NONAME ; void HsContentService::widgetRemoved(class QString const &, class QHash const &) - ?widgetMoveUpdated@HsScene@@IAEXABVQPointF@@PAVHsWidgetHost@@@Z @ 404 NONAME ; void HsScene::widgetMoveUpdated(class QPointF const &, class HsWidgetHost *) - ?qt_metacall@HsWallpaperLoaderThread@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 405 NONAME ; int HsWallpaperLoaderThread::qt_metacall(enum QMetaObject::Call, int, void * *) - ?loadPresentation@HsWidgetHost@@QAE_NXZ @ 406 NONAME ; bool HsWidgetHost::loadPresentation(void) - ?setupStates@HsWidgetHost@@AAEXXZ @ 407 NONAME ; void HsWidgetHost::setupStates(void) - ?getStaticMetaObject@HsContentService@@SAABUQMetaObject@@XZ @ 408 NONAME ; struct QMetaObject const & HsContentService::getStaticMetaObject(void) - ?wallpaper@HsScene@@QBEPAVHsWallpaper@@XZ @ 409 NONAME ; class HsWallpaper * HsScene::wallpaper(void) const - ?isItemShortcutWidget@HsShortcutService@@QAE_NH@Z @ 410 NONAME ; bool HsShortcutService::isItemShortcutWidget(int) - ?setGeometry@HsPageVisual@@UAEXABVQRectF@@@Z @ 411 NONAME ; void HsPageVisual::setGeometry(class QRectF const &) - ?tr@HsIdleWidget@@SA?AVQString@@PBD0H@Z @ 412 NONAME ; class QString HsIdleWidget::tr(char const *, char const *, int) - ?setDatabaseName@HsDatabase@@QAEXABVQString@@@Z @ 413 NONAME ; void HsDatabase::setDatabaseName(class QString const &) - ?updateWidget@HsDatabase@@QAE_NABVHsWidgetData@@@Z @ 414 NONAME ; bool HsDatabase::updateWidget(class HsWidgetData const &) - ?trUtf8@HsBackupRestoreObserver@@SA?AVQString@@PBD0H@Z @ 415 NONAME ; class QString HsBackupRestoreObserver::trUtf8(char const *, char const *, int) - ?loadPresentation@HsWidgetHost@@QAE_NW4Orientation@Qt@@@Z @ 416 NONAME ; bool HsWidgetHost::loadPresentation(enum Qt::Orientation) - ?createWidgetForPreview@HsContentService@@QAEPAVHsWidgetHost@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 417 NONAME ; class HsWidgetHost * HsContentService::createWidgetForPreview(class QHash const &) - ?available@HsWidgetHost@@IAEXXZ @ 418 NONAME ; void HsWidgetHost::available(void) - ?setPageChangeZoneWidth@HsConfiguration@@QAEXM@Z @ 419 NONAME ; void HsConfiguration::setPageChangeZoneWidth(float) - ?emitAboutToUninstall@HsWidgetComponent@@AAEXXZ @ 420 NONAME ; void HsWidgetComponent::emitAboutToUninstall(void) - ?iconUri@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 421 NONAME ; class QString HsWidgetComponentDescriptor::iconUri(void) const - ?event_faulted@HsWidgetHost@@IAEXXZ @ 422 NONAME ; void HsWidgetHost::event_faulted(void) - ?emitUnavailable@HsWidgetComponent@@AAEXXZ @ 423 NONAME ; void HsWidgetComponent::emitUnavailable(void) - ??1HsWidgetData@@QAE@XZ @ 424 NONAME ; HsWidgetData::~HsWidgetData(void) - ?snapTimeout@HsConfiguration@@QBEHXZ @ 425 NONAME ; int HsConfiguration::snapTimeout(void) const - ?faulted@HsWidgetHost@@IAEXXZ @ 426 NONAME ; void HsWidgetHost::faulted(void) - ??0HsIdleWidget@@QAE@PAVQGraphicsItem@@@Z @ 427 NONAME ; HsIdleWidget::HsIdleWidget(class QGraphicsItem *) - ?event_unload@HsWidgetHost@@IAEXXZ @ 428 NONAME ; void HsWidgetHost::event_unload(void) - ?handleEntryRemoved@HsWidgetComponentRegistry@@AAEXABVCaEntry@@ABVQString@@@Z @ 429 NONAME ; void HsWidgetComponentRegistry::handleEntryRemoved(class CaEntry const &, class QString const &) - ?metaObject@HsWidgetComponentRegistry@@UBEPBUQMetaObject@@XZ @ 430 NONAME ; struct QMetaObject const * HsWidgetComponentRegistry::metaObject(void) const - ?updated@HsWidgetComponent@@IAEXXZ @ 431 NONAME ; void HsWidgetComponent::updated(void) - ?takeInstance@HsConfiguration@@SAPAV1@XZ @ 432 NONAME ; class HsConfiguration * HsConfiguration::takeInstance(void) - ?pageIndex@HsPage@@QAEHXZ @ 433 NONAME ; int HsPage::pageIndex(void) - ?setTargets@HsWallpaperLoader@@QAEXABV?$QHash@VQString@@VQVariant@@@@@Z @ 434 NONAME ; void HsWallpaperLoader::setTargets(class QHash const &) - ??1HsIdleWidget@@UAE@XZ @ 435 NONAME ; HsIdleWidget::~HsIdleWidget(void) - ??_EHsHostedWidgetFactory@@UAE@I@Z @ 436 NONAME ; HsHostedWidgetFactory::~HsHostedWidgetFactory(unsigned int) - ??0HsWallpaperLoaderThread@@QAE@PAVQObject@@@Z @ 437 NONAME ; HsWallpaperLoaderThread::HsWallpaperLoaderThread(class QObject *) - ?staticMetaObject@HsGui@@2UQMetaObject@@B @ 438 NONAME ; struct QMetaObject const HsGui::staticMetaObject - ?start@HsWallpaperLoader@@QAEXXZ @ 439 NONAME ; void HsWallpaperLoader::start(void) - ?component@HsWidgetComponentRegistry@@QAEPAVHsWidgetComponent@@ABVQString@@@Z @ 440 NONAME ; class HsWidgetComponent * HsWidgetComponentRegistry::component(class QString const &) - ??_EHsWidgetComponent@@UAE@I@Z @ 441 NONAME ; HsWidgetComponent::~HsWidgetComponent(unsigned int) - ?mInstance@HsScene@@0PAV1@A @ 442 NONAME ; class HsScene * HsScene::mInstance - ?getStaticMetaObject@HsGui@@SAABUQMetaObject@@XZ @ 443 NONAME ; struct QMetaObject const & HsGui::getStaticMetaObject(void) - ?trUtf8@HsSceneWallpaper@@SA?AVQString@@PBD0@Z @ 444 NONAME ; class QString HsSceneWallpaper::trUtf8(char const *, char const *) - ??_EHsWidgetHost@@UAE@I@Z @ 445 NONAME ; HsWidgetHost::~HsWidgetHost(unsigned int) - ?minimumWidgetHeight@HsConfiguration@@QBEMXZ @ 446 NONAME ; float HsConfiguration::minimumWidgetHeight(void) const - ?setVisualModel@HsWidgetHostVisual@@QAEXPAVHsWidgetHost@@@Z @ 447 NONAME ; void HsWidgetHostVisual::setVisualModel(class HsWidgetHost *) - ??0HsPageWallpaper@@QAE@PAVHsPage@@PAVQGraphicsItem@@@Z @ 448 NONAME ; HsPageWallpaper::HsPageWallpaper(class HsPage *, class QGraphicsItem *) - ?onSetPreferences@HsWidgetHost@@AAEXABVQStringList@@@Z @ 449 NONAME ; void HsWidgetHost::onSetPreferences(class QStringList const &) - ?staticMetaObject@HsShortcutService@@2UQMetaObject@@B @ 450 NONAME ; struct QMetaObject const HsShortcutService::staticMetaObject - ??1HsWidgetComponentDescriptor@@QAE@XZ @ 451 NONAME ; HsWidgetComponentDescriptor::~HsWidgetComponentDescriptor(void) - ?showPageIndicator@HsIdleWidget@@QAEXXZ @ 452 NONAME ; void HsIdleWidget::showPageIndicator(void) - ??1HsBackupRestoreObserver@@UAE@XZ @ 453 NONAME ; HsBackupRestoreObserver::~HsBackupRestoreObserver(void) - ?insertPage@HsDatabase@@QAE_NAAVHsPageData@@@Z @ 454 NONAME ; bool HsDatabase::insertPage(class HsPageData &) - ??_EHsWidgetComponentRegistry@@UAE@I@Z @ 455 NONAME ; HsWidgetComponentRegistry::~HsWidgetComponentRegistry(unsigned int) - ?metaObject@HsIdleWidget@@UBEPBUQMetaObject@@XZ @ 456 NONAME ; struct QMetaObject const * HsIdleWidget::metaObject(void) const - ?qt_metacast@HsHostedWidgetFactory@@UAEPAXPBD@Z @ 457 NONAME ; void * HsHostedWidgetFactory::qt_metacast(char const *) - ?setUri@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 458 NONAME ; void HsWidgetComponentDescriptor::setUri(class QString const &) - ??1HsWallpaperLoaderThread@@UAE@XZ @ 459 NONAME ; HsWallpaperLoaderThread::~HsWallpaperLoaderThread(void) - ?staticMetaObject@HsWidgetComponentRegistry@@2UQMetaObject@@B @ 460 NONAME ; struct QMetaObject const HsWidgetComponentRegistry::staticMetaObject - ??1HsWallpaper@@UAE@XZ @ 461 NONAME ; HsWallpaper::~HsWallpaper(void) - ?qt_metacall@HsPage@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 462 NONAME ; int HsPage::qt_metacall(enum QMetaObject::Call, int, void * *) - ?onWidgetAvailable@HsPage@@AAEXXZ @ 463 NONAME ; void HsPage::onWidgetAvailable(void) - ?qt_metacast@HsPage@@UAEPAXPBD@Z @ 464 NONAME ; void * HsPage::qt_metacast(char const *) - ?result@HsWallpaperLoaderThread@@QBE_NXZ @ 465 NONAME ; bool HsWallpaperLoaderThread::result(void) const - ?setPageIndicatorSpacing@HsConfiguration@@QAEXM@Z @ 466 NONAME ; void HsConfiguration::setPageIndicatorSpacing(float) - ?setSnapLineFadeInDuration@HsConfiguration@@QAEXH@Z @ 467 NONAME ; void HsConfiguration::setSnapLineFadeInDuration(int) - ??1HsGui@@UAE@XZ @ 468 NONAME ; HsGui::~HsGui(void) - ?isValid@HsWidgetComponentDescriptor@@QAE_NXZ @ 469 NONAME ; bool HsWidgetComponentDescriptor::isValid(void) - ?uri@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 470 NONAME ; class QString HsWidgetComponentDescriptor::uri(void) const - ?setOrientation@HsGui@@QAEXW4Orientation@Qt@@@Z @ 471 NONAME ; void HsGui::setOrientation(enum Qt::Orientation) - ?tr@HsWidgetComponentRegistry@@SA?AVQString@@PBD0@Z @ 472 NONAME ; class QString HsWidgetComponentRegistry::tr(char const *, char const *) - ?getStaticMetaObject@HsPage@@SAABUQMetaObject@@XZ @ 473 NONAME ; struct QMetaObject const & HsPage::getStaticMetaObject(void) - ?onWidgetFaulted@HsPage@@AAEXXZ @ 474 NONAME ; void HsPage::onWidgetFaulted(void) - ?page@HsPageWallpaper@@QBEPAVHsPage@@XZ @ 475 NONAME ; class HsPage * HsPageWallpaper::page(void) const - ?qt_metacast@HsBackupRestoreObserver@@UAEPAXPBD@Z @ 476 NONAME ; void * HsBackupRestoreObserver::qt_metacast(char const *) - ?setTargetPath@HsWallpaperLoaderThread@@QAEXABVQString@@@Z @ 477 NONAME ; void HsWallpaperLoaderThread::setTargetPath(class QString const &) - ?setSnapTimeout@HsConfiguration@@QAEXH@Z @ 478 NONAME ; void HsConfiguration::setSnapTimeout(int) - ?createTargets@HsSceneWallpaper@@MAE?AV?$QHash@VQString@@VQVariant@@@@ABVQString@@@Z @ 479 NONAME ; class QHash HsSceneWallpaper::createTargets(class QString const &) - ?onWidgetResized@HsPage@@AAEXXZ @ 480 NONAME ; void HsPage::onWidgetResized(void) - ?checkBUR@HsBackupRestoreObserver@@QAE_NXZ @ 481 NONAME ; bool HsBackupRestoreObserver::checkBUR(void) - ?showWidgets@HsPage@@QAEXXZ @ 482 NONAME ; void HsPage::showWidgets(void) - ?startWidget@HsWidgetHost@@QAEX_N@Z @ 483 NONAME ; void HsWidgetHost::startWidget(bool) - ??_EHsShortcutService@@UAE@I@Z @ 484 NONAME ; HsShortcutService::~HsShortcutService(unsigned int) - ?bounceFeedbackEffectDistance@HsConfiguration@@QBEMXZ @ 485 NONAME ; float HsConfiguration::bounceFeedbackEffectDistance(void) const - ?unavailable@HsWidgetHost@@IAEXXZ @ 486 NONAME ; void HsWidgetHost::unavailable(void) - ?qt_metacall@HsDatabase@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 487 NONAME ; int HsDatabase::qt_metacall(enum QMetaObject::Call, int, void * *) - ?contentRect@HsPage@@QAE?AVQRectF@@W4Orientation@Qt@@@Z @ 488 NONAME ; class QRectF HsPage::contentRect(enum Qt::Orientation) - ?contentGeometry@HsPage@@QAE?AVQRectF@@XZ @ 489 NONAME ; class QRectF HsPage::contentGeometry(void) - ?setHidden@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 490 NONAME ; void HsWidgetComponentDescriptor::setHidden(class QString const &) - ?widgets@HsDatabase@@QAE_NHAAV?$QList@VHsWidgetData@@@@@Z @ 491 NONAME ; bool HsDatabase::widgets(int, class QList &) - ??_EHsPageWallpaper@@UAE@I@Z @ 492 NONAME ; HsPageWallpaper::~HsPageWallpaper(unsigned int) - ?databaseId@HsPage@@QBEHXZ @ 493 NONAME ; int HsPage::databaseId(void) const - ?tr@HsWallpaperLoader@@SA?AVQString@@PBD0@Z @ 494 NONAME ; class QString HsWallpaperLoader::tr(char const *, char const *) - ?show@HsGui@@QAEXXZ @ 495 NONAME ; void HsGui::show(void) - ??0HsGui@@AAE@PAVQObject@@@Z @ 496 NONAME ; HsGui::HsGui(class QObject *) - ?qt_metacall@HsBackupRestoreObserver@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 497 NONAME ; int HsBackupRestoreObserver::qt_metacall(enum QMetaObject::Call, int, void * *) - ??_EHsWallpaperLoaderThread@@UAE@I@Z @ 498 NONAME ; HsWallpaperLoaderThread::~HsWallpaperLoaderThread(unsigned int) - ?resolveRootPathAndTranslationFilename@HsWidgetComponent@@AAEXXZ @ 499 NONAME ; void HsWidgetComponent::resolveRootPathAndTranslationFilename(void) - ?maximumWidgetHeight@HsConfiguration@@QBEMXZ @ 500 NONAME ; float HsConfiguration::maximumWidgetHeight(void) const - ?isSnapEnabled@HsConfiguration@@QBE_NXZ @ 501 NONAME ; bool HsConfiguration::isSnapEnabled(void) const - ?backupRestoreCompleted@HsBackupRestoreObserver@@QAEXXZ @ 502 NONAME ; void HsBackupRestoreObserver::backupRestoreCompleted(void) - ?setPageRemovedAnimationDuration@HsConfiguration@@QAEXH@Z @ 503 NONAME ; void HsConfiguration::setPageRemovedAnimationDuration(int) - ?insertWidget@HsDatabase@@QAE_NAAVHsWidgetData@@@Z @ 504 NONAME ; bool HsDatabase::insertWidget(class HsWidgetData &) - ??1HsShortcutService@@UAE@XZ @ 505 NONAME ; HsShortcutService::~HsShortcutService(void) - ?setupTouchArea@HsWidgetHostVisual@@AAEXXZ @ 506 NONAME ; void HsWidgetHostVisual::setupTouchArea(void) - ?setBounceFeedbackEffectDistance@HsConfiguration@@QAEXM@Z @ 507 NONAME ; void HsConfiguration::setBounceFeedbackEffectDistance(float) - ?onEntryChanged@HsWidgetComponentRegistry@@AAEXABVCaEntry@@W4ChangeType@@@Z @ 508 NONAME ; void HsWidgetComponentRegistry::onEntryChanged(class CaEntry const &, enum ChangeType) - ?getPresentation@HsWidgetHost@@QAE_NAAVHsWidgetPresentationData@@@Z @ 509 NONAME ; bool HsWidgetHost::getPresentation(class HsWidgetPresentationData &) - ?getStaticMetaObject@HsSceneWallpaper@@SAABUQMetaObject@@XZ @ 510 NONAME ; struct QMetaObject const & HsSceneWallpaper::getStaticMetaObject(void) - ?tr@HsScene@@SA?AVQString@@PBD0H@Z @ 511 NONAME ; class QString HsScene::tr(char const *, char const *, int) - ?uri@HsWidgetComponent@@QBE?AVQString@@XZ @ 512 NONAME ; class QString HsWidgetComponent::uri(void) const - ?instance@HsContentService@@SAPAV1@XZ @ 513 NONAME ; class HsContentService * HsContentService::instance(void) - ?snapGap@HsConfiguration@@QBEMXZ @ 514 NONAME ; float HsConfiguration::snapGap(void) const - ?savePresentation@HsWidgetHost@@QAE_NW4Orientation@Qt@@@Z @ 515 NONAME ; bool HsWidgetHost::savePresentation(enum Qt::Orientation) - ?setWidgetDropToTrashbinFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 516 NONAME ; void HsConfiguration::setWidgetDropToTrashbinFeedbackEffect(enum HbFeedback::InstantEffect) - ?tr@HsIdleWidget@@SA?AVQString@@PBD0@Z @ 517 NONAME ; class QString HsIdleWidget::tr(char const *, char const *) - ?title@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 518 NONAME ; class QString HsWidgetComponentDescriptor::title(void) const - ?event_hide@HsWidgetHost@@IAEXXZ @ 519 NONAME ; void HsWidgetHost::event_hide(void) - ?databaseId@HsScene@@QBEHXZ @ 520 NONAME ; int HsScene::databaseId(void) const - ?setWidgetDropFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 521 NONAME ; void HsConfiguration::setWidgetDropFeedbackEffect(enum HbFeedback::InstantEffect) - ??1HsWidgetComponentRegistry@@UAE@XZ @ 522 NONAME ; HsWidgetComponentRegistry::~HsWidgetComponentRegistry(void) - ?setDescription@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 523 NONAME ; void HsWidgetComponentDescriptor::setDescription(class QString const &) - ?getStaticMetaObject@HsConfiguration@@SAABUQMetaObject@@XZ @ 524 NONAME ; struct QMetaObject const & HsConfiguration::getStaticMetaObject(void) - ?isRunning@HsWallpaperLoader@@QBE_NXZ @ 525 NONAME ; bool HsWallpaperLoader::isRunning(void) const - ?activePageChanged@HsScene@@IAEXXZ @ 526 NONAME ; void HsScene::activePageChanged(void) - ?staticMetaObject@HsSceneWallpaper@@2UQMetaObject@@B @ 527 NONAME ; struct QMetaObject const HsSceneWallpaper::staticMetaObject - ?uninstalled@HsWidgetComponent@@IAEXXZ @ 528 NONAME ; void HsWidgetComponent::uninstalled(void) - ??1HsHostedWidgetFactory@@UAE@XZ @ 529 NONAME ; HsHostedWidgetFactory::~HsHostedWidgetFactory(void) - ?trUtf8@HsShortcutService@@SA?AVQString@@PBD0@Z @ 530 NONAME ; class QString HsShortcutService::trUtf8(char const *, char const *) - ?setPage@HsWidgetHost@@QAE_NPAVHsPage@@@Z @ 531 NONAME ; bool HsWidgetHost::setPage(class HsPage *) - ?metaObject@HsScene@@UBEPBUQMetaObject@@XZ @ 532 NONAME ; struct QMetaObject const * HsScene::metaObject(void) const - ??_EHsScene@@UAE@I@Z @ 533 NONAME ; HsScene::~HsScene(unsigned int) - ?pageTapAndHoldFinished@HsScene@@IAEXPAVQGestureEvent@@@Z @ 534 NONAME ; void HsScene::pageTapAndHoldFinished(class QGestureEvent *) - ?remove@HsWidgetHost@@QAEXXZ @ 535 NONAME ; void HsWidgetHost::remove(void) - ?run@HsWallpaperLoaderThread@@MAEXXZ @ 536 NONAME ; void HsWallpaperLoaderThread::run(void) - ?maximumWidgetSizeInUnits@HsConfiguration@@QBE?AVQSizeF@@XZ @ 537 NONAME ; class QSizeF HsConfiguration::maximumWidgetSizeInUnits(void) const - ?getStaticMetaObject@HsScene@@SAABUQMetaObject@@XZ @ 538 NONAME ; struct QMetaObject const & HsScene::getStaticMetaObject(void) - ?finished@HsWallpaperLoader@@IAEXXZ @ 539 NONAME ; void HsWallpaperLoader::finished(void) - ?visual@HsPage@@QBEPAVHsPageVisual@@XZ @ 540 NONAME ; class HsPageVisual * HsPage::visual(void) const - ?snapLineFadeOutDuration@HsConfiguration@@QBEHXZ @ 541 NONAME ; int HsConfiguration::snapLineFadeOutDuration(void) const - ?trUtf8@HsPageWallpaper@@SA?AVQString@@PBD0H@Z @ 542 NONAME ; class QString HsPageWallpaper::trUtf8(char const *, char const *, int) - ?setNewSize@HsWidgetHostVisual@@AAEXABVQSizeF@@@Z @ 543 NONAME ; void HsWidgetHostVisual::setNewSize(class QSizeF const &) - ?imageSet@HsWallpaper@@IAEXXZ @ 544 NONAME ; void HsWallpaper::imageSet(void) - ?tr@HsWidgetHostVisual@@SA?AVQString@@PBD0H@Z @ 545 NONAME ; class QString HsWidgetHostVisual::tr(char const *, char const *, int) - ?sceneType@HsConfiguration@@QBE?AW4SceneType@1@XZ @ 546 NONAME ; enum HsConfiguration::SceneType HsConfiguration::sceneType(void) const - ?tr@HsPage@@SA?AVQString@@PBD0H@Z @ 547 NONAME ; class QString HsPage::tr(char const *, char const *, int) - ?setNewPageAddedAnimationDuration@HsConfiguration@@QAEXH@Z @ 548 NONAME ; void HsConfiguration::setNewPageAddedAnimationDuration(int) - ??_EHsGui@@UAE@I@Z @ 549 NONAME ; HsGui::~HsGui(unsigned int) - ?isAvailable@HsWidgetComponent@@QBE_NXZ @ 550 NONAME ; bool HsWidgetComponent::isAvailable(void) const - ?updateWidgetZValues@HsDatabase@@QAE_NABV?$QHash@HM@@W4Orientation@Qt@@@Z @ 551 NONAME ; bool HsDatabase::updateWidgetZValues(class QHash const &, enum Qt::Orientation) - ?checkConnection@HsDatabase@@ABE_NXZ @ 552 NONAME ; bool HsDatabase::checkConnection(void) const - ?staticMetaObject@HsConfiguration@@2UQMetaObject@@B @ 553 NONAME ; struct QMetaObject const HsConfiguration::staticMetaObject - ?takeInstance@HsDatabase@@SAPAV1@XZ @ 554 NONAME ; class HsDatabase * HsDatabase::takeInstance(void) - ?tr@HsWallpaper@@SA?AVQString@@PBD0@Z @ 555 NONAME ; class QString HsWallpaper::tr(char const *, char const *) - ?deleteWidgets@HsDatabase@@QAE_NABVQString@@@Z @ 556 NONAME ; bool HsDatabase::deleteWidgets(class QString const &) - ??0HsPageData@@QAE@XZ @ 557 NONAME ; HsPageData::HsPageData(void) - ?tr@HsSceneWallpaper@@SA?AVQString@@PBD0H@Z @ 558 NONAME ; class QString HsSceneWallpaper::tr(char const *, char const *, int) - ?pageIndicatorSpacing@HsConfiguration@@QBEMXZ @ 559 NONAME ; float HsConfiguration::pageIndicatorSpacing(void) const - ?getStaticMetaObject@HsShortcutService@@SAABUQMetaObject@@XZ @ 560 NONAME ; struct QMetaObject const & HsShortcutService::getStaticMetaObject(void) - ?isRemovable@HsPage@@QBE_NXZ @ 561 NONAME ; bool HsPage::isRemovable(void) const - ?setDatabaseId@HsPage@@QAEXH@Z @ 562 NONAME ; void HsPage::setDatabaseId(int) - ?trUtf8@HsIdleWidget@@SA?AVQString@@PBD0@Z @ 563 NONAME ; class QString HsIdleWidget::trUtf8(char const *, char const *) - ?pageChangeAnimationDuration@HsConfiguration@@QBEHXZ @ 564 NONAME ; int HsConfiguration::pageChangeAnimationDuration(void) const - ?staticMetaObject@HsBackupRestoreObserver@@2UQMetaObject@@B @ 565 NONAME ; struct QMetaObject const HsBackupRestoreObserver::staticMetaObject - ?widgetTapAndHoldFinished@HsScene@@IAEXPAVQGestureEvent@@PAVHsWidgetHost@@@Z @ 566 NONAME ; void HsScene::widgetTapAndHoldFinished(class QGestureEvent *, class HsWidgetHost *) - ?metaObject@HsPageWallpaper@@UBEPBUQMetaObject@@XZ @ 567 NONAME ; struct QMetaObject const * HsPageWallpaper::metaObject(void) const - ?tr@HsGui@@SA?AVQString@@PBD0H@Z @ 568 NONAME ; class QString HsGui::tr(char const *, char const *, int) - ?updatePage@HsDatabase@@QAE_NABVHsPageData@@@Z @ 569 NONAME ; bool HsDatabase::updatePage(class HsPageData const &) - ?action_uninitialize@HsWidgetHost@@AAEXXZ @ 570 NONAME ; void HsWidgetHost::action_uninitialize(void) - ??_EHsWallpaperLoader@@UAE@I@Z @ 571 NONAME ; HsWallpaperLoader::~HsWallpaperLoader(unsigned int) - ??_EHsWallpaper@@UAE@I@Z @ 572 NONAME ; HsWallpaper::~HsWallpaper(unsigned int) - ?action_connectComponent@HsWidgetHost@@AAEXXZ @ 573 NONAME ; void HsWidgetHost::action_connectComponent(void) - ?setImage@HsWallpaper@@QAEXABVQString@@@Z @ 574 NONAME ; void HsWallpaper::setImage(class QString const &) - ?setPageChangeAnimationDuration@HsConfiguration@@QAEXH@Z @ 575 NONAME ; void HsConfiguration::setPageChangeAnimationDuration(int) - ??0HsSceneData@@QAE@XZ @ 576 NONAME ; HsSceneData::HsSceneData(void) - ?hasSignal@HsWidgetHost@@AAE_NPBD@Z @ 577 NONAME ; bool HsWidgetHost::hasSignal(char const *) - ?getStaticMetaObject@HsWidgetHostVisual@@SAABUQMetaObject@@XZ @ 578 NONAME ; struct QMetaObject const & HsWidgetHostVisual::getStaticMetaObject(void) - ?getStaticMetaObject@HsWallpaper@@SAABUQMetaObject@@XZ @ 579 NONAME ; struct QMetaObject const & HsWallpaper::getStaticMetaObject(void) - ?trUtf8@HsWallpaper@@SA?AVQString@@PBD0@Z @ 580 NONAME ; class QString HsWallpaper::trUtf8(char const *, char const *) - ??0HsWidgetHost@@QAE@HPAVQObject@@@Z @ 581 NONAME ; HsWidgetHost::HsWidgetHost(int, class QObject *) - ?emitWidgetRemoved@HsContentService@@QAEXABVQString@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 582 NONAME ; void HsContentService::emitWidgetRemoved(class QString const &, class QHash const &) - ?pages@HsScene@@QBE?AV?$QList@PAVHsPage@@@@XZ @ 583 NONAME ; class QList HsScene::pages(void) const - ??1HsConfiguration@@UAE@XZ @ 584 NONAME ; HsConfiguration::~HsConfiguration(void) - ?trashBin@HsIdleWidget@@QBEPAVHsTrashBinWidget@@XZ @ 585 NONAME ; class HsTrashBinWidget * HsIdleWidget::trashBin(void) const - ?translationFilename@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 586 NONAME ; class QString HsWidgetComponentDescriptor::translationFilename(void) const - ?trUtf8@HsConfiguration@@SA?AVQString@@PBD0@Z @ 587 NONAME ; class QString HsConfiguration::trUtf8(char const *, char const *) - ?instance@HsScene@@SAPAV1@XZ @ 588 NONAME ; class HsScene * HsScene::instance(void) - ?eventFilter@HsScene@@MAE_NPAVQObject@@PAVQEvent@@@Z @ 589 NONAME ; bool HsScene::eventFilter(class QObject *, class QEvent *) - ?trUtf8@HsPage@@SA?AVQString@@PBD0H@Z @ 590 NONAME ; class QString HsPage::trUtf8(char const *, char const *, int) - ?isDefaultPage@HsPage@@QBE_NXZ @ 591 NONAME ; bool HsPage::isDefaultPage(void) const - ??_EHsDatabase@@UAE@I@Z @ 592 NONAME ; HsDatabase::~HsDatabase(unsigned int) - ?event_startAndShow@HsWidgetHost@@IAEXXZ @ 593 NONAME ; void HsWidgetHost::event_startAndShow(void) - ?layoutRect@HsGui@@QBE?AVQRectF@@XZ @ 594 NONAME ; class QRectF HsGui::layoutRect(void) const - ?trUtf8@HsContentService@@SA?AVQString@@PBD0H@Z @ 595 NONAME ; class QString HsContentService::trUtf8(char const *, char const *, int) - ?setMinimumWidgetHeight@HsConfiguration@@QAEXM@Z @ 596 NONAME ; void HsConfiguration::setMinimumWidgetHeight(float) - ?pageTapFinished@HsScene@@IAEXPAVQGestureEvent@@@Z @ 597 NONAME ; void HsScene::pageTapFinished(class QGestureEvent *) - ?unavailable@HsWidgetComponent@@IAEXXZ @ 598 NONAME ; void HsWidgetComponent::unavailable(void) - ?isShortcutLabelVisible@HsConfiguration@@QBE_NXZ @ 599 NONAME ; bool HsConfiguration::isShortcutLabelVisible(void) const - ?setPageChangeZoneReverseAnimationDuration@HsConfiguration@@QAEXH@Z @ 600 NONAME ; void HsConfiguration::setPageChangeZoneReverseAnimationDuration(int) - ?getStaticMetaObject@HsIdleWidget@@SAABUQMetaObject@@XZ @ 601 NONAME ; struct QMetaObject const & HsIdleWidget::getStaticMetaObject(void) - ?qt_metacall@HsWidgetHostVisual@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 602 NONAME ; int HsWidgetHostVisual::qt_metacall(enum QMetaObject::Call, int, void * *) - ?tr@HsDatabase@@SA?AVQString@@PBD0H@Z @ 603 NONAME ; class QString HsDatabase::tr(char const *, char const *, int) - ?instance@HsWidgetComponentRegistry@@SAPAV1@XZ @ 604 NONAME ; class HsWidgetComponentRegistry * HsWidgetComponentRegistry::instance(void) - ?serviceXml@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 605 NONAME ; class QString HsWidgetComponentDescriptor::serviceXml(void) const - ?qt_metacall@HsWallpaperLoader@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 606 NONAME ; int HsWallpaperLoader::qt_metacall(enum QMetaObject::Call, int, void * *) - ??_EHsSceneWallpaper@@UAE@I@Z @ 607 NONAME ; HsSceneWallpaper::~HsSceneWallpaper(unsigned int) - ?instance@HsDatabase@@SAPAV1@XZ @ 608 NONAME ; class HsDatabase * HsDatabase::instance(void) - ?setTranslationFilename@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 609 NONAME ; void HsWidgetComponentDescriptor::setTranslationFilename(class QString const &) - ?onLoaderFinished@HsWallpaper@@AAEXXZ @ 610 NONAME ; void HsWallpaper::onLoaderFinished(void) - ?qt_metacall@HsIdleWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 611 NONAME ; int HsIdleWidget::qt_metacall(enum QMetaObject::Call, int, void * *) - ?addWidget@HsContentService@@QAE_NABVQString@@ABV?$QHash@VQString@@VQVariant@@@@ABVQVariant@@@Z @ 612 NONAME ; bool HsContentService::addWidget(class QString const &, class QHash const &, class QVariant const &) - ?shortcutWidgetTapFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 613 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::shortcutWidgetTapFeedbackEffect(void) const - ?widgetMoveFinished@HsScene@@IAEXABVQPointF@@PAVHsWidgetHost@@@Z @ 614 NONAME ; void HsScene::widgetMoveFinished(class QPointF const &, class HsWidgetHost *) - ?setInstance@HsScene@@SAXPAV1@@Z @ 615 NONAME ; void HsScene::setInstance(class HsScene *) - ?tr@HsPageVisual@@SA?AVQString@@PBD0H@Z @ 616 NONAME ; class QString HsPageVisual::tr(char const *, char const *, int) - ??_EHsContentService@@UAE@I@Z @ 617 NONAME ; HsContentService::~HsContentService(unsigned int) - ?trUtf8@HsDatabase@@SA?AVQString@@PBD0H@Z @ 618 NONAME ; class QString HsDatabase::trUtf8(char const *, char const *, int) - ?action_hide@HsWidgetHost@@AAEXXZ @ 619 NONAME ; void HsWidgetHost::action_hide(void) - ?addNewWidget@HsPage@@QAE_NPAVHsWidgetHost@@ABVQPointF@@@Z @ 620 NONAME ; bool HsPage::addNewWidget(class HsWidgetHost *, class QPointF const &) - ?removePresentation@HsWidgetHost@@QAE_NW4Orientation@Qt@@@Z @ 621 NONAME ; bool HsWidgetHost::removePresentation(enum Qt::Orientation) - ?staticMetaObject@HsContentService@@2UQMetaObject@@B @ 622 NONAME ; struct QMetaObject const HsContentService::staticMetaObject - ?tr@HsWidgetHost@@SA?AVQString@@PBD0H@Z @ 623 NONAME ; class QString HsWidgetHost::tr(char const *, char const *, int) - ?setWidgetRepositionFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 624 NONAME ; void HsConfiguration::setWidgetRepositionFeedbackEffect(enum HbFeedback::InstantEffect) - ?gestureEvent@HsWidgetHostVisual@@MAEXPAVQGestureEvent@@@Z @ 625 NONAME ; void HsWidgetHostVisual::gestureEvent(class QGestureEvent *) - ?metaObject@HsBackupRestoreObserver@@UBEPBUQMetaObject@@XZ @ 626 NONAME ; struct QMetaObject const * HsBackupRestoreObserver::metaObject(void) const - ?instance@HsGui@@SAPAV1@XZ @ 627 NONAME ; class HsGui * HsGui::instance(void) - ?getStaticMetaObject@HsHostedWidgetFactory@@SAABUQMetaObject@@XZ @ 628 NONAME ; struct QMetaObject const & HsHostedWidgetFactory::getStaticMetaObject(void) - ?pageIndex@HsPageVisual@@QBEHXZ @ 629 NONAME ; int HsPageVisual::pageIndex(void) const - ?qt_metacall@HsScene@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 630 NONAME ; int HsScene::qt_metacall(enum QMetaObject::Call, int, void * *) - ?setExistingImage@HsWallpaper@@IAE_NXZ @ 631 NONAME ; bool HsWallpaper::setExistingImage(void) - ?setPageChangeFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 632 NONAME ; void HsConfiguration::setPageChangeFeedbackEffect(enum HbFeedback::InstantEffect) - ?trUtf8@HsHostedWidgetFactory@@SA?AVQString@@PBD0H@Z @ 633 NONAME ; class QString HsHostedWidgetFactory::trUtf8(char const *, char const *, int) - ?trUtf8@HsConfiguration@@SA?AVQString@@PBD0H@Z @ 634 NONAME ; class QString HsConfiguration::trUtf8(char const *, char const *, int) - ?minimumWidgetSizeInPixels@HsConfiguration@@QBE?AVQSizeF@@XZ @ 635 NONAME ; class QSizeF HsConfiguration::minimumWidgetSizeInPixels(void) const - ?event_finished@HsWidgetHost@@IAEXXZ @ 636 NONAME ; void HsWidgetHost::event_finished(void) - ?sourcePath@HsWallpaperLoaderThread@@QBE?AVQString@@XZ @ 637 NONAME ; class QString HsWallpaperLoaderThread::sourcePath(void) const - ?widgets@HsPage@@QBE?AV?$QList@PAVHsWidgetHost@@@@XZ @ 638 NONAME ; class QList HsPage::widgets(void) const - ?setPageMargin@HsConfiguration@@QAEXM@Z @ 639 NONAME ; void HsConfiguration::setPageMargin(float) - ?parallaxFactor@HsIdleWidget@@QBEMXZ @ 640 NONAME ; float HsIdleWidget::parallaxFactor(void) const - ?setOnline@HsWidgetHost@@QAEX_N@Z @ 641 NONAME ; void HsWidgetHost::setOnline(bool) - ?setPreferencesToWidget@HsWidgetHost@@AAE_NXZ @ 642 NONAME ; bool HsWidgetHost::setPreferencesToWidget(void) - ?setWidgetPickFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 643 NONAME ; void HsConfiguration::setWidgetPickFeedbackEffect(enum HbFeedback::InstantEffect) - ?getStaticMetaObject@HsPageWallpaper@@SAABUQMetaObject@@XZ @ 644 NONAME ; struct QMetaObject const & HsPageWallpaper::getStaticMetaObject(void) - ??0HsWidgetHostVisual@@QAE@PAVQGraphicsItem@@@Z @ 645 NONAME ; HsWidgetHostVisual::HsWidgetHostVisual(class QGraphicsItem *) - ?trUtf8@HsIdleWidget@@SA?AVQString@@PBD0H@Z @ 646 NONAME ; class QString HsIdleWidget::trUtf8(char const *, char const *, int) - ??0HsContentService@@QAE@PAVQObject@@@Z @ 647 NONAME ; HsContentService::HsContentService(class QObject *) - ?trUtf8@HsWidgetComponentRegistry@@SA?AVQString@@PBD0H@Z @ 648 NONAME ; class QString HsWidgetComponentRegistry::trUtf8(char const *, char const *, int) - ?targetPath@HsWallpaperLoaderThread@@QBE?AVQString@@XZ @ 649 NONAME ; class QString HsWallpaperLoaderThread::targetPath(void) const - ?staticMetaObject@HsWallpaper@@2UQMetaObject@@B @ 650 NONAME ; struct QMetaObject const HsWallpaper::staticMetaObject - ?trUtf8@HsGui@@SA?AVQString@@PBD0H@Z @ 651 NONAME ; class QString HsGui::trUtf8(char const *, char const *, int) - ?metaObject@HsPageVisual@@UBEPBUQMetaObject@@XZ @ 652 NONAME ; struct QMetaObject const * HsPageVisual::metaObject(void) const - ?tr@HsWidgetComponent@@SA?AVQString@@PBD0@Z @ 653 NONAME ; class QString HsWidgetComponent::tr(char const *, char const *) - ?tr@HsHostedWidgetFactory@@SA?AVQString@@PBD0@Z @ 654 NONAME ; class QString HsHostedWidgetFactory::tr(char const *, char const *) - ?setBounceEffect@HsConfiguration@@QAEXH@Z @ 655 NONAME ; void HsConfiguration::setBounceEffect(int) - ??0HsPage@@QAE@PAVQObject@@@Z @ 656 NONAME ; HsPage::HsPage(class QObject *) - ?qt_metacast@HsDatabase@@UAEPAXPBD@Z @ 657 NONAME ; void * HsDatabase::qt_metacast(char const *) - ?registerService@HsWidgetComponentRegistry@@AAEXABVCaEntry@@ABVQString@@_N@Z @ 658 NONAME ; void HsWidgetComponentRegistry::registerService(class CaEntry const &, class QString const &, bool) - ?trUtf8@HsBackupRestoreObserver@@SA?AVQString@@PBD0@Z @ 659 NONAME ; class QString HsBackupRestoreObserver::trUtf8(char const *, char const *) - ?metaObject@HsWidgetHost@@UBEPBUQMetaObject@@XZ @ 660 NONAME ; struct QMetaObject const * HsWidgetHost::metaObject(void) const - ?qt_metacast@HsConfiguration@@UAEPAXPBD@Z @ 661 NONAME ; void * HsConfiguration::qt_metacast(char const *) + ?instance@HsWidgetPositioningOnWidgetAdd@@SAPAV1@XZ @ 3 NONAME ; class HsWidgetPositioningOnWidgetAdd * HsWidgetPositioningOnWidgetAdd::instance(void) + ?convert@HsAnchorPointInBottomRight@@UAE?AV?$QList@VQRectF@@@@ABVQRectF@@ABV2@1ABVQPointF@@@Z @ 4 NONAME ; class QList HsAnchorPointInBottomRight::convert(class QRectF const &, class QList const &, class QList const &, class QPointF const &) + ?metaObject@HsConfiguration@@UBEPBUQMetaObject@@XZ @ 5 NONAME ; struct QMetaObject const * HsConfiguration::metaObject(void) const + ?aboutToUninstall@HsWidgetComponent@@IAEXXZ @ 6 NONAME ; void HsWidgetComponent::aboutToUninstall(void) + ??_EHsWidgetData@@QAE@I@Z @ 7 NONAME ; HsWidgetData::~HsWidgetData(unsigned int) + ?metaObject@HsHostedWidgetFactory@@UBEPBUQMetaObject@@XZ @ 8 NONAME ; struct QMetaObject const * HsHostedWidgetFactory::metaObject(void) const + ?pageChangeZoneAnimationDuration@HsConfiguration@@QBEHXZ @ 9 NONAME ; int HsConfiguration::pageChangeZoneAnimationDuration(void) const + ?takeInstance@HsHostedWidgetFactory@@SAPAV1@XZ @ 10 NONAME ; class HsHostedWidgetFactory * HsHostedWidgetFactory::takeInstance(void) + ?convertToAnchors@HsWidgetOrganizer@@AAEHH@Z @ 11 NONAME ; int HsWidgetOrganizer::convertToAnchors(int) + ?widgetDropEffectDuration@HsConfiguration@@QBEHXZ @ 12 NONAME ; int HsConfiguration::widgetDropEffectDuration(void) const + ?setMaximumPageCount@HsConfiguration@@QAEXH@Z @ 13 NONAME ; void HsConfiguration::setMaximumPageCount(int) + ?qt_metacast@HsShortcutService@@UAEPAXPBD@Z @ 14 NONAME ; void * HsShortcutService::qt_metacast(char const *) + ?propertyChanged@HsConfiguration@@IAEXABVQString@@@Z @ 15 NONAME ; void HsConfiguration::propertyChanged(class QString const &) + ?showWidget@HsWidgetHost@@QAEXXZ @ 16 NONAME ; void HsWidgetHost::showWidget(void) + ?setInstance@HsConfiguration@@SAXPAV1@@Z @ 17 NONAME ; void HsConfiguration::setInstance(class HsConfiguration *) + ?isActivePage@HsPage@@QBE_NXZ @ 18 NONAME ; bool HsPage::isActivePage(void) const + ?hidden@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 19 NONAME ; class QString HsWidgetComponentDescriptor::hidden(void) const + ?cancel@HsWallpaperLoader@@QAEXXZ @ 20 NONAME ; void HsWallpaperLoader::cancel(void) + ?metaObject@HsShortcutService@@UBEPBUQMetaObject@@XZ @ 21 NONAME ; struct QMetaObject const * HsShortcutService::metaObject(void) const + ?instance@HsBackupRestoreObserver@@SAPAV1@XZ @ 22 NONAME ; class HsBackupRestoreObserver * HsBackupRestoreObserver::instance(void) + ??1HsWidgetHostVisual@@UAE@XZ @ 23 NONAME ; HsWidgetHostVisual::~HsWidgetHostVisual(void) + ?load@HsPage@@QAE_NXZ @ 24 NONAME ; bool HsPage::load(void) + ?setSnapEnabled@HsConfiguration@@QAEX_N@Z @ 25 NONAME ; void HsConfiguration::setSnapEnabled(bool) + ?clockWidgetTapFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 26 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::clockWidgetTapFeedbackEffect(void) const + ?readyForBUR@HsBackupRestoreObserver@@QAEXXZ @ 27 NONAME ; void HsBackupRestoreObserver::readyForBUR(void) + ?handleEntryUpdated@HsWidgetComponentRegistry@@AAEXABVCaEntry@@ABVQString@@@Z @ 28 NONAME ; void HsWidgetComponentRegistry::handleEntryUpdated(class CaEntry const &, class QString const &) + ?instance@HsShortcutService@@SAPAV1@PAVQStateMachine@@@Z @ 29 NONAME ; class HsShortcutService * HsShortcutService::instance(class QStateMachine *) + ?staticMetaObject@HsDatabase@@2UQMetaObject@@B @ 30 NONAME ; struct QMetaObject const HsDatabase::staticMetaObject + ??1HsSceneWallpaper@@UAE@XZ @ 31 NONAME ; HsSceneWallpaper::~HsSceneWallpaper(void) + ?setActivePageIndex@HsScene@@QAE_NH@Z @ 32 NONAME ; bool HsScene::setActivePageIndex(int) + ??1HsContentService@@UAE@XZ @ 33 NONAME ; HsContentService::~HsContentService(void) + ?widgetPreference@HsDatabase@@QAE_NHABVQString@@AAVQVariant@@@Z @ 34 NONAME ; bool HsDatabase::widgetPreference(int, class QString const &, class QVariant &) + ?tr@HsBackupRestoreObserver@@SA?AVQString@@PBD0H@Z @ 35 NONAME ; class QString HsBackupRestoreObserver::tr(char const *, char const *, int) + ?setOnline@HsScene@@QAEX_N@Z @ 36 NONAME ; void HsScene::setOnline(bool) + ?updateIconItem@HsWallpaper@@AAEXW4Orientation@Qt@@@Z @ 37 NONAME ; void HsWallpaper::updateIconItem(enum Qt::Orientation) + ?getStaticMetaObject@HsWidgetComponentRegistry@@SAABUQMetaObject@@XZ @ 38 NONAME ; struct QMetaObject const & HsWidgetComponentRegistry::getStaticMetaObject(void) + ?trUtf8@HsPageWallpaper@@SA?AVQString@@PBD0@Z @ 39 NONAME ; class QString HsPageWallpaper::trUtf8(char const *, char const *) + ??0HsWidgetComponentRegistry@@AAE@PAVQObject@@@Z @ 40 NONAME ; HsWidgetComponentRegistry::HsWidgetComponentRegistry(class QObject *) + ?action_unload@HsWidgetHost@@AAEXXZ @ 41 NONAME ; void HsWidgetHost::action_unload(void) + ?visualModel@HsWidgetHostVisual@@QBEPAVHsWidgetHost@@XZ @ 42 NONAME ; class HsWidgetHost * HsWidgetHostVisual::visualModel(void) const + ?tr@HsBackupRestoreObserver@@SA?AVQString@@PBD0@Z @ 43 NONAME ; class QString HsBackupRestoreObserver::tr(char const *, char const *) + ?setMinimumWidgetWidth@HsConfiguration@@QAEXM@Z @ 44 NONAME ; void HsConfiguration::setMinimumWidgetWidth(float) + ?event_show@HsWidgetHost@@IAEXXZ @ 45 NONAME ; void HsWidgetHost::event_show(void) + ?setBounceAnimationEasingCurve@HsConfiguration@@QAEXW4Type@QEasingCurve@@@Z @ 46 NONAME ; void HsConfiguration::setBounceAnimationEasingCurve(enum QEasingCurve::Type) + ?wallpaperDirectory@HsSceneWallpaper@@MBE?AVQString@@XZ @ 47 NONAME ; class QString HsSceneWallpaper::wallpaperDirectory(void) const + ?setWidgetMoveBlockedFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 48 NONAME ; void HsConfiguration::setWidgetMoveBlockedFeedbackEffect(enum HbFeedback::InstantEffect) + ?imageSetFailed@HsWallpaper@@IAEXXZ @ 49 NONAME ; void HsWallpaper::imageSetFailed(void) + ?trUtf8@HsWidgetHostVisual@@SA?AVQString@@PBD0@Z @ 50 NONAME ; class QString HsWidgetHostVisual::trUtf8(char const *, char const *) + ?setSnapForce@HsConfiguration@@QAEXM@Z @ 51 NONAME ; void HsConfiguration::setSnapForce(float) + ??0HsWidgetData@@QAE@XZ @ 52 NONAME ; HsWidgetData::HsWidgetData(void) + ?event_backupRestoreCompleted@HsBackupRestoreObserver@@IAEXXZ @ 53 NONAME ; void HsBackupRestoreObserver::event_backupRestoreCompleted(void) + ?staticMetaObject@HsWidgetHostVisual@@2UQMetaObject@@B @ 54 NONAME ; struct QMetaObject const HsWidgetHostVisual::staticMetaObject + ?setActivePage@HsScene@@QAE_NPAVHsPage@@@Z @ 55 NONAME ; bool HsScene::setActivePage(class HsPage *) + ?setSceneX@HsIdleWidget@@QAEXM@Z @ 56 NONAME ; void HsIdleWidget::setSceneX(float) + ??_EHsWidgetOrganizer@@UAE@I@Z @ 57 NONAME ; HsWidgetOrganizer::~HsWidgetOrganizer(unsigned int) + ?qt_metacast@HsContentService@@UAEPAXPBD@Z @ 58 NONAME ; void * HsContentService::qt_metacast(char const *) + ?qt_metacall@HsContentService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 59 NONAME ; int HsContentService::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@HsSceneWallpaper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 60 NONAME ; int HsSceneWallpaper::qt_metacall(enum QMetaObject::Call, int, void * *) + ?widgets@HsContentService@@QAE_NABVQString@@ABV?$QHash@VQString@@VQVariant@@@@AAH@Z @ 61 NONAME ; bool HsContentService::widgets(class QString const &, class QHash const &, int &) + ?createWidget@HsHostedWidgetFactory@@QAEPAVQObject@@ABVQString@@@Z @ 62 NONAME ; class QObject * HsHostedWidgetFactory::createWidget(class QString const &) + ?metaObject@HsDatabase@@UBEPBUQMetaObject@@XZ @ 63 NONAME ; struct QMetaObject const * HsDatabase::metaObject(void) const + ?contentGeometry@HsPage@@QAE?AVQRectF@@W4Orientation@Qt@@@Z @ 64 NONAME ; class QRectF HsPage::contentGeometry(enum Qt::Orientation) + ?exportToFile@HsConfiguration@@QAE_NABVQString@@@Z @ 65 NONAME ; bool HsConfiguration::exportToFile(class QString const &) + ?widgetStartFaulted@HsContentService@@AAEXXZ @ 66 NONAME ; void HsContentService::widgetStartFaulted(void) + ??_EHsWidgetHostVisual@@UAE@I@Z @ 67 NONAME ; HsWidgetHostVisual::~HsWidgetHostVisual(unsigned int) + ?setPageChangePanDistance@HsConfiguration@@QAEXM@Z @ 68 NONAME ; void HsConfiguration::setPageChangePanDistance(float) + ?qt_metacast@HsSceneWallpaper@@UAEPAXPBD@Z @ 69 NONAME ; void * HsSceneWallpaper::qt_metacast(char const *) + ?metaObject@HsWallpaperLoader@@UBEPBUQMetaObject@@XZ @ 70 NONAME ; struct QMetaObject const * HsWallpaperLoader::metaObject(void) const + ?action_finished@HsWidgetHost@@AAEXXZ @ 71 NONAME ; void HsWidgetHost::action_finished(void) + ?widget@HsWidgetHostVisual@@QAEPAVQObject@@XZ @ 72 NONAME ; class QObject * HsWidgetHostVisual::widget(void) + ?visual@HsWidgetHost@@QBEPAVHsWidgetHostVisual@@XZ @ 73 NONAME ; class HsWidgetHostVisual * HsWidgetHost::visual(void) const + ?pageChangeFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 74 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::pageChangeFeedbackEffect(void) const + ??0HsWallpaperLoader@@QAE@PAVQObject@@@Z @ 75 NONAME ; HsWallpaperLoader::HsWallpaperLoader(class QObject *) + ?trUtf8@HsShortcutService@@SA?AVQString@@PBD0H@Z @ 76 NONAME ; class QString HsShortcutService::trUtf8(char const *, char const *, int) + ?maximumWidgetWidth@HsConfiguration@@QBEMXZ @ 77 NONAME ; float HsConfiguration::maximumWidgetWidth(void) const + ?metaObject@HsContentService@@UBEPBUQMetaObject@@XZ @ 78 NONAME ; struct QMetaObject const * HsContentService::metaObject(void) const + ?setScene@HsSceneWallpaper@@QAEXPAVHsScene@@@Z @ 79 NONAME ; void HsSceneWallpaper::setScene(class HsScene *) + ?onPageMarginChanged@HsPage@@AAEXABVQString@@@Z @ 80 NONAME ; void HsPage::onPageMarginChanged(class QString const &) + ?finished@HsWidgetHost@@IAEXXZ @ 81 NONAME ; void HsWidgetHost::finished(void) + ?pagePanStarted@HsScene@@IAEXPAVQGestureEvent@@@Z @ 82 NONAME ; void HsScene::pagePanStarted(class QGestureEvent *) + ?checkExistingRects@HsWidgetOrganizer@@AAE_NABV?$QList@VQRectF@@@@@Z @ 83 NONAME ; bool HsWidgetOrganizer::checkExistingRects(class QList const &) + ?addPage@HsScene@@QAE_NPAVHsPage@@@Z @ 84 NONAME ; bool HsScene::addPage(class HsPage *) + ?controlLayer@HsIdleWidget@@QBEPAVHbWidget@@XZ @ 85 NONAME ; class HbWidget * HsIdleWidget::controlLayer(void) const + ?qt_metacall@HsWidgetHost@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 86 NONAME ; int HsWidgetHost::qt_metacall(enum QMetaObject::Call, int, void * *) + ?configuration@HsDatabase@@QAE_NAAV?$QHash@VQString@@VQVariant@@@@@Z @ 87 NONAME ; bool HsDatabase::configuration(class QHash &) + ?tr@HsContentService@@SA?AVQString@@PBD0@Z @ 88 NONAME ; class QString HsContentService::tr(char const *, char const *) + ?searchPositionRowByRow@HsWidgetOrganizer@@AAE?AVQPointF@@V2@HH@Z @ 89 NONAME ; class QPointF HsWidgetOrganizer::searchPositionRowByRow(class QPointF, int, int) + ?mInstance@HsHostedWidgetFactory@@0PAV1@A @ 90 NONAME ; class HsHostedWidgetFactory * HsHostedWidgetFactory::mInstance + ??1HsAnchorPointInCenter@@UAE@XZ @ 91 NONAME ; HsAnchorPointInCenter::~HsAnchorPointInCenter(void) + ?setInstance@HsHostedWidgetFactory@@SAPAV1@PAV1@@Z @ 92 NONAME ; class HsHostedWidgetFactory * HsHostedWidgetFactory::setInstance(class HsHostedWidgetFactory *) + ?staticMetaObject@HsScene@@2UQMetaObject@@B @ 93 NONAME ; struct QMetaObject const HsScene::staticMetaObject + ?setMaximumWidgetWidth@HsConfiguration@@QAEXM@Z @ 94 NONAME ; void HsConfiguration::setMaximumWidgetWidth(float) + ?scene@HsDatabase@@QAE_NAAVHsSceneData@@@Z @ 95 NONAME ; bool HsDatabase::scene(class HsSceneData &) + ?resetNewWidgets@HsPage@@QAEXXZ @ 96 NONAME ; void HsPage::resetNewWidgets(void) + ?tr@HsScene@@SA?AVQString@@PBD0@Z @ 97 NONAME ; class QString HsScene::tr(char const *, char const *) + ?tr@HsPage@@SA?AVQString@@PBD0@Z @ 98 NONAME ; class QString HsPage::tr(char const *, char const *) + ?emitAvailable@HsWidgetComponent@@AAEXXZ @ 99 NONAME ; void HsWidgetComponent::emitAvailable(void) + ?getStaticMetaObject@HsDatabase@@SAABUQMetaObject@@XZ @ 100 NONAME ; struct QMetaObject const & HsDatabase::getStaticMetaObject(void) + ?contentRect@HsPage@@QAE?AVQRectF@@XZ @ 101 NONAME ; class QRectF HsPage::contentRect(void) + ?tr@HsPageVisual@@SA?AVQString@@PBD0@Z @ 102 NONAME ; class QString HsPageVisual::tr(char const *, char const *) + ?setIconUri@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 103 NONAME ; void HsWidgetComponentDescriptor::setIconUri(class QString const &) + ?orientationChanged@HsGui@@IAEXW4Orientation@Qt@@@Z @ 104 NONAME ; void HsGui::orientationChanged(enum Qt::Orientation) + ?widgetAdded@HsContentService@@IAEXABVQString@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 105 NONAME ; void HsContentService::widgetAdded(class QString const &, class QHash const &) + ?staticMetaObject@HsWallpaperLoaderThread@@2UQMetaObject@@B @ 106 NONAME ; struct QMetaObject const HsWallpaperLoaderThread::staticMetaObject + ?databaseName@HsDatabase@@QBE?AVQString@@XZ @ 107 NONAME ; class QString HsDatabase::databaseName(void) const + ?setPageChangeAnimationEasingCurve@HsConfiguration@@QAEXW4Type@QEasingCurve@@@Z @ 108 NONAME ; void HsConfiguration::setPageChangeAnimationEasingCurve(enum QEasingCurve::Type) + ?setPageChangeZoneAnimationDuration@HsConfiguration@@QAEXH@Z @ 109 NONAME ; void HsConfiguration::setPageChangeZoneAnimationDuration(int) + ?qt_metacast@HsIdleWidget@@UAEPAXPBD@Z @ 110 NONAME ; void * HsIdleWidget::qt_metacast(char const *) + ?executeCollectionAction@HsShortcutService@@QAEXHABVQString@@@Z @ 111 NONAME ; void HsShortcutService::executeCollectionAction(int, class QString const &) + ?widgets@HsDatabase@@QAE_NABVQString@@ABV?$QHash@VQString@@VQVariant@@@@AAH@Z @ 112 NONAME ; bool HsDatabase::widgets(class QString const &, class QHash const &, int &) + ?qt_metacast@HsWallpaperLoaderThread@@UAEPAXPBD@Z @ 113 NONAME ; void * HsWallpaperLoaderThread::qt_metacast(char const *) + ?pageCrawlingAnimation@HsGui@@QAEPAVHsPropertyAnimationWrapper@@XZ @ 114 NONAME ; class HsPropertyAnimationWrapper * HsGui::pageCrawlingAnimation(void) + ?setSceneType@HsConfiguration@@QAEXW4SceneType@1@@Z @ 115 NONAME ; void HsConfiguration::setSceneType(enum HsConfiguration::SceneType) + ?layoutNewWidgets@HsPage@@QAEXXZ @ 116 NONAME ; void HsPage::layoutNewWidgets(void) + ?matchWidgetPreferences@HsDatabase@@AAE_NABV?$QHash@VQString@@VQVariant@@@@ABV?$QMultiMap@VQString@@V1@@@@Z @ 117 NONAME ; bool HsDatabase::matchWidgetPreferences(class QHash const &, class QMultiMap const &) + ?tr@HsWidgetHostVisual@@SA?AVQString@@PBD0@Z @ 118 NONAME ; class QString HsWidgetHostVisual::tr(char const *, char const *) + ?targetSize@HsWallpaperLoaderThread@@QBE?AVQSize@@XZ @ 119 NONAME ; class QSize HsWallpaperLoaderThread::targetSize(void) const + ?trUtf8@HsWallpaperLoader@@SA?AVQString@@PBD0H@Z @ 120 NONAME ; class QString HsWallpaperLoader::trUtf8(char const *, char const *, int) + ?event_remove@HsWidgetHost@@IAEXXZ @ 121 NONAME ; void HsWidgetHost::event_remove(void) + ?startDropEffect@HsWidgetHost@@QAEXXZ @ 122 NONAME ; void HsWidgetHost::startDropEffect(void) + ?trUtf8@HsWidgetComponentRegistry@@SA?AVQString@@PBD0@Z @ 123 NONAME ; class QString HsWidgetComponentRegistry::trUtf8(char const *, char const *) + ?event_close@HsWidgetHost@@IAEXXZ @ 124 NONAME ; void HsWidgetHost::event_close(void) + ??1HsWallpaperLoader@@UAE@XZ @ 125 NONAME ; HsWallpaperLoader::~HsWallpaperLoader(void) + ?mInstance@HsBackupRestoreObserver@@0PAV1@A @ 126 NONAME ; class HsBackupRestoreObserver * HsBackupRestoreObserver::mInstance + ?connectWidget@HsPage@@AAEXPAVHsWidgetHost@@@Z @ 127 NONAME ; void HsPage::connectWidget(class HsWidgetHost *) + ?setShortcutLabelVisible@HsConfiguration@@QAEX_N@Z @ 128 NONAME ; void HsConfiguration::setShortcutLabelVisible(bool) + ?sceneLayer@HsIdleWidget@@QBEPAVHbWidget@@XZ @ 129 NONAME ; class HbWidget * HsIdleWidget::sceneLayer(void) const + ?trUtf8@HsWallpaperLoaderThread@@SA?AVQString@@PBD0@Z @ 130 NONAME ; class QString HsWallpaperLoaderThread::trUtf8(char const *, char const *) + ?qt_metacast@HsScene@@UAEPAXPBD@Z @ 131 NONAME ; void * HsScene::qt_metacast(char const *) + ??1HsWidgetHost@@UAE@XZ @ 132 NONAME ; HsWidgetHost::~HsWidgetHost(void) + ?uninstallComponent@HsWidgetComponentRegistry@@QAEXABVHsWidgetComponentDescriptor@@@Z @ 133 NONAME ; void HsWidgetComponentRegistry::uninstallComponent(class HsWidgetComponentDescriptor const &) + ?action_notifyRemove@HsWidgetHost@@AAEXXZ @ 134 NONAME ; void HsWidgetHost::action_notifyRemove(void) + ?open@HsDatabase@@QAE_NXZ @ 135 NONAME ; bool HsDatabase::open(void) + ?idleWidget@HsGui@@QBEPAVHsIdleWidget@@XZ @ 136 NONAME ; class HsIdleWidget * HsGui::idleWidget(void) const + ?pageMargin@HsConfiguration@@QBEMXZ @ 137 NONAME ; float HsConfiguration::pageMargin(void) const + ?setWidgetOrganizerSearchSequence@HsConfiguration@@QAEXW4WidgetOrganizerSearchSequence@1@@Z @ 138 NONAME ; void HsConfiguration::setWidgetOrganizerSearchSequence(enum HsConfiguration::WidgetOrganizerSearchSequence) + ?failed@HsWallpaperLoader@@IAEXXZ @ 139 NONAME ; void HsWallpaperLoader::failed(void) + ?setPos@HsWidgetPresentationData@@QAEXABVQPointF@@@Z @ 140 NONAME ; void HsWidgetPresentationData::setPos(class QPointF const &) + ?isSnapEffectsEnabled@HsConfiguration@@QBE_NXZ @ 141 NONAME ; bool HsConfiguration::isSnapEffectsEnabled(void) const + ?trUtf8@HsWallpaperLoaderThread@@SA?AVQString@@PBD0H@Z @ 142 NONAME ; class QString HsWallpaperLoaderThread::trUtf8(char const *, char const *, int) + ?setSourcePath@HsWallpaperLoaderThread@@QAEXABVQString@@@Z @ 143 NONAME ; void HsWallpaperLoaderThread::setSourcePath(class QString const &) + ?tr@HsGui@@SA?AVQString@@PBD0@Z @ 144 NONAME ; class QString HsGui::tr(char const *, char const *) + ?disconnectWidget@HsPage@@AAEXPAVHsWidgetHost@@@Z @ 145 NONAME ; void HsPage::disconnectWidget(class HsWidgetHost *) + ?setOnline@HsPage@@QAEX_N@Z @ 146 NONAME ; void HsPage::setOnline(bool) + ?tr@HsDatabase@@SA?AVQString@@PBD0@Z @ 147 NONAME ; class QString HsDatabase::tr(char const *, char const *) + ?onLoaderFailed@HsWallpaper@@AAEXXZ @ 148 NONAME ; void HsWallpaper::onLoaderFailed(void) + ?trUtf8@HsScene@@SA?AVQString@@PBD0@Z @ 149 NONAME ; class QString HsScene::trUtf8(char const *, char const *) + ?uninstallTranslator@HsWidgetComponent@@AAEXXZ @ 150 NONAME ; void HsWidgetComponent::uninstallTranslator(void) + ?setGeometry@HsIdleWidget@@UAEXABVQRectF@@@Z @ 151 NONAME ; void HsIdleWidget::setGeometry(class QRectF const &) + ?updateZValues@HsPage@@QAEXXZ @ 152 NONAME ; void HsPage::updateZValues(void) + ?tr@HsShortcutService@@SA?AVQString@@PBD0H@Z @ 153 NONAME ; class QString HsShortcutService::tr(char const *, char const *, int) + ?pos@HsWidgetPresentationData@@QBE?AVQPointF@@XZ @ 154 NONAME ; class QPointF HsWidgetPresentationData::pos(void) const + ?getStaticMetaObject@HsBackupRestoreObserver@@SAABUQMetaObject@@XZ @ 155 NONAME ; struct QMetaObject const & HsBackupRestoreObserver::getStaticMetaObject(void) + ?trUtf8@HsPageVisual@@SA?AVQString@@PBD0@Z @ 156 NONAME ; class QString HsPageVisual::trUtf8(char const *, char const *) + ?action_show@HsWidgetHost@@AAEXXZ @ 157 NONAME ; void HsWidgetHost::action_show(void) + ?pageLayer@HsIdleWidget@@QBEPAVHbWidget@@XZ @ 158 NONAME ; class HbWidget * HsIdleWidget::pageLayer(void) const + ?setSnapGap@HsConfiguration@@QAEXM@Z @ 159 NONAME ; void HsConfiguration::setSnapGap(float) + ?trUtf8@HsHostedWidgetFactory@@SA?AVQString@@PBD0@Z @ 160 NONAME ; class QString HsHostedWidgetFactory::trUtf8(char const *, char const *) + ?setActiveWidget@HsScene@@QAEXPAVHsWidgetHost@@@Z @ 161 NONAME ; void HsScene::setActiveWidget(class HsWidgetHost *) + ?transaction@HsDatabase@@QAE_NXZ @ 162 NONAME ; bool HsDatabase::transaction(void) + ?snapForce@HsConfiguration@@QBEMXZ @ 163 NONAME ; float HsConfiguration::snapForce(void) const + ?isOnline@HsScene@@QBE_NXZ @ 164 NONAME ; bool HsScene::isOnline(void) const + ??0HsWidgetPresentationData@@QAE@XZ @ 165 NONAME ; HsWidgetPresentationData::HsWidgetPresentationData(void) + ?tr@HsShortcutService@@SA?AVQString@@PBD0@Z @ 166 NONAME ; class QString HsShortcutService::tr(char const *, char const *) + ?metaObject@HsWidgetComponent@@UBEPBUQMetaObject@@XZ @ 167 NONAME ; struct QMetaObject const * HsWidgetComponent::metaObject(void) const + ?setConnectionName@HsDatabase@@QAEXABVQString@@@Z @ 168 NONAME ; void HsDatabase::setConnectionName(class QString const &) + ?qt_metacall@HsGui@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 169 NONAME ; int HsGui::qt_metacall(enum QMetaObject::Call, int, void * *) + ?metaObject@HsWallpaper@@UBEPBUQMetaObject@@XZ @ 170 NONAME ; struct QMetaObject const * HsWallpaper::metaObject(void) const + ?removeWidget@HsPage@@QAE_NPAVHsWidgetHost@@@Z @ 171 NONAME ; bool HsPage::removeWidget(class HsWidgetHost *) + ?trUtf8@HsPageVisual@@SA?AVQString@@PBD0H@Z @ 172 NONAME ; class QString HsPageVisual::trUtf8(char const *, char const *, int) + ?tr@HsWallpaperLoaderThread@@SA?AVQString@@PBD0@Z @ 173 NONAME ; class QString HsWallpaperLoaderThread::tr(char const *, char const *) + ?qt_metacall@HsWallpaper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 174 NONAME ; int HsWallpaper::qt_metacall(enum QMetaObject::Call, int, void * *) + ?onWidgetUnavailable@HsPage@@AAEXXZ @ 175 NONAME ; void HsPage::onWidgetUnavailable(void) + ?mInstance@HsDatabase@@0PAV1@A @ 176 NONAME ; class HsDatabase * HsDatabase::mInstance + ?available@HsWidgetComponent@@IAEXXZ @ 177 NONAME ; void HsWidgetComponent::available(void) + ?tr@HsSceneWallpaper@@SA?AVQString@@PBD0@Z @ 178 NONAME ; class QString HsSceneWallpaper::tr(char const *, char const *) + ?trUtf8@HsPage@@SA?AVQString@@PBD0@Z @ 179 NONAME ; class QString HsPage::trUtf8(char const *, char const *) + ?trUtf8@HsWidgetHostVisual@@SA?AVQString@@PBD0H@Z @ 180 NONAME ; class QString HsWidgetHostVisual::trUtf8(char const *, char const *, int) + ?hideWidgets@HsPage@@QAEXXZ @ 181 NONAME ; void HsPage::hideWidgets(void) + ?trUtf8@HsWidgetHost@@SA?AVQString@@PBD0H@Z @ 182 NONAME ; class QString HsWidgetHost::trUtf8(char const *, char const *, int) + ?qt_metacall@HsHostedWidgetFactory@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 183 NONAME ; int HsHostedWidgetFactory::qt_metacall(enum QMetaObject::Call, int, void * *) + ??0HsScene@@QAE@PAVQObject@@@Z @ 184 NONAME ; HsScene::HsScene(class QObject *) + ?getStaticMetaObject@HsPageVisual@@SAABUQMetaObject@@XZ @ 185 NONAME ; struct QMetaObject const & HsPageVisual::getStaticMetaObject(void) + ?pagePanUpdated@HsScene@@IAEXPAVQGestureEvent@@@Z @ 186 NONAME ; void HsScene::pagePanUpdated(class QGestureEvent *) + ?showTrashBin@HsIdleWidget@@QAEXXZ @ 187 NONAME ; void HsIdleWidget::showTrashBin(void) + ?qt_metacast@HsWidgetHost@@UAEPAXPBD@Z @ 188 NONAME ; void * HsWidgetHost::qt_metacast(char const *) + ?trUtf8@HsWallpaperLoader@@SA?AVQString@@PBD0@Z @ 189 NONAME ; class QString HsWallpaperLoader::trUtf8(char const *, char const *) + ?qt_metacall@HsWidgetComponentRegistry@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 190 NONAME ; int HsWidgetComponentRegistry::qt_metacall(enum QMetaObject::Call, int, void * *) + ?setMaximumWidgetHeight@HsConfiguration@@QAEXM@Z @ 191 NONAME ; void HsConfiguration::setMaximumWidgetHeight(float) + ?qt_metacall@HsPageVisual@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 192 NONAME ; int HsPageVisual::qt_metacall(enum QMetaObject::Call, int, void * *) + ?instance@HsConfiguration@@SAPAV1@XZ @ 193 NONAME ; class HsConfiguration * HsConfiguration::instance(void) + ?tr@HsWallpaperLoader@@SA?AVQString@@PBD0H@Z @ 194 NONAME ; class QString HsWallpaperLoader::tr(char const *, char const *, int) + ??_EHsConfiguration@@UAE@I@Z @ 195 NONAME ; HsConfiguration::~HsConfiguration(unsigned int) + ?metaObject@HsPage@@UBEPBUQMetaObject@@XZ @ 196 NONAME ; struct QMetaObject const * HsPage::metaObject(void) const + ??_EHsWidgetPositioningOnWidgetAdd@@UAE@I@Z @ 197 NONAME ; HsWidgetPositioningOnWidgetAdd::~HsWidgetPositioningOnWidgetAdd(unsigned int) + ?activePageIndex@HsScene@@QBEHXZ @ 198 NONAME ; int HsScene::activePageIndex(void) const + ?widgetOrganizerSearchSequence@HsConfiguration@@QBE?AW4WidgetOrganizerSearchSequence@1@XZ @ 199 NONAME ; enum HsConfiguration::WidgetOrganizerSearchSequence HsConfiguration::widgetOrganizerSearchSequence(void) const + ?qt_metacast@HsWidgetHostVisual@@UAEPAXPBD@Z @ 200 NONAME ; void * HsWidgetHostVisual::qt_metacast(char const *) + ?hideHorizontalSnapLine@HsIdleWidget@@QAEXXZ @ 201 NONAME ; void HsIdleWidget::hideHorizontalSnapLine(void) + ?minimumWidgetWidth@HsConfiguration@@QBEMXZ @ 202 NONAME ; float HsConfiguration::minimumWidgetWidth(void) const + ?setWidgetPreferences@HsDatabase@@QAE_NHABV?$QHash@VQString@@VQVariant@@@@@Z @ 203 NONAME ; bool HsDatabase::setWidgetPreferences(int, class QHash const &) + ?orientation@HsGui@@QAE?AW4Orientation@Qt@@XZ @ 204 NONAME ; enum Qt::Orientation HsGui::orientation(void) + ?deleteWidget@HsDatabase@@QAE_NH@Z @ 205 NONAME ; bool HsDatabase::deleteWidget(int) + ?widgetOverTrashbinFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 206 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::widgetOverTrashbinFeedbackEffect(void) const + ?deleteFromDatabase@HsPage@@QAE_NXZ @ 207 NONAME ; bool HsPage::deleteFromDatabase(void) + ?setWidgetPresentation@HsDatabase@@QAE_NABVHsWidgetPresentationData@@@Z @ 208 NONAME ; bool HsDatabase::setWidgetPresentation(class HsWidgetPresentationData const &) + ?takeInstance@HsGui@@SAPAV1@XZ @ 209 NONAME ; class HsGui * HsGui::takeInstance(void) + ??0HsConfiguration@@QAE@PAVQObject@@@Z @ 210 NONAME ; HsConfiguration::HsConfiguration(class QObject *) + ?setDefaultImage@HsWallpaper@@QAEXXZ @ 211 NONAME ; void HsWallpaper::setDefaultImage(void) + ?setupTouchArea@HsPageVisual@@AAEXXZ @ 212 NONAME ; void HsPageVisual::setupTouchArea(void) + ?trUtf8@HsWidgetComponent@@SA?AVQString@@PBD0H@Z @ 213 NONAME ; class QString HsWidgetComponent::trUtf8(char const *, char const *, int) + ?setWidget@HsWidgetHostVisual@@QAEXPAVQObject@@@Z @ 214 NONAME ; void HsWidgetHostVisual::setWidget(class QObject *) + ?importFromFile@HsConfiguration@@QAE_NABVQString@@@Z @ 215 NONAME ; bool HsConfiguration::importFromFile(class QString const &) + ?page@HsDatabase@@QAE_NAAVHsPageData@@@Z @ 216 NONAME ; bool HsDatabase::page(class HsPageData &) + ??_EHsPage@@UAE@I@Z @ 217 NONAME ; HsPage::~HsPage(unsigned int) + ?instance@HsHostedWidgetFactory@@SAPAV1@XZ @ 218 NONAME ; class HsHostedWidgetFactory * HsHostedWidgetFactory::instance(void) + ?staticMetaObject@HsPage@@2UQMetaObject@@B @ 219 NONAME ; struct QMetaObject const HsPage::staticMetaObject + ?widgetDropFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 220 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::widgetDropFeedbackEffect(void) const + ?pageChangeZoneReverseAnimationDuration@HsConfiguration@@QBEHXZ @ 221 NONAME ; int HsConfiguration::pageChangeZoneReverseAnimationDuration(void) const + ?createWidget@HsContentService@@QAE_NABV?$QHash@VQString@@VQVariant@@@@@Z @ 222 NONAME ; bool HsContentService::createWidget(class QHash const &) + ?setVersion@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 223 NONAME ; void HsWidgetComponentDescriptor::setVersion(class QString const &) + ?getStaticMetaObject@HsWallpaperLoader@@SAABUQMetaObject@@XZ @ 224 NONAME ; struct QMetaObject const & HsWallpaperLoader::getStaticMetaObject(void) + ?mInstance@HsWidgetComponentRegistry@@0PAV1@A @ 225 NONAME ; class HsWidgetComponentRegistry * HsWidgetComponentRegistry::mInstance + ?staticMetaObject@HsWidgetHost@@2UQMetaObject@@B @ 226 NONAME ; struct QMetaObject const HsWidgetHost::staticMetaObject + ?qt_metacast@HsPageVisual@@UAEPAXPBD@Z @ 227 NONAME ; void * HsPageVisual::qt_metacast(char const *) + ?qt_metacall@HsShortcutService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 228 NONAME ; int HsShortcutService::qt_metacall(enum QMetaObject::Call, int, void * *) + ?setImages@HsWallpaper@@QAEXABVQString@@0@Z @ 229 NONAME ; void HsWallpaper::setImages(class QString const &, class QString const &) + ??1HsPageWallpaper@@UAE@XZ @ 230 NONAME ; HsPageWallpaper::~HsPageWallpaper(void) + ?startDropEffect@HsWidgetHostVisual@@QAEXXZ @ 231 NONAME ; void HsWidgetHostVisual::startDropEffect(void) + ?activeWidget@HsScene@@QBEPAVHsWidgetHost@@XZ @ 232 NONAME ; class HsWidgetHost * HsScene::activeWidget(void) const + ?widgets@HsDatabase@@QAE_NABVQString@@AAV?$QList@VHsWidgetData@@@@@Z @ 233 NONAME ; bool HsDatabase::widgets(class QString const &, class QList &) + ?rootDirectory@HsWallpaper@@IBE?AVQString@@XZ @ 234 NONAME ; class QString HsWallpaper::rootDirectory(void) const + ?markAnchors@HsWidgetOrganizer@@AAE_NABVQRectF@@@Z @ 235 NONAME ; bool HsWidgetOrganizer::markAnchors(class QRectF const &) + ?tr@HsContentService@@SA?AVQString@@PBD0H@Z @ 236 NONAME ; class QString HsContentService::tr(char const *, char const *, int) + ??0HsDatabase@@QAE@PAVQObject@@@Z @ 237 NONAME ; HsDatabase::HsDatabase(class QObject *) + ?eventFilter@HsWidgetHostVisual@@MAE_NPAVQObject@@PAVQEvent@@@Z @ 238 NONAME ; bool HsWidgetHostVisual::eventFilter(class QObject *, class QEvent *) + ?tr@HsWidgetHost@@SA?AVQString@@PBD0@Z @ 239 NONAME ; class QString HsWidgetHost::tr(char const *, char const *) + ?remove@HsWallpaper@@QAEXXZ @ 240 NONAME ; void HsWallpaper::remove(void) + ?idleView@HsGui@@QBEPAVHbView@@XZ @ 241 NONAME ; class HbView * HsGui::idleView(void) const + ??1HsPageVisual@@UAE@XZ @ 242 NONAME ; HsPageVisual::~HsPageVisual(void) + ?initAnchors@HsWidgetOrganizer@@AAEXXZ @ 243 NONAME ; void HsWidgetOrganizer::initAnchors(void) + ?widgetMoveBlockedFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 244 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::widgetMoveBlockedFeedbackEffect(void) const + ?widgetPickFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 245 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::widgetPickFeedbackEffect(void) const + ?widgetSnappingFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 246 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::widgetSnappingFeedbackEffect(void) const + ?load@HsScene@@QAE_NXZ @ 247 NONAME ; bool HsScene::load(void) + ?trUtf8@HsSceneWallpaper@@SA?AVQString@@PBD0H@Z @ 248 NONAME ; class QString HsSceneWallpaper::trUtf8(char const *, char const *, int) + ?tr@HsConfiguration@@SA?AVQString@@PBD0@Z @ 249 NONAME ; class QString HsConfiguration::tr(char const *, char const *) + ?widgetRepositionFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 250 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::widgetRepositionFeedbackEffect(void) const + ?onError@HsWidgetHost@@AAEXXZ @ 251 NONAME ; void HsWidgetHost::onError(void) + ?cleanup@HsWallpaperLoader@@AAEXXZ @ 252 NONAME ; void HsWallpaperLoader::cleanup(void) + ?targets@HsWallpaperLoader@@QBE?AV?$QHash@VQString@@VQVariant@@@@XZ @ 253 NONAME ; class QHash HsWallpaperLoader::targets(void) const + ??0HsShortcutService@@AAE@PAVQStateMachine@@PAVQObject@@@Z @ 254 NONAME ; HsShortcutService::HsShortcutService(class QStateMachine *, class QObject *) + ?hideVerticalSnapLine@HsIdleWidget@@QAEXXZ @ 255 NONAME ; void HsIdleWidget::hideVerticalSnapLine(void) + ?setActivePage@HsIdleWidget@@QAEXH@Z @ 256 NONAME ; void HsIdleWidget::setActivePage(int) + ?setSnapLineFadeOutDuration@HsConfiguration@@QAEXH@Z @ 257 NONAME ; void HsConfiguration::setSnapLineFadeOutDuration(int) + ?polishEvent@HsIdleWidget@@MAEXXZ @ 258 NONAME ; void HsIdleWidget::polishEvent(void) + ?tr@HsPageWallpaper@@SA?AVQString@@PBD0H@Z @ 259 NONAME ; class QString HsPageWallpaper::tr(char const *, char const *, int) + ?widgetDropToTrashbinFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 260 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::widgetDropToTrashbinFeedbackEffect(void) const + ?staticMetaObject@HsPageWallpaper@@2UQMetaObject@@B @ 261 NONAME ; struct QMetaObject const HsPageWallpaper::staticMetaObject + ?onWidgetFinished@HsPage@@AAEXXZ @ 262 NONAME ; void HsPage::onWidgetFinished(void) + ?onThreadFinished@HsWallpaperLoader@@AAEXXZ @ 263 NONAME ; void HsWallpaperLoader::onThreadFinished(void) + ?tr@HsWidgetComponentRegistry@@SA?AVQString@@PBD0H@Z @ 264 NONAME ; class QString HsWidgetComponentRegistry::tr(char const *, char const *, int) + ?loadControlLayer@HsIdleWidget@@AAEXXZ @ 265 NONAME ; void HsIdleWidget::loadControlLayer(void) + ?action_initialize@HsWidgetHost@@AAEXXZ @ 266 NONAME ; void HsWidgetHost::action_initialize(void) + ?sceneX@HsIdleWidget@@QBEMXZ @ 267 NONAME ; float HsIdleWidget::sceneX(void) const + ?action_load@HsWidgetHost@@AAEXXZ @ 268 NONAME ; void HsWidgetHost::action_load(void) + ?connectionName@HsDatabase@@QBE?AVQString@@XZ @ 269 NONAME ; class QString HsDatabase::connectionName(void) const + ?snapLineFadeInDuration@HsConfiguration@@QBEHXZ @ 270 NONAME ; int HsConfiguration::snapLineFadeInDuration(void) const + ?setMethod@HsWidgetHost@@AAE_NPBDAAVQMetaMethod@@@Z @ 271 NONAME ; bool HsWidgetHost::setMethod(char const *, class QMetaMethod &) + ?setInstance@HsDatabase@@SAXPAV1@@Z @ 272 NONAME ; void HsDatabase::setInstance(class HsDatabase *) + ??0HsWallpaper@@QAE@PAVQGraphicsItem@@@Z @ 273 NONAME ; HsWallpaper::HsWallpaper(class QGraphicsItem *) + ?setSnapEffectsEnabled@HsConfiguration@@QAEX_N@Z @ 274 NONAME ; void HsConfiguration::setSnapEffectsEnabled(bool) + ?newPageAddedAnimationDuration@HsConfiguration@@QBEHXZ @ 275 NONAME ; int HsConfiguration::newPageAddedAnimationDuration(void) const + ?getStaticMetaObject@HsWallpaperLoaderThread@@SAABUQMetaObject@@XZ @ 276 NONAME ; struct QMetaObject const & HsWallpaperLoaderThread::getStaticMetaObject(void) + ?commit@HsDatabase@@QAE_NXZ @ 277 NONAME ; bool HsDatabase::commit(void) + ?trUtf8@HsDatabase@@SA?AVQString@@PBD0@Z @ 278 NONAME ; class QString HsDatabase::trUtf8(char const *, char const *) + ?mousePressEvent@HsWidgetHostVisual@@MAEXPAVQGraphicsSceneMouseEvent@@@Z @ 279 NONAME ; void HsWidgetHostVisual::mousePressEvent(class QGraphicsSceneMouseEvent *) + ?tr@HsWidgetComponent@@SA?AVQString@@PBD0H@Z @ 280 NONAME ; class QString HsWidgetComponent::tr(char const *, char const *, int) + ?backupRestoreStarted@HsBackupRestoreObserver@@QAEXXZ @ 281 NONAME ; void HsBackupRestoreObserver::backupRestoreStarted(void) + ?qt_metacast@HsPageWallpaper@@UAEPAXPBD@Z @ 282 NONAME ; void * HsPageWallpaper::qt_metacast(char const *) + ?trUtf8@HsWidgetHost@@SA?AVQString@@PBD0@Z @ 283 NONAME ; class QString HsWidgetHost::trUtf8(char const *, char const *) + ?setDefaultPageId@HsConfiguration@@QAEXH@Z @ 284 NONAME ; void HsConfiguration::setDefaultPageId(int) + ?metaObject@HsWidgetHostVisual@@UBEPBUQMetaObject@@XZ @ 285 NONAME ; struct QMetaObject const * HsWidgetHostVisual::metaObject(void) const + ?installTranslator@HsWidgetComponent@@AAEXXZ @ 286 NONAME ; void HsWidgetComponent::installTranslator(void) + ?bounceAnimationEasingCurve@HsConfiguration@@QBE?AW4Type@QEasingCurve@@XZ @ 287 NONAME ; enum QEasingCurve::Type HsConfiguration::bounceAnimationEasingCurve(void) const + ??_EHsIdleWidget@@UAE@I@Z @ 288 NONAME ; HsIdleWidget::~HsIdleWidget(unsigned int) + ?qt_metacall@HsWidgetComponent@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 289 NONAME ; int HsWidgetComponent::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@HsConfiguration@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 290 NONAME ; int HsConfiguration::qt_metacall(enum QMetaObject::Call, int, void * *) + ?cleanupIdleUi@HsGui@@QAEXXZ @ 291 NONAME ; void HsGui::cleanupIdleUi(void) + ?setWidgetOverTrashbinFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 292 NONAME ; void HsConfiguration::setWidgetOverTrashbinFeedbackEffect(enum HbFeedback::InstantEffect) + ?handleEntryAdded@HsWidgetComponentRegistry@@AAEXABVCaEntry@@ABVQString@@@Z @ 293 NONAME ; void HsWidgetComponentRegistry::handleEntryAdded(class CaEntry const &, class QString const &) + ?setProperty@HsWidgetHost@@AAE_NPBDAAVQMetaProperty@@@Z @ 294 NONAME ; bool HsWidgetHost::setProperty(char const *, class QMetaProperty &) + ?pagePanFinished@HsScene@@IAEXPAVQGestureEvent@@@Z @ 295 NONAME ; void HsScene::pagePanFinished(class QGestureEvent *) + ?minimumWidgetSizeInUnits@HsConfiguration@@QBE?AVQSizeF@@XZ @ 296 NONAME ; class QSizeF HsConfiguration::minimumWidgetSizeInUnits(void) const + ??0HsBackupRestoreObserver@@AAE@PAVQObject@@@Z @ 297 NONAME ; HsBackupRestoreObserver::HsBackupRestoreObserver(class QObject *) + ?setClockWidgetTapFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 298 NONAME ; void HsConfiguration::setClockWidgetTapFeedbackEffect(enum HbFeedback::InstantEffect) + ??1HsPage@@UAE@XZ @ 299 NONAME ; HsPage::~HsPage(void) + ?databaseId@HsWidgetHost@@QBEHXZ @ 300 NONAME ; int HsWidgetHost::databaseId(void) const + ?setInstallationPath@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 301 NONAME ; void HsWidgetComponentDescriptor::setInstallationPath(class QString const &) + ?staticMetaObject@HsHostedWidgetFactory@@2UQMetaObject@@B @ 302 NONAME ; struct QMetaObject const HsHostedWidgetFactory::staticMetaObject + ?setTitle@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 303 NONAME ; void HsWidgetComponentDescriptor::setTitle(class QString const &) + ?getAnchorCoordinates@HsWidgetOrganizer@@AAE?AVQPointF@@H@Z @ 304 NONAME ; class QPointF HsWidgetOrganizer::getAnchorCoordinates(int) + ?qt_metacall@HsPageWallpaper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 305 NONAME ; int HsPageWallpaper::qt_metacall(enum QMetaObject::Call, int, void * *) + ?mInstance@HsWidgetPositioningOnWidgetAdd@@0PAV1@A @ 306 NONAME ; class HsWidgetPositioningOnWidgetAdd * HsWidgetPositioningOnWidgetAdd::mInstance + ?setWidgetSnappingFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 307 NONAME ; void HsConfiguration::setWidgetSnappingFeedbackEffect(enum HbFeedback::InstantEffect) + ?setWidgetDragEffectDuration@HsConfiguration@@QAEXH@Z @ 308 NONAME ; void HsConfiguration::setWidgetDragEffectDuration(int) + ?setInstance@HsWidgetPositioningOnWidgetAdd@@SAXPAV1@@Z @ 309 NONAME ; void HsWidgetPositioningOnWidgetAdd::setInstance(class HsWidgetPositioningOnWidgetAdd *) + ?widgetPresentation@HsDatabase@@QAE_NAAVHsWidgetPresentationData@@@Z @ 310 NONAME ; bool HsDatabase::widgetPresentation(class HsWidgetPresentationData &) + ?pageChangePanDistance@HsConfiguration@@QBEMXZ @ 311 NONAME ; float HsConfiguration::pageChangePanDistance(void) const + ?mInstance@HsContentService@@0PAV1@A @ 312 NONAME ; class HsContentService * HsContentService::mInstance + ??0HsWidgetComponent@@AAE@ABVQString@@PAVQObject@@@Z @ 313 NONAME ; HsWidgetComponent::HsWidgetComponent(class QString const &, class QObject *) + ?startDragEffect@HsWidgetHostVisual@@QAEXXZ @ 314 NONAME ; void HsWidgetHostVisual::startDragEffect(void) + ?insertPage@HsIdleWidget@@QAEXHPAVHsPage@@@Z @ 315 NONAME ; void HsIdleWidget::insertPage(int, class HsPage *) + ?onOrientationChanged@HsPage@@AAEXW4Orientation@Qt@@@Z @ 316 NONAME ; void HsPage::onOrientationChanged(enum Qt::Orientation) + ?adjustedWidgetPosition@HsPage@@QAE?AVQPointF@@ABVQRectF@@@Z @ 317 NONAME ; class QPointF HsPage::adjustedWidgetPosition(class QRectF const &) + ?staticMetaObject@HsWallpaperLoader@@2UQMetaObject@@B @ 318 NONAME ; struct QMetaObject const HsWallpaperLoader::staticMetaObject + ?widgetTapStarted@HsScene@@IAEXVQPointF@@PAVHsWidgetHost@@@Z @ 319 NONAME ; void HsScene::widgetTapStarted(class QPointF, class HsWidgetHost *) + ?widgetDragEffectDuration@HsConfiguration@@QBEHXZ @ 320 NONAME ; int HsConfiguration::widgetDragEffectDuration(void) const + ?tr@HsHostedWidgetFactory@@SA?AVQString@@PBD0H@Z @ 321 NONAME ; class QString HsHostedWidgetFactory::tr(char const *, char const *, int) + ?navigateToApplibrary@HsGui@@IAEXXZ @ 322 NONAME ; void HsGui::navigateToApplibrary(void) + ?load@HsConfiguration@@QAE_NXZ @ 323 NONAME ; bool HsConfiguration::load(void) + ?createInstance@HsPage@@SAPAV1@ABVHsPageData@@@Z @ 324 NONAME ; class HsPage * HsPage::createInstance(class HsPageData const &) + ?widgetPreferences@HsDatabase@@QAE_NHAAV?$QHash@VQString@@VQVariant@@@@@Z @ 325 NONAME ; bool HsDatabase::widgetPreferences(int, class QHash &) + ?removePage@HsScene@@QAE_NPAVHsPage@@@Z @ 326 NONAME ; bool HsScene::removePage(class HsPage *) + ?hideWidget@HsWidgetHost@@QAEXXZ @ 327 NONAME ; void HsWidgetHost::hideWidget(void) + ?close@HsDatabase@@QAEXXZ @ 328 NONAME ; void HsDatabase::close(void) + ?maximumPageCount@HsConfiguration@@QBEHXZ @ 329 NONAME ; int HsConfiguration::maximumPageCount(void) const + ?action_faulted@HsWidgetHost@@AAEXXZ @ 330 NONAME ; void HsWidgetHost::action_faulted(void) + ?setServiceXml@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 331 NONAME ; void HsWidgetComponentDescriptor::setServiceXml(class QString const &) + ?getStaticMetaObject@HsWidgetHost@@SAABUQMetaObject@@XZ @ 332 NONAME ; struct QMetaObject const & HsWidgetHost::getStaticMetaObject(void) + ?sortRects@HsWidgetOrganizer@@AAE?AV?$QList@H@@W4SortMode@1@ABV?$QMap@HVQRectF@@@@@Z @ 333 NONAME ; class QList HsWidgetOrganizer::sortRects(enum HsWidgetOrganizer::SortMode, class QMap const &) + ??0HsWidgetData@@QAE@ABV0@@Z @ 334 NONAME ; HsWidgetData::HsWidgetData(class HsWidgetData const &) + ?installationPath@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 335 NONAME ; class QString HsWidgetComponentDescriptor::installationPath(void) const + ?showHorizontalSnapLine@HsIdleWidget@@QAEXABVQLineF@@@Z @ 336 NONAME ; void HsIdleWidget::showHorizontalSnapLine(class QLineF const &) + ??_EHsPageVisual@@UAE@I@Z @ 337 NONAME ; HsPageVisual::~HsPageVisual(unsigned int) + ?setWidgetDropEffectDuration@HsConfiguration@@QAEXH@Z @ 338 NONAME ; void HsConfiguration::setWidgetDropEffectDuration(int) + ?pageRemovedAnimationDuration@HsConfiguration@@QBEHXZ @ 339 NONAME ; int HsConfiguration::pageRemovedAnimationDuration(void) const + ?onFinished@HsWidgetHost@@AAEXXZ @ 340 NONAME ; void HsWidgetHost::onFinished(void) + ?rollback@HsDatabase@@QAE_NXZ @ 341 NONAME ; bool HsDatabase::rollback(void) + ?widget@HsDatabase@@QAE_NAAVHsWidgetData@@@Z @ 342 NONAME ; bool HsDatabase::widget(class HsWidgetData &) + ?description@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 343 NONAME ; class QString HsWidgetComponentDescriptor::description(void) const + ?mInstance@HsShortcutService@@0PAV1@A @ 344 NONAME ; class HsShortcutService * HsShortcutService::mInstance + ?pageIndicator@HsIdleWidget@@QBEPAVHsPageIndicator@@XZ @ 345 NONAME ; class HsPageIndicator * HsIdleWidget::pageIndicator(void) const + ?setShortcutWidgetTapFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 346 NONAME ; void HsConfiguration::setShortcutWidgetTapFeedbackEffect(enum HbFeedback::InstantEffect) + ?wallpaperDirectory@HsPageWallpaper@@MBE?AVQString@@XZ @ 347 NONAME ; class QString HsPageWallpaper::wallpaperDirectory(void) const + ?qt_metacast@HsWidgetComponent@@UAEPAXPBD@Z @ 348 NONAME ; void * HsWidgetComponent::qt_metacast(char const *) + ?metaObject@HsWallpaperLoaderThread@@UBEPBUQMetaObject@@XZ @ 349 NONAME ; struct QMetaObject const * HsWallpaperLoaderThread::metaObject(void) const + ?setTargetSize@HsWallpaperLoaderThread@@QAEXABVQSize@@@Z @ 350 NONAME ; void HsWallpaperLoaderThread::setTargetSize(class QSize const &) + ?removePage@HsIdleWidget@@QAEXH@Z @ 351 NONAME ; void HsIdleWidget::removePage(int) + ?tr@HsWallpaper@@SA?AVQString@@PBD0H@Z @ 352 NONAME ; class QString HsWallpaper::tr(char const *, char const *, int) + ?defaultPageId@HsConfiguration@@QBEHXZ @ 353 NONAME ; int HsConfiguration::defaultPageId(void) const + ?setSourcePath@HsWallpaperLoader@@QAEXABVQString@@@Z @ 354 NONAME ; void HsWallpaperLoader::setSourcePath(class QString const &) + ?metaObject@HsGui@@UBEPBUQMetaObject@@XZ @ 355 NONAME ; struct QMetaObject const * HsGui::metaObject(void) const + ?pageChangeAnimationEasingCurve@HsConfiguration@@QBE?AW4Type@QEasingCurve@@XZ @ 356 NONAME ; enum QEasingCurve::Type HsConfiguration::pageChangeAnimationEasingCurve(void) const + ?wallpaper@HsPage@@QBEPAVHsWallpaper@@XZ @ 357 NONAME ; class HsWallpaper * HsPage::wallpaper(void) const + ??0HsPageVisual@@QAE@PAVQGraphicsItem@@@Z @ 358 NONAME ; HsPageVisual::HsPageVisual(class QGraphicsItem *) + ?trUtf8@HsWidgetComponent@@SA?AVQString@@PBD0@Z @ 359 NONAME ; class QString HsWidgetComponent::trUtf8(char const *, char const *) + ?event_backupRestoreStarted@HsBackupRestoreObserver@@IAEXXZ @ 360 NONAME ; void HsBackupRestoreObserver::event_backupRestoreStarted(void) + ?getAnchorListIndex@HsWidgetOrganizer@@AAEHABVQPointF@@@Z @ 361 NONAME ; int HsWidgetOrganizer::getAnchorListIndex(class QPointF const &) + ?version@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 362 NONAME ; class QString HsWidgetComponentDescriptor::version(void) const + ?action_disconnectComponent@HsWidgetHost@@AAEXXZ @ 363 NONAME ; void HsWidgetHost::action_disconnectComponent(void) + ?scene@HsSceneWallpaper@@QBEPAVHsScene@@XZ @ 364 NONAME ; class HsScene * HsSceneWallpaper::scene(void) const + ?mInstance@HsConfiguration@@0PAV1@A @ 365 NONAME ; class HsConfiguration * HsConfiguration::mInstance + ?newWidgets@HsPage@@QAE?AV?$QList@PAVHsWidgetHost@@@@XZ @ 366 NONAME ; class QList HsPage::newWidgets(void) + ??0HsHostedWidgetFactory@@AAE@PAVQObject@@@Z @ 367 NONAME ; HsHostedWidgetFactory::HsHostedWidgetFactory(class QObject *) + ?trUtf8@HsContentService@@SA?AVQString@@PBD0@Z @ 368 NONAME ; class QString HsContentService::trUtf8(char const *, char const *) + ?emitUpdated@HsWidgetComponent@@AAEXXZ @ 369 NONAME ; void HsWidgetComponent::emitUpdated(void) + ?emitUninstalled@HsWidgetComponent@@AAEXXZ @ 370 NONAME ; void HsWidgetComponent::emitUninstalled(void) + ?tr@HsConfiguration@@SA?AVQString@@PBD0H@Z @ 371 NONAME ; class QString HsConfiguration::tr(char const *, char const *, int) + ??0HsSceneWallpaper@@QAE@PAVHsScene@@PAVQGraphicsItem@@@Z @ 372 NONAME ; HsSceneWallpaper::HsSceneWallpaper(class HsScene *, class QGraphicsItem *) + ?createTargets@HsPageWallpaper@@MAE?AV?$QHash@VQString@@VQVariant@@@@ABVQString@@@Z @ 373 NONAME ; class QHash HsPageWallpaper::createTargets(class QString const &) + ?mInstance@HsGui@@0PAV1@A @ 374 NONAME ; class HsGui * HsGui::mInstance + ?pageChangeZoneWidth@HsConfiguration@@QBEMXZ @ 375 NONAME ; float HsConfiguration::pageChangeZoneWidth(void) const + ?qt_metacast@HsGui@@UAEPAXPBD@Z @ 376 NONAME ; void * HsGui::qt_metacast(char const *) + ?setInstance@HsGui@@SAPAV1@PAV1@@Z @ 377 NONAME ; class HsGui * HsGui::setInstance(class HsGui *) + ?tr@HsPageWallpaper@@SA?AVQString@@PBD0@Z @ 378 NONAME ; class QString HsPageWallpaper::tr(char const *, char const *) + ?maximumWidgetSizeInPixels@HsConfiguration@@QBE?AVQSizeF@@XZ @ 379 NONAME ; class QSizeF HsConfiguration::maximumWidgetSizeInPixels(void) const + ??_EHsBackupRestoreObserver@@UAE@I@Z @ 380 NONAME ; HsBackupRestoreObserver::~HsBackupRestoreObserver(unsigned int) + ??1HsScene@@UAE@XZ @ 381 NONAME ; HsScene::~HsScene(void) + ?pageWallpaperLayer@HsIdleWidget@@QBEPAVHbWidget@@XZ @ 382 NONAME ; class HbWidget * HsIdleWidget::pageWallpaperLayer(void) const + ?deleteWidgetPresentation@HsDatabase@@QAE_NHW4Orientation@Qt@@@Z @ 383 NONAME ; bool HsDatabase::deleteWidgetPresentation(int, enum Qt::Orientation) + ?setWidgetOrganizerAnchorDistance@HsConfiguration@@QAEXH@Z @ 384 NONAME ; void HsConfiguration::setWidgetOrganizerAnchorDistance(int) + ?getStaticMetaObject@HsWidgetComponent@@SAABUQMetaObject@@XZ @ 385 NONAME ; struct QMetaObject const & HsWidgetComponent::getStaticMetaObject(void) + ?addExistingWidget@HsPage@@QAE_NPAVHsWidgetHost@@@Z @ 386 NONAME ; bool HsPage::addExistingWidget(class HsWidgetHost *) + ?qt_metacast@HsWidgetComponentRegistry@@UAEPAXPBD@Z @ 387 NONAME ; void * HsWidgetComponentRegistry::qt_metacast(char const *) + ?close@HsWidgetHost@@QAEXXZ @ 388 NONAME ; void HsWidgetHost::close(void) + ?action_remove@HsWidgetHost@@AAEXXZ @ 389 NONAME ; void HsWidgetHost::action_remove(void) + ?trUtf8@HsWallpaper@@SA?AVQString@@PBD0H@Z @ 390 NONAME ; class QString HsWallpaper::trUtf8(char const *, char const *, int) + ?activePage@HsScene@@QBEPAVHsPage@@XZ @ 391 NONAME ; class HsPage * HsScene::activePage(void) const + ?bounceEffect@HsConfiguration@@QBEHXZ @ 392 NONAME ; int HsConfiguration::bounceEffect(void) const + ?setupIdleUi@HsGui@@QAEXXZ @ 393 NONAME ; void HsGui::setupIdleUi(void) + ?pages@HsDatabase@@QAE_NAAV?$QList@VHsPageData@@@@@Z @ 394 NONAME ; bool HsDatabase::pages(class QList &) + ?savePresentation@HsWidgetHost@@QAE_NXZ @ 395 NONAME ; bool HsWidgetHost::savePresentation(void) + ?pageChangeAnimation@HsGui@@QAEPAVHsPropertyAnimationWrapper@@XZ @ 396 NONAME ; class HsPropertyAnimationWrapper * HsGui::pageChangeAnimation(void) + ?takeInstance@HsScene@@SAPAV1@XZ @ 397 NONAME ; class HsScene * HsScene::takeInstance(void) + ?rootPath@HsWidgetComponent@@QBE?AVQString@@XZ @ 398 NONAME ; class QString HsWidgetComponent::rootPath(void) const + ?startDragEffect@HsWidgetHost@@QAEXXZ @ 399 NONAME ; void HsWidgetHost::startDragEffect(void) + ?event_startAndHide@HsWidgetHost@@IAEXXZ @ 400 NONAME ; void HsWidgetHost::event_startAndHide(void) + ?qt_metacast@HsWallpaperLoader@@UAEPAXPBD@Z @ 401 NONAME ; void * HsWallpaperLoader::qt_metacast(char const *) + ??1HsDatabase@@UAE@XZ @ 402 NONAME ; HsDatabase::~HsDatabase(void) + ??0HsWidgetOrganizer@@QAE@HW4WidgetOrganizerSearchSequence@HsConfiguration@@@Z @ 403 NONAME ; HsWidgetOrganizer::HsWidgetOrganizer(int, enum HsConfiguration::WidgetOrganizerSearchSequence) + ?getPosition@HsWidgetOrganizer@@AAE?AVQPointF@@ABVQSizeF@@@Z @ 404 NONAME ; class QPointF HsWidgetOrganizer::getPosition(class QSizeF const &) + ??1HsWidgetComponent@@UAE@XZ @ 405 NONAME ; HsWidgetComponent::~HsWidgetComponent(void) + ?metaObject@HsSceneWallpaper@@UBEPBUQMetaObject@@XZ @ 406 NONAME ; struct QMetaObject const * HsSceneWallpaper::metaObject(void) const + ?createInstance@HsWidgetHost@@SAPAV1@AAVHsWidgetData@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 407 NONAME ; class HsWidgetHost * HsWidgetHost::createInstance(class HsWidgetData &, class QHash const &) + ?setupEffects@HsWidgetHostVisual@@AAEXXZ @ 408 NONAME ; void HsWidgetHostVisual::setupEffects(void) + ?trUtf8@HsGui@@SA?AVQString@@PBD0@Z @ 409 NONAME ; class QString HsGui::trUtf8(char const *, char const *) + ?setPage@HsPageWallpaper@@QAEXPAVHsPage@@@Z @ 410 NONAME ; void HsPageWallpaper::setPage(class HsPage *) + ?shape@HsWidgetHostVisual@@UBE?AVQPainterPath@@XZ @ 411 NONAME ; class QPainterPath HsWidgetHostVisual::shape(void) const + ?deletePage@HsDatabase@@QAE_NH@Z @ 412 NONAME ; bool HsDatabase::deletePage(int) + ?savePresentation@HsWidgetHost@@QAE_NAAVHsWidgetPresentationData@@@Z @ 413 NONAME ; bool HsWidgetHost::savePresentation(class HsWidgetPresentationData &) + ?tr@HsWallpaperLoaderThread@@SA?AVQString@@PBD0H@Z @ 414 NONAME ; class QString HsWallpaperLoaderThread::tr(char const *, char const *, int) + ?resized@HsWidgetHostVisual@@IAEXXZ @ 415 NONAME ; void HsWidgetHostVisual::resized(void) + ?page@HsWidgetHost@@QBEPAVHsPage@@XZ @ 416 NONAME ; class HsPage * HsWidgetHost::page(void) const + ?qt_metacast@HsWallpaper@@UAEPAXPBD@Z @ 417 NONAME ; void * HsWallpaper::qt_metacast(char const *) + ?staticMetaObject@HsWidgetComponent@@2UQMetaObject@@B @ 418 NONAME ; struct QMetaObject const HsWidgetComponent::staticMetaObject + ?setRemovable@HsPage@@QAEX_N@Z @ 419 NONAME ; void HsPage::setRemovable(bool) + ?staticMetaObject@HsIdleWidget@@2UQMetaObject@@B @ 420 NONAME ; struct QMetaObject const HsIdleWidget::staticMetaObject + ?showVerticalSnapLine@HsIdleWidget@@QAEXABVQLineF@@@Z @ 421 NONAME ; void HsIdleWidget::showVerticalSnapLine(class QLineF const &) + ?widgetRemoved@HsContentService@@IAEXABVQString@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 422 NONAME ; void HsContentService::widgetRemoved(class QString const &, class QHash const &) + ?widgetMoveUpdated@HsScene@@IAEXABVQPointF@@PAVHsWidgetHost@@@Z @ 423 NONAME ; void HsScene::widgetMoveUpdated(class QPointF const &, class HsWidgetHost *) + ?qt_metacall@HsWallpaperLoaderThread@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 424 NONAME ; int HsWallpaperLoaderThread::qt_metacall(enum QMetaObject::Call, int, void * *) + ?loadPresentation@HsWidgetHost@@QAE_NXZ @ 425 NONAME ; bool HsWidgetHost::loadPresentation(void) + ?setupStates@HsWidgetHost@@AAEXXZ @ 426 NONAME ; void HsWidgetHost::setupStates(void) + ?getStaticMetaObject@HsContentService@@SAABUQMetaObject@@XZ @ 427 NONAME ; struct QMetaObject const & HsContentService::getStaticMetaObject(void) + ?wallpaper@HsScene@@QBEPAVHsWallpaper@@XZ @ 428 NONAME ; class HsWallpaper * HsScene::wallpaper(void) const + ?isItemShortcutWidget@HsShortcutService@@QAE_NH@Z @ 429 NONAME ; bool HsShortcutService::isItemShortcutWidget(int) + ?setGeometry@HsPageVisual@@UAEXABVQRectF@@@Z @ 430 NONAME ; void HsPageVisual::setGeometry(class QRectF const &) + ?tr@HsIdleWidget@@SA?AVQString@@PBD0H@Z @ 431 NONAME ; class QString HsIdleWidget::tr(char const *, char const *, int) + ?setDatabaseName@HsDatabase@@QAEXABVQString@@@Z @ 432 NONAME ; void HsDatabase::setDatabaseName(class QString const &) + ?updateWidget@HsDatabase@@QAE_NABVHsWidgetData@@@Z @ 433 NONAME ; bool HsDatabase::updateWidget(class HsWidgetData const &) + ?trUtf8@HsBackupRestoreObserver@@SA?AVQString@@PBD0H@Z @ 434 NONAME ; class QString HsBackupRestoreObserver::trUtf8(char const *, char const *, int) + ?loadPresentation@HsWidgetHost@@QAE_NW4Orientation@Qt@@@Z @ 435 NONAME ; bool HsWidgetHost::loadPresentation(enum Qt::Orientation) + ?createWidgetForPreview@HsContentService@@QAEPAVHsWidgetHost@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 436 NONAME ; class HsWidgetHost * HsContentService::createWidgetForPreview(class QHash const &) + ?available@HsWidgetHost@@IAEXXZ @ 437 NONAME ; void HsWidgetHost::available(void) + ?setPageChangeZoneWidth@HsConfiguration@@QAEXM@Z @ 438 NONAME ; void HsConfiguration::setPageChangeZoneWidth(float) + ?emitAboutToUninstall@HsWidgetComponent@@AAEXXZ @ 439 NONAME ; void HsWidgetComponent::emitAboutToUninstall(void) + ?iconUri@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 440 NONAME ; class QString HsWidgetComponentDescriptor::iconUri(void) const + ?event_faulted@HsWidgetHost@@IAEXXZ @ 441 NONAME ; void HsWidgetHost::event_faulted(void) + ?emitUnavailable@HsWidgetComponent@@AAEXXZ @ 442 NONAME ; void HsWidgetComponent::emitUnavailable(void) + ?snapTimeout@HsConfiguration@@QBEHXZ @ 443 NONAME ; int HsConfiguration::snapTimeout(void) const + ??1HsWidgetData@@QAE@XZ @ 444 NONAME ; HsWidgetData::~HsWidgetData(void) + ?faulted@HsWidgetHost@@IAEXXZ @ 445 NONAME ; void HsWidgetHost::faulted(void) + ??0HsIdleWidget@@QAE@PAVQGraphicsItem@@@Z @ 446 NONAME ; HsIdleWidget::HsIdleWidget(class QGraphicsItem *) + ?event_unload@HsWidgetHost@@IAEXXZ @ 447 NONAME ; void HsWidgetHost::event_unload(void) + ?handleEntryRemoved@HsWidgetComponentRegistry@@AAEXABVCaEntry@@ABVQString@@@Z @ 448 NONAME ; void HsWidgetComponentRegistry::handleEntryRemoved(class CaEntry const &, class QString const &) + ?metaObject@HsWidgetComponentRegistry@@UBEPBUQMetaObject@@XZ @ 449 NONAME ; struct QMetaObject const * HsWidgetComponentRegistry::metaObject(void) const + ?updated@HsWidgetComponent@@IAEXXZ @ 450 NONAME ; void HsWidgetComponent::updated(void) + ?takeInstance@HsConfiguration@@SAPAV1@XZ @ 451 NONAME ; class HsConfiguration * HsConfiguration::takeInstance(void) + ?pageIndex@HsPage@@QAEHXZ @ 452 NONAME ; int HsPage::pageIndex(void) + ?setTargets@HsWallpaperLoader@@QAEXABV?$QHash@VQString@@VQVariant@@@@@Z @ 453 NONAME ; void HsWallpaperLoader::setTargets(class QHash const &) + ??1HsIdleWidget@@UAE@XZ @ 454 NONAME ; HsIdleWidget::~HsIdleWidget(void) + ??_EHsHostedWidgetFactory@@UAE@I@Z @ 455 NONAME ; HsHostedWidgetFactory::~HsHostedWidgetFactory(unsigned int) + ?staticMetaObject@HsGui@@2UQMetaObject@@B @ 456 NONAME ; struct QMetaObject const HsGui::staticMetaObject + ??0HsWallpaperLoaderThread@@QAE@PAVQObject@@@Z @ 457 NONAME ; HsWallpaperLoaderThread::HsWallpaperLoaderThread(class QObject *) + ?start@HsWallpaperLoader@@QAEXXZ @ 458 NONAME ; void HsWallpaperLoader::start(void) + ?component@HsWidgetComponentRegistry@@QAEPAVHsWidgetComponent@@ABVQString@@@Z @ 459 NONAME ; class HsWidgetComponent * HsWidgetComponentRegistry::component(class QString const &) + ??_EHsWidgetComponent@@UAE@I@Z @ 460 NONAME ; HsWidgetComponent::~HsWidgetComponent(unsigned int) + ?mInstance@HsScene@@0PAV1@A @ 461 NONAME ; class HsScene * HsScene::mInstance + ?getStaticMetaObject@HsGui@@SAABUQMetaObject@@XZ @ 462 NONAME ; struct QMetaObject const & HsGui::getStaticMetaObject(void) + ?trUtf8@HsSceneWallpaper@@SA?AVQString@@PBD0@Z @ 463 NONAME ; class QString HsSceneWallpaper::trUtf8(char const *, char const *) + ??_EHsWidgetHost@@UAE@I@Z @ 464 NONAME ; HsWidgetHost::~HsWidgetHost(unsigned int) + ?minimumWidgetHeight@HsConfiguration@@QBEMXZ @ 465 NONAME ; float HsConfiguration::minimumWidgetHeight(void) const + ?setVisualModel@HsWidgetHostVisual@@QAEXPAVHsWidgetHost@@@Z @ 466 NONAME ; void HsWidgetHostVisual::setVisualModel(class HsWidgetHost *) + ?staticMetaObject@HsShortcutService@@2UQMetaObject@@B @ 467 NONAME ; struct QMetaObject const HsShortcutService::staticMetaObject + ??0HsPageWallpaper@@QAE@PAVHsPage@@PAVQGraphicsItem@@@Z @ 468 NONAME ; HsPageWallpaper::HsPageWallpaper(class HsPage *, class QGraphicsItem *) + ?onSetPreferences@HsWidgetHost@@AAEXABVQStringList@@@Z @ 469 NONAME ; void HsWidgetHost::onSetPreferences(class QStringList const &) + ??1HsWidgetComponentDescriptor@@QAE@XZ @ 470 NONAME ; HsWidgetComponentDescriptor::~HsWidgetComponentDescriptor(void) + ?showPageIndicator@HsIdleWidget@@QAEXXZ @ 471 NONAME ; void HsIdleWidget::showPageIndicator(void) + ??1HsBackupRestoreObserver@@UAE@XZ @ 472 NONAME ; HsBackupRestoreObserver::~HsBackupRestoreObserver(void) + ?insertPage@HsDatabase@@QAE_NAAVHsPageData@@@Z @ 473 NONAME ; bool HsDatabase::insertPage(class HsPageData &) + ??_EHsWidgetComponentRegistry@@UAE@I@Z @ 474 NONAME ; HsWidgetComponentRegistry::~HsWidgetComponentRegistry(unsigned int) + ?metaObject@HsIdleWidget@@UBEPBUQMetaObject@@XZ @ 475 NONAME ; struct QMetaObject const * HsIdleWidget::metaObject(void) const + ?qt_metacast@HsHostedWidgetFactory@@UAEPAXPBD@Z @ 476 NONAME ; void * HsHostedWidgetFactory::qt_metacast(char const *) + ?setUri@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 477 NONAME ; void HsWidgetComponentDescriptor::setUri(class QString const &) + ??1HsWallpaperLoaderThread@@UAE@XZ @ 478 NONAME ; HsWallpaperLoaderThread::~HsWallpaperLoaderThread(void) + ?staticMetaObject@HsWidgetComponentRegistry@@2UQMetaObject@@B @ 479 NONAME ; struct QMetaObject const HsWidgetComponentRegistry::staticMetaObject + ??1HsWallpaper@@UAE@XZ @ 480 NONAME ; HsWallpaper::~HsWallpaper(void) + ?qt_metacall@HsPage@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 481 NONAME ; int HsPage::qt_metacall(enum QMetaObject::Call, int, void * *) + ?onWidgetAvailable@HsPage@@AAEXXZ @ 482 NONAME ; void HsPage::onWidgetAvailable(void) + ?convert@HsWidgetOrganizer@@UAE?AV?$QList@VQRectF@@@@ABVQRectF@@ABV2@1ABVQPointF@@@Z @ 483 NONAME ; class QList HsWidgetOrganizer::convert(class QRectF const &, class QList const &, class QList const &, class QPointF const &) + ?qt_metacast@HsPage@@UAEPAXPBD@Z @ 484 NONAME ; void * HsPage::qt_metacast(char const *) + ?result@HsWallpaperLoaderThread@@QBE_NXZ @ 485 NONAME ; bool HsWallpaperLoaderThread::result(void) const + ?setPageIndicatorSpacing@HsConfiguration@@QAEXM@Z @ 486 NONAME ; void HsConfiguration::setPageIndicatorSpacing(float) + ?setSnapLineFadeInDuration@HsConfiguration@@QAEXH@Z @ 487 NONAME ; void HsConfiguration::setSnapLineFadeInDuration(int) + ??1HsGui@@UAE@XZ @ 488 NONAME ; HsGui::~HsGui(void) + ?isValid@HsWidgetComponentDescriptor@@QAE_NXZ @ 489 NONAME ; bool HsWidgetComponentDescriptor::isValid(void) + ?uri@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 490 NONAME ; class QString HsWidgetComponentDescriptor::uri(void) const + ?setOrientation@HsGui@@QAEXW4Orientation@Qt@@@Z @ 491 NONAME ; void HsGui::setOrientation(enum Qt::Orientation) + ?tr@HsWidgetComponentRegistry@@SA?AVQString@@PBD0@Z @ 492 NONAME ; class QString HsWidgetComponentRegistry::tr(char const *, char const *) + ?getStaticMetaObject@HsPage@@SAABUQMetaObject@@XZ @ 493 NONAME ; struct QMetaObject const & HsPage::getStaticMetaObject(void) + ?onWidgetFaulted@HsPage@@AAEXXZ @ 494 NONAME ; void HsPage::onWidgetFaulted(void) + ?page@HsPageWallpaper@@QBEPAVHsPage@@XZ @ 495 NONAME ; class HsPage * HsPageWallpaper::page(void) const + ?qt_metacast@HsBackupRestoreObserver@@UAEPAXPBD@Z @ 496 NONAME ; void * HsBackupRestoreObserver::qt_metacast(char const *) + ?setTargetPath@HsWallpaperLoaderThread@@QAEXABVQString@@@Z @ 497 NONAME ; void HsWallpaperLoaderThread::setTargetPath(class QString const &) + ??1HsWidgetPositioningOnWidgetAdd@@UAE@XZ @ 498 NONAME ; HsWidgetPositioningOnWidgetAdd::~HsWidgetPositioningOnWidgetAdd(void) + ?setSnapTimeout@HsConfiguration@@QAEXH@Z @ 499 NONAME ; void HsConfiguration::setSnapTimeout(int) + ?createTargets@HsSceneWallpaper@@MAE?AV?$QHash@VQString@@VQVariant@@@@ABVQString@@@Z @ 500 NONAME ; class QHash HsSceneWallpaper::createTargets(class QString const &) + ?onWidgetResized@HsPage@@AAEXXZ @ 501 NONAME ; void HsPage::onWidgetResized(void) + ?showWidgets@HsPage@@QAEXXZ @ 502 NONAME ; void HsPage::showWidgets(void) + ?checkBUR@HsBackupRestoreObserver@@QAE_NXZ @ 503 NONAME ; bool HsBackupRestoreObserver::checkBUR(void) + ?startWidget@HsWidgetHost@@QAEX_N@Z @ 504 NONAME ; void HsWidgetHost::startWidget(bool) + ??_EHsShortcutService@@UAE@I@Z @ 505 NONAME ; HsShortcutService::~HsShortcutService(unsigned int) + ?bounceFeedbackEffectDistance@HsConfiguration@@QBEMXZ @ 506 NONAME ; float HsConfiguration::bounceFeedbackEffectDistance(void) const + ?unavailable@HsWidgetHost@@IAEXXZ @ 507 NONAME ; void HsWidgetHost::unavailable(void) + ?qt_metacall@HsDatabase@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 508 NONAME ; int HsDatabase::qt_metacall(enum QMetaObject::Call, int, void * *) + ?searchPositionColumnByColumn@HsWidgetOrganizer@@AAE?AVQPointF@@V2@HH@Z @ 509 NONAME ; class QPointF HsWidgetOrganizer::searchPositionColumnByColumn(class QPointF, int, int) + ?contentRect@HsPage@@QAE?AVQRectF@@W4Orientation@Qt@@@Z @ 510 NONAME ; class QRectF HsPage::contentRect(enum Qt::Orientation) + ?contentGeometry@HsPage@@QAE?AVQRectF@@XZ @ 511 NONAME ; class QRectF HsPage::contentGeometry(void) + ?setHidden@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 512 NONAME ; void HsWidgetComponentDescriptor::setHidden(class QString const &) + ?widgets@HsDatabase@@QAE_NHAAV?$QList@VHsWidgetData@@@@@Z @ 513 NONAME ; bool HsDatabase::widgets(int, class QList &) + ??_EHsPageWallpaper@@UAE@I@Z @ 514 NONAME ; HsPageWallpaper::~HsPageWallpaper(unsigned int) + ?databaseId@HsPage@@QBEHXZ @ 515 NONAME ; int HsPage::databaseId(void) const + ?tr@HsWallpaperLoader@@SA?AVQString@@PBD0@Z @ 516 NONAME ; class QString HsWallpaperLoader::tr(char const *, char const *) + ?show@HsGui@@QAEXXZ @ 517 NONAME ; void HsGui::show(void) + ??0HsGui@@AAE@PAVQObject@@@Z @ 518 NONAME ; HsGui::HsGui(class QObject *) + ?qt_metacall@HsBackupRestoreObserver@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 519 NONAME ; int HsBackupRestoreObserver::qt_metacall(enum QMetaObject::Call, int, void * *) + ??_EHsWallpaperLoaderThread@@UAE@I@Z @ 520 NONAME ; HsWallpaperLoaderThread::~HsWallpaperLoaderThread(unsigned int) + ?resolveRootPathAndTranslationFilename@HsWidgetComponent@@AAEXXZ @ 521 NONAME ; void HsWidgetComponent::resolveRootPathAndTranslationFilename(void) + ?isSnapEnabled@HsConfiguration@@QBE_NXZ @ 522 NONAME ; bool HsConfiguration::isSnapEnabled(void) const + ?maximumWidgetHeight@HsConfiguration@@QBEMXZ @ 523 NONAME ; float HsConfiguration::maximumWidgetHeight(void) const + ?backupRestoreCompleted@HsBackupRestoreObserver@@QAEXXZ @ 524 NONAME ; void HsBackupRestoreObserver::backupRestoreCompleted(void) + ?setPageRemovedAnimationDuration@HsConfiguration@@QAEXH@Z @ 525 NONAME ; void HsConfiguration::setPageRemovedAnimationDuration(int) + ?insertWidget@HsDatabase@@QAE_NAAVHsWidgetData@@@Z @ 526 NONAME ; bool HsDatabase::insertWidget(class HsWidgetData &) + ??1HsShortcutService@@UAE@XZ @ 527 NONAME ; HsShortcutService::~HsShortcutService(void) + ?setupTouchArea@HsWidgetHostVisual@@AAEXXZ @ 528 NONAME ; void HsWidgetHostVisual::setupTouchArea(void) + ?setBounceFeedbackEffectDistance@HsConfiguration@@QAEXM@Z @ 529 NONAME ; void HsConfiguration::setBounceFeedbackEffectDistance(float) + ?onEntryChanged@HsWidgetComponentRegistry@@AAEXABVCaEntry@@W4ChangeType@@@Z @ 530 NONAME ; void HsWidgetComponentRegistry::onEntryChanged(class CaEntry const &, enum ChangeType) + ?getPresentation@HsWidgetHost@@QAE_NAAVHsWidgetPresentationData@@@Z @ 531 NONAME ; bool HsWidgetHost::getPresentation(class HsWidgetPresentationData &) + ?getStaticMetaObject@HsSceneWallpaper@@SAABUQMetaObject@@XZ @ 532 NONAME ; struct QMetaObject const & HsSceneWallpaper::getStaticMetaObject(void) + ?tr@HsScene@@SA?AVQString@@PBD0H@Z @ 533 NONAME ; class QString HsScene::tr(char const *, char const *, int) + ?uri@HsWidgetComponent@@QBE?AVQString@@XZ @ 534 NONAME ; class QString HsWidgetComponent::uri(void) const + ?instance@HsContentService@@SAPAV1@XZ @ 535 NONAME ; class HsContentService * HsContentService::instance(void) + ?snapGap@HsConfiguration@@QBEMXZ @ 536 NONAME ; float HsConfiguration::snapGap(void) const + ?widgetOrganizerAnchorDistance@HsConfiguration@@QBEHXZ @ 537 NONAME ; int HsConfiguration::widgetOrganizerAnchorDistance(void) const + ?savePresentation@HsWidgetHost@@QAE_NW4Orientation@Qt@@@Z @ 538 NONAME ; bool HsWidgetHost::savePresentation(enum Qt::Orientation) + ?setWidgetDropToTrashbinFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 539 NONAME ; void HsConfiguration::setWidgetDropToTrashbinFeedbackEffect(enum HbFeedback::InstantEffect) + ?tr@HsIdleWidget@@SA?AVQString@@PBD0@Z @ 540 NONAME ; class QString HsIdleWidget::tr(char const *, char const *) + ?title@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 541 NONAME ; class QString HsWidgetComponentDescriptor::title(void) const + ?convert@HsAnchorPointInCenter@@UAE?AV?$QList@VQRectF@@@@ABVQRectF@@ABV2@1ABVQPointF@@@Z @ 542 NONAME ; class QList HsAnchorPointInCenter::convert(class QRectF const &, class QList const &, class QList const &, class QPointF const &) + ?event_hide@HsWidgetHost@@IAEXXZ @ 543 NONAME ; void HsWidgetHost::event_hide(void) + ?databaseId@HsScene@@QBEHXZ @ 544 NONAME ; int HsScene::databaseId(void) const + ?setWidgetDropFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 545 NONAME ; void HsConfiguration::setWidgetDropFeedbackEffect(enum HbFeedback::InstantEffect) + ??1HsWidgetComponentRegistry@@UAE@XZ @ 546 NONAME ; HsWidgetComponentRegistry::~HsWidgetComponentRegistry(void) + ?setDescription@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 547 NONAME ; void HsWidgetComponentDescriptor::setDescription(class QString const &) + ?getStaticMetaObject@HsConfiguration@@SAABUQMetaObject@@XZ @ 548 NONAME ; struct QMetaObject const & HsConfiguration::getStaticMetaObject(void) + ?staticMetaObject@HsSceneWallpaper@@2UQMetaObject@@B @ 549 NONAME ; struct QMetaObject const HsSceneWallpaper::staticMetaObject + ?isRunning@HsWallpaperLoader@@QBE_NXZ @ 550 NONAME ; bool HsWallpaperLoader::isRunning(void) const + ?activePageChanged@HsScene@@IAEXXZ @ 551 NONAME ; void HsScene::activePageChanged(void) + ?uninstalled@HsWidgetComponent@@IAEXXZ @ 552 NONAME ; void HsWidgetComponent::uninstalled(void) + ??1HsHostedWidgetFactory@@UAE@XZ @ 553 NONAME ; HsHostedWidgetFactory::~HsHostedWidgetFactory(void) + ?trUtf8@HsShortcutService@@SA?AVQString@@PBD0@Z @ 554 NONAME ; class QString HsShortcutService::trUtf8(char const *, char const *) + ?setPage@HsWidgetHost@@QAE_NPAVHsPage@@@Z @ 555 NONAME ; bool HsWidgetHost::setPage(class HsPage *) + ??_EHsScene@@UAE@I@Z @ 556 NONAME ; HsScene::~HsScene(unsigned int) + ?metaObject@HsScene@@UBEPBUQMetaObject@@XZ @ 557 NONAME ; struct QMetaObject const * HsScene::metaObject(void) const + ?pageTapAndHoldFinished@HsScene@@IAEXPAVQGestureEvent@@@Z @ 558 NONAME ; void HsScene::pageTapAndHoldFinished(class QGestureEvent *) + ?remove@HsWidgetHost@@QAEXXZ @ 559 NONAME ; void HsWidgetHost::remove(void) + ?run@HsWallpaperLoaderThread@@MAEXXZ @ 560 NONAME ; void HsWallpaperLoaderThread::run(void) + ?maximumWidgetSizeInUnits@HsConfiguration@@QBE?AVQSizeF@@XZ @ 561 NONAME ; class QSizeF HsConfiguration::maximumWidgetSizeInUnits(void) const + ?getStaticMetaObject@HsScene@@SAABUQMetaObject@@XZ @ 562 NONAME ; struct QMetaObject const & HsScene::getStaticMetaObject(void) + ?finished@HsWallpaperLoader@@IAEXXZ @ 563 NONAME ; void HsWallpaperLoader::finished(void) + ?visual@HsPage@@QBEPAVHsPageVisual@@XZ @ 564 NONAME ; class HsPageVisual * HsPage::visual(void) const + ?snapLineFadeOutDuration@HsConfiguration@@QBEHXZ @ 565 NONAME ; int HsConfiguration::snapLineFadeOutDuration(void) const + ?trUtf8@HsPageWallpaper@@SA?AVQString@@PBD0H@Z @ 566 NONAME ; class QString HsPageWallpaper::trUtf8(char const *, char const *, int) + ?setNewSize@HsWidgetHostVisual@@AAEXABVQSizeF@@@Z @ 567 NONAME ; void HsWidgetHostVisual::setNewSize(class QSizeF const &) + ?imageSet@HsWallpaper@@IAEXXZ @ 568 NONAME ; void HsWallpaper::imageSet(void) + ?tr@HsWidgetHostVisual@@SA?AVQString@@PBD0H@Z @ 569 NONAME ; class QString HsWidgetHostVisual::tr(char const *, char const *, int) + ?sceneType@HsConfiguration@@QBE?AW4SceneType@1@XZ @ 570 NONAME ; enum HsConfiguration::SceneType HsConfiguration::sceneType(void) const + ?tr@HsPage@@SA?AVQString@@PBD0H@Z @ 571 NONAME ; class QString HsPage::tr(char const *, char const *, int) + ?setNewPageAddedAnimationDuration@HsConfiguration@@QAEXH@Z @ 572 NONAME ; void HsConfiguration::setNewPageAddedAnimationDuration(int) + ??_EHsGui@@UAE@I@Z @ 573 NONAME ; HsGui::~HsGui(unsigned int) + ?isAvailable@HsWidgetComponent@@QBE_NXZ @ 574 NONAME ; bool HsWidgetComponent::isAvailable(void) const + ?updateWidgetZValues@HsDatabase@@QAE_NABV?$QHash@HM@@W4Orientation@Qt@@@Z @ 575 NONAME ; bool HsDatabase::updateWidgetZValues(class QHash const &, enum Qt::Orientation) + ?staticMetaObject@HsConfiguration@@2UQMetaObject@@B @ 576 NONAME ; struct QMetaObject const HsConfiguration::staticMetaObject + ?checkConnection@HsDatabase@@ABE_NXZ @ 577 NONAME ; bool HsDatabase::checkConnection(void) const + ?takeInstance@HsDatabase@@SAPAV1@XZ @ 578 NONAME ; class HsDatabase * HsDatabase::takeInstance(void) + ?tr@HsWallpaper@@SA?AVQString@@PBD0@Z @ 579 NONAME ; class QString HsWallpaper::tr(char const *, char const *) + ?deleteWidgets@HsDatabase@@QAE_NABVQString@@@Z @ 580 NONAME ; bool HsDatabase::deleteWidgets(class QString const &) + ?searchSpace@HsWidgetOrganizer@@AAE?AVQPointF@@W4SearchMode@1@V2@H@Z @ 581 NONAME ; class QPointF HsWidgetOrganizer::searchSpace(enum HsWidgetOrganizer::SearchMode, class QPointF, int) + ??0HsPageData@@QAE@XZ @ 582 NONAME ; HsPageData::HsPageData(void) + ?tr@HsSceneWallpaper@@SA?AVQString@@PBD0H@Z @ 583 NONAME ; class QString HsSceneWallpaper::tr(char const *, char const *, int) + ?pageIndicatorSpacing@HsConfiguration@@QBEMXZ @ 584 NONAME ; float HsConfiguration::pageIndicatorSpacing(void) const + ?getStaticMetaObject@HsShortcutService@@SAABUQMetaObject@@XZ @ 585 NONAME ; struct QMetaObject const & HsShortcutService::getStaticMetaObject(void) + ?isRemovable@HsPage@@QBE_NXZ @ 586 NONAME ; bool HsPage::isRemovable(void) const + ?setDatabaseId@HsPage@@QAEXH@Z @ 587 NONAME ; void HsPage::setDatabaseId(int) + ?trUtf8@HsIdleWidget@@SA?AVQString@@PBD0@Z @ 588 NONAME ; class QString HsIdleWidget::trUtf8(char const *, char const *) + ?staticMetaObject@HsBackupRestoreObserver@@2UQMetaObject@@B @ 589 NONAME ; struct QMetaObject const HsBackupRestoreObserver::staticMetaObject + ?pageChangeAnimationDuration@HsConfiguration@@QBEHXZ @ 590 NONAME ; int HsConfiguration::pageChangeAnimationDuration(void) const + ?widgetTapAndHoldFinished@HsScene@@IAEXPAVQGestureEvent@@PAVHsWidgetHost@@@Z @ 591 NONAME ; void HsScene::widgetTapAndHoldFinished(class QGestureEvent *, class HsWidgetHost *) + ?metaObject@HsPageWallpaper@@UBEPBUQMetaObject@@XZ @ 592 NONAME ; struct QMetaObject const * HsPageWallpaper::metaObject(void) const + ?tr@HsGui@@SA?AVQString@@PBD0H@Z @ 593 NONAME ; class QString HsGui::tr(char const *, char const *, int) + ?updatePage@HsDatabase@@QAE_NABVHsPageData@@@Z @ 594 NONAME ; bool HsDatabase::updatePage(class HsPageData const &) + ?action_uninitialize@HsWidgetHost@@AAEXXZ @ 595 NONAME ; void HsWidgetHost::action_uninitialize(void) + ??_EHsWallpaperLoader@@UAE@I@Z @ 596 NONAME ; HsWallpaperLoader::~HsWallpaperLoader(unsigned int) + ??_EHsWallpaper@@UAE@I@Z @ 597 NONAME ; HsWallpaper::~HsWallpaper(unsigned int) + ?action_connectComponent@HsWidgetHost@@AAEXXZ @ 598 NONAME ; void HsWidgetHost::action_connectComponent(void) + ?setImage@HsWallpaper@@QAEXABVQString@@@Z @ 599 NONAME ; void HsWallpaper::setImage(class QString const &) + ?setPageChangeAnimationDuration@HsConfiguration@@QAEXH@Z @ 600 NONAME ; void HsConfiguration::setPageChangeAnimationDuration(int) + ??0HsSceneData@@QAE@XZ @ 601 NONAME ; HsSceneData::HsSceneData(void) + ?hasSignal@HsWidgetHost@@AAE_NPBD@Z @ 602 NONAME ; bool HsWidgetHost::hasSignal(char const *) + ?getStaticMetaObject@HsWidgetHostVisual@@SAABUQMetaObject@@XZ @ 603 NONAME ; struct QMetaObject const & HsWidgetHostVisual::getStaticMetaObject(void) + ?getStaticMetaObject@HsWallpaper@@SAABUQMetaObject@@XZ @ 604 NONAME ; struct QMetaObject const & HsWallpaper::getStaticMetaObject(void) + ?trUtf8@HsWallpaper@@SA?AVQString@@PBD0@Z @ 605 NONAME ; class QString HsWallpaper::trUtf8(char const *, char const *) + ??0HsWidgetHost@@QAE@HPAVQObject@@@Z @ 606 NONAME ; HsWidgetHost::HsWidgetHost(int, class QObject *) + ?emitWidgetRemoved@HsContentService@@QAEXABVQString@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 607 NONAME ; void HsContentService::emitWidgetRemoved(class QString const &, class QHash const &) + ?pages@HsScene@@QBE?AV?$QList@PAVHsPage@@@@XZ @ 608 NONAME ; class QList HsScene::pages(void) const + ??1HsConfiguration@@UAE@XZ @ 609 NONAME ; HsConfiguration::~HsConfiguration(void) + ?trashBin@HsIdleWidget@@QBEPAVHsTrashBinWidget@@XZ @ 610 NONAME ; class HsTrashBinWidget * HsIdleWidget::trashBin(void) const + ?translationFilename@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 611 NONAME ; class QString HsWidgetComponentDescriptor::translationFilename(void) const + ?trUtf8@HsConfiguration@@SA?AVQString@@PBD0@Z @ 612 NONAME ; class QString HsConfiguration::trUtf8(char const *, char const *) + ?instance@HsScene@@SAPAV1@XZ @ 613 NONAME ; class HsScene * HsScene::instance(void) + ?eventFilter@HsScene@@MAE_NPAVQObject@@PAVQEvent@@@Z @ 614 NONAME ; bool HsScene::eventFilter(class QObject *, class QEvent *) + ?trUtf8@HsPage@@SA?AVQString@@PBD0H@Z @ 615 NONAME ; class QString HsPage::trUtf8(char const *, char const *, int) + ?isDefaultPage@HsPage@@QBE_NXZ @ 616 NONAME ; bool HsPage::isDefaultPage(void) const + ??_EHsDatabase@@UAE@I@Z @ 617 NONAME ; HsDatabase::~HsDatabase(unsigned int) + ?event_startAndShow@HsWidgetHost@@IAEXXZ @ 618 NONAME ; void HsWidgetHost::event_startAndShow(void) + ?layoutRect@HsGui@@QBE?AVQRectF@@XZ @ 619 NONAME ; class QRectF HsGui::layoutRect(void) const + ?trUtf8@HsContentService@@SA?AVQString@@PBD0H@Z @ 620 NONAME ; class QString HsContentService::trUtf8(char const *, char const *, int) + ?setMinimumWidgetHeight@HsConfiguration@@QAEXM@Z @ 621 NONAME ; void HsConfiguration::setMinimumWidgetHeight(float) + ?pageTapFinished@HsScene@@IAEXPAVQGestureEvent@@@Z @ 622 NONAME ; void HsScene::pageTapFinished(class QGestureEvent *) + ?unavailable@HsWidgetComponent@@IAEXXZ @ 623 NONAME ; void HsWidgetComponent::unavailable(void) + ?isShortcutLabelVisible@HsConfiguration@@QBE_NXZ @ 624 NONAME ; bool HsConfiguration::isShortcutLabelVisible(void) const + ?setPageChangeZoneReverseAnimationDuration@HsConfiguration@@QAEXH@Z @ 625 NONAME ; void HsConfiguration::setPageChangeZoneReverseAnimationDuration(int) + ?getStaticMetaObject@HsIdleWidget@@SAABUQMetaObject@@XZ @ 626 NONAME ; struct QMetaObject const & HsIdleWidget::getStaticMetaObject(void) + ?qt_metacall@HsWidgetHostVisual@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 627 NONAME ; int HsWidgetHostVisual::qt_metacall(enum QMetaObject::Call, int, void * *) + ?tr@HsDatabase@@SA?AVQString@@PBD0H@Z @ 628 NONAME ; class QString HsDatabase::tr(char const *, char const *, int) + ?instance@HsWidgetComponentRegistry@@SAPAV1@XZ @ 629 NONAME ; class HsWidgetComponentRegistry * HsWidgetComponentRegistry::instance(void) + ?serviceXml@HsWidgetComponentDescriptor@@QBE?AVQString@@XZ @ 630 NONAME ; class QString HsWidgetComponentDescriptor::serviceXml(void) const + ?qt_metacall@HsWallpaperLoader@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 631 NONAME ; int HsWallpaperLoader::qt_metacall(enum QMetaObject::Call, int, void * *) + ??_EHsSceneWallpaper@@UAE@I@Z @ 632 NONAME ; HsSceneWallpaper::~HsSceneWallpaper(unsigned int) + ?instance@HsDatabase@@SAPAV1@XZ @ 633 NONAME ; class HsDatabase * HsDatabase::instance(void) + ?setTranslationFilename@HsWidgetComponentDescriptor@@QAEXABVQString@@@Z @ 634 NONAME ; void HsWidgetComponentDescriptor::setTranslationFilename(class QString const &) + ?onLoaderFinished@HsWallpaper@@AAEXXZ @ 635 NONAME ; void HsWallpaper::onLoaderFinished(void) + ?qt_metacall@HsIdleWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 636 NONAME ; int HsIdleWidget::qt_metacall(enum QMetaObject::Call, int, void * *) + ?addWidget@HsContentService@@QAE_NABVQString@@ABV?$QHash@VQString@@VQVariant@@@@ABVQVariant@@@Z @ 637 NONAME ; bool HsContentService::addWidget(class QString const &, class QHash const &, class QVariant const &) + ?shortcutWidgetTapFeedbackEffect@HsConfiguration@@QBE?AW4InstantEffect@HbFeedback@@XZ @ 638 NONAME ; enum HbFeedback::InstantEffect HsConfiguration::shortcutWidgetTapFeedbackEffect(void) const + ?widgetMoveFinished@HsScene@@IAEXABVQPointF@@PAVHsWidgetHost@@@Z @ 639 NONAME ; void HsScene::widgetMoveFinished(class QPointF const &, class HsWidgetHost *) + ?setInstance@HsScene@@SAXPAV1@@Z @ 640 NONAME ; void HsScene::setInstance(class HsScene *) + ?tr@HsPageVisual@@SA?AVQString@@PBD0H@Z @ 641 NONAME ; class QString HsPageVisual::tr(char const *, char const *, int) + ??_EHsContentService@@UAE@I@Z @ 642 NONAME ; HsContentService::~HsContentService(unsigned int) + ?trUtf8@HsDatabase@@SA?AVQString@@PBD0H@Z @ 643 NONAME ; class QString HsDatabase::trUtf8(char const *, char const *, int) + ?action_hide@HsWidgetHost@@AAEXXZ @ 644 NONAME ; void HsWidgetHost::action_hide(void) + ?addNewWidget@HsPage@@QAE_NPAVHsWidgetHost@@ABVQPointF@@@Z @ 645 NONAME ; bool HsPage::addNewWidget(class HsWidgetHost *, class QPointF const &) + ?removePresentation@HsWidgetHost@@QAE_NW4Orientation@Qt@@@Z @ 646 NONAME ; bool HsWidgetHost::removePresentation(enum Qt::Orientation) + ?staticMetaObject@HsContentService@@2UQMetaObject@@B @ 647 NONAME ; struct QMetaObject const HsContentService::staticMetaObject + ?tr@HsWidgetHost@@SA?AVQString@@PBD0H@Z @ 648 NONAME ; class QString HsWidgetHost::tr(char const *, char const *, int) + ?setWidgetRepositionFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 649 NONAME ; void HsConfiguration::setWidgetRepositionFeedbackEffect(enum HbFeedback::InstantEffect) + ?gestureEvent@HsWidgetHostVisual@@MAEXPAVQGestureEvent@@@Z @ 650 NONAME ; void HsWidgetHostVisual::gestureEvent(class QGestureEvent *) + ??1HsWidgetOrganizer@@UAE@XZ @ 651 NONAME ; HsWidgetOrganizer::~HsWidgetOrganizer(void) + ?metaObject@HsBackupRestoreObserver@@UBEPBUQMetaObject@@XZ @ 652 NONAME ; struct QMetaObject const * HsBackupRestoreObserver::metaObject(void) const + ?instance@HsGui@@SAPAV1@XZ @ 653 NONAME ; class HsGui * HsGui::instance(void) + ?getStaticMetaObject@HsHostedWidgetFactory@@SAABUQMetaObject@@XZ @ 654 NONAME ; struct QMetaObject const & HsHostedWidgetFactory::getStaticMetaObject(void) + ?pageIndex@HsPageVisual@@QBEHXZ @ 655 NONAME ; int HsPageVisual::pageIndex(void) const + ?qt_metacall@HsScene@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 656 NONAME ; int HsScene::qt_metacall(enum QMetaObject::Call, int, void * *) + ?setExistingImage@HsWallpaper@@IAE_NXZ @ 657 NONAME ; bool HsWallpaper::setExistingImage(void) + ?setPageChangeFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 658 NONAME ; void HsConfiguration::setPageChangeFeedbackEffect(enum HbFeedback::InstantEffect) + ?trUtf8@HsHostedWidgetFactory@@SA?AVQString@@PBD0H@Z @ 659 NONAME ; class QString HsHostedWidgetFactory::trUtf8(char const *, char const *, int) + ?trUtf8@HsConfiguration@@SA?AVQString@@PBD0H@Z @ 660 NONAME ; class QString HsConfiguration::trUtf8(char const *, char const *, int) + ?minimumWidgetSizeInPixels@HsConfiguration@@QBE?AVQSizeF@@XZ @ 661 NONAME ; class QSizeF HsConfiguration::minimumWidgetSizeInPixels(void) const + ?sourcePath@HsWallpaperLoaderThread@@QBE?AVQString@@XZ @ 662 NONAME ; class QString HsWallpaperLoaderThread::sourcePath(void) const + ?event_finished@HsWidgetHost@@IAEXXZ @ 663 NONAME ; void HsWidgetHost::event_finished(void) + ?widgets@HsPage@@QBE?AV?$QList@PAVHsWidgetHost@@@@XZ @ 664 NONAME ; class QList HsPage::widgets(void) const + ?setPageMargin@HsConfiguration@@QAEXM@Z @ 665 NONAME ; void HsConfiguration::setPageMargin(float) + ?parallaxFactor@HsIdleWidget@@QBEMXZ @ 666 NONAME ; float HsIdleWidget::parallaxFactor(void) const + ?setOnline@HsWidgetHost@@QAEX_N@Z @ 667 NONAME ; void HsWidgetHost::setOnline(bool) + ?setPreferencesToWidget@HsWidgetHost@@AAE_NXZ @ 668 NONAME ; bool HsWidgetHost::setPreferencesToWidget(void) + ?setWidgetPickFeedbackEffect@HsConfiguration@@QAEXW4InstantEffect@HbFeedback@@@Z @ 669 NONAME ; void HsConfiguration::setWidgetPickFeedbackEffect(enum HbFeedback::InstantEffect) + ?getStaticMetaObject@HsPageWallpaper@@SAABUQMetaObject@@XZ @ 670 NONAME ; struct QMetaObject const & HsPageWallpaper::getStaticMetaObject(void) + ??0HsWidgetHostVisual@@QAE@PAVQGraphicsItem@@@Z @ 671 NONAME ; HsWidgetHostVisual::HsWidgetHostVisual(class QGraphicsItem *) + ?trUtf8@HsIdleWidget@@SA?AVQString@@PBD0H@Z @ 672 NONAME ; class QString HsIdleWidget::trUtf8(char const *, char const *, int) + ??0HsContentService@@QAE@PAVQObject@@@Z @ 673 NONAME ; HsContentService::HsContentService(class QObject *) + ?trUtf8@HsWidgetComponentRegistry@@SA?AVQString@@PBD0H@Z @ 674 NONAME ; class QString HsWidgetComponentRegistry::trUtf8(char const *, char const *, int) + ?targetPath@HsWallpaperLoaderThread@@QBE?AVQString@@XZ @ 675 NONAME ; class QString HsWallpaperLoaderThread::targetPath(void) const + ?staticMetaObject@HsWallpaper@@2UQMetaObject@@B @ 676 NONAME ; struct QMetaObject const HsWallpaper::staticMetaObject + ??_EHsAnchorPointInCenter@@UAE@I@Z @ 677 NONAME ; HsAnchorPointInCenter::~HsAnchorPointInCenter(unsigned int) + ?trUtf8@HsGui@@SA?AVQString@@PBD0H@Z @ 678 NONAME ; class QString HsGui::trUtf8(char const *, char const *, int) + ?metaObject@HsPageVisual@@UBEPBUQMetaObject@@XZ @ 679 NONAME ; struct QMetaObject const * HsPageVisual::metaObject(void) const + ?tr@HsWidgetComponent@@SA?AVQString@@PBD0@Z @ 680 NONAME ; class QString HsWidgetComponent::tr(char const *, char const *) + ?tr@HsHostedWidgetFactory@@SA?AVQString@@PBD0@Z @ 681 NONAME ; class QString HsHostedWidgetFactory::tr(char const *, char const *) + ?setBounceEffect@HsConfiguration@@QAEXH@Z @ 682 NONAME ; void HsConfiguration::setBounceEffect(int) + ??0HsPage@@QAE@PAVQObject@@@Z @ 683 NONAME ; HsPage::HsPage(class QObject *) + ?qt_metacast@HsDatabase@@UAEPAXPBD@Z @ 684 NONAME ; void * HsDatabase::qt_metacast(char const *) + ?registerService@HsWidgetComponentRegistry@@AAEXABVCaEntry@@ABVQString@@_N@Z @ 685 NONAME ; void HsWidgetComponentRegistry::registerService(class CaEntry const &, class QString const &, bool) + ?trUtf8@HsBackupRestoreObserver@@SA?AVQString@@PBD0@Z @ 686 NONAME ; class QString HsBackupRestoreObserver::trUtf8(char const *, char const *) + ?metaObject@HsWidgetHost@@UBEPBUQMetaObject@@XZ @ 687 NONAME ; struct QMetaObject const * HsWidgetHost::metaObject(void) const + ?qt_metacast@HsConfiguration@@UAEPAXPBD@Z @ 688 NONAME ; void * HsConfiguration::qt_metacast(char const *) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/eabi/hsdomainmodelu.def --- a/homescreenapp/hsdomainmodel/eabi/hsdomainmodelu.def Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsdomainmodel/eabi/hsdomainmodelu.def Mon Sep 20 10:19:07 2010 +0300 @@ -260,300 +260,329 @@ _ZN17HsWidgetComponentD0Ev @ 259 NONAME _ZN17HsWidgetComponentD1Ev @ 260 NONAME _ZN17HsWidgetComponentD2Ev @ 261 NONAME - _ZN18HsWidgetHostVisual10setNewSizeERK6QSizeF @ 262 NONAME - _ZN18HsWidgetHostVisual11eventFilterEP7QObjectP6QEvent @ 263 NONAME - _ZN18HsWidgetHostVisual11qt_metacallEN11QMetaObject4CallEiPPv @ 264 NONAME - _ZN18HsWidgetHostVisual11qt_metacastEPKc @ 265 NONAME - _ZN18HsWidgetHostVisual12gestureEventEP13QGestureEvent @ 266 NONAME - _ZN18HsWidgetHostVisual12setupEffectsEv @ 267 NONAME - _ZN18HsWidgetHostVisual14setVisualModelEP12HsWidgetHost @ 268 NONAME - _ZN18HsWidgetHostVisual14setupTouchAreaEv @ 269 NONAME - _ZN18HsWidgetHostVisual15startDragEffectEv @ 270 NONAME - _ZN18HsWidgetHostVisual15startDropEffectEv @ 271 NONAME - _ZN18HsWidgetHostVisual16staticMetaObjectE @ 272 NONAME DATA 16 - _ZN18HsWidgetHostVisual19getStaticMetaObjectEv @ 273 NONAME - _ZN18HsWidgetHostVisual7resizedEv @ 274 NONAME - _ZN18HsWidgetHostVisual9setWidgetEP7QObject @ 275 NONAME - _ZN18HsWidgetHostVisualC1EP13QGraphicsItem @ 276 NONAME - _ZN18HsWidgetHostVisualC2EP13QGraphicsItem @ 277 NONAME - _ZN18HsWidgetHostVisualD0Ev @ 278 NONAME - _ZN18HsWidgetHostVisualD1Ev @ 279 NONAME - _ZN18HsWidgetHostVisualD2Ev @ 280 NONAME - _ZN21HsHostedWidgetFactory11qt_metacallEN11QMetaObject4CallEiPPv @ 281 NONAME - _ZN21HsHostedWidgetFactory11qt_metacastEPKc @ 282 NONAME - _ZN21HsHostedWidgetFactory11setInstanceEPS_ @ 283 NONAME - _ZN21HsHostedWidgetFactory12createWidgetERK7QString @ 284 NONAME - _ZN21HsHostedWidgetFactory12takeInstanceEv @ 285 NONAME - _ZN21HsHostedWidgetFactory16staticMetaObjectE @ 286 NONAME DATA 16 - _ZN21HsHostedWidgetFactory19getStaticMetaObjectEv @ 287 NONAME - _ZN21HsHostedWidgetFactory8instanceEv @ 288 NONAME - _ZN21HsHostedWidgetFactory9mInstanceE @ 289 NONAME DATA 4 - _ZN21HsHostedWidgetFactoryC1EP7QObject @ 290 NONAME - _ZN21HsHostedWidgetFactoryC2EP7QObject @ 291 NONAME - _ZN21HsHostedWidgetFactoryD0Ev @ 292 NONAME - _ZN21HsHostedWidgetFactoryD1Ev @ 293 NONAME - _ZN21HsHostedWidgetFactoryD2Ev @ 294 NONAME - _ZN23HsBackupRestoreObserver11qt_metacallEN11QMetaObject4CallEiPPv @ 295 NONAME - _ZN23HsBackupRestoreObserver11qt_metacastEPKc @ 296 NONAME - _ZN23HsBackupRestoreObserver11readyForBUREv @ 297 NONAME - _ZN23HsBackupRestoreObserver16staticMetaObjectE @ 298 NONAME DATA 16 - _ZN23HsBackupRestoreObserver19getStaticMetaObjectEv @ 299 NONAME - _ZN23HsBackupRestoreObserver20backupRestoreStartedEv @ 300 NONAME - _ZN23HsBackupRestoreObserver22backupRestoreCompletedEv @ 301 NONAME - _ZN23HsBackupRestoreObserver26event_backupRestoreStartedEv @ 302 NONAME - _ZN23HsBackupRestoreObserver28event_backupRestoreCompletedEv @ 303 NONAME - _ZN23HsBackupRestoreObserver8checkBUREv @ 304 NONAME - _ZN23HsBackupRestoreObserver8instanceEv @ 305 NONAME - _ZN23HsBackupRestoreObserver9mInstanceE @ 306 NONAME DATA 4 - _ZN23HsBackupRestoreObserverC1EP7QObject @ 307 NONAME - _ZN23HsBackupRestoreObserverC2EP7QObject @ 308 NONAME - _ZN23HsBackupRestoreObserverD0Ev @ 309 NONAME - _ZN23HsBackupRestoreObserverD1Ev @ 310 NONAME - _ZN23HsBackupRestoreObserverD2Ev @ 311 NONAME - _ZN23HsWallpaperLoaderThread11qt_metacallEN11QMetaObject4CallEiPPv @ 312 NONAME - _ZN23HsWallpaperLoaderThread11qt_metacastEPKc @ 313 NONAME - _ZN23HsWallpaperLoaderThread16staticMetaObjectE @ 314 NONAME DATA 16 - _ZN23HsWallpaperLoaderThread19getStaticMetaObjectEv @ 315 NONAME - _ZN23HsWallpaperLoaderThread3runEv @ 316 NONAME - _ZN23HsWallpaperLoaderThreadC1EP7QObject @ 317 NONAME - _ZN23HsWallpaperLoaderThreadC2EP7QObject @ 318 NONAME - _ZN23HsWallpaperLoaderThreadD0Ev @ 319 NONAME - _ZN23HsWallpaperLoaderThreadD1Ev @ 320 NONAME - _ZN23HsWallpaperLoaderThreadD2Ev @ 321 NONAME - _ZN25HsWidgetComponentRegistry11qt_metacallEN11QMetaObject4CallEiPPv @ 322 NONAME - _ZN25HsWidgetComponentRegistry11qt_metacastEPKc @ 323 NONAME - _ZN25HsWidgetComponentRegistry14onEntryChangedERK7CaEntry10ChangeType @ 324 NONAME - _ZN25HsWidgetComponentRegistry15registerServiceERK7CaEntryRK7QStringb @ 325 NONAME - _ZN25HsWidgetComponentRegistry16handleEntryAddedERK7CaEntryRK7QString @ 326 NONAME - _ZN25HsWidgetComponentRegistry16staticMetaObjectE @ 327 NONAME DATA 16 - _ZN25HsWidgetComponentRegistry18handleEntryRemovedERK7CaEntryRK7QString @ 328 NONAME - _ZN25HsWidgetComponentRegistry18handleEntryUpdatedERK7CaEntryRK7QString @ 329 NONAME - _ZN25HsWidgetComponentRegistry18uninstallComponentERK27HsWidgetComponentDescriptor @ 330 NONAME - _ZN25HsWidgetComponentRegistry19getStaticMetaObjectEv @ 331 NONAME - _ZN25HsWidgetComponentRegistry8instanceEv @ 332 NONAME - _ZN25HsWidgetComponentRegistry9componentERK7QString @ 333 NONAME - _ZN25HsWidgetComponentRegistry9mInstanceE @ 334 NONAME DATA 4 - _ZN25HsWidgetComponentRegistryC1EP7QObject @ 335 NONAME - _ZN25HsWidgetComponentRegistryC2EP7QObject @ 336 NONAME - _ZN25HsWidgetComponentRegistryD0Ev @ 337 NONAME - _ZN25HsWidgetComponentRegistryD1Ev @ 338 NONAME - _ZN25HsWidgetComponentRegistryD2Ev @ 339 NONAME - _ZN27HsWidgetComponentDescriptor7isValidEv @ 340 NONAME - _ZN5HsGui11orientationEv @ 341 NONAME - _ZN5HsGui11qt_metacallEN11QMetaObject4CallEiPPv @ 342 NONAME - _ZN5HsGui11qt_metacastEPKc @ 343 NONAME - _ZN5HsGui11setInstanceEPS_ @ 344 NONAME - _ZN5HsGui11setupIdleUiEv @ 345 NONAME - _ZN5HsGui12takeInstanceEv @ 346 NONAME - _ZN5HsGui13cleanupIdleUiEv @ 347 NONAME - _ZN5HsGui14setOrientationEN2Qt11OrientationE @ 348 NONAME - _ZN5HsGui16staticMetaObjectE @ 349 NONAME DATA 16 - _ZN5HsGui18orientationChangedEN2Qt11OrientationE @ 350 NONAME - _ZN5HsGui19getStaticMetaObjectEv @ 351 NONAME - _ZN5HsGui19pageChangeAnimationEv @ 352 NONAME - _ZN5HsGui20navigateToApplibraryEv @ 353 NONAME - _ZN5HsGui21pageCrawlingAnimationEv @ 354 NONAME - _ZN5HsGui4showEv @ 355 NONAME - _ZN5HsGui8instanceEv @ 356 NONAME - _ZN5HsGui9mInstanceE @ 357 NONAME DATA 4 - _ZN5HsGuiC1EP7QObject @ 358 NONAME - _ZN5HsGuiC2EP7QObject @ 359 NONAME - _ZN5HsGuiD0Ev @ 360 NONAME - _ZN5HsGuiD1Ev @ 361 NONAME - _ZN5HsGuiD2Ev @ 362 NONAME - _ZN6HsPage10newWidgetsEv @ 363 NONAME - _ZN6HsPage11contentRectEN2Qt11OrientationE @ 364 NONAME - _ZN6HsPage11contentRectEv @ 365 NONAME - _ZN6HsPage11hideWidgetsEv @ 366 NONAME - _ZN6HsPage11qt_metacallEN11QMetaObject4CallEiPPv @ 367 NONAME - _ZN6HsPage11qt_metacastEPKc @ 368 NONAME - _ZN6HsPage11showWidgetsEv @ 369 NONAME - _ZN6HsPage12addNewWidgetEP12HsWidgetHostRK7QPointF @ 370 NONAME - _ZN6HsPage12removeWidgetEP12HsWidgetHost @ 371 NONAME - _ZN6HsPage12setRemovableEb @ 372 NONAME - _ZN6HsPage13connectWidgetEP12HsWidgetHost @ 373 NONAME - _ZN6HsPage13setDatabaseIdEi @ 374 NONAME - _ZN6HsPage13updateZValuesEv @ 375 NONAME - _ZN6HsPage14createInstanceERK10HsPageData @ 376 NONAME - _ZN6HsPage15contentGeometryEN2Qt11OrientationE @ 377 NONAME - _ZN6HsPage15contentGeometryEv @ 378 NONAME - _ZN6HsPage15onWidgetFaultedEv @ 379 NONAME - _ZN6HsPage15onWidgetResizedEv @ 380 NONAME - _ZN6HsPage15resetNewWidgetsEv @ 381 NONAME - _ZN6HsPage16disconnectWidgetEP12HsWidgetHost @ 382 NONAME - _ZN6HsPage16layoutNewWidgetsEv @ 383 NONAME - _ZN6HsPage16onWidgetFinishedEv @ 384 NONAME - _ZN6HsPage16staticMetaObjectE @ 385 NONAME DATA 16 - _ZN6HsPage17addExistingWidgetEP12HsWidgetHost @ 386 NONAME - _ZN6HsPage17onWidgetAvailableEv @ 387 NONAME - _ZN6HsPage18deleteFromDatabaseEv @ 388 NONAME - _ZN6HsPage19getStaticMetaObjectEv @ 389 NONAME - _ZN6HsPage19onPageMarginChangedERK7QString @ 390 NONAME - _ZN6HsPage19onWidgetUnavailableEv @ 391 NONAME - _ZN6HsPage20onOrientationChangedEN2Qt11OrientationE @ 392 NONAME - _ZN6HsPage22adjustedWidgetPositionERK6QRectF @ 393 NONAME - _ZN6HsPage4loadEv @ 394 NONAME - _ZN6HsPage9pageIndexEv @ 395 NONAME - _ZN6HsPage9setOnlineEb @ 396 NONAME - _ZN6HsPageC1EP7QObject @ 397 NONAME - _ZN6HsPageC2EP7QObject @ 398 NONAME - _ZN6HsPageD0Ev @ 399 NONAME - _ZN6HsPageD1Ev @ 400 NONAME - _ZN6HsPageD2Ev @ 401 NONAME - _ZN7HsScene10removePageEP6HsPage @ 402 NONAME - _ZN7HsScene11eventFilterEP7QObjectP6QEvent @ 403 NONAME - _ZN7HsScene11qt_metacallEN11QMetaObject4CallEiPPv @ 404 NONAME - _ZN7HsScene11qt_metacastEPKc @ 405 NONAME - _ZN7HsScene11setInstanceEPS_ @ 406 NONAME - _ZN7HsScene12takeInstanceEv @ 407 NONAME - _ZN7HsScene13setActivePageEP6HsPage @ 408 NONAME - _ZN7HsScene14pagePanStartedEP13QGestureEvent @ 409 NONAME - _ZN7HsScene14pagePanUpdatedEP13QGestureEvent @ 410 NONAME - _ZN7HsScene15pagePanFinishedEP13QGestureEvent @ 411 NONAME - _ZN7HsScene15pageTapFinishedEP13QGestureEvent @ 412 NONAME - _ZN7HsScene15setActiveWidgetEP12HsWidgetHost @ 413 NONAME - _ZN7HsScene16staticMetaObjectE @ 414 NONAME DATA 16 - _ZN7HsScene16widgetTapStartedE7QPointFP12HsWidgetHost @ 415 NONAME - _ZN7HsScene17activePageChangedEv @ 416 NONAME - _ZN7HsScene17widgetMoveUpdatedERK7QPointFP12HsWidgetHost @ 417 NONAME - _ZN7HsScene18setActivePageIndexEi @ 418 NONAME - _ZN7HsScene18widgetMoveFinishedERK7QPointFP12HsWidgetHost @ 419 NONAME - _ZN7HsScene19getStaticMetaObjectEv @ 420 NONAME - _ZN7HsScene22pageTapAndHoldFinishedEP13QGestureEvent @ 421 NONAME - _ZN7HsScene24widgetTapAndHoldFinishedEP13QGestureEventP12HsWidgetHost @ 422 NONAME - _ZN7HsScene4loadEv @ 423 NONAME - _ZN7HsScene7addPageEP6HsPage @ 424 NONAME - _ZN7HsScene8instanceEv @ 425 NONAME - _ZN7HsScene9mInstanceE @ 426 NONAME DATA 4 - _ZN7HsScene9setOnlineEb @ 427 NONAME - _ZN7HsSceneC1EP7QObject @ 428 NONAME - _ZN7HsSceneC2EP7QObject @ 429 NONAME - _ZN7HsSceneD0Ev @ 430 NONAME - _ZN7HsSceneD1Ev @ 431 NONAME - _ZN7HsSceneD2Ev @ 432 NONAME - _ZNK10HsDatabase10metaObjectEv @ 433 NONAME - _ZNK10HsDatabase12databaseNameEv @ 434 NONAME - _ZNK10HsDatabase14connectionNameEv @ 435 NONAME - _ZNK10HsDatabase15checkConnectionEv @ 436 NONAME - _ZNK11HsWallpaper10metaObjectEv @ 437 NONAME - _ZNK11HsWallpaper13rootDirectoryEv @ 438 NONAME - _ZNK12HsIdleWidget10metaObjectEv @ 439 NONAME - _ZNK12HsIdleWidget14parallaxFactorEv @ 440 NONAME - _ZNK12HsIdleWidget6sceneXEv @ 441 NONAME - _ZNK12HsPageVisual10metaObjectEv @ 442 NONAME - _ZNK12HsPageVisual9pageIndexEv @ 443 NONAME - _ZNK12HsWidgetHost10databaseIdEv @ 444 NONAME - _ZNK12HsWidgetHost10metaObjectEv @ 445 NONAME - _ZNK12HsWidgetHost4pageEv @ 446 NONAME - _ZNK12HsWidgetHost6visualEv @ 447 NONAME - _ZNK15HsConfiguration10metaObjectEv @ 448 NONAME - _ZNK15HsConfiguration24maximumWidgetSizeInUnitsEv @ 449 NONAME - _ZNK15HsConfiguration24minimumWidgetSizeInUnitsEv @ 450 NONAME - _ZNK15HsConfiguration25maximumWidgetSizeInPixelsEv @ 451 NONAME - _ZNK15HsConfiguration25minimumWidgetSizeInPixelsEv @ 452 NONAME - _ZNK15HsPageWallpaper10metaObjectEv @ 453 NONAME - _ZNK15HsPageWallpaper18wallpaperDirectoryEv @ 454 NONAME - _ZNK16HsContentService10metaObjectEv @ 455 NONAME - _ZNK16HsSceneWallpaper10metaObjectEv @ 456 NONAME - _ZNK16HsSceneWallpaper18wallpaperDirectoryEv @ 457 NONAME - _ZNK17HsShortcutService10metaObjectEv @ 458 NONAME - _ZNK17HsWallpaperLoader10metaObjectEv @ 459 NONAME - _ZNK17HsWidgetComponent10metaObjectEv @ 460 NONAME - _ZNK17HsWidgetComponent11isAvailableEv @ 461 NONAME - _ZNK17HsWidgetComponent3uriEv @ 462 NONAME - _ZNK17HsWidgetComponent8rootPathEv @ 463 NONAME - _ZNK18HsWidgetHostVisual10metaObjectEv @ 464 NONAME - _ZNK18HsWidgetHostVisual11visualModelEv @ 465 NONAME - _ZNK18HsWidgetHostVisual5shapeEv @ 466 NONAME - _ZNK21HsHostedWidgetFactory10metaObjectEv @ 467 NONAME - _ZNK23HsBackupRestoreObserver10metaObjectEv @ 468 NONAME - _ZNK23HsWallpaperLoaderThread10metaObjectEv @ 469 NONAME - _ZNK25HsWidgetComponentRegistry10metaObjectEv @ 470 NONAME - _ZNK5HsGui10idleWidgetEv @ 471 NONAME - _ZNK5HsGui10layoutRectEv @ 472 NONAME - _ZNK5HsGui10metaObjectEv @ 473 NONAME - _ZNK5HsGui8idleViewEv @ 474 NONAME - _ZNK6HsPage10databaseIdEv @ 475 NONAME - _ZNK6HsPage10metaObjectEv @ 476 NONAME - _ZNK6HsPage11isRemovableEv @ 477 NONAME - _ZNK6HsPage12isActivePageEv @ 478 NONAME - _ZNK6HsPage13isDefaultPageEv @ 479 NONAME - _ZNK6HsPage6visualEv @ 480 NONAME - _ZNK6HsPage7widgetsEv @ 481 NONAME - _ZNK6HsPage9wallpaperEv @ 482 NONAME - _ZNK7HsScene10activePageEv @ 483 NONAME - _ZNK7HsScene10databaseIdEv @ 484 NONAME - _ZNK7HsScene10metaObjectEv @ 485 NONAME - _ZNK7HsScene12activeWidgetEv @ 486 NONAME - _ZNK7HsScene15activePageIndexEv @ 487 NONAME - _ZNK7HsScene5pagesEv @ 488 NONAME - _ZNK7HsScene8isOnlineEv @ 489 NONAME - _ZNK7HsScene9wallpaperEv @ 490 NONAME - _ZTI10HsDatabase @ 491 NONAME - _ZTI11HsWallpaper @ 492 NONAME - _ZTI12HsIdleWidget @ 493 NONAME - _ZTI12HsPageVisual @ 494 NONAME - _ZTI12HsWidgetHost @ 495 NONAME - _ZTI15HsConfiguration @ 496 NONAME - _ZTI15HsPageWallpaper @ 497 NONAME - _ZTI16HsContentService @ 498 NONAME - _ZTI16HsSceneWallpaper @ 499 NONAME - _ZTI17HsShortcutService @ 500 NONAME - _ZTI17HsWallpaperLoader @ 501 NONAME - _ZTI17HsWidgetComponent @ 502 NONAME - _ZTI18HsWidgetHostVisual @ 503 NONAME - _ZTI21HsHostedWidgetFactory @ 504 NONAME - _ZTI23HsBackupRestoreObserver @ 505 NONAME - _ZTI23HsWallpaperLoaderThread @ 506 NONAME - _ZTI25HsWidgetComponentRegistry @ 507 NONAME - _ZTI5HsGui @ 508 NONAME - _ZTI6HsPage @ 509 NONAME - _ZTI7HsScene @ 510 NONAME - _ZTV10HsDatabase @ 511 NONAME - _ZTV11HsWallpaper @ 512 NONAME - _ZTV12HsIdleWidget @ 513 NONAME - _ZTV12HsPageVisual @ 514 NONAME - _ZTV12HsWidgetHost @ 515 NONAME - _ZTV15HsConfiguration @ 516 NONAME - _ZTV15HsPageWallpaper @ 517 NONAME - _ZTV16HsContentService @ 518 NONAME - _ZTV16HsSceneWallpaper @ 519 NONAME - _ZTV17HsShortcutService @ 520 NONAME - _ZTV17HsWallpaperLoader @ 521 NONAME - _ZTV17HsWidgetComponent @ 522 NONAME - _ZTV18HsWidgetHostVisual @ 523 NONAME - _ZTV21HsHostedWidgetFactory @ 524 NONAME - _ZTV23HsBackupRestoreObserver @ 525 NONAME - _ZTV23HsWallpaperLoaderThread @ 526 NONAME - _ZTV25HsWidgetComponentRegistry @ 527 NONAME - _ZTV5HsGui @ 528 NONAME - _ZTV6HsPage @ 529 NONAME - _ZTV7HsScene @ 530 NONAME - _ZThn16_N11HsWallpaperD0Ev @ 531 NONAME - _ZThn16_N11HsWallpaperD1Ev @ 532 NONAME - _ZThn16_N12HsIdleWidget11setGeometryERK6QRectF @ 533 NONAME - _ZThn16_N12HsIdleWidgetD0Ev @ 534 NONAME - _ZThn16_N12HsIdleWidgetD1Ev @ 535 NONAME - _ZThn16_N12HsPageVisual11setGeometryERK6QRectF @ 536 NONAME - _ZThn16_N12HsPageVisualD0Ev @ 537 NONAME - _ZThn16_N12HsPageVisualD1Ev @ 538 NONAME - _ZThn16_N15HsPageWallpaperD0Ev @ 539 NONAME - _ZThn16_N15HsPageWallpaperD1Ev @ 540 NONAME - _ZThn16_N16HsSceneWallpaperD0Ev @ 541 NONAME - _ZThn16_N16HsSceneWallpaperD1Ev @ 542 NONAME - _ZThn16_N18HsWidgetHostVisualD0Ev @ 543 NONAME - _ZThn16_N18HsWidgetHostVisualD1Ev @ 544 NONAME - _ZThn8_N11HsWallpaperD0Ev @ 545 NONAME - _ZThn8_N11HsWallpaperD1Ev @ 546 NONAME - _ZThn8_N12HsIdleWidgetD0Ev @ 547 NONAME - _ZThn8_N12HsIdleWidgetD1Ev @ 548 NONAME - _ZThn8_N12HsPageVisualD0Ev @ 549 NONAME - _ZThn8_N12HsPageVisualD1Ev @ 550 NONAME - _ZThn8_N15HsPageWallpaperD0Ev @ 551 NONAME - _ZThn8_N15HsPageWallpaperD1Ev @ 552 NONAME - _ZThn8_N16HsSceneWallpaperD0Ev @ 553 NONAME - _ZThn8_N16HsSceneWallpaperD1Ev @ 554 NONAME - _ZThn8_N18HsWidgetHostVisualD0Ev @ 555 NONAME - _ZThn8_N18HsWidgetHostVisualD1Ev @ 556 NONAME - _ZThn8_NK18HsWidgetHostVisual5shapeEv @ 557 NONAME + _ZN17HsWidgetOrganizer11getPositionERK6QSizeF @ 262 NONAME + _ZN17HsWidgetOrganizer11initAnchorsEv @ 263 NONAME + _ZN17HsWidgetOrganizer11markAnchorsERK6QRectF @ 264 NONAME + _ZN17HsWidgetOrganizer11searchSpaceENS_10SearchModeE7QPointFi @ 265 NONAME + _ZN17HsWidgetOrganizer16convertToAnchorsEi @ 266 NONAME + _ZN17HsWidgetOrganizer18checkExistingRectsERK5QListI6QRectFE @ 267 NONAME + _ZN17HsWidgetOrganizer18getAnchorListIndexERK7QPointF @ 268 NONAME + _ZN17HsWidgetOrganizer20getAnchorCoordinatesEi @ 269 NONAME + _ZN17HsWidgetOrganizer22searchPositionRowByRowE7QPointFii @ 270 NONAME + _ZN17HsWidgetOrganizer28searchPositionColumnByColumnE7QPointFii @ 271 NONAME + _ZN17HsWidgetOrganizer7convertERK6QRectFRK5QListIS0_ES6_RK7QPointF @ 272 NONAME + _ZN17HsWidgetOrganizer9sortRectsENS_8SortModeERK4QMapIi6QRectFE @ 273 NONAME + _ZN17HsWidgetOrganizerC1EiN15HsConfiguration29WidgetOrganizerSearchSequenceE @ 274 NONAME + _ZN17HsWidgetOrganizerC2EiN15HsConfiguration29WidgetOrganizerSearchSequenceE @ 275 NONAME + _ZN17HsWidgetOrganizerD0Ev @ 276 NONAME + _ZN17HsWidgetOrganizerD1Ev @ 277 NONAME + _ZN17HsWidgetOrganizerD2Ev @ 278 NONAME + _ZN18HsWidgetHostVisual10setNewSizeERK6QSizeF @ 279 NONAME + _ZN18HsWidgetHostVisual11eventFilterEP7QObjectP6QEvent @ 280 NONAME + _ZN18HsWidgetHostVisual11qt_metacallEN11QMetaObject4CallEiPPv @ 281 NONAME + _ZN18HsWidgetHostVisual11qt_metacastEPKc @ 282 NONAME + _ZN18HsWidgetHostVisual12gestureEventEP13QGestureEvent @ 283 NONAME + _ZN18HsWidgetHostVisual12setupEffectsEv @ 284 NONAME + _ZN18HsWidgetHostVisual14setVisualModelEP12HsWidgetHost @ 285 NONAME + _ZN18HsWidgetHostVisual14setupTouchAreaEv @ 286 NONAME + _ZN18HsWidgetHostVisual15startDragEffectEv @ 287 NONAME + _ZN18HsWidgetHostVisual15startDropEffectEv @ 288 NONAME + _ZN18HsWidgetHostVisual16staticMetaObjectE @ 289 NONAME DATA 16 + _ZN18HsWidgetHostVisual19getStaticMetaObjectEv @ 290 NONAME + _ZN18HsWidgetHostVisual7resizedEv @ 291 NONAME + _ZN18HsWidgetHostVisual9setWidgetEP7QObject @ 292 NONAME + _ZN18HsWidgetHostVisualC1EP13QGraphicsItem @ 293 NONAME + _ZN18HsWidgetHostVisualC2EP13QGraphicsItem @ 294 NONAME + _ZN18HsWidgetHostVisualD0Ev @ 295 NONAME + _ZN18HsWidgetHostVisualD1Ev @ 296 NONAME + _ZN18HsWidgetHostVisualD2Ev @ 297 NONAME + _ZN21HsAnchorPointInCenter7convertERK6QRectFRK5QListIS0_ES6_RK7QPointF @ 298 NONAME + _ZN21HsHostedWidgetFactory11qt_metacallEN11QMetaObject4CallEiPPv @ 299 NONAME + _ZN21HsHostedWidgetFactory11qt_metacastEPKc @ 300 NONAME + _ZN21HsHostedWidgetFactory11setInstanceEPS_ @ 301 NONAME + _ZN21HsHostedWidgetFactory12createWidgetERK7QString @ 302 NONAME + _ZN21HsHostedWidgetFactory12takeInstanceEv @ 303 NONAME + _ZN21HsHostedWidgetFactory16staticMetaObjectE @ 304 NONAME DATA 16 + _ZN21HsHostedWidgetFactory19getStaticMetaObjectEv @ 305 NONAME + _ZN21HsHostedWidgetFactory8instanceEv @ 306 NONAME + _ZN21HsHostedWidgetFactory9mInstanceE @ 307 NONAME DATA 4 + _ZN21HsHostedWidgetFactoryC1EP7QObject @ 308 NONAME + _ZN21HsHostedWidgetFactoryC2EP7QObject @ 309 NONAME + _ZN21HsHostedWidgetFactoryD0Ev @ 310 NONAME + _ZN21HsHostedWidgetFactoryD1Ev @ 311 NONAME + _ZN21HsHostedWidgetFactoryD2Ev @ 312 NONAME + _ZN23HsBackupRestoreObserver11qt_metacallEN11QMetaObject4CallEiPPv @ 313 NONAME + _ZN23HsBackupRestoreObserver11qt_metacastEPKc @ 314 NONAME + _ZN23HsBackupRestoreObserver11readyForBUREv @ 315 NONAME + _ZN23HsBackupRestoreObserver16staticMetaObjectE @ 316 NONAME DATA 16 + _ZN23HsBackupRestoreObserver19getStaticMetaObjectEv @ 317 NONAME + _ZN23HsBackupRestoreObserver20backupRestoreStartedEv @ 318 NONAME + _ZN23HsBackupRestoreObserver22backupRestoreCompletedEv @ 319 NONAME + _ZN23HsBackupRestoreObserver26event_backupRestoreStartedEv @ 320 NONAME + _ZN23HsBackupRestoreObserver28event_backupRestoreCompletedEv @ 321 NONAME + _ZN23HsBackupRestoreObserver8checkBUREv @ 322 NONAME + _ZN23HsBackupRestoreObserver8instanceEv @ 323 NONAME + _ZN23HsBackupRestoreObserver9mInstanceE @ 324 NONAME DATA 4 + _ZN23HsBackupRestoreObserverC1EP7QObject @ 325 NONAME + _ZN23HsBackupRestoreObserverC2EP7QObject @ 326 NONAME + _ZN23HsBackupRestoreObserverD0Ev @ 327 NONAME + _ZN23HsBackupRestoreObserverD1Ev @ 328 NONAME + _ZN23HsBackupRestoreObserverD2Ev @ 329 NONAME + _ZN23HsWallpaperLoaderThread11qt_metacallEN11QMetaObject4CallEiPPv @ 330 NONAME + _ZN23HsWallpaperLoaderThread11qt_metacastEPKc @ 331 NONAME + _ZN23HsWallpaperLoaderThread16staticMetaObjectE @ 332 NONAME DATA 16 + _ZN23HsWallpaperLoaderThread19getStaticMetaObjectEv @ 333 NONAME + _ZN23HsWallpaperLoaderThread3runEv @ 334 NONAME + _ZN23HsWallpaperLoaderThreadC1EP7QObject @ 335 NONAME + _ZN23HsWallpaperLoaderThreadC2EP7QObject @ 336 NONAME + _ZN23HsWallpaperLoaderThreadD0Ev @ 337 NONAME + _ZN23HsWallpaperLoaderThreadD1Ev @ 338 NONAME + _ZN23HsWallpaperLoaderThreadD2Ev @ 339 NONAME + _ZN25HsWidgetComponentRegistry11qt_metacallEN11QMetaObject4CallEiPPv @ 340 NONAME + _ZN25HsWidgetComponentRegistry11qt_metacastEPKc @ 341 NONAME + _ZN25HsWidgetComponentRegistry14onEntryChangedERK7CaEntry10ChangeType @ 342 NONAME + _ZN25HsWidgetComponentRegistry15registerServiceERK7CaEntryRK7QStringb @ 343 NONAME + _ZN25HsWidgetComponentRegistry16handleEntryAddedERK7CaEntryRK7QString @ 344 NONAME + _ZN25HsWidgetComponentRegistry16staticMetaObjectE @ 345 NONAME DATA 16 + _ZN25HsWidgetComponentRegistry18handleEntryRemovedERK7CaEntryRK7QString @ 346 NONAME + _ZN25HsWidgetComponentRegistry18handleEntryUpdatedERK7CaEntryRK7QString @ 347 NONAME + _ZN25HsWidgetComponentRegistry18uninstallComponentERK27HsWidgetComponentDescriptor @ 348 NONAME + _ZN25HsWidgetComponentRegistry19getStaticMetaObjectEv @ 349 NONAME + _ZN25HsWidgetComponentRegistry8instanceEv @ 350 NONAME + _ZN25HsWidgetComponentRegistry9componentERK7QString @ 351 NONAME + _ZN25HsWidgetComponentRegistry9mInstanceE @ 352 NONAME DATA 4 + _ZN25HsWidgetComponentRegistryC1EP7QObject @ 353 NONAME + _ZN25HsWidgetComponentRegistryC2EP7QObject @ 354 NONAME + _ZN25HsWidgetComponentRegistryD0Ev @ 355 NONAME + _ZN25HsWidgetComponentRegistryD1Ev @ 356 NONAME + _ZN25HsWidgetComponentRegistryD2Ev @ 357 NONAME + _ZN26HsAnchorPointInBottomRight7convertERK6QRectFRK5QListIS0_ES6_RK7QPointF @ 358 NONAME + _ZN27HsWidgetComponentDescriptor7isValidEv @ 359 NONAME + _ZN30HsWidgetPositioningOnWidgetAdd11setInstanceEPS_ @ 360 NONAME + _ZN30HsWidgetPositioningOnWidgetAdd8instanceEv @ 361 NONAME + _ZN30HsWidgetPositioningOnWidgetAdd9mInstanceE @ 362 NONAME DATA 4 + _ZN5HsGui11orientationEv @ 363 NONAME + _ZN5HsGui11qt_metacallEN11QMetaObject4CallEiPPv @ 364 NONAME + _ZN5HsGui11qt_metacastEPKc @ 365 NONAME + _ZN5HsGui11setInstanceEPS_ @ 366 NONAME + _ZN5HsGui11setupIdleUiEv @ 367 NONAME + _ZN5HsGui12takeInstanceEv @ 368 NONAME + _ZN5HsGui13cleanupIdleUiEv @ 369 NONAME + _ZN5HsGui14setOrientationEN2Qt11OrientationE @ 370 NONAME + _ZN5HsGui16staticMetaObjectE @ 371 NONAME DATA 16 + _ZN5HsGui18orientationChangedEN2Qt11OrientationE @ 372 NONAME + _ZN5HsGui19getStaticMetaObjectEv @ 373 NONAME + _ZN5HsGui19pageChangeAnimationEv @ 374 NONAME + _ZN5HsGui20navigateToApplibraryEv @ 375 NONAME + _ZN5HsGui21pageCrawlingAnimationEv @ 376 NONAME + _ZN5HsGui4showEv @ 377 NONAME + _ZN5HsGui8instanceEv @ 378 NONAME + _ZN5HsGui9mInstanceE @ 379 NONAME DATA 4 + _ZN5HsGuiC1EP7QObject @ 380 NONAME + _ZN5HsGuiC2EP7QObject @ 381 NONAME + _ZN5HsGuiD0Ev @ 382 NONAME + _ZN5HsGuiD1Ev @ 383 NONAME + _ZN5HsGuiD2Ev @ 384 NONAME + _ZN6HsPage10newWidgetsEv @ 385 NONAME + _ZN6HsPage11contentRectEN2Qt11OrientationE @ 386 NONAME + _ZN6HsPage11contentRectEv @ 387 NONAME + _ZN6HsPage11hideWidgetsEv @ 388 NONAME + _ZN6HsPage11qt_metacallEN11QMetaObject4CallEiPPv @ 389 NONAME + _ZN6HsPage11qt_metacastEPKc @ 390 NONAME + _ZN6HsPage11showWidgetsEv @ 391 NONAME + _ZN6HsPage12addNewWidgetEP12HsWidgetHostRK7QPointF @ 392 NONAME + _ZN6HsPage12removeWidgetEP12HsWidgetHost @ 393 NONAME + _ZN6HsPage12setRemovableEb @ 394 NONAME + _ZN6HsPage13connectWidgetEP12HsWidgetHost @ 395 NONAME + _ZN6HsPage13setDatabaseIdEi @ 396 NONAME + _ZN6HsPage13updateZValuesEv @ 397 NONAME + _ZN6HsPage14createInstanceERK10HsPageData @ 398 NONAME + _ZN6HsPage15contentGeometryEN2Qt11OrientationE @ 399 NONAME + _ZN6HsPage15contentGeometryEv @ 400 NONAME + _ZN6HsPage15onWidgetFaultedEv @ 401 NONAME + _ZN6HsPage15onWidgetResizedEv @ 402 NONAME + _ZN6HsPage15resetNewWidgetsEv @ 403 NONAME + _ZN6HsPage16disconnectWidgetEP12HsWidgetHost @ 404 NONAME + _ZN6HsPage16layoutNewWidgetsEv @ 405 NONAME + _ZN6HsPage16onWidgetFinishedEv @ 406 NONAME + _ZN6HsPage16staticMetaObjectE @ 407 NONAME DATA 16 + _ZN6HsPage17addExistingWidgetEP12HsWidgetHost @ 408 NONAME + _ZN6HsPage17onWidgetAvailableEv @ 409 NONAME + _ZN6HsPage18deleteFromDatabaseEv @ 410 NONAME + _ZN6HsPage19getStaticMetaObjectEv @ 411 NONAME + _ZN6HsPage19onPageMarginChangedERK7QString @ 412 NONAME + _ZN6HsPage19onWidgetUnavailableEv @ 413 NONAME + _ZN6HsPage20onOrientationChangedEN2Qt11OrientationE @ 414 NONAME + _ZN6HsPage22adjustedWidgetPositionERK6QRectF @ 415 NONAME + _ZN6HsPage4loadEv @ 416 NONAME + _ZN6HsPage9pageIndexEv @ 417 NONAME + _ZN6HsPage9setOnlineEb @ 418 NONAME + _ZN6HsPageC1EP7QObject @ 419 NONAME + _ZN6HsPageC2EP7QObject @ 420 NONAME + _ZN6HsPageD0Ev @ 421 NONAME + _ZN6HsPageD1Ev @ 422 NONAME + _ZN6HsPageD2Ev @ 423 NONAME + _ZN7HsScene10removePageEP6HsPage @ 424 NONAME + _ZN7HsScene11eventFilterEP7QObjectP6QEvent @ 425 NONAME + _ZN7HsScene11qt_metacallEN11QMetaObject4CallEiPPv @ 426 NONAME + _ZN7HsScene11qt_metacastEPKc @ 427 NONAME + _ZN7HsScene11setInstanceEPS_ @ 428 NONAME + _ZN7HsScene12takeInstanceEv @ 429 NONAME + _ZN7HsScene13setActivePageEP6HsPage @ 430 NONAME + _ZN7HsScene14pagePanStartedEP13QGestureEvent @ 431 NONAME + _ZN7HsScene14pagePanUpdatedEP13QGestureEvent @ 432 NONAME + _ZN7HsScene15pagePanFinishedEP13QGestureEvent @ 433 NONAME + _ZN7HsScene15pageTapFinishedEP13QGestureEvent @ 434 NONAME + _ZN7HsScene15setActiveWidgetEP12HsWidgetHost @ 435 NONAME + _ZN7HsScene16staticMetaObjectE @ 436 NONAME DATA 16 + _ZN7HsScene16widgetTapStartedE7QPointFP12HsWidgetHost @ 437 NONAME + _ZN7HsScene17activePageChangedEv @ 438 NONAME + _ZN7HsScene17widgetMoveUpdatedERK7QPointFP12HsWidgetHost @ 439 NONAME + _ZN7HsScene18setActivePageIndexEi @ 440 NONAME + _ZN7HsScene18widgetMoveFinishedERK7QPointFP12HsWidgetHost @ 441 NONAME + _ZN7HsScene19getStaticMetaObjectEv @ 442 NONAME + _ZN7HsScene22pageTapAndHoldFinishedEP13QGestureEvent @ 443 NONAME + _ZN7HsScene24widgetTapAndHoldFinishedEP13QGestureEventP12HsWidgetHost @ 444 NONAME + _ZN7HsScene4loadEv @ 445 NONAME + _ZN7HsScene7addPageEP6HsPage @ 446 NONAME + _ZN7HsScene8instanceEv @ 447 NONAME + _ZN7HsScene9mInstanceE @ 448 NONAME DATA 4 + _ZN7HsScene9setOnlineEb @ 449 NONAME + _ZN7HsSceneC1EP7QObject @ 450 NONAME + _ZN7HsSceneC2EP7QObject @ 451 NONAME + _ZN7HsSceneD0Ev @ 452 NONAME + _ZN7HsSceneD1Ev @ 453 NONAME + _ZN7HsSceneD2Ev @ 454 NONAME + _ZNK10HsDatabase10metaObjectEv @ 455 NONAME + _ZNK10HsDatabase12databaseNameEv @ 456 NONAME + _ZNK10HsDatabase14connectionNameEv @ 457 NONAME + _ZNK10HsDatabase15checkConnectionEv @ 458 NONAME + _ZNK11HsWallpaper10metaObjectEv @ 459 NONAME + _ZNK11HsWallpaper13rootDirectoryEv @ 460 NONAME + _ZNK12HsIdleWidget10metaObjectEv @ 461 NONAME + _ZNK12HsIdleWidget14parallaxFactorEv @ 462 NONAME + _ZNK12HsIdleWidget6sceneXEv @ 463 NONAME + _ZNK12HsPageVisual10metaObjectEv @ 464 NONAME + _ZNK12HsPageVisual9pageIndexEv @ 465 NONAME + _ZNK12HsWidgetHost10databaseIdEv @ 466 NONAME + _ZNK12HsWidgetHost10metaObjectEv @ 467 NONAME + _ZNK12HsWidgetHost4pageEv @ 468 NONAME + _ZNK12HsWidgetHost6visualEv @ 469 NONAME + _ZNK15HsConfiguration10metaObjectEv @ 470 NONAME + _ZNK15HsConfiguration24maximumWidgetSizeInUnitsEv @ 471 NONAME + _ZNK15HsConfiguration24minimumWidgetSizeInUnitsEv @ 472 NONAME + _ZNK15HsConfiguration25maximumWidgetSizeInPixelsEv @ 473 NONAME + _ZNK15HsConfiguration25minimumWidgetSizeInPixelsEv @ 474 NONAME + _ZNK15HsPageWallpaper10metaObjectEv @ 475 NONAME + _ZNK15HsPageWallpaper18wallpaperDirectoryEv @ 476 NONAME + _ZNK16HsContentService10metaObjectEv @ 477 NONAME + _ZNK16HsSceneWallpaper10metaObjectEv @ 478 NONAME + _ZNK16HsSceneWallpaper18wallpaperDirectoryEv @ 479 NONAME + _ZNK17HsShortcutService10metaObjectEv @ 480 NONAME + _ZNK17HsWallpaperLoader10metaObjectEv @ 481 NONAME + _ZNK17HsWidgetComponent10metaObjectEv @ 482 NONAME + _ZNK17HsWidgetComponent11isAvailableEv @ 483 NONAME + _ZNK17HsWidgetComponent3uriEv @ 484 NONAME + _ZNK17HsWidgetComponent8rootPathEv @ 485 NONAME + _ZNK18HsWidgetHostVisual10metaObjectEv @ 486 NONAME + _ZNK18HsWidgetHostVisual11visualModelEv @ 487 NONAME + _ZNK18HsWidgetHostVisual5shapeEv @ 488 NONAME + _ZNK21HsHostedWidgetFactory10metaObjectEv @ 489 NONAME + _ZNK23HsBackupRestoreObserver10metaObjectEv @ 490 NONAME + _ZNK23HsWallpaperLoaderThread10metaObjectEv @ 491 NONAME + _ZNK25HsWidgetComponentRegistry10metaObjectEv @ 492 NONAME + _ZNK5HsGui10idleWidgetEv @ 493 NONAME + _ZNK5HsGui10layoutRectEv @ 494 NONAME + _ZNK5HsGui10metaObjectEv @ 495 NONAME + _ZNK5HsGui8idleViewEv @ 496 NONAME + _ZNK6HsPage10databaseIdEv @ 497 NONAME + _ZNK6HsPage10metaObjectEv @ 498 NONAME + _ZNK6HsPage11isRemovableEv @ 499 NONAME + _ZNK6HsPage12isActivePageEv @ 500 NONAME + _ZNK6HsPage13isDefaultPageEv @ 501 NONAME + _ZNK6HsPage6visualEv @ 502 NONAME + _ZNK6HsPage7widgetsEv @ 503 NONAME + _ZNK6HsPage9wallpaperEv @ 504 NONAME + _ZNK7HsScene10activePageEv @ 505 NONAME + _ZNK7HsScene10databaseIdEv @ 506 NONAME + _ZNK7HsScene10metaObjectEv @ 507 NONAME + _ZNK7HsScene12activeWidgetEv @ 508 NONAME + _ZNK7HsScene15activePageIndexEv @ 509 NONAME + _ZNK7HsScene5pagesEv @ 510 NONAME + _ZNK7HsScene8isOnlineEv @ 511 NONAME + _ZNK7HsScene9wallpaperEv @ 512 NONAME + _ZTI10HsDatabase @ 513 NONAME + _ZTI11HsWallpaper @ 514 NONAME + _ZTI12HsIdleWidget @ 515 NONAME + _ZTI12HsPageVisual @ 516 NONAME + _ZTI12HsWidgetHost @ 517 NONAME + _ZTI15HsConfiguration @ 518 NONAME + _ZTI15HsPageWallpaper @ 519 NONAME + _ZTI16HsContentService @ 520 NONAME + _ZTI16HsSceneWallpaper @ 521 NONAME + _ZTI17HsShortcutService @ 522 NONAME + _ZTI17HsWallpaperLoader @ 523 NONAME + _ZTI17HsWidgetComponent @ 524 NONAME + _ZTI17HsWidgetOrganizer @ 525 NONAME + _ZTI18HsWidgetHostVisual @ 526 NONAME + _ZTI21HsAnchorPointInCenter @ 527 NONAME + _ZTI21HsHostedWidgetFactory @ 528 NONAME + _ZTI23HsBackupRestoreObserver @ 529 NONAME + _ZTI23HsWallpaperLoaderThread @ 530 NONAME + _ZTI25HsWidgetComponentRegistry @ 531 NONAME + _ZTI26HsAnchorPointInBottomRight @ 532 NONAME + _ZTI30HsWidgetPositioningOnWidgetAdd @ 533 NONAME + _ZTI5HsGui @ 534 NONAME + _ZTI6HsPage @ 535 NONAME + _ZTI7HsScene @ 536 NONAME + _ZTV10HsDatabase @ 537 NONAME + _ZTV11HsWallpaper @ 538 NONAME + _ZTV12HsIdleWidget @ 539 NONAME + _ZTV12HsPageVisual @ 540 NONAME + _ZTV12HsWidgetHost @ 541 NONAME + _ZTV15HsConfiguration @ 542 NONAME + _ZTV15HsPageWallpaper @ 543 NONAME + _ZTV16HsContentService @ 544 NONAME + _ZTV16HsSceneWallpaper @ 545 NONAME + _ZTV17HsShortcutService @ 546 NONAME + _ZTV17HsWallpaperLoader @ 547 NONAME + _ZTV17HsWidgetComponent @ 548 NONAME + _ZTV17HsWidgetOrganizer @ 549 NONAME + _ZTV18HsWidgetHostVisual @ 550 NONAME + _ZTV21HsAnchorPointInCenter @ 551 NONAME + _ZTV21HsHostedWidgetFactory @ 552 NONAME + _ZTV23HsBackupRestoreObserver @ 553 NONAME + _ZTV23HsWallpaperLoaderThread @ 554 NONAME + _ZTV25HsWidgetComponentRegistry @ 555 NONAME + _ZTV26HsAnchorPointInBottomRight @ 556 NONAME + _ZTV5HsGui @ 557 NONAME + _ZTV6HsPage @ 558 NONAME + _ZTV7HsScene @ 559 NONAME + _ZThn16_N11HsWallpaperD0Ev @ 560 NONAME + _ZThn16_N11HsWallpaperD1Ev @ 561 NONAME + _ZThn16_N12HsIdleWidget11setGeometryERK6QRectF @ 562 NONAME + _ZThn16_N12HsIdleWidgetD0Ev @ 563 NONAME + _ZThn16_N12HsIdleWidgetD1Ev @ 564 NONAME + _ZThn16_N12HsPageVisual11setGeometryERK6QRectF @ 565 NONAME + _ZThn16_N12HsPageVisualD0Ev @ 566 NONAME + _ZThn16_N12HsPageVisualD1Ev @ 567 NONAME + _ZThn16_N15HsPageWallpaperD0Ev @ 568 NONAME + _ZThn16_N15HsPageWallpaperD1Ev @ 569 NONAME + _ZThn16_N16HsSceneWallpaperD0Ev @ 570 NONAME + _ZThn16_N16HsSceneWallpaperD1Ev @ 571 NONAME + _ZThn16_N18HsWidgetHostVisualD0Ev @ 572 NONAME + _ZThn16_N18HsWidgetHostVisualD1Ev @ 573 NONAME + _ZThn8_N11HsWallpaperD0Ev @ 574 NONAME + _ZThn8_N11HsWallpaperD1Ev @ 575 NONAME + _ZThn8_N12HsIdleWidgetD0Ev @ 576 NONAME + _ZThn8_N12HsIdleWidgetD1Ev @ 577 NONAME + _ZThn8_N12HsPageVisualD0Ev @ 578 NONAME + _ZThn8_N12HsPageVisualD1Ev @ 579 NONAME + _ZThn8_N15HsPageWallpaperD0Ev @ 580 NONAME + _ZThn8_N15HsPageWallpaperD1Ev @ 581 NONAME + _ZThn8_N16HsSceneWallpaperD0Ev @ 582 NONAME + _ZThn8_N16HsSceneWallpaperD1Ev @ 583 NONAME + _ZThn8_N18HsWidgetHostVisualD0Ev @ 584 NONAME + _ZThn8_N18HsWidgetHostVisualD1Ev @ 585 NONAME + _ZThn8_NK18HsWidgetHostVisual5shapeEv @ 586 NONAME diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/hsdomainmodel.pri --- a/homescreenapp/hsdomainmodel/hsdomainmodel.pri Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsdomainmodel/hsdomainmodel.pri Mon Sep 20 10:19:07 2010 +0300 @@ -39,7 +39,8 @@ ./inc/hswidgettoucharea.h \ ./inc/hspagetoucharea.h \ ./inc/hsidlewidget.h \ - ./inc/hsdocumentloader.h + ./inc/hsdocumentloader.h \ + ./inc/hswidgetpositioningonwidgetadd.h SOURCES += ./src/hscontentservice.cpp \ @@ -64,7 +65,8 @@ ./src/hswidgettoucharea.cpp \ ./src/hspagetoucharea.cpp \ ./src/hsidlewidget.cpp \ - ./src/hsdocumentloader.cpp + ./src/hsdocumentloader.cpp \ + ./src/hswidgetpositioningonwidgetadd.cpp symbian: { HEADERS += ./inc/hsbackuprestoreobserver_p.h \ diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/hsdomainmodel.pro --- a/homescreenapp/hsdomainmodel/hsdomainmodel.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsdomainmodel/hsdomainmodel.pro Mon Sep 20 10:19:07 2010 +0300 @@ -48,12 +48,12 @@ RESOURCES += hsdomainmodel.qrc TARGET.UID3 = 0x20022F38 LIBS += -lxqsettingsmanager -labclient + + MMP_RULES += SMPSAFE } !symbian:{ RESOURCES += hsdomainmodel_win.qrc QT += network } -new_short:DEFINES += HSWIDGETORGANIZER_ALGORITHM - include(hsdomainmodel.pri) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/inc/hsbackuprestoreactivecallback.h --- a/homescreenapp/hsdomainmodel/inc/hsbackuprestoreactivecallback.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsdomainmodel/inc/hsbackuprestoreactivecallback.h Mon Sep 20 10:19:07 2010 +0300 @@ -2,7 +2,7 @@ * 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 the License "Eclipse Public License v1.0" +* under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl-v10.html". * @@ -30,7 +30,7 @@ { public: - IMPORT_C static CHsBURActiveCallback* NewL(HsBackupRestoreObserver* observer); + static CHsBURActiveCallback* NewL(HsBackupRestoreObserver* observer); virtual ~CHsBURActiveCallback(); diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/inc/hsconfiguration.h --- a/homescreenapp/hsdomainmodel/inc/hsconfiguration.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsdomainmodel/inc/hsconfiguration.h Mon Sep 20 10:19:07 2010 +0300 @@ -77,8 +77,11 @@ 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_PROPERTY(int widgetOrganizerAnchorDistance READ widgetOrganizerAnchorDistance WRITE setWidgetOrganizerAnchorDistance) + Q_PROPERTY(WidgetOrganizerSearchSequence widgetOrganizerSearchSequence READ widgetOrganizerSearchSequence WRITE setWidgetOrganizerSearchSequence) Q_ENUMS(SceneType) + Q_ENUMS(WidgetOrganizerSearchSequence) public: HsConfiguration(QObject *parent = 0); @@ -89,6 +92,12 @@ PageWallpapers, SceneWallpaper }; + + enum WidgetOrganizerSearchSequence + { + SearchRowByRow, + SearchColumnByColumn + }; #define SETVALUE(member, name) \ if (member != value) { \ @@ -176,6 +185,10 @@ void setBounceAnimationEasingCurve(QEasingCurve::Type value) { SETVALUE(mBounceAnimationEasingCurve, "bounceAnimationEasingCurve") } QEasingCurve::Type pageChangeAnimationEasingCurve() const { return mPageChangeAnimationEasingCurve; } void setPageChangeAnimationEasingCurve(QEasingCurve::Type value) { SETVALUE(mPageChangeAnimationEasingCurve, "pageChangeAnimationEasingCurve") } + int widgetOrganizerAnchorDistance() const { return mWidgetOrganizerAnchorDistance; } + void setWidgetOrganizerAnchorDistance(int value) { SETVALUE(mWidgetOrganizerAnchorDistance, "widgetOrganizerAnchorDistance") } + WidgetOrganizerSearchSequence widgetOrganizerSearchSequence() const { return mWidgetOrganizerSearchSequence; } + void setWidgetOrganizerSearchSequence(WidgetOrganizerSearchSequence value) { SETVALUE(mWidgetOrganizerSearchSequence, "widgetOrganizerSearchSequence") } #undef SETVALUE @@ -239,6 +252,8 @@ SceneType mSceneType; QEasingCurve::Type mBounceAnimationEasingCurve; QEasingCurve::Type mPageChangeAnimationEasingCurve; + int mWidgetOrganizerAnchorDistance; + WidgetOrganizerSearchSequence mWidgetOrganizerSearchSequence; static HsConfiguration *mInstance; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/inc/hspage.h --- a/homescreenapp/hsdomainmodel/inc/hspage.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsdomainmodel/inc/hspage.h Mon Sep 20 10:19:07 2010 +0300 @@ -64,9 +64,7 @@ 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(); @@ -79,9 +77,6 @@ // 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(); diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/inc/hspagenewwidgetlayout.h --- a/homescreenapp/hsdomainmodel/inc/hspagenewwidgetlayout.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsdomainmodel/inc/hspagenewwidgetlayout.h Mon Sep 20 10:19:07 2010 +0300 @@ -23,7 +23,7 @@ HOMESCREEN_TEST_CLASS(TestHsDomainModel) class HsWidgetHost; -class HsPageNewWidgetLayout : public QGraphicsLayout +class HsPageNewWidgetLayout : public QGraphicsLayout { public: HsPageNewWidgetLayout(const QPointF &touchPoint = QPointF(), @@ -36,13 +36,8 @@ 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; QPointF mTouchPoint; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/inc/hswidgetpositioningonwidgetadd.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/inc/hswidgetpositioningonwidgetadd.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef HSWIDGETPOSITIONINGONWIDGETADD_H +#define HSWIDGETPOSITIONINGONWIDGETADD_H + +#include +#include +#include + +#include "hsconfiguration.h" +#include "hstest_global.h" +#include "hsdomainmodel_global.h" + +HOMESCREEN_TEST_CLASS(TestHsDomainModel) + +class HsWidgetHost; + +class HSDOMAINMODEL_EXPORT HsWidgetPositioningOnWidgetAdd +{ +public: + virtual ~HsWidgetPositioningOnWidgetAdd() {} + + virtual QList convert(const QRectF &contentArea, + const QList &existingRects, + const QList &newRects, + const QPointF &startPoint) = 0; + + static void setInstance(HsWidgetPositioningOnWidgetAdd *instance); + static HsWidgetPositioningOnWidgetAdd *instance(); + +private: + static HsWidgetPositioningOnWidgetAdd *mInstance; +}; + +class HSDOMAINMODEL_EXPORT HsAnchorPointInBottomRight : public HsWidgetPositioningOnWidgetAdd +{ +public: + QList convert(const QRectF &contentArea, + const QList &existingRects, + const QList &newRects, + const QPointF &startPoint); + +}; + +class HSDOMAINMODEL_EXPORT HsAnchorPointInCenter : public HsWidgetPositioningOnWidgetAdd +{ +public: + QList convert(const QRectF &contentArea, + const QList &existingRects, + const QList &newRects, + const QPointF &startPoint); + }; + +class HSDOMAINMODEL_EXPORT HsWidgetOrganizer : public HsWidgetPositioningOnWidgetAdd +{ +public: + HsWidgetOrganizer(int anchorDistance, HsConfiguration::WidgetOrganizerSearchSequence sequence); + ~HsWidgetOrganizer(); + +public: + QList convert(const QRectF &contentArea, + const QList &existingRects, + const QList &newRects, + const QPointF &startPoint); + +private: + enum SortMode {SortByHeight, SortByWidth, SortByArea}; + enum SearchMode {SearchColumn, SearchRow}; + +private: + void initAnchors(); + bool checkExistingRects(const QList &existingRects); + int convertToAnchors(int length); + bool markAnchors(const QRectF &rect); + int getAnchorListIndex(const QPointF &position); + QPointF getPosition(const QSizeF &size); + QPointF searchPositionRowByRow(QPointF startPoint, int width, int height); + QPointF searchPositionColumnByColumn(QPointF startPoint, int width, int height); + QPointF searchSpace(SearchMode mode, QPointF startPoint, int contentLength); + QPointF getAnchorCoordinates(int index); + QList sortRects(SortMode mode, const QMap &rects); + +private: + int mAnchorDistance; + HsConfiguration::WidgetOrganizerSearchSequence mSequence; + QList mAnchors; + QRectF mContentArea; + int mAnchorColumns; + int mAnchorRows; + HsAnchorPointInCenter *mCenterAlgorithm; + + HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) +}; + + +#endif // HSWIDGETPOSITIONINGONWIDGETADD_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/src/hsbackuprestoreactivecallback.cpp --- a/homescreenapp/hsdomainmodel/src/hsbackuprestoreactivecallback.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hsbackuprestoreactivecallback.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -2,7 +2,7 @@ * 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 the License "Eclipse Public License v1.0" +* under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl-v10.html". * diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/src/hsconfiguration.cpp --- a/homescreenapp/hsdomainmodel/src/hsconfiguration.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hsconfiguration.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -75,7 +75,9 @@ mIsSnapEffectsEnabled(true), mSceneType(PageWallpapers), mBounceAnimationEasingCurve(QEasingCurve::Linear), - mPageChangeAnimationEasingCurve(QEasingCurve::Linear) + mPageChangeAnimationEasingCurve(QEasingCurve::Linear), + mWidgetOrganizerAnchorDistance(5), + mWidgetOrganizerSearchSequence(SearchRowByRow) { } diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/src/hscontentservice.cpp --- a/homescreenapp/hsdomainmodel/src/hscontentservice.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hscontentservice.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -98,7 +98,7 @@ } connect(widget,SIGNAL(event_faulted()),SLOT(widgetStartFaulted())); mWidgetStartFaulted = false; - widget->startWidget(); // synchronous operation + widget->startWidget(false); // synchronous operation if (mWidgetStartFaulted) { // page will destroy widget instance return false; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/src/hspage.cpp --- a/homescreenapp/hsdomainmodel/src/hspage.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hspage.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -668,21 +668,12 @@ HsPageVisual *pageVisual = visual(); HsWidgetHostVisual *visual(0); -#ifdef HSWIDGETORGANIZER_ALGORITHM - QList newWidgets; -#endif //HSWIDGETORGANIZER_ALGORITHM + QList newWidgets; foreach (HsWidgetHost *widget, mWidgets) { visual = widget->visual(); if ( pageVisual->isAncestorOf(visual)) { if (!widget->getPresentation(presentation)) { -#ifndef HSWIDGETORGANIZER_ALGORITHM - QList geometries = converter->convert( - from, QList() << visual->geometry(), to); - visual->setGeometry(geometries.first()); - widget->savePresentation(); -#else //HSWIDGETORGANIZER_ALGORITHM newWidgets << widget; -#endif //HSWIDGETORGANIZER_ALGORITHM } else { QRectF adjustWidgetPosition; adjustWidgetPosition = visual->geometry(); @@ -693,16 +684,7 @@ } } } - -#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) { @@ -716,7 +698,7 @@ QList existingRects; foreach (HsWidgetHost *widget, mWidgets) { if (!newWidgets.contains(widget)) { - existingRects << QRectF(widget->visual()->pos(), widget->visual()->preferredSize()); + existingRects << QRectF(widget->visual()->geometry()); } } @@ -726,14 +708,12 @@ 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) @@ -758,45 +738,3 @@ } } } -#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 -*/ -void HsPage::sortWidgets(sortOrder order, QList &widgets) -{ - 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 e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/src/hspagenewwidgetlayout.cpp --- a/homescreenapp/hsdomainmodel/src/hspagenewwidgetlayout.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hspagenewwidgetlayout.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -45,6 +45,7 @@ QGraphicsLayoutItem *parent) : QGraphicsLayout(parent), mTouchPoint(touchPoint) + // add mWidgetRects { mSize = HsGui::instance()->layoutRect().size(); } @@ -104,15 +105,6 @@ { QGraphicsLayout::setGeometry(rect); -#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) { @@ -123,7 +115,7 @@ then there is only one widget in the list -> set widget center point to this touch point */ - if (mTouchPoint != QPointF() && mNewWidgets.count() == 1) { + if (mTouchPoint != QPointF() && newRects.count() == 1) { QRectF widgetRect = newRects.at(0); widgetRect.moveCenter(mTouchPoint); widgetRect.moveTopLeft(HsScene::instance()->activePage()->adjustedWidgetPosition(widgetRect)); @@ -153,8 +145,8 @@ HsWidgetPositioningOnWidgetAdd::instance(); QList calculatedRects = algorithm->convert(pageRect, existingRects, newRects, QPointF()); - - for ( int i=0; ivisual()->setGeometry(calculatedRects.at(i)); mNewWidgets.at(i)->savePresentation(); } @@ -168,47 +160,3 @@ { 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 - diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/src/hswidgethostvisual.cpp --- a/homescreenapp/hsdomainmodel/src/hswidgethostvisual.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hswidgethostvisual.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -84,17 +84,19 @@ QPainterPath path; if (mWidget) { - QRectF currRect = rect(); + QRectF visualRect = rect(); path = mWidget->shape(); - QRectF pathRect(path.boundingRect()); + QRectF widgetRect(path.boundingRect()); + if (widgetRect.width() > visualRect.width() + || widgetRect.height() > visualRect.height()) { + QPainterPath newPath; + newPath.addRect(visualRect); + path = path.intersected(newPath); + } else if ( widgetRect.isEmpty() ) { + path.addRect(visualRect); + } - if (pathRect.width() > currRect.width() - || pathRect.height() > currRect.height()) { - QPainterPath newPath(currRect.topLeft()); - newPath.addRect(currRect); - path = path.intersected(newPath); - } } return path; } diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/src/hswidgetpositioningonwidgetadd.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/src/hswidgetpositioningonwidgetadd.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,627 @@ +/* +* 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: +* +*/ + +#include +#include +#include +#include + +#include "hswidgetpositioningonwidgetadd.h" +#include "hsconfiguration.h" +#include "hsgui.h" + +const qreal offset = 20; //TODO: Implement this as configurable parameter + + +/*! + \class HsWidgetPositioningOnWidgetAdd + \ingroup group_hsutils + \brief +*/ + +/*! + \class HsWidgetPositioningOnWidgetAdd + \brief Defines widget positioning on widget add. + + Widget positioning on widget add sets positions for + a set of home screen widgets added from application library. +*/ + +/*! + Sets the positioning \a instance as the current one. + Deletes the existing instance if present. +*/ +void HsWidgetPositioningOnWidgetAdd::setInstance( + HsWidgetPositioningOnWidgetAdd *instance) +{ + if (mInstance) + delete mInstance; + mInstance = instance; +} + +/*! + Returns the current positioning instance. +*/ +HsWidgetPositioningOnWidgetAdd *HsWidgetPositioningOnWidgetAdd::instance() +{ + return mInstance; +} + +/*! + Stores the current positioning instance. +*/ +HsWidgetPositioningOnWidgetAdd *HsWidgetPositioningOnWidgetAdd::mInstance = 0; + +/*! + \class HsAnchorPointInBottomRight + \brief Diagonal widget positioning algorithm. + + Sets widget's lower right corner to follow content area's diagonal. + Widgets are positioned to certain offset to each other. +*/ +QList HsAnchorPointInBottomRight::convert( + const QRectF &contentArea, + const QList &existingRects, + const QList &newRects, + const QPointF &startPoint) +{ + Q_UNUSED(existingRects); + + QList toGeometries; + + //Offset for widgets' bottom right position to each other + qreal k = contentArea.height()/contentArea.width(); //slope of the diagonal + qreal offset_x = offset/(sqrt(k + 1)); + qreal offset_y = k*offset_x; + QPointF offsetPoint(offset_x, offset_y); + + QPointF anchorPoint; + + if(startPoint.isNull()){ + + QLineF diagonal(contentArea.topLeft(), contentArea.bottomRight()); + QLineF widgetRightSide(contentArea.center().x()+ newRects.at(0).width()/2, + contentArea.top(), + 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 newRects; //Return original since undefined error. + //In this case widget's must be wider than the content area. + } + }else{ + anchorPoint = startPoint - offsetPoint; + } + + QRectF widgetRect; + for(int i=0;i HsAnchorPointInCenter::convert( + const QRectF &contentArea, + const QList &existingRects, + const QList &newRects, + const QPointF &startPoint ) +{ + Q_UNUSED(existingRects); + Q_UNUSED(startPoint) + + QList toGeometries; + + //Offset for widgets' centers position to each other + qreal k = contentArea.height()/contentArea.width(); //slope of the diagonal + qreal offset_x = offset/(sqrt(k + 1)); + qreal offset_y = k*offset_x; + QPointF offsetPoint(offset_x, offset_y); + + //First widget to the center of the content area + QPointF anchorPoint = contentArea.center(); + foreach (QRectF g, newRects) { + g.moveCenter(anchorPoint); + toGeometries << g; + anchorPoint -= offsetPoint; + if(!contentArea.contains(anchorPoint)) { + anchorPoint = contentArea.bottomRight(); + } + } + return toGeometries; +} + +HsWidgetOrganizer::HsWidgetOrganizer(int anchorDistance, + HsConfiguration::WidgetOrganizerSearchSequence sequence) +: mAnchorDistance(anchorDistance), mSequence(sequence), mAnchorColumns(0), mAnchorRows(0), + mCenterAlgorithm(new HsAnchorPointInCenter()) +{ + +} + +HsWidgetOrganizer::~HsWidgetOrganizer() +{ + delete mCenterAlgorithm; +} + +/*! + \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) + + // mandatory check ups + if (mAnchorDistance <= 0 || contentArea == QRectF() || + newRects == QList()) { + return QList(); + } + + // calculate anchor limits based on anchor distance + mAnchorColumns = convertToAnchors(contentArea.width()); + mAnchorRows = convertToAnchors(contentArea.height()); + mContentArea = contentArea; + + // map rects so that we can later return them in original order + QMap newRectsMap; + for (int id = 0; id < newRects.count(); id++) { + newRectsMap.insert(id, newRects.at(id)); + } + + // get orientation + Qt::Orientation orientation(HsGui::instance()->orientation()); + + SortMode mode; + // select sorting mode based on orientation and search sequence + if((orientation == Qt::Vertical && mSequence == HsConfiguration::SearchRowByRow) || + (orientation == Qt::Horizontal && mSequence == HsConfiguration::SearchColumnByColumn)) { + mode = SortByHeight; + } else { + mode = SortByWidth; + } + + // sort rects into order + QList newRectsSorted = sortRects(mode, newRectsMap); + + // initialize anchor points + initAnchors(); + + // go through existing rects + bool ok = checkExistingRects(existingRects); + if (!ok) { + return QList(); + } + + QList newRectsNotCalculated; + QList newExistingRects; + newExistingRects += existingRects; + + // get positions for all new rects + for (int i = 0; i < newRectsMap.count(); i++) { + // proceed in sorted order with the rects + QRectF newRect = newRectsMap.value(newRectsSorted.at(i)); + // find first free anchor point for rect + QPointF position = getPosition(newRect.size()); + if (position != QPointF(-1,-1)) { + QRectF calculatedGeometry = QRectF(position.x() + mContentArea.x(), + position.y() + mContentArea.y(), + newRect.width(), newRect.height()); + // update new rect instead of old one based on id map + newRectsMap.insert(newRectsSorted.at(i), calculatedGeometry); + // update existing rects + newExistingRects << calculatedGeometry; + // mark new rect reserved + bool marked = markAnchors(QRectF(position, newRect.size())); + if (!marked) { + return QList(); + } + + } else { + // collect rect that do not fit + newRectsNotCalculated << newRectsSorted.at(i); + } + } + + // use center algorithm with offset for the rest rects that did not fit to content area + if (newRectsNotCalculated.count() > 0 ) { + // collect not organized rects + QList undoneRects; + for (int i = 0; i < newRectsNotCalculated.count(); i++) { + undoneRects << newRectsMap.value(newRectsNotCalculated.at(i)); + } + QList calculatedRects = + mCenterAlgorithm->convert(mContentArea, newExistingRects, undoneRects, QPointF()); + // update the rest rects instead of old ones + for (int i = 0; i < calculatedRects.count(); i++) { + newRectsMap.insert(newRectsNotCalculated.at(i), calculatedRects.at(i)); + /* take rect out of list and add it to the end of the list + rect that do not fit are added in the end in users add order */ + // we need to map z values to correct widgets to enable this + /* + newRectsMap.take(newRectsNotCalculated.at(i)); + newRectsMap.insert(newRectsMap.count() + i + 1, calculatedRects.at(i)); + */ + } + } + + return newRectsMap.values(); +} + +/*! + Initializes anchor point network for area size +*/ +void HsWidgetOrganizer::initAnchors() +{ + // need to zero just in case (if algorithm is called twice) + mAnchors = QList(); + // create anchor point network + for (int i = 0; i < (mAnchorColumns * mAnchorRows); i++) { + mAnchors.append(false); + } +} + +/*! + Check existing rects and marks them reserved +*/ +bool HsWidgetOrganizer::checkExistingRects(const QList &existingRects) +{ + foreach (QRectF rect, existingRects) { + /* if existing rect is on the edges of content area + need to drop one pixels because there is no anchors on the edge */ + int rightmostPoint = rect.x() + rect.width(); + if (rightmostPoint == mContentArea.width()) { + rect.setWidth(rect.width() - 1); + } + int undermostPoint = rect.y() + rect.height(); + if (undermostPoint == mContentArea.height()) { + rect.setHeight(rect.height() - 1); + } + // decrease content area size in case it does not start from (0,0) + rect = QRectF( + QPointF(rect.x() - mContentArea.x(), rect.y() - mContentArea.y()), + rect.size()); + bool marked = markAnchors(rect); + if (!marked) { + return false; + } + } + return true; +} + +/*! + Calculates pixel length as anchor points +*/ +int HsWidgetOrganizer::convertToAnchors(int length) +{ + // calculate remainder + int remainder = length % mAnchorDistance; + // calculate anchor points (only pixel integrals are counted, decimals are cut away) + int anchorPoints = (length - remainder) / mAnchorDistance; + return anchorPoints; +} + +/*! + Marks reserved anchor points based on given rects +*/ +bool HsWidgetOrganizer::markAnchors(const QRectF &rect) +{ + // in case content does not start from zero, need take contentArea into calculations + int startWidth = convertToAnchors(rect.x()); + int endWidth = convertToAnchors(rect.x() + rect.width()); + int startHeight = convertToAnchors(rect.y()); + int endHeight = convertToAnchors(rect.y() + rect.height()); + + // mark reserved anchors row by row from left to right + for (int i = startWidth; i <= endWidth; i++) { + for (int j = startHeight; j <= endHeight; j++) { + int index = getAnchorListIndex(QPointF(i,j)); + if (index < 0) { + return false; + } + mAnchors[index] = true; + } + } + return true; +} + +/*! + Returns anchor's list index based on given position +*/ +int HsWidgetOrganizer::getAnchorListIndex(const QPointF &position) +{ + int index = (position.y() * mAnchorColumns) + position.x(); + if (index < mAnchors.count()) { + return index; + } else { + return -1; + } +} + +/*! + Finds anchor points for content size +*/ +QPointF HsWidgetOrganizer::getPosition(const QSizeF &size) +{ + QPointF startPoint(0,0); + // convert units from pixels to anchors + int width = convertToAnchors(size.width()); + int height = convertToAnchors(size.height()); + + // based on search sequence, select position searching method + if (mSequence == HsConfiguration::SearchRowByRow) { + startPoint = searchPositionRowByRow(startPoint, width, height); + } else { + startPoint = searchPositionColumnByColumn(startPoint, width, height); + } + + if (startPoint == QPointF(-1,-1)) { + return startPoint; + } else { + // return the actual pixel coordinate + return QPointF(startPoint.x() * mAnchorDistance, startPoint.y() * mAnchorDistance); + } +} + +/*! + Search sequence that finds anchor position by looking first for width on x-axis and + then secondarily on height from y-axis +*/ +QPointF HsWidgetOrganizer::searchPositionRowByRow(QPointF startPoint, int width, int height) +{ + bool anchorFound = false; + QPointF candidatePoint(0,0); + // loop until anchor point is found + while (anchorFound == false) { + // search for width on specified row + candidatePoint = searchSpace(SearchRow, startPoint, width); + if (candidatePoint != QPointF(-1,-1)) { + // update start point to where found width starts + startPoint.setX(candidatePoint.x()); + // check all anchor height points corresponding the found free width points + for(int i = startPoint.x(); i <= startPoint.x() + width; i++) { + // save current start point to be checked + QPointF point = QPointF(i, startPoint.y()); + // search for height on specified column + candidatePoint = searchSpace(SearchColumn, point, height); + if (candidatePoint == QPointF(-1,-1)) { + // update x anchor index + startPoint.setX(startPoint.x() + 1); + // set i to max to stop searching + i = startPoint.x() + width; + } + } + // if all height searches were successfull + if (candidatePoint != QPointF(-1,-1)) { + anchorFound = true; + } + } else { + // update x and y start positions when row has been checked + startPoint.setX(0); + startPoint.setY(startPoint.y() + 1); + // check that enough height left + if (startPoint.y() >= mAnchorRows) { + return QPointF(-1,-1); + } + } + } + + return startPoint; +} + +/*! + Search sequence that finds anchor position by looking first for height on y-axis and + then secondarily on width from x-axis +*/ +QPointF HsWidgetOrganizer::searchPositionColumnByColumn(QPointF startPoint, + int width, int height) +{ + bool anchorFound = false; + QPointF candidatePoint(0,0); + + while (anchorFound == false) { + candidatePoint = searchSpace(SearchColumn, startPoint, height); + if (candidatePoint != QPointF(-1,-1)) { + startPoint.setY(candidatePoint.y()); + for(int i = startPoint.y(); i <= startPoint.y() + height; i++) { + QPointF point = QPointF(startPoint.x(), i); + candidatePoint = searchSpace(SearchRow, point, width); + if (candidatePoint == QPointF(-1,-1)) { + startPoint.setY(startPoint.y() + 1); + i = startPoint.y() + height; + } + } + if (candidatePoint != QPointF(-1,-1)) { + anchorFound = true; + } + } else { + startPoint.setY(0); + startPoint.setX(startPoint.x() + 1); + if (startPoint.x() >= mAnchorColumns) { + return QPointF(-1,-1); + } + } + } + + return startPoint; +} + +/*! + Searches anchor point space for given length +*/ +QPointF HsWidgetOrganizer::searchSpace(SearchMode mode, QPointF startPoint, int length) +{ + int availableLength = 0; + // convert start point to an index in anchor list + int startIndex = getAnchorListIndex(startPoint); + int increment = 0; + int endIndex = 0; + + // set end anchor index depending on checked axis + if (mode == SearchRow) { + // save the last index of the checked row + endIndex = getAnchorListIndex(QPointF((mAnchorColumns - 1), startPoint.y())); + + } else { + // save the last index of the checked column + endIndex = getAnchorListIndex(QPointF(startPoint.x(), (mAnchorRows - 1))); + // we need to add increment due to anchors are listed row by row + increment = mAnchorColumns - 1; + } + + // safety checks + if (startIndex == -1 || endIndex == -1) { + return QPointF(-1,-1); + } + + // loop through anchor indexes, increment is added only when going through height + for (int i = startIndex; i <= endIndex; i = i + 1 + increment) { + // if anchor reserved + if (mAnchors.at(i) == true) { + availableLength = 0; + // if going through the first part of sequence (width/height) + if ((mSequence == HsConfiguration::SearchRowByRow && mode == SearchRow) || + (mSequence == HsConfiguration::SearchColumnByColumn && mode == SearchColumn)) { + // update start index + startIndex = i + 1 + increment; + } else { + // exit immediately if second part of sequence fails + return QPointF(-1,-1); + } + } else { + // if enough space found + if (availableLength == length) { + // return the actual anchor position + return getAnchorCoordinates(startIndex); + } + // update available length + availableLength++; + } + } + + return QPointF(-1,-1); +} + +/*! + 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(); + } +} + +/*! + Sorts rects based on sort mode and given map of rects +*/ +QList HsWidgetOrganizer::sortRects(SortMode mode, const QMap &rects) +{ + QList sortedRects; + int i = 0; + // loop through all rects + QMapIterator id(rects); + while (id.hasNext()) { + id.next(); + int index = 0; + // add first rect id to sorted list + if (i == 0) { + sortedRects << id.key(); + } else { + // go through existing rects in the sorted list + for ( int j = 0; j < sortedRects.count(); j++) { + // calculations for sortByArea + qreal existingArea = rects.value(sortedRects.at(j)).width() * + rects.value(sortedRects.at(j)).height(); + qreal newArea = id.value().width() * id.value().height(); + // sort rects in height order + switch (mode) { + case SortByHeight: + /* if rect heigth is smaller on already + existing ones in the list -> increment index + */ + if (id.value().height() <= rects.value(sortedRects.at(j)).height()) { + index++; + } + break; + // sort rects in width order + case SortByWidth: + // if rect width is smaller -> increment index + if (id.value().width() <= rects.value(sortedRects.at(j)).width()) { + index++; + } + break; + case SortByArea: + // if rect area is smaller -> increment index + if (newArea <= existingArea) { + index++; + } + // otherwise return in original order + default: + index++; + break; + } + } + // add rect id in the sorted list + sortedRects.insert(index, id.key()); + } + i++; + } + return sortedRects; +} + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidget/inc/mockwidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidget/inc/mockwidget.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,55 @@ +/* +* 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: Mocked widget. +* +*/ + +#ifndef MOCKWIDGET_H +#define MOCKWIDGET_H + +#include + +class MockWidget: public HbWidget + { + Q_OBJECT + Q_PROPERTY(bool isOnline READ isOnline WRITE setOnline) + +public: + MockWidget(); + MockWidget(QSizeF widgetSize); + bool isOnline(){ return mOnline; } + void setOnline(bool online){ mOnline = online; } + QPainterPath shape() const; +public slots: + + void onInitialize(); + void onShow(); + void onHide(); + void onUninitialize(); + +signals: + void setPreferences(const QStringList &names); + // for testing + void initializeCalled(); + void showCalled(); + void hideCalled(); + void uninitializeCalled(); +private: + Q_DISABLE_COPY(MockWidget) +private: + bool mOnline; + + }; + +#endif //MOCKWIDGET_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidget/src/mockwidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidget/src/mockwidget.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,66 @@ +/* +* 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: Mocked widget. +* +*/ + +#include +#include +#include + +#include "mockwidget.h" + +MockWidget::MockWidget():HbWidget() +{ + setProperty("my_preference1",QString("sun")); + setProperty("my_preference2",QString("moon")); + setProperty("my_preference3",QString("earth")); +} + +MockWidget::MockWidget(QSizeF widgetSize):HbWidget() +{ + setProperty("my_preference1",QString("sun")); + setProperty("my_preference2",QString("moon")); + setProperty("my_preference3",QString("earth")); + + resize(widgetSize); +} + +void MockWidget::onInitialize() +{ + emit initializeCalled(); +} + +void MockWidget::onShow() +{ + setProperty("testProperty",QString("dynamic_widget_property")); + emit showCalled(); +} + +void MockWidget::onHide() +{ + emit hideCalled(); +} + +void MockWidget::onUninitialize() +{ + emit uninitializeCalled(); +} + +QPainterPath MockWidget::shape() const +{ + QPainterPath path; + path.addRect(rect()); + return path; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugin/inc/mockwidgetplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugin/inc/mockwidgetplugin.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Mocked widget plugin. +* +*/ + +#ifndef MOCKWIDGETPLUGIN_H +#define MOCKWIDGETPLUGIN_H + +#include +#include + +QTM_USE_NAMESPACE + +class MockWidgetPlugin : public QObject, public QServicePluginInterface +{ + Q_OBJECT + Q_INTERFACES(QtMobility::QServicePluginInterface) + +public: + QObject *createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session); +}; + +#endif //MOCKRUNTIMEPLUGIN_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugin/installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugin/installs_win32.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,29 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +localtestfiles.files = ./debug/mockwidgetplugin.dll ./resource/mockwidgetplugin.xml +localtestfiles.path = ./../t_hsdomainmodel/debug/hsresources/plugins/widgetplugins + +localqmfiles.files = ./resource/mockwidgetplugin.qm +localqmfiles.path = ./../t_hsdomainmodel/debug/resource/qt/translations + +globaltestfiles.files = ./debug/mockwidgetplugin.dll ./resource/mockwidgetplugin.xml +globaltestfiles.path = ./../../../../../bin/hstests/hsresources/plugins/widgetplugins + +globalqmfiles.files = ./resource/mockwidgetplugin.qm +globalqmfiles.path = ./../../../../../bin/hstests/resource/qt/translations + + +INSTALLS += localtestfiles globaltestfiles localqmfiles globalqmfiles diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugin/mockwidgetplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugin/mockwidgetplugin.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,23 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +#Header files +HEADERS += ./inc/*.h \ + ../mockwidget/inc/*.h + +#Source files +SOURCES += ./src/*.cpp \ + ../mockwidget/src/*.cpp + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugin/mockwidgetplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugin/mockwidgetplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,45 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +CONFIG += plugin hb mobility +MOBILITY = serviceframework + +DEFINES += HSDOMAINMODEL_TEST + +DEPENDPATH += .\ + ./src \ + ./inc \ + ../mockwidget/inc/ \ + ../mockwidget/src/ + +INCLUDEPATH += .\ + ./inc \ + ../mockwidget/inc/ + +symbian: { + +CONFIG += symbian_test + +TARGET.UID3 = 0x20022F71 +TARGET.CAPABILITY = CAP_APPLICATION AllFiles +TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB +TARGET.EPOCALLOWDLLDATA=1 +MMP_RULES += SMPSAFE +} + +include(mockwidgetplugin.pri) +win32:include(installs_win32.pri) \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugin/resource/mockwidgetplugin.qm Binary file homescreenapp/hsdomainmodel/tsrc/mockwidgetplugin/resource/mockwidgetplugin.qm has changed diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugin/resource/mockwidgetplugin.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugin/resource/mockwidgetplugin.ts Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,26 @@ + + + + + + Hello World title + Hello World + Hello World + + helloview + title + he + False + + + Hello text + Hello! + Hello! + + helloview + info + he + False + + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugin/resource/mockwidgetplugin.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugin/resource/mockwidgetplugin.xml Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,12 @@ + + + mockwidgetplugin + mockwidgetplugin + Mocked Homescreen Widget Plugin + + com.nokia.symbian.IHomeScreenWidget + 1.0 + widget interface + + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugin/src/mockwidgetplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugin/src/mockwidgetplugin.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Mocked widget plugin. +* +*/ + +#include +#include +#include + +#include "mockwidget.h" +#include "mockwidgetplugin.h" + +QObject *MockWidgetPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session) +{ + Q_UNUSED(context); + Q_UNUSED(session); + + if (descriptor.interfaceName() == "com.nokia.symbian.IHomeScreenWidget") { + return new MockWidget(); + } else { + return 0; + } +} + +Q_EXPORT_PLUGIN2(mockwidgetplugin, MockWidgetPlugin) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/inc/mockwidgetcheater.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/inc/mockwidgetcheater.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,56 @@ +/* +* 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: Mocked Mocked widget plugin, which trys +* to changes it's size illegally. +* +*/ + +#ifndef MOCKWIDGETCHEATER_H +#define MOCKWIDGETCHEATER_H + +#include + +class MockWidgetCheater: public HbWidget + { + Q_OBJECT + Q_PROPERTY(bool isOnline READ isOnline WRITE setOnline) + +public: + MockWidgetCheater(); + MockWidgetCheater(QSizeF widgetSize); + bool isOnline(){ return mOnline; } + void setOnline(bool online){ mOnline = online; } + QPainterPath shape() const; +public slots: + + void onInitialize(); + void onShow(); + void onHide(); + void onUninitialize(); + +signals: + void setPreferences(const QStringList &names); + // for testing + void initializeCalled(); + void showCalled(); + void hideCalled(); + void uninitializeCalled(); +private: + Q_DISABLE_COPY(MockWidgetCheater) +private: + bool mOnline; + + }; + +#endif //MOCKWIDGETCHEATER_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/inc/mockwidgetplugincheater.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/inc/mockwidgetplugincheater.h Mon Sep 20 10:19: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: Mocked Mocked widget plugin, which trys +* to changes it's size illegally. +* +*/ + +#ifndef MOCKWIDGETPLUGINCHEATER_H +#define MOCKWIDGETPLUGINCHEATER_H + +#include +#include + +QTM_USE_NAMESPACE + +class MockWidgetPluginCheater : public QObject, public QServicePluginInterface +{ + Q_OBJECT + Q_INTERFACES(QtMobility::QServicePluginInterface) + +public: + QObject *createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session); +}; + +#endif //MOCKWIDGETPLUGINCHEATER_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/installs_win32.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,29 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +localtestfiles.files = ./debug/mockwidgetplugincheater.dll ./resource/mockwidgetplugincheater.xml +localtestfiles.path = ./../t_hsdomainmodel/debug/hsresources/plugins/widgetplugins + +localqmfiles.files = ./resource/mockwidgetplugincheater.qm +localqmfiles.path = ./../t_hsdomainmodel/debug/resource/qt/translations + +globaltestfiles.files = ./debug/mockwidgetplugincheater.dll ./resource/mockwidgetplugincheater.xml +globaltestfiles.path = ./../../../../../bin/hstests/hsresources/plugins/widgetplugins + +globalqmfiles.files = ./resource/mockwidgetplugincheater.qm +globalqmfiles.path = ./../../../../../bin/hstests/resource/qt/translations + + +INSTALLS += localtestfiles globaltestfiles localqmfiles globalqmfiles diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/mockwidgetplugincheater.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/mockwidgetplugincheater.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,21 @@ +# +# 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: +# +#Header files +HEADERS += ./inc/*.h + +#Source files +SOURCES += ./src/*.cpp + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/mockwidgetplugincheater.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/mockwidgetplugincheater.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,42 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +CONFIG += plugin hb mobility +MOBILITY = serviceframework + +DEFINES += HSDOMAINMODEL_TEST + +DEPENDPATH += .\ + ./src \ + ./inc + +INCLUDEPATH += .\ + ./inc + +symbian: { + +CONFIG += symbian_test + +TARGET.UID3 = 0x20022F70 +TARGET.CAPABILITY = CAP_APPLICATION AllFiles +TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB +TARGET.EPOCALLOWDLLDATA=1 +MMP_RULES += SMPSAFE +} + +include(mockwidgetplugincheater.pri) +win32:include(installs_win32.pri) \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/resource/mockwidgetplugincheater.qm Binary file homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/resource/mockwidgetplugincheater.qm has changed diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/resource/mockwidgetplugincheater.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/resource/mockwidgetplugincheater.ts Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,26 @@ + + + + + + Hello World title + Hello World + Hello World + + helloview + title + he + False + + + Hello text + Hello! + Hello! + + helloview + info + he + False + + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/resource/mockwidgetplugincheater.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/resource/mockwidgetplugincheater.xml Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,12 @@ + + + mockwidgetplugincheater + mockwidgetplugincheater + Mocked Homescreen Widget Plugin, which cheats... + + com.nokia.symbian.IHomeScreenWidget + 1.0 + widget interface + + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/src/mockwidgetcheater.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/src/mockwidgetcheater.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Mocked Mocked widget plugin, which trys +* to changes it's size illegally. +* +*/ + +#include +#include +#include + +#include "mockwidgetcheater.h" + +MockWidgetCheater::MockWidgetCheater():HbWidget() +{ + setProperty("my_preference1",QString("sun")); + setProperty("my_preference2",QString("moon")); + setProperty("my_preference3",QString("earth")); +} + +MockWidgetCheater::MockWidgetCheater(QSizeF widgetSize):HbWidget() +{ + setProperty("my_preference1",QString("sun")); + setProperty("my_preference2",QString("moon")); + setProperty("my_preference3",QString("earth")); + + resize(widgetSize); +} + +void MockWidgetCheater::onInitialize() +{ + emit initializeCalled(); +} + +void MockWidgetCheater::onShow() +{ + setProperty("testProperty",QString("dynamic_widget_property")); + emit showCalled(); +} + +void MockWidgetCheater::onHide() +{ + emit hideCalled(); +} + +void MockWidgetCheater::onUninitialize() +{ + emit uninitializeCalled(); +} + +QPainterPath MockWidgetCheater::shape() const +{ + QPainterPath path; + QRectF currentRect(rect()); + currentRect.setHeight(currentRect.height() + 10); + path.addRect(currentRect); + return path; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/src/mockwidgetplugincheater.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugincheater/src/mockwidgetplugincheater.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Mocked Mocked widget plugin, which trys +* to changes it's size illegally. +* +*/ + +#include +#include +#include + +#include "mockwidgetcheater.h" +#include "mockwidgetplugincheater.h" + +QObject *MockWidgetPluginCheater::createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session) +{ + Q_UNUSED(context); + Q_UNUSED(session); + + if (descriptor.interfaceName() == "com.nokia.symbian.IHomeScreenWidget") { + return new MockWidgetCheater(QSizeF(100,100)); + } else { + return 0; + } +} + +Q_EXPORT_PLUGIN2(mockwidgetplugincheater, MockWidgetPluginCheater) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoobig/inc/mockwidgetplugintoobig.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoobig/inc/mockwidgetplugintoobig.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Mocked widget plugin. +* +*/ + +#ifndef MOCKWIDGETPLUGINTOOBIG_H +#define MOCKWIDGETPLUGINTOOBIG_H + +#include +#include + +QTM_USE_NAMESPACE + +class MockWidgetPluginTooBig : public QObject, public QServicePluginInterface +{ + Q_OBJECT + Q_INTERFACES(QtMobility::QServicePluginInterface) + +public: + QObject *createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session); +}; + +#endif //MOCKRUNTIMEPLUGINTOOBIG_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoobig/installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoobig/installs_win32.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,22 @@ +# +# 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: +# +localtestfiles.files = ./debug/mockwidgetplugintoobig.dll ./resource/mockwidgetplugintoobig.xml +localtestfiles.path = ./../t_hsdomainmodel/debug/hsresources/plugins/widgetplugins + +globaltestfiles.files = ./debug/mockwidgetplugintoobig.dll ./resource/mockwidgetplugintoobig.xml +globaltestfiles.path = ./../../../../../bin/hstests/hsresources/plugins/widgetplugins + +INSTALLS += localtestfiles globaltestfiles diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoobig/mockwidgetplugintoobig.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoobig/mockwidgetplugintoobig.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,23 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +#Header files +HEADERS += ./inc/*.h \ + ../mockwidget/inc/*.h + +#Source files +SOURCES += ./src/*.cpp \ + ../mockwidget/src/*.cpp + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoobig/mockwidgetplugintoobig.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoobig/mockwidgetplugintoobig.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,47 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +CONFIG += plugin hb mobility +MOBILITY = serviceframework + +DEFINES += HSDOMAINMODEL_TEST + +DEPENDPATH += .\ + ./src \ + ./inc \ + ../mockwidget/inc/ \ + ../mockwidget/src/ + +INCLUDEPATH += .\ + ./inc \ + ../mockwidget/inc/ + +symbian: { + +CONFIG += symbian_test + +TARGET.UID3 = 0x20022F77 +TARGET.CAPABILITY = CAP_APPLICATION AllFiles +TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB +TARGET.EPOCALLOWDLLDATA=1 + +MMP_RULES += SMPSAFE + +} + +include(mockwidgetplugintoobig.pri) +win32:include(installs_win32.pri) \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoobig/resource/mockwidgetplugintoobig.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoobig/resource/mockwidgetplugintoobig.xml Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,12 @@ + + + mockwidgetplugintoobig + mockwidgetplugintoobig + Mocked Homescreen Widget Plugin + + com.nokia.symbian.IHomeScreenWidget + 1.0 + widget interface + + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoobig/src/mockwidgetplugintoobig.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoobig/src/mockwidgetplugintoobig.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Mocked widget plugin. +* +*/ + +#include +#include +#include + +#include "mockwidget.h" +#include "mockwidgetplugintoobig.h" + +QObject *MockWidgetPluginTooBig::createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session) +{ + Q_UNUSED(context); + Q_UNUSED(session); + + if (descriptor.interfaceName() == "com.nokia.symbian.IHomeScreenWidget") { + return new MockWidget(QSizeF(1000,1000)); + } else { + return 0; + } +} + +Q_EXPORT_PLUGIN2(mockwidgetplugintoobig, MockWidgetPluginTooBig) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoosmall/inc/mockwidgetplugintoosmall.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoosmall/inc/mockwidgetplugintoosmall.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Mocked widget plugin. +* +*/ + +#ifndef MOCKWIDGETPLUGINTOOSMALL_H +#define MOCKWIDGETPLUGINTOOSMALL_H + +#include +#include + +QTM_USE_NAMESPACE + +class MockWidgetPluginTooSmall : public QObject, public QServicePluginInterface +{ + Q_OBJECT + Q_INTERFACES(QtMobility::QServicePluginInterface) + +public: + QObject *createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session); +}; + +#endif //MOCKRUNTIMEPLUGINTOOSMALL_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoosmall/installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoosmall/installs_win32.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,22 @@ +# +# 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: +# +localtestfiles.files = ./debug/mockwidgetplugintoosmall.dll ./resource/mockwidgetplugintoosmall.xml +localtestfiles.path = ./../t_hsdomainmodel/debug/hsresources/plugins/widgetplugins + +globaltestfiles.files = ./debug/mockwidgetplugintoosmall.dll ./resource/mockwidgetplugintoosmall.xml +globaltestfiles.path = ./../../../../../bin/hstests/hsresources/plugins/widgetplugins + +INSTALLS += localtestfiles globaltestfiles diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoosmall/mockwidgetplugintoosmall.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoosmall/mockwidgetplugintoosmall.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,23 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +#Header files +HEADERS += ./inc/*.h \ + ../mockwidget/inc/*.h + +#Source files +SOURCES += ./src/*.cpp \ + ../mockwidget/src/*.cpp + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoosmall/mockwidgetplugintoosmall.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoosmall/mockwidgetplugintoosmall.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,47 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +CONFIG += plugin hb mobility +MOBILITY = serviceframework + +DEFINES += HSDOMAINMODEL_TEST + +DEPENDPATH += .\ + ./src \ + ./inc \ + ../mockwidget/inc/ \ + ../mockwidget/src/ + +INCLUDEPATH += .\ + ./inc \ + ../mockwidget/inc/ + +symbian: { + +CONFIG += symbian_test + +TARGET.UID3 = 0x20022F75 +TARGET.CAPABILITY = CAP_APPLICATION AllFiles +TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB +TARGET.EPOCALLOWDLLDATA=1 + +MMP_RULES += SMPSAFE + +} + +include(mockwidgetplugintoosmall.pri) +win32:include(installs_win32.pri) \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoosmall/resource/mockwidgetplugintoosmall.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoosmall/resource/mockwidgetplugintoosmall.xml Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,12 @@ + + + mockwidgetplugintoosmall + mockwidgetplugintoosmall + Mocked Homescreen Widget Plugin + + com.nokia.symbian.IHomeScreenWidget + 1.0 + widget interface + + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoosmall/src/mockwidgetplugintoosmall.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/mockwidgetplugintoosmall/src/mockwidgetplugintoosmall.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Mocked widget plugin. +* +*/ + +#include +#include +#include + +#include "mockwidget.h" +#include "mockwidgetplugintoosmall.h" + +QObject *MockWidgetPluginTooSmall::createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session) +{ + Q_UNUSED(context); + Q_UNUSED(session); + + if (descriptor.interfaceName() == "com.nokia.symbian.IHomeScreenWidget") { + return new MockWidget(QSizeF(5,5)); + } else { + return 0; + } +} + +Q_EXPORT_PLUGIN2(mockwidgetplugintoosmall, MockWidgetPluginTooSmall) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/sis/t_hsdomainmodel.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/sis/t_hsdomainmodel.pkg Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,64 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; + +; Language +&EN + +; SIS header: name, uid, version +#{"t_hsdomainmodel"},(0x20022F59),1,0,0 + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Supports S60 5th Edition +[0x1028315F], 0, 0, 0, {"S60ProductID"} + +; domain model test +"/epoc32/release/armv5/urel/t_hsdomainmodel.exe" - "c:/sys/bin/t_hsdomainmodel.exe" +"/epoc32/data/z/private/10003a3f/import/apps/t_hsdomainmodel_reg.rsc" - "c:/private/10003a3f/import/apps/t_hsdomainmodel_reg.rsc" +"/epoc32/data/z/resource/apps/t_hsdomainmodel.rsc" - "c:/resource/apps/t_hsdomainmodel.rsc" + +; Test resources +"../t_hsdomainmodel/hsdomainmodeltest.db" - "c:/private/20022F59/hsdomainmodeltest.db" +"../t_hsdomainmodel/resource/default_portrait.png" - "c:/private/20022F59/wallpapers/scene/default_landscape.png" +"../t_hsdomainmodel/resource/default_landscape.png" - "c:/private/20022F59/wallpapers/scene/default_portrait.png" +"../t_hsdomainmodel/resource/default_portrait.png" - "c:/private/20022F59/wallpapers/page/default_landscape.png" +"../t_hsdomainmodel/resource/default_landscape.png" - "c:/private/20022F59/wallpapers/page/default_portrait.png" + +; mockwidgetplugin +"/epoc32/release/armv5/urel/mockwidgetplugin.dll" - "c:/sys/bin/mockwidgetplugin.dll" +"/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugin.qtplugin" - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugin.qtplugin" +"/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugin.xml" - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugin.xml" +"/epoc32/data/z/resource/qt/translations/mockwidgetplugin.qm" - "c:/resource/qt/translations/mockwidgetplugin.qm" + +; mockwidgetplugintoosmall +"/epoc32/release/armv5/urel/mockwidgetplugintoosmall.dll" - "c:/sys/bin/mockwidgetplugintoosmall.dll" +"/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoosmall.qtplugin" - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoosmall.qtplugin" +"/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoosmall.xml" - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoosmall.xml" + +; mockwidgetplugintoobig +"/epoc32/release/armv5/urel/mockwidgetplugintoobig.dll" - "c:/sys/bin/mockwidgetplugintoobig.dll" +"/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" + +; mockwidgetplugincheater +"/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" +"/epoc32/data/z/resource/qt/translations/mockwidgetplugincheater.qm" - "c:/resource/qt/translations/mockwidgetplugincheater.qm" diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/sis/t_hsdomainmodel_sisx.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/sis/t_hsdomainmodel_sisx.bat Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,30 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem +@echo off + +if exist t_hsdomainmodel.sisx del t_hsdomainmodel.sisx + +makesis t_hsdomainmodel.pkg +signsis t_hsdomainmodel.sis t_hsdomainmodel.sisx ../../../internal/sis/rd.cer ../../../internal/sis/rd-key.pem + +if exist t_hsdomainmodel.sisx ( +echo t_hsdomainmodel.sisx creation SUCCEEDED +del t_hsdomainmodel.sis +) + +if not exist t_hsdomainmodel.sisx ( +echo t_hsdomainmodel.sisx creation FAILED +) \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/createdatabase.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/createdatabase.sql Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,39 @@ +DROP TABLE IF EXISTS Scene; +CREATE TABLE Scene ( + id INTEGER PRIMARY KEY); + +DROP TABLE IF EXISTS Pages; +CREATE TABLE Pages ( + id INTEGER PRIMARY KEY, + indexPosition INTEGER); + +DROP TABLE IF EXISTS Widgets; +CREATE TABLE Widgets ( + id INTEGER PRIMARY KEY, + uri TEXT, + pageId INTEGER); + +DROP TABLE IF EXISTS WidgetPresentations; +CREATE TABLE WidgetPresentations ( + key TEXT, + x REAL, + y REAL, + zValue REAL, + widgetId INTEGER, + UNIQUE(widgetId, key) ON CONFLICT REPLACE, + FOREIGN KEY(widgetId) REFERENCES Widgets(id) ON DELETE CASCADE); + +DROP TABLE IF EXISTS WidgetPreferences; +CREATE TABLE WidgetPreferences ( + key TEXT, + value TEXT, + widgetId INTEGER, + UNIQUE(widgetId, key) ON CONFLICT REPLACE, + FOREIGN KEY(widgetId) REFERENCES Widgets(id) ON DELETE CASCADE); + +DROP TABLE IF EXISTS Configuration; +CREATE TABLE Configuration ( + key TEXT, + value TEXT, + UNIQUE(key) ON CONFLICT REPLACE); + \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/hsdomainmodeltest.db Binary file homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/hsdomainmodeltest.db has changed diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/hsdomainmodeltest.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/hsdomainmodeltest.sql Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,42 @@ +INSERT INTO Scene (id) VALUES (1); +INSERT INTO Configuration (key, value) VALUES ('bounceEffect', '20'); +INSERT INTO Configuration (key, value) VALUES ('widgetTapAndHoldTimeout', '500'); +INSERT INTO Configuration (key, value) VALUES ('sceneTapAndHoldTimeout', '500'); +INSERT INTO Configuration (key, value) VALUES ('pageChangeAnimationDuration', '200'); +INSERT INTO Configuration (key, value) VALUES ('pageChangeZoneAnimationDuration', '800'); +INSERT INTO Configuration (key, value) VALUES ('pageChangeZoneReverseAnimationDuration', '200'); +INSERT INTO Configuration (key, value) VALUES ('pageRemovedAnimationDuration', '200'); +INSERT INTO Configuration (key, value) VALUES ('newPageAddedAnimationDuration', '200'); +INSERT INTO Configuration (key, value) VALUES ('widgetDragEffectDuration', '200'); +INSERT INTO Configuration (key, value) VALUES ('widgetDropEffectDuration', '200'); +INSERT INTO Configuration (key, value) VALUES ('defaultPageId', '1'); +INSERT INTO Configuration (key, value) VALUES ('maximumPageCount', '8'); +INSERT INTO Configuration (key, value) VALUES ('isShortcutLabelVisible', 'true'); +INSERT INTO Configuration (key, value) VALUES ('bounceFeedbackEffectDistance', '3'); +INSERT INTO Configuration (key, value) VALUES ('pageChangePanDistanceInPixels', '120'); +INSERT INTO Configuration (key, value) VALUES ('tapAndHoldDistance', '16'); +INSERT INTO Configuration (key, value) VALUES ('pageChangeZoneWidth', '60'); +INSERT INTO Configuration (key, value) VALUES ('pageIndicatorSpacing', '8'); +INSERT INTO Configuration (key, value) VALUES ('maximumWidgetHeight', '39'); +INSERT INTO Configuration (key, value) VALUES ('maximumWidgetWidth', '48'); +INSERT INTO Configuration (key, value) VALUES ('minimumWidgetHeight', '8.75'); +INSERT INTO Configuration (key, value) VALUES ('minimumWidgetWidth', '8.75'); +INSERT INTO Configuration (key, value) VALUES ('pageChangePanDistance', '17.91'); +INSERT INTO Configuration (key, value) VALUES ('pageChangeFeedbackEffect', 'Sensitive'); +INSERT INTO Configuration (key, value) VALUES ('widgetPickFeedbackEffect', 'ItemPick'); +INSERT INTO Configuration (key, value) VALUES ('widgetDropFeedbackEffect', 'ItemDrop'); +INSERT INTO Configuration (key, value) VALUES ('widgetRepositionFeedbackEffect', 'BounceEffect'); +INSERT INTO Configuration (key, value) VALUES ('widgetOverTrashbinFeedbackEffect', 'ItemMoveOver'); +INSERT INTO Configuration (key, value) VALUES ('widgetDropToTrashbinFeedbackEffect', 'ItemDrop'); +INSERT INTO Configuration (key, value) VALUES ('shortcutWidgetTapFeedbackEffect', 'BasicItem'); +INSERT INTO Configuration (key, value) VALUES ('widgetMoveBlockedFeedbackEffect', 'Basic'); +INSERT INTO Configuration (key, value) VALUES ('clockWidgetTapFeedbackEffect', 'BasicItem'); +INSERT INTO Configuration (key, value) VALUES ('widgetSnappingFeedbackEffect', 'ItemMoveOver'); +INSERT INTO Configuration (key, value) VALUES ('isSnapEnabled', 'true'); +INSERT INTO Configuration (key, value) VALUES ('snapTimeout', '1000'); +INSERT INTO Configuration (key, value) VALUES ('snapForce', '30'); +INSERT INTO Configuration (key, value) VALUES ('snapGap', '6'); +INSERT INTO Configuration (key, value) VALUES ('snapBorderGap', '0'); +INSERT INTO Configuration (key, value) VALUES ('snapLineFadeInDuration', '200'); +INSERT INTO Configuration (key, value) VALUES ('snapLineFadeOutDuration', '100'); + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/inc/t_hsdomainmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/inc/t_hsdomainmodel.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,232 @@ +/* +* 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 + +class CaService; + +class TestHsDomainModel : public QObject +{ + Q_OBJECT + +private slots: + void init(); + void cleanup(); + void initTestCase(); + void cleanupTestCase(); + + //t_hswidgethostvisual + void testHsWidgetHostVisualConstruction(); + void testHsWidgetHostVisualShape(); + void testHsWidgetHostVisualSetWidget(); + void testHsWidgetHostVisualSetVisualModel(); + void testHsWidgetHostVisualEffects(); + void testHsWidgetHostVisualEventFilter(); + void testHsWidgetHostVisualGestureEvent(); + void testHsWidgetHostVisualSetupTouchArea(); + void testHsWidgetHostVisualSetupEffects(); + void testHsWidgetHostVisualSetNewSize(); + + //t_hsidlewidget + void testIdleWidgetConstruction(); + void testIdleWidgetSetGeometry(); + void testIdleWidgetSetSceneX(); + void testIdleWidgetSetActivePage(); + void testIdleWidgetInsertPage(); + void testIdleWidgetRemovePage(); + void testIdleWidgetLayers(); + void testIdleWidgetTrashbin(); + void testIdleWidgetPageIndicator(); + void testIdleWidgetParallaxFactor(); + void testIdleWidgetShowTrashBin(); + void testIdleWidgetShowPageIndicator(); + void testIdleWidgetShowSnapLines(); + void testIdleWidgetPolishEvent(); + + // testshortcutservice.cpp + void testShortcutService(); + + //t_hsdatabase.cpp + void testHsDatabaseConstruction(); + void testHsDatabaseProperties(); + void testHsDatabaseStaticInterface(); + void testHsDatabaseTransaction(); + void testHsDatabaseSceneMethods(); + void testHsDatabasePageMethods(); + void testHsDatabaseWidgetMethods(); + void testHsDatabaseWidgetPreferenceMethods(); + void testHsDatabaseBadConnection(); + void testHsDatabaseMatchWidgetsPreferences_data(); + void testHsDatabaseMatchWidgetsPreferences(); + void testHsDatabaseWidgetsCount(); + void testHsDatabaseUpdateWidgetZValues(); + + //t_hswidgethost.cpp + void testHsWidgetHostConstruction(); + void testHsWidgetHostStateMachine(); + void testHsWidgetHostCloseAndRemove(); + void testHsWidgetHostPage(); + void testHsWidgetHostEffects(); + void testHsWidgetHostShowAndHideActions(); + void testHsWidgetHostPresentation(); + void testHsWidgetHostOnError(); + void testHsWidgetHostOnSetPreferences(); + void testHsWidgetHostShape(); + void testHsWidgetHostShapeInvalidValues(); + void testHsWidgetHostGestureEvent(); + + //testcontentservice.cpp + void testCreateNDeleteWidget(); + void testContentServiceStaticInterface(); + void testContentServiceWidgetCount(); + + //t_hswallpaperloaderthread.cpp + void testHsWallpaperLoaderThreadConstruction(); + void testHsWallpaperLoaderThreadRun(); + + //t_hswallpaperloader.cpp + void testHsWallpaperLoaderConstruction(); + void testHsWallpaperLoaderStartWithFinished(); + void testHsWallpaperLoaderStartWithFailed(); + void testHsWallpaperLoaderCancel(); + + //t_hswallpaper.cpp + void testHsWallpaperConstruction(); + void testHsWallpaperSetNRemoveDefaultImage(); + void testHsWallpaperSetNRemoveImage(); + void testHsWallpaperLoaderFailed(); + void testHsWallpaperScene(); + void testHsWallpaperPage(); + void testHsWallpaperSetImages(); + + //t_hspage.cpp + void testHsPage(); + void testHsPageLoad(); + void testHsPageContentRects(); + void testHsPageAddRemoveWidget(); + void testHsPageAddExistingWidget(); + void testHsPageWidgetFinished(); + void testHsPageIsActivePage(); + void testHsPageWidgetSignals(); + void testHsPageOrientationChange(); + void testHsPageDeleteFromDatabase(); + void testHsPageOnPageMarginChanged(); + void testHsPageIndex(); + + //t_hspagenewwidgetlayout.cpp + void testHsPageNewWidgetLayout(); + void testHsPageNewWidgetLayoutWithPosition(); + + //t_hsscene.cpp + void testSceneDefaultValues(); + void testSceneStaticInterface(); + void testSceneLoad(); + void testSceneAddPages(); + void testSceneOnline(); + void testSceneEventFilter(); + + //t_hswidgetcomponent.cpp + void testWidgetComponent(); + void testWidgetComponentEmits(); + + //t_hswidgetcomponentregistry.cpp + void testWidgetComponentRegistry(); + void testWidgetComponentRegistryOnEntryChanged(); + + // hswidgetcomponentdescriptor.cpp + void testWidgetComponentDescriptor(); + + // t_hsbackuprestoreobserver.cpp + void testBackupRestoreObserver(); + void testBackupRestoreObserverStarted(); + void testBackupRestoreObserverCompleted(); +#ifdef Q_OS_SYMBIAN + void testBackupRestoreObserverPsKeyObserver(); +#endif //Q_OS_SYMBIAN + // t_hsbackuprestoreactivecallback.cpp + void testBackupRestoreActiveCallback(); + + // t_hsconfiguration.cpp + void testConfigurationConstruction(); + void testConfigurationStaticInterface(); + void testConfigurationSizes(); + void testConfigurationImportAndExport(); + void testConfigurationLoad(); + + // t_hspagetoucharea.cpp + void testPageTouchAreaConstruction(); + void testPageTouchAreaGestureEvent(); + + // t_hswidgettoucharea.cpp + void testWidgetTouchAreaConstruction(); + void testWidgetTouchAreaSceneEvent(); + void testWidgetTouchAreaGestureEvent(); + + // hsdocumentloader.cpp + void testDocumentLoaderConstructors(); + void testDocumentLoaderCreateObjects(); + + // t_hswidgetpositioningonwidgetadd + void testWidgetPositioningOnWidgetAddChangeInstance(); + void testHsAnchorPointInBottomRight_data(); + void testHsAnchorPointInBottomRight(); + void testHsWidgetOrganizerCase1_data(); + void testHsWidgetOrganizerCase1(); + void testHsWidgetOrganizerCase2_data(); + void testHsWidgetOrganizerCase2(); + void testHsWidgetOrganizerCase3_data(); + void testHsWidgetOrganizerCase3(); + + /** + * hsgui.cpp + */ + void testGuiStaticInterface(); + void testSetupCleanupIdleUi(); + void testOrientation(); + void testShow(); + void testPageChangeAnimation(); + void testPageCrawlingAnimation(); + + /** + * hshostedwidgetfactory.cpp + */ + void testHostedWidgetFactoryStaticInterface(); +private: + void createPagesToDatabase(int pageCount); + void createSceneWithPages(int pageCount=1,int activePageIndex=0); + void destroySceneAndPages(); + QString sourceTestWallpaper(); + QString targetPortraitTestWallpaper(); + QString targetLandscapeTestWallpaper(); + QString tempTestWallpaper(); + QString notExistingTestWallpaper(); + QString wallpaperDirectory(); + void cleanupTargetWallpaperFiles(); + +signals: + void quitStateMachine(); + +private: + HbMainWindow mainWindow; + + QSharedPointer mCaService; + bool mWallpaperTypeScene; //set true at init() +}; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/installs_symbian.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/installs_symbian.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,44 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +exporttestdb.sources = hsdomainmodeltest.db +exporttestdb.path = . + +exporttestwallpapers.sources = ./resource/default_portrait.png \ + ./resource/default_landscape.png +exporttestwallpapers.path = ./wallpapers/scene/ + +exporttestwallpapers2.sources = ./resource/default_portrait.png \ + ./resource/default_landscape.png +exporttestwallpapers2.path = ./wallpapers/page/ + +exportmockwidgetplugin.sources = ./../mockwidgetplugin/resource/mockwidgetplugin.xml \ + ./../mockwidgetplugincheater/resource/mockwidgetplugincheater.xml \ + ./../mockwidgetplugintoobig/resource/mockwidgetplugintoobig.xml \ + ./../mockwidgetplugintoosmall/resource/mockwidgetplugintoosmall.xml +exportmockwidgetplugin.path = ./hsresources/plugins/widgetplugins + +mockwidgetpluginqmfiles.sources = ./../mockwidgetplugin/resource/mockwidgetplugin.qm \ + ./../mockwidgetplugincheater/resource/mockwidgetplugincheater.qm +mockwidgetpluginqmfiles.path = /resource/qt/translations + +pluginstub.sources = ./../mockwidgetplugin/qmakepluginstubs/mockwidgetplugin.dll \ + ./../mockwidgetplugincheater/qmakepluginstubs/mockwidgetplugincheater.dll \ + ./../mockwidgetplugintoobig/qmakepluginstubs/mockwidgetplugintoobig.dll \ + ./../mockwidgetplugintoosmall/qmakepluginstubs/mockwidgetplugintoosmall.dll +pluginstub.path = ./hsresources/plugins/widgetplugins + +DEPLOYMENT += exporttestdb exporttestwallpapers exporttestwallpapers2 exportmockwidgetplugin mockwidgetpluginqmfiles pluginstub diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/installs_win32.pri Mon Sep 20 10:19: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: + +dlocaldatafiles1.files = ./hsdomainmodeltest.db +dlocaldatafiles1.path = ./debug + +dlocaldatafiles2.files = ./resource/*.png +dlocaldatafiles2.path = ./debug/wallpapers/scene/ + +dlocaldatafiles3.files = ./resource/*.png +dlocaldatafiles3.path = ./debug/wallpapers/page/ + +globaldatafiles1.files = ./hsdomainmodeltest.db +globaldatafiles1.path = ./../../../../../bin/hstests + +globaldatafiles2.files = ./resource/*.png +globaldatafiles2.path = ./../../../../../bin/hstests/wallpapers/scene/ + +globaldatafiles3.files = ./resource/*.png +globaldatafiles3.path = ./../../../../../bin/hstests/wallpapers/page/ + +globaltest.files = ./../../../../../bin/debug/caclient.dll \ + ./../../../../../bin/debug/hsutils.dll \ + ./debug/t_hsdomainmodel.exe +globaltest.path = ./../../../../../bin/hstests + +ddepend1.files = ./../../../../../bin/debug/caclient.dll \ + ./../../../../../bin/debug/hsutils.dll +ddepend1.path = ./debug + +testfiles.path = ./../../../../../bin/hstests +testfiles.files = ./debug/t_hsdomainmodel.exe + +testresources.path = ./../../../../../bin/hstests/hsresources/ +testresources.files = ../../resource/controllayer.docml + +docmltestresources_local.path = ./hsresources/ +docmltestresources_local.files = ../../resource/controllayer.docml + +dtestresources_local.path = ./debug/hsresources/ +dtestresources_local.files = ../../resource/controllayer.docml + +INSTALLS += dlocaldatafiles1 dlocaldatafiles2 dlocaldatafiles3 globaldatafiles1 globaldatafiles2 globaldatafiles3 globaltest ddepend1 testfiles testresources docmltestresources_local dtestresources_local diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/resource/default_landscape.png Binary file homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/resource/default_landscape.png has changed diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/resource/default_portrait.png Binary file homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/resource/default_portrait.png has changed diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/abclient_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/abclient_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,83 @@ +// 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: +// Mocked implementation of CActiveBackupClient class. +// +// + + +#include +#ifdef Q_OS_SYMBIAN + +#include "abclient.h" + +namespace conn + { + + CActiveBackupClient::CActiveBackupClient() : iClientSession(NULL), iABCallbackHandler(NULL) + { + } + + + EXPORT_C CActiveBackupClient* CActiveBackupClient::NewL() + { + CActiveBackupClient* self = new (ELeave) CActiveBackupClient(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + EXPORT_C CActiveBackupClient* CActiveBackupClient::NewL(MActiveBackupDataClient* aClient) + { + CActiveBackupClient* self = new (ELeave) CActiveBackupClient(); + CleanupStack::PushL(self); + self->ConstructL(aClient); + CleanupStack::Pop(self); + return self; + } + + void CActiveBackupClient::ConstructL() + { + } + + void CActiveBackupClient::ConstructL(MActiveBackupDataClient* aClient) + { + ConstructL(); + Q_UNUSED(aClient); + } + + EXPORT_C CActiveBackupClient::~CActiveBackupClient() + { + } + + EXPORT_C void CActiveBackupClient::BURModeInfoL(TDriveList& aDriveList, TBURPartType& aBackupType, TBackupIncType& aIncBackupType) + { + Q_UNUSED(aDriveList); + Q_UNUSED(aBackupType); + Q_UNUSED(aIncBackupType); + } + + EXPORT_C TBool CActiveBackupClient::DoesPartialBURAffectMeL() + { + return EFalse; + } + + EXPORT_C void CActiveBackupClient::ConfirmReadyForBURL(TInt aErrorCode) + { + Q_UNUSED(aErrorCode); + } + +} // end of conn namespace + +#endif diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/hspropertyanimationwrapper_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/hspropertyanimationwrapper_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,103 @@ +/* +* 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 "hspropertyanimationwrapper.h" + +/*! + \class HsMessageBoxWrapper + \ingroup group_hsutils + \brief +*/ +struct HsPropertyAnimationWrapperImpl +{ +public: + bool running; + bool forward; +}; + +/*! + +*/ +HsPropertyAnimationWrapper::HsPropertyAnimationWrapper(QObject *parent) + : QObject(parent),mImpl(new HsPropertyAnimationWrapperImpl) +{ + mImpl->running = false; + mImpl->forward = true; +} + +/*! + +*/ +HsPropertyAnimationWrapper::~HsPropertyAnimationWrapper() +{ + +} + +/*! + +*/ +void HsPropertyAnimationWrapper::setTargetObject(QObject *target) +{ + Q_UNUSED(target) +} +/*! + +*/ +void HsPropertyAnimationWrapper::setPropertyName(const QByteArray &propertyName) +{ + Q_UNUSED(propertyName) +} + +bool HsPropertyAnimationWrapper::isRunning() +{ + return mImpl->running; +} +void HsPropertyAnimationWrapper::setEndValue(const QVariant &value) +{ + Q_UNUSED(value) +} +void HsPropertyAnimationWrapper::setDuration(int msecs) +{ + Q_UNUSED(msecs) +} +void HsPropertyAnimationWrapper::setForward() +{ + mImpl->forward = true; +} + +void HsPropertyAnimationWrapper::setBackward() +{ + mImpl->forward = false; +} + +bool HsPropertyAnimationWrapper::isForward() const +{ + return mImpl->forward; +} +void HsPropertyAnimationWrapper::start() +{ + mImpl->running = true; + emit finished(); +} +/*! + +*/ +void HsPropertyAnimationWrapper::stop() +{ + mImpl->running = false; +} \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsbackuprestoreactivecallback.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsbackuprestoreactivecallback.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include "t_hsdomainmodel.h" +#include "hsbackuprestoreobserver.h" +#ifdef Q_OS_SYMBIAN +#include "hsbackuprestoreactivecallback.h" +#endif +/*! + +*/ +void TestHsDomainModel::testBackupRestoreActiveCallback() +{ +#ifdef Q_OS_SYMBIAN + int error = 0; + HsBackupRestoreObserver *observer = HsBackupRestoreObserver::instance(); + CHsBURActiveCallback *activeCallback = 0; + TRAP(error, activeCallback = CHsBURActiveCallback::NewL(observer)); + QVERIFY(error == KErrNone); + QVERIFY(activeCallback); + activeCallback->AllSnapshotsSuppliedL(); + + TDriveNumber driveNumber = EDriveC; + TBuf8<1> buf; + HBufC8 *heapBuf = HBufC8::NewL(1); + TBool retValue = EFalse; + + TRAP(error, activeCallback->ReceiveSnapshotDataL(driveNumber, buf, retValue)); + QVERIFY(error == KErrNotSupported); + + TUint dataSize = activeCallback->GetExpectedDataSize(driveNumber); + QVERIFY(dataSize == 0); + + TPtr8 bufPtr = heapBuf->Des(); + TRAP(error, activeCallback->GetSnapshotDataL(driveNumber, bufPtr, retValue)); + QVERIFY(error == KErrNotSupported); + + activeCallback->InitialiseGetBackupDataL(driveNumber); + QVERIFY(observer->checkBUR()); + + TRAP(error, activeCallback->GetBackupDataSectionL(bufPtr, retValue)); + QVERIFY(error == KErrNone); + QVERIFY(retValue); + + TRAP(error, activeCallback->InitialiseRestoreBaseDataL(driveNumber)); + QVERIFY(error == KErrNotSupported); + + TRAP(error, activeCallback->RestoreBaseDataSectionL(buf, retValue)); + QVERIFY(error == KErrNotSupported); + + TRAP(error, activeCallback->InitialiseRestoreIncrementDataL(driveNumber)); + QVERIFY(error == KErrNotSupported); + + TRAP(error, activeCallback->RestoreIncrementDataSectionL(buf, retValue)); + QVERIFY(error == KErrNotSupported); + + activeCallback->RestoreComplete(driveNumber); + activeCallback->TerminateMultiStageOperation(); + QVERIFY(activeCallback->GetDataChecksum(driveNumber)==0); + + delete activeCallback; +#endif +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsbackuprestoreobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsbackuprestoreobserver.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,86 @@ +/* +* 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: Wallpaper test. +* +*/ + + +#include "t_hsdomainmodel.h" +#include "hsbackuprestoreobserver.h" +#include "hsscene.h" +#include +#ifdef Q_OS_SYMBIAN +#include +#include +#include +#include +#include "hsbackuprestoreobserver_p.h" + +using namespace conn; +#endif //Q_OS_SYMBIAN +/*! + +*/ +void TestHsDomainModel::testBackupRestoreObserver() +{ + HsBackupRestoreObserver *observer = HsBackupRestoreObserver::instance(); + QVERIFY(observer); + QVERIFY(observer->mInstance != 0); + QVERIFY(observer->mInstance == HsBackupRestoreObserver::instance()); + delete observer->mInstance; + observer->mInstance = 0; +} + + +void TestHsDomainModel::testBackupRestoreObserverStarted() +{ + HsBackupRestoreObserver *observer = HsBackupRestoreObserver::instance(); + QSignalSpy observerSpy(observer,SIGNAL(event_backupRestoreStarted())); + observer->backupRestoreStarted(); + observer->readyForBUR(); + QVERIFY(observer->mBUROngoing); + QVERIFY(observer->checkBUR()); + QVERIFY(observerSpy.count()==1); + delete observer->mInstance; + observer->mInstance = 0;} + +void TestHsDomainModel::testBackupRestoreObserverCompleted() +{ + HsBackupRestoreObserver *observer = HsBackupRestoreObserver::instance(); + QSignalSpy observerSpy(observer,SIGNAL(event_backupRestoreCompleted())); + observer->backupRestoreCompleted(); + QVERIFY(!observer->mBUROngoing); + QVERIFY(!observer->checkBUR()); + QVERIFY(observerSpy.count()==1); + delete observer->mInstance; + observer->mInstance = 0; +} + +#ifdef Q_OS_SYMBIAN +void TestHsDomainModel::testBackupRestoreObserverPsKeyObserver() +{ + HsBackupRestoreObserver *observer = HsBackupRestoreObserver::instance(); + XQSettingsKey brk(XQSettingsKey::TargetPublishAndSubscribe, + KUidSystemCategory.iUid, KUidBackupRestoreKey); + observer->mD->handleKeyChange(brk, conn::EBURBackupFull); + QVERIFY(observer->mBUROngoing); + QVERIFY(observer->checkBUR()); + + observer->mD->handleKeyChange(brk, conn::EBURNormal); + QVERIFY(!observer->mBUROngoing); + QVERIFY(!observer->checkBUR()); + delete observer->mInstance; + observer->mInstance = 0; +} +#endif //Q_OS_SYMBIAN diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsconfiguration.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsconfiguration.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,178 @@ +/* +* 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 "t_hsdomainmodel.h" +#include "hsdomainmodeldatastructures.h" +#include "hsconfiguration.h" + + +void TestHsDomainModel::testConfigurationConstruction() +{ + HsConfiguration *c = new HsConfiguration; + + QCOMPARE(c->mBounceEffect, 20); + QCOMPARE(c->mPageChangeAnimationDuration, 300); + QCOMPARE(c->mPageChangeZoneAnimationDuration, 600); + QCOMPARE(c->mPageChangeZoneReverseAnimationDuration, 200); + QCOMPARE(c->mPageRemovedAnimationDuration, 1000); + QCOMPARE(c->mNewPageAddedAnimationDuration, 1000); + QCOMPARE(c->mWidgetDragEffectDuration, 250); + QCOMPARE(c->mWidgetDropEffectDuration, 200); + QCOMPARE(c->mDefaultPageId, 1); + QCOMPARE(c->mMaximumPageCount, 8); + QCOMPARE(c->mIsShortcutLabelVisible, true); + QCOMPARE(c->mBounceFeedbackEffectDistance, qreal(3)); + QCOMPARE(c->mPageChangeZoneWidth, qreal(30)); + QCOMPARE(c->mPageIndicatorSpacing, qreal(8)); + QCOMPARE(c->mMaximumWidgetHeight, qreal(39)); + QCOMPARE(c->mMaximumWidgetWidth, qreal(48)); + QCOMPARE(c->mMinimumWidgetHeight, qreal(8.75)); + QCOMPARE(c->mMinimumWidgetWidth, qreal(8.75)); + QCOMPARE(c->mPageChangePanDistance, qreal(120)); + QCOMPARE(c->mPageChangeFeedbackEffect, HbFeedback::Sensitive); + QCOMPARE(c->mWidgetPickFeedbackEffect, HbFeedback::ItemPick); + QCOMPARE(c->mWidgetDropFeedbackEffect, HbFeedback::ItemDrop); + QCOMPARE(c->mWidgetRepositionFeedbackEffect, HbFeedback::BounceEffect); + QCOMPARE(c->mWidgetOverTrashbinFeedbackEffect, HbFeedback::ItemMoveOver); + QCOMPARE(c->mWidgetDropToTrashbinFeedbackEffect, HbFeedback::ItemDrop); + QCOMPARE(c->mShortcutWidgetTapFeedbackEffect, HbFeedback::BasicItem); + QCOMPARE(c->mWidgetMoveBlockedFeedbackEffect, HbFeedback::Basic); + QCOMPARE(c->mClockWidgetTapFeedbackEffect, HbFeedback::BasicItem); + QCOMPARE(c->mWidgetSnappingFeedbackEffect, HbFeedback::ItemMoveOver); + QCOMPARE(c->mIsSnapEnabled, true); + QCOMPARE(c->mSnapTimeout, 300); + QCOMPARE(c->mSnapForce, qreal(30)); + QCOMPARE(c->mSnapGap, qreal(6)); + QCOMPARE(c->mPageMargin, qreal(0)); + QCOMPARE(c->mSnapLineFadeInDuration, 100); + QCOMPARE(c->mSnapLineFadeOutDuration, 100); + QCOMPARE(c->mSceneType, HsConfiguration::PageWallpapers); + + delete c; +} + +void TestHsDomainModel::testConfigurationStaticInterface() +{ + HsConfiguration *stored = HsConfiguration::takeInstance(); + + HsConfiguration *c = new HsConfiguration; + QVERIFY(!HsConfiguration::instance()); + HsConfiguration::setInstance(c); + QVERIFY(HsConfiguration::instance() == c); + HsConfiguration::setInstance(c); + QVERIFY(HsConfiguration::instance() == c); + HsConfiguration *c2 = HsConfiguration::takeInstance(); + QVERIFY(!HsConfiguration::instance()); + QVERIFY(c == c2); + delete c; + + HsConfiguration::setInstance(stored); +} + +void TestHsDomainModel::testConfigurationSizes() +{ + HsConfiguration *c = new HsConfiguration; + + QSizeF min1(c->mMinimumWidgetWidth, c->mMinimumWidgetHeight); + QSizeF max1(c->mMaximumWidgetWidth, c->mMaximumWidgetHeight); + + QSizeF min2(c->minimumWidgetSizeInUnits()); + QSizeF max2(c->maximumWidgetSizeInUnits()); + + QVERIFY(qFuzzyCompare(min1.width(), min2.width())); + QVERIFY(qFuzzyCompare(min1.height(), min2.height())); + QVERIFY(qFuzzyCompare(max1.width(), max2.width())); + QVERIFY(qFuzzyCompare(max1.height(), max2.height())); + + HbDeviceProfile profile; + qreal factor = profile.unitValue(); + + min1 *= factor; + max1 *= factor; + + min2 = c->minimumWidgetSizeInPixels(); + max2 = c->maximumWidgetSizeInPixels(); + + QVERIFY(qFuzzyCompare(min1.width(), min2.width())); + QVERIFY(qFuzzyCompare(min1.height(), min2.height())); + QVERIFY(qFuzzyCompare(max1.width(), max2.width())); + QVERIFY(qFuzzyCompare(max1.height(), max2.height())); + + delete c; +} + +void TestHsDomainModel::testConfigurationImportAndExport() +{ + HsConfiguration *c = new HsConfiguration; + + QVERIFY(!c->exportToFile(QString())); + QVERIFY(!c->importFromFile(QString())); + + QVERIFY(c->exportToFile("test_hsconfiguration.txt")); + QVERIFY(c->importFromFile("test_hsconfiguration.txt")); + + QFile::remove("test_hsconfiguration.txt"); + + QCOMPARE(c->mBounceEffect, 20); + QCOMPARE(c->mPageChangeAnimationDuration, 300); + QCOMPARE(c->mPageChangeZoneAnimationDuration, 600); + QCOMPARE(c->mPageChangeZoneReverseAnimationDuration, 200); + QCOMPARE(c->mPageRemovedAnimationDuration, 1000); + QCOMPARE(c->mNewPageAddedAnimationDuration, 1000); + QCOMPARE(c->mWidgetDragEffectDuration, 250); + QCOMPARE(c->mWidgetDropEffectDuration, 200); + QCOMPARE(c->mDefaultPageId, 1); + QCOMPARE(c->mMaximumPageCount, 8); + QCOMPARE(c->mIsShortcutLabelVisible, true); + QCOMPARE(c->mBounceFeedbackEffectDistance, qreal(3)); + QCOMPARE(c->mPageChangeZoneWidth, qreal(30)); + QCOMPARE(c->mPageIndicatorSpacing, qreal(8)); + QCOMPARE(c->mMaximumWidgetHeight, qreal(39)); + QCOMPARE(c->mMaximumWidgetWidth, qreal(48)); + QCOMPARE(c->mMinimumWidgetHeight, qreal(8.75)); + QCOMPARE(c->mMinimumWidgetWidth, qreal(8.75)); + QCOMPARE(c->mPageChangePanDistance, qreal(120)); + QCOMPARE(c->mPageChangeFeedbackEffect, HbFeedback::Sensitive); + QCOMPARE(c->mWidgetPickFeedbackEffect, HbFeedback::ItemPick); + QCOMPARE(c->mWidgetDropFeedbackEffect, HbFeedback::ItemDrop); + QCOMPARE(c->mWidgetRepositionFeedbackEffect, HbFeedback::BounceEffect); + QCOMPARE(c->mWidgetOverTrashbinFeedbackEffect, HbFeedback::ItemMoveOver); + QCOMPARE(c->mWidgetDropToTrashbinFeedbackEffect, HbFeedback::ItemDrop); + QCOMPARE(c->mShortcutWidgetTapFeedbackEffect, HbFeedback::BasicItem); + QCOMPARE(c->mWidgetMoveBlockedFeedbackEffect, HbFeedback::Basic); + QCOMPARE(c->mClockWidgetTapFeedbackEffect, HbFeedback::BasicItem); + QCOMPARE(c->mWidgetSnappingFeedbackEffect, HbFeedback::ItemMoveOver); + QCOMPARE(c->mIsSnapEnabled, true); + QCOMPARE(c->mSnapTimeout, 300); + QCOMPARE(c->mSnapForce, qreal(30)); + QCOMPARE(c->mSnapGap, qreal(6)); + QCOMPARE(c->mPageMargin, qreal(0)); + QCOMPARE(c->mSnapLineFadeInDuration, 100); + QCOMPARE(c->mSnapLineFadeOutDuration, 100); + QCOMPARE(c->mSceneType, HsConfiguration::PageWallpapers); + + delete c; +} + +void TestHsDomainModel::testConfigurationLoad() +{ + HsConfiguration *c = new HsConfiguration; + QVERIFY(c->load()); + delete c; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsdatabase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsdatabase.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,390 @@ +/* +* 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 "t_hsdomainmodel.h" +#include "hsdatabase.h" +#include "hsdomainmodeldatastructures.h" + +void TestHsDomainModel::testHsDatabaseConstruction() +{ + HsDatabase *db = new HsDatabase; + QVERIFY(!db->parent()); + + delete db; + + QObject *parent = new QObject; + db = new HsDatabase(parent); + QVERIFY(db->parent() == parent); + delete parent; +} + +void TestHsDomainModel::testHsDatabaseProperties() +{ + HsDatabase *db = new HsDatabase; + + QVERIFY(db->property("connectionName").toString().isEmpty()); + QVERIFY(db->connectionName().isEmpty()); + + QVERIFY(db->property("databaseName").toString().isEmpty()); + QVERIFY(db->databaseName().isEmpty()); + + db->setProperty("connectionName", "a"); + QCOMPARE(db->connectionName(), QLatin1String("a")); + db->setConnectionName("b"); + QCOMPARE(db->connectionName(), QLatin1String("b")); + + db->setProperty("databaseName", "c"); + QCOMPARE(db->databaseName(), QLatin1String("c")); + db->setDatabaseName("d"); + QCOMPARE(db->databaseName(), QLatin1String("d")); + + delete db; +} + +void TestHsDomainModel::testHsDatabaseStaticInterface() +{ + HsDatabase *db = HsDatabase::takeInstance(); + QVERIFY(!HsDatabase::instance()); + HsDatabase::setInstance(db); + QVERIFY(HsDatabase::instance() == db); +} + +void TestHsDomainModel::testHsDatabaseTransaction() +{ + HsDatabase *db = HsDatabase::instance(); + + QList pages; + db->pages(pages); + QCOMPARE(pages.count(), 0); + + HsPageData page; + + db->transaction(); + page.indexPosition = 0; + db->insertPage(page); + db->rollback(); + db->pages(pages); + QCOMPARE(pages.count(), 0); + + db->transaction(); + page.indexPosition = 0; + db->insertPage(page); + db->commit(); + db->pages(pages); + QCOMPARE(pages.count(), 1); +} + +void TestHsDomainModel::testHsDatabaseSceneMethods() +{ + HsDatabase *db = HsDatabase::instance(); + + HsSceneData scene; + db->scene(scene); + QCOMPARE(scene.id, 1); +} + +void TestHsDomainModel::testHsDatabasePageMethods() +{ + HsDatabase *db = HsDatabase::instance(); + + HsPageData page; + page.indexPosition = 0; + db->insertPage(page); + + HsPageData page2; + page2.id = page.id; + db->page(page2); + + QCOMPARE(page2.indexPosition, page.indexPosition); + + page.indexPosition = 1; + db->updatePage(page); + + db->page(page2); + + QCOMPARE(page2.indexPosition, page.indexPosition); +} + +void TestHsDomainModel::testHsDatabaseWidgetMethods() +{ + HsDatabase *db = HsDatabase::instance(); + + HsWidgetData widget; + widget.uri = "widgeturi"; + widget.pageId = 1; + db->insertWidget(widget); + + QList widgets; + db->widgets(1, widgets); + + QCOMPARE(widgets.count(), 1); + + db->deleteWidgets("widgeturi"); + db->widgets(1, widgets); + + QCOMPARE(widgets.count(), 0); +} + +void TestHsDomainModel::testHsDatabaseWidgetPreferenceMethods() +{ + HsDatabase *db = HsDatabase::instance(); + + HsWidgetData widget; + widget.uri = "widgeturi"; + widget.pageId = 1; + db->insertWidget(widget); + + QVariantHash preferences; + preferences.insert("a", 1); + preferences.insert("b", 2); + + db->setWidgetPreferences(widget.id, preferences); + + QVariantHash preferences2; + db->widgetPreferences(widget.id, preferences2); + + QCOMPARE(preferences2.count(), 2); + QCOMPARE(preferences2.value("a"), QVariant(1)); + QCOMPARE(preferences2.value("b"), QVariant(2)); + + QVariant value; + db->widgetPreference(widget.id, "a", value); + + QCOMPARE(value, QVariant(1)); + preferences.insert("a", QVariant()); + preferences.insert("b", QVariant()); + + db->setWidgetPreferences(widget.id, preferences); + db->widgetPreferences(widget.id, preferences2); + + QCOMPARE(preferences2.count(), 0); + +} + +void TestHsDomainModel::testHsDatabaseBadConnection() +{ + HsDatabase db; + + QVariantHash vh; + QVariant v; + Qt::Orientation orientation(Qt::Vertical); + HsWidgetPresentationData pd; + QString uri("foouri"); + QString key("fookey"); + HsWidgetData wd; + QList wds; + HsPageData pad; + QList pads; + HsSceneData sd; + + db.setConnectionName(QString("fooconnection")); + QVERIFY(!db.open()); + + QVERIFY(!db.configuration(vh)); + + QVERIFY(!db.setWidgetPreferences(33, vh)); + + QVERIFY(!db.widgetPreference(33, key, v)); + + QVERIFY(!db.widgetPreferences(33, vh)); + + QVERIFY(!db.deleteWidgetPresentation(33, orientation)); + + QVERIFY(!db.setWidgetPresentation(pd)); + + QVERIFY(!db.widgetPresentation(pd)); + + QVERIFY(!db.deleteWidgets(uri)); + + QVERIFY(!db.deleteWidget(33)); + + QVERIFY(!db.updateWidget(wd)); + + QVERIFY(!db.insertWidget(wd)); + + QVERIFY(!db.widget(wd)); + + QVERIFY(!db.widgets(uri, wds)); + + QVERIFY(!db.widgets(22, wds)); + QVariantHash variantHash; + int count=0; + QVERIFY(!db.widgets("uri", variantHash, count)); + + QVERIFY(!db.deletePage(22)); + + QVERIFY(!db.updatePage(pad)); + + QVERIFY(!db.insertPage(pad)); + + QVERIFY(!db.page(pad)); + + QVERIFY(!db.pages(pads)); + + QVERIFY(!db.scene(sd)); + + QVERIFY(!db.updateWidgetZValues(QHash(), Qt::Vertical)); +} + +Q_DECLARE_METATYPE(QVariantHash) +void TestHsDomainModel::testHsDatabaseMatchWidgetsPreferences_data() +{ + QTest::addColumn("matchesPreferences"); + QTest::addColumn("widgetsPreferencesKeys"); + QTest::addColumn("widgetsPreferencesValues"); + QTest::addColumn("expectedResult"); + + QVariantHash preferences; + preferences.insert("a", "1"); + QTest::newRow("searchCriteria1") + << preferences + << (QStringList() << "a" << "a" << "a" << "b" << "c" << "d") + << (QStringList() << "1" << "2" << "3" << "1" << "1" << "1") + << true; + + preferences.insert("b", "1"); + QTest::newRow("searchCriteria2") + << preferences + << (QStringList() << "a" << "a" << "a" << "b" << "c" << "d") + << (QStringList() << "1" << "2" << "3" << "1" << "1" << "1") + << true; + preferences.insert("e", "1"); + QTest::newRow("searchCriteria2") + << preferences + << (QStringList() << "a" << "a" << "a" << "b" << "c" << "d") + << (QStringList() << "1" << "2" << "3" << "1" << "1" << "1") + << false; + QTest::newRow("searchCriteria3") + << preferences + << (QStringList()) + << (QStringList()) + << false; + preferences.clear(); + QTest::newRow("searchCriteria4") + << preferences + << (QStringList() << "a" << "a" << "a" << "b" << "c" << "d") + << (QStringList() << "1" << "2" << "3" << "1" << "1" << "1") + << true; +} + +void TestHsDomainModel::testHsDatabaseMatchWidgetsPreferences() +{ + QFETCH(QVariantHash, matchesPreferences); + QFETCH(QStringList, widgetsPreferencesKeys); + QFETCH(QStringList, widgetsPreferencesValues); + QFETCH(bool, expectedResult); + + QMultiMap widgetPreferences; + for (int i=0; imatchWidgetPreferences(matchesPreferences, widgetPreferences)); +} + +void TestHsDomainModel::testHsDatabaseWidgetsCount() +{ + HsDatabase *db = HsDatabase::instance(); + + HsWidgetData widget; + widget.uri = "widgeturi"; + widget.pageId = 1; + db->insertWidget(widget); + QVariantHash preferences; + preferences.insert("a", "1"); + preferences.insert("b", "2"); + db->setWidgetPreferences(widget.id, preferences); + + widget.uri = "widgeturi2"; + widget.pageId = 1; + db->insertWidget(widget); + + widget.uri = "widgeturi"; + widget.pageId = 1; + db->insertWidget(widget); + preferences.insert("a", "3"); + db->setWidgetPreferences(widget.id, preferences); + + QVariantHash searchCriteria; + int count=0; + QVERIFY(db->widgets("widgeturi", searchCriteria, count)); + QCOMPARE(count, 2); + + searchCriteria.insert("a", "1"); + QVERIFY(db->widgets("widgeturi", searchCriteria, count)); + QCOMPARE(count, 1); + searchCriteria.insert("a", "2"); + QVERIFY(db->widgets("widgeturi", searchCriteria, count)); + QCOMPARE(count, 0); + searchCriteria.insert("a", "1"); + QVERIFY(db->widgets("widgeturi2", searchCriteria, count)); + QCOMPARE(count, 0); + QVERIFY(db->widgets("", searchCriteria, count)); + QCOMPARE(count, 0); + searchCriteria.clear(); + QVERIFY(db->widgets("widgeturi2", searchCriteria, count)); + QCOMPARE(count, 1); + searchCriteria.clear(); + QVERIFY(db->widgets("", searchCriteria, count)); + QCOMPARE(count, 0); +} + +void TestHsDomainModel::testHsDatabaseUpdateWidgetZValues() +{ + HsDatabase *db = HsDatabase::instance(); + HsPageData page; + page.indexPosition = 0; + QVERIFY(db->insertPage(page)); + + HsWidgetData widget1; + widget1.pageId = page.id; + widget1.uri = "uri1"; + QVERIFY(db->insertWidget(widget1)); + + HsWidgetData widget2; + widget2.pageId = page.id; + widget2.uri = "uri2"; + QVERIFY(db->insertWidget(widget2)); + + HsWidgetPresentationData presentation1; + presentation1.widgetId = widget1.id; + presentation1.zValue = 0; + presentation1.orientation = Qt::Vertical; + db->setWidgetPresentation(presentation1); + + HsWidgetPresentationData presentation2; + presentation2.widgetId = widget2.id; + presentation2.zValue = 0; + presentation2.orientation = Qt::Vertical; + db->setWidgetPresentation(presentation2); + + QHash data; + data.insert(1, 2); + data.insert(2, 3); + QVERIFY(db->updateWidgetZValues(data, Qt::Vertical)); + + QVERIFY(db->widgetPresentation(presentation1)); + QCOMPARE(presentation1.zValue, qreal(2)); + QVERIFY(db->widgetPresentation(presentation2)); + QCOMPARE(presentation2.zValue, qreal(3)); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsdocumentloader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsdocumentloader.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Homescreen document loader class. +* +*/ + +#include "t_hsdomainmodel.h" +#include "hsdocumentloader.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void TestHsDomainModel::testDocumentLoaderConstructors() +{ + HsDocumentLoader *loaderFromHeap = new HsDocumentLoader(); + QVERIFY(loaderFromHeap); + delete loaderFromHeap; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void TestHsDomainModel::testDocumentLoaderCreateObjects() +{ + HsDocumentLoader *loader = new HsDocumentLoader(); + QVERIFY(loader); + + QObject *testObject = loader->createObject(QString("UnknownWidgetType"), QString("testNullReturn")); + QVERIFY(!testObject); + + testObject = loader->createObject(QString("HbPushButton"), QString("testNotAnyHsWidget")); + QVERIFY(testObject); + QCOMPARE(testObject->objectName(), QString("testNotAnyHsWidget")); + delete testObject; + testObject = 0; + + testObject = loader->createObject(QString("HsPageIndicator"), QString("HsPageIndicator")); + QVERIFY(testObject); + QCOMPARE(testObject->objectName(), QString("HsPageIndicator")); + delete testObject; + testObject = 0; + + testObject = loader->createObject(QString("HsTrashBinWidget"), QString("HsTrashBinWidget")); + QVERIFY(testObject); + QCOMPARE(testObject->objectName(), QString("HsTrashBinWidget")); + delete testObject; + testObject = 0; + + delete loader; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsdomainmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsdomainmodel.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,258 @@ +/* +* 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: Main test class for domain model. +* +*/ + +#include +#include +#include "t_hsdomainmodel.h" +#include "hsdatabase.h" +#include "hspage.h" +#include "hsscene.h" +#include "hsdomainmodeldatastructures.h" +#include "hswidgetpositioningonwidgetadd.h" +#include "hswidgetcomponentregistry.h" +#include "hsbackuprestoreobserver.h" +#include "hsshortcutservice.h" +#include "caservice.h" +#include "hsconfiguration.h" +#include "hswallpaper.h" + +QTM_USE_NAMESPACE + +#ifdef Q_OS_SYMBIAN +#include +#endif + +const char WIDGET_PLUGIN_PATH[] = "./hsresources/plugins/widgetplugins/"; +const char WIDGET_PLUGIN_XML[] = "mockwidgetplugin.xml"; +const char WIDGET_PLUGIN_TOOSMALL_XML[] = "mockwidgetplugintoosmall.xml"; +const char WIDGET_PLUGIN_TOOBIG_XML[] = "mockwidgetplugintoobig.xml"; +const char WIDGET_PLUGIN_CHEATER_XML[] = "mockwidgetplugincheater.xml"; +const char DBPATH[]= "./"; +const char DBNAME[] = "hsdomainmodeltest2.db"; +const char DBNAMECLEAN[] = "hsdomainmodeltest.db"; + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void TestHsDomainModel::initTestCase() +{ + mCaService = CaService::instance(); + QString path = QDir(WIDGET_PLUGIN_PATH).absolutePath(); + QApplication::addLibraryPath(path); + QServiceManager manager; + if (!manager.addService(QDir(WIDGET_PLUGIN_PATH).absolutePath().append("/").append(WIDGET_PLUGIN_XML))) { + QServiceManager::Error err = manager.error(); + qDebug() << "TestHsDomainModel::initTestCase register mockwidgetplugin failed" << err; + } + if (!manager.addService(QDir(WIDGET_PLUGIN_PATH).absolutePath().append("/").append(WIDGET_PLUGIN_TOOSMALL_XML))) { + QServiceManager::Error err = manager.error(); + qDebug() << "TestHsDomainModel::initTestCase register mockwidgetplugintoosmall failed" << err; + } + + if (!manager.addService(QDir(WIDGET_PLUGIN_PATH).absolutePath().append("/").append(WIDGET_PLUGIN_TOOBIG_XML))) { + QServiceManager::Error err = manager.error(); + qDebug() << "TestHsDomainModel::initTestCase register mockwidgetplugintoobig failed" << err; + } + + if (!manager.addService(QDir(WIDGET_PLUGIN_PATH).absolutePath().append("/").append(WIDGET_PLUGIN_CHEATER_XML))) { + QServiceManager::Error err = manager.error(); + qDebug() << "TestHsDomainModel::initTestCase register mockwidgetplugincheater failed" << err; + } + + HsConfiguration::setInstance(new HsConfiguration); + + HsWidgetPositioningOnWidgetAdd::setInstance( + new HsAnchorPointInBottomRight); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void TestHsDomainModel::cleanupTestCase() +{ + QServiceManager manager; + manager.removeService("mockwidgetplugin"); + manager.removeService("mockwidgetplugintoosmall"); + manager.removeService("mockwidgetplugintoobig"); + manager.removeService("mockwidgetplugincheater"); + HsDatabase::setInstance(0); + + delete HsWidgetComponentRegistry::mInstance; + HsWidgetComponentRegistry::mInstance = 0; + + delete HsShortcutService::mInstance; + HsShortcutService::mInstance = 0; +} + +void TestHsDomainModel::init() +{ + QString dbFile = QDir(DBPATH).absolutePath() + "/" + QString(DBNAME); + QString testDbFile = QDir(DBPATH).absolutePath() + "/" + QString(DBNAMECLEAN); + QFile::remove(dbFile); + QFile::copy(testDbFile, dbFile); + + HsScene::setInstance(new HsScene); + + HsDatabase *db = new HsDatabase; + HsDatabase::setInstance(db); + db->setConnectionName("homescreen.dbc"); + db->setDatabaseName(dbFile); + db->open(); + + mWallpaperTypeScene = true; +} + +void TestHsDomainModel::cleanup() +{ + // cleanup all the pages and widgets + HsDatabase::setInstance(0); + QString path = QDir(WIDGET_PLUGIN_PATH).absolutePath(); + QApplication::addLibraryPath( path ); + QString dbFile = QDir(DBPATH).absolutePath() + "/" + QString(DBNAME); + QFile::remove(dbFile); + + if (HsBackupRestoreObserver::mInstance) { + delete HsBackupRestoreObserver::mInstance; + HsBackupRestoreObserver::mInstance = 0; + } + + delete HsScene::takeInstance(); +} + +void TestHsDomainModel::createPagesToDatabase(int pageCount) +{ + HsDatabase *db = HsDatabase::instance(); + for (int i = 0; i < pageCount; ++i) { + HsPageData data; + data.indexPosition = i; + db->insertPage(data); + } +} + +void TestHsDomainModel::createSceneWithPages(int pageCount,int activePageIndex) +{ + for (int i = 0; i < pageCount; ++i) { + HsPageData pageData; + pageData.indexPosition = i; + HsPage *p = HsPage::createInstance(pageData); + HsScene::instance()->addPage(p); + } + if (activePageIndex < pageCount) { + QList pages = HsScene::instance()->pages(); + if(activePageIndex < pages.count()) + HsScene::instance()->setActivePage(pages.at(activePageIndex)); + } + +} + +void TestHsDomainModel::destroySceneAndPages() +{ + delete HsScene::takeInstance(); +} + +QString TestHsDomainModel::sourceTestWallpaper() +{ + QString testImage("default_portrait.png"); + QString fullSource(wallpaperDirectory() + testImage); + return QDir::toNativeSeparators(fullSource); +} + +QString TestHsDomainModel::targetPortraitTestWallpaper() +{ + QString path = wallpaperDirectory() + + "1_portrait." + + QFileInfo(sourceTestWallpaper()).suffix(); + return QDir::toNativeSeparators(path); +} + +QString TestHsDomainModel::targetLandscapeTestWallpaper() +{ + QString path = wallpaperDirectory() + + "1_landscape." + + QFileInfo(sourceTestWallpaper()).suffix(); + return QDir::toNativeSeparators(path); +} + +QString TestHsDomainModel::tempTestWallpaper() +{ + QString tempTestImage("tempdefault_portrait.png"); + QString fullTarget(wallpaperDirectory() + tempTestImage); + return QDir::toNativeSeparators(fullTarget); +} + +QString TestHsDomainModel::notExistingTestWallpaper() +{ + QString tempTestImage("notfound.png"); + QString fullTarget(wallpaperDirectory() + tempTestImage); + return QDir::toNativeSeparators(fullTarget); +} + +QString TestHsDomainModel::wallpaperDirectory() +{ + QString directory; + if (mWallpaperTypeScene) { + HsSceneWallpaper wallpaper(HsScene::instance()); + directory = wallpaper.wallpaperDirectory(); + } else { + HsPage *page = new HsPage(); + HsPageWallpaper wallpaper(page); + directory = wallpaper.wallpaperDirectory(); + delete page; + } + + return directory; +} + +void TestHsDomainModel::cleanupTargetWallpaperFiles() +{ + if (QFile::exists(targetPortraitTestWallpaper())) { + QFile::remove(targetPortraitTestWallpaper()); + } + + if (QFile::exists(targetLandscapeTestWallpaper())) { + QFile::remove(targetLandscapeTestWallpaper()); + } + + if (QFile::exists(tempTestWallpaper())) { + QFile::remove(tempTestWallpaper()); + } +} + +#ifdef Q_OS_SYMBIAN +//QTEST_MAIN corrected since crashes if TRAP not in correct place. +//Will be corrected in later (estimate 4.6.0) Qt release for Symbian. +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + int error(0); + TRAP_IGNORE( QTEST_DISABLE_KEYPAD_NAVIGATION \ + HbInstance::instance(); \ + TestHsDomainModel tc; \ + error = QTest::qExec(&tc, argc, argv);); + return error; +} +#else //Q_OS_SYMBIAN +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + QTEST_DISABLE_KEYPAD_NAVIGATION + HbInstance::instance(); + TestHsDomainModel tc; + return QTest::qExec(&tc, argc, argv); +} +//QTEST_MAIN(TestHsDomainModel) +#endif //Q_OS_SYMBIAN diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsgui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsgui.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,91 @@ +/* +* 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: +* +*/ + +#include "t_hsdomainmodel.h" +#include "hsgui.h" + + +void TestHsDomainModel::testGuiStaticInterface() +{ + HsGui *stored = HsGui::takeInstance(); + + HsGui *gui = new HsGui; + HsGui::setInstance(gui); + HsGui::setInstance(gui); + QVERIFY(HsGui::instance() == gui); + HsGui *gui2 = HsGui::takeInstance(); + QVERIFY(gui == gui2); + delete gui; + + HsGui::setInstance(stored); +} + +void TestHsDomainModel::testSetupCleanupIdleUi() +{ + HsGui *gui = HsGui::instance(); + + gui->setupIdleUi(); + QVERIFY(gui->idleWidget()); + QVERIFY(gui->idleView()); + gui->setupIdleUi(); + + gui->cleanupIdleUi(); + QVERIFY(!gui->idleView()); +} + + +void TestHsDomainModel::testOrientation() +{ + HsGui *gui = HsGui::instance(); + Qt::Orientation orientation = gui->orientation(); + + if (orientation == Qt::Horizontal){ + gui->setOrientation(Qt::Vertical); + } + else { + gui->setOrientation(Qt::Horizontal); + } + QVERIFY(gui->orientation() != orientation); + + gui->setOrientation(orientation); + QVERIFY(gui->orientation() == orientation); +} + + +void TestHsDomainModel::testShow() +{ + HsGui *gui = HsGui::instance(); + gui->setupIdleUi(); + gui->show(); + gui->cleanupIdleUi(); +} + +void TestHsDomainModel::testPageChangeAnimation() +{ + HsGui *gui = HsGui::instance(); + + QVERIFY(gui->pageChangeAnimation()); + gui->cleanupIdleUi(); +} + +void TestHsDomainModel::testPageCrawlingAnimation() +{ + HsGui *gui = HsGui::instance(); + + QVERIFY(gui->pageCrawlingAnimation()); + gui->cleanupIdleUi(); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hshostedwidgetfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hshostedwidgetfactory.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,34 @@ +/* +* 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: +* +*/ + +#include "t_hsdomainmodel.h" +#include "hshostedwidgetfactory.h" + + +void TestHsDomainModel::testHostedWidgetFactoryStaticInterface() +{ + HsHostedWidgetFactory *stored = HsHostedWidgetFactory::takeInstance(); + + HsHostedWidgetFactory *factory = new HsHostedWidgetFactory; + HsHostedWidgetFactory::setInstance(factory); + QVERIFY(HsHostedWidgetFactory::instance() == factory); + HsHostedWidgetFactory *factory2 = HsHostedWidgetFactory::takeInstance(); + QVERIFY(factory == factory2); + delete factory; + + HsHostedWidgetFactory::setInstance(stored); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsidlewidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsidlewidget.cpp Mon Sep 20 10:19: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: Tests for HsIdleState class. +* +*/ + +#include "hsscene.h" +#include "hsgui.h" +#include "hspage.h" +#include "hspageindicator.h" +#include "hsconfiguration.h" +#include "hsidlewidget.h" +#include "t_hsdomainmodel.h" +#include "hsdomainmodeldatastructures.h" + +void TestHsDomainModel::testIdleWidgetConstruction() +{ + HsIdleWidget *iw = new HsIdleWidget(); + delete iw; +} + +void TestHsDomainModel::testIdleWidgetSetGeometry() +{ + HsIdleWidget *iw = new HsIdleWidget(); + + iw->setGeometry(QRectF(0,0,100,100)); + HSCONFIGURATION_SET(setSceneType, HsConfiguration::SceneWallpaper); + iw->setGeometry(QRectF(0,0,100,100)); + delete iw; + HSCONFIGURATION_SET(setSceneType, HsConfiguration::PageWallpapers); +} + +void TestHsDomainModel::testIdleWidgetSetSceneX() +{ + HsIdleWidget *iw = new HsIdleWidget(); + iw->setSceneX(100); + QVERIFY(iw->sceneX() == 100); + + HSCONFIGURATION_SET(setSceneType, HsConfiguration::SceneWallpaper); + iw->setSceneX(200); + QVERIFY(iw->sceneX() == 200); + + delete iw; + HSCONFIGURATION_SET(setSceneType, HsConfiguration::PageWallpapers); +} + +void TestHsDomainModel::testIdleWidgetSetActivePage() +{ + HsIdleWidget *iw = new HsIdleWidget(); + iw->mPageIndicator->initialize(3, 2); + iw->setActivePage(0); + QCOMPARE(iw->mPageIndicator->activeItemIndex(), 0); + delete iw; +} + +void TestHsDomainModel::testIdleWidgetInsertPage() +{ + HSCONFIGURATION_SET(setSceneType, HsConfiguration::PageWallpapers); + HsIdleWidget *iw = new HsIdleWidget(); + HsPage *page = new HsPage(); + iw->insertPage(0, page); + delete iw; + HSCONFIGURATION_SET(setSceneType, HsConfiguration::SceneWallpaper); + iw = new HsIdleWidget(); + page = new HsPage(); + iw->insertPage(0, page); + delete iw; + HSCONFIGURATION_SET(setSceneType, HsConfiguration::PageWallpapers); +} + +void TestHsDomainModel::testIdleWidgetRemovePage() +{ + HSCONFIGURATION_SET(setSceneType, HsConfiguration::PageWallpapers); + HsIdleWidget *iw = new HsIdleWidget(); + + HsPage *pageOne = new HsPage(); + HsPage *pageTwo = new HsPage(); + + iw->insertPage(0, pageTwo); + iw->insertPage(0, pageOne); + iw->removePage(1); + iw->removePage(0); + delete iw; + + HSCONFIGURATION_SET(setSceneType, HsConfiguration::SceneWallpaper); + iw = new HsIdleWidget(); + + pageOne = new HsPage(); + pageTwo = new HsPage(); + + iw->insertPage(0, pageTwo); + iw->insertPage(0, pageOne); + iw->removePage(1); + iw->removePage(0); + delete iw; + HSCONFIGURATION_SET(setSceneType, HsConfiguration::PageWallpapers); +} + +void TestHsDomainModel::testIdleWidgetLayers() +{ + HsIdleWidget *iw = new HsIdleWidget(); + iw->controlLayer(); + iw->pageLayer(); + iw->pageWallpaperLayer(); + iw->sceneLayer(); + delete iw; +} + +void TestHsDomainModel::testIdleWidgetTrashbin() +{ + HsIdleWidget *iw = new HsIdleWidget(); + iw->trashBin(); + delete iw; +} + +void TestHsDomainModel::testIdleWidgetPageIndicator() +{ + HsIdleWidget *iw = new HsIdleWidget(); + iw->pageIndicator(); + delete iw; +} + +void TestHsDomainModel::testIdleWidgetParallaxFactor() +{ + HsIdleWidget *iw = new HsIdleWidget(); + + // factor == 1 when page count < 2 + QCOMPARE( (int)iw->parallaxFactor(), 1); + + createSceneWithPages(3, 0); + // factor must be != 0 when page count >= 2 + QVERIFY(iw->parallaxFactor()); + delete iw; + destroySceneAndPages(); +} + +void TestHsDomainModel::testIdleWidgetShowTrashBin() +{ + HsIdleWidget *iw = new HsIdleWidget(); + iw->showTrashBin(); + delete iw; +} + +void TestHsDomainModel::testIdleWidgetShowPageIndicator() +{ + HsIdleWidget *iw = new HsIdleWidget(); + iw->showPageIndicator(); + delete iw; +} + + +void TestHsDomainModel::testIdleWidgetShowSnapLines() +{ + HsIdleWidget *iw = new HsIdleWidget(); + QLineF verticalSnapLine(0,0,0,100); + iw->showVerticalSnapLine(verticalSnapLine); + QLineF horizontalSnapLine(0,0,100,0); + iw->showHorizontalSnapLine(horizontalSnapLine); + iw->hideVerticalSnapLine(); + iw->hideHorizontalSnapLine(); + delete iw; +} + +void TestHsDomainModel::testIdleWidgetPolishEvent() +{ + HsIdleWidget *iw = new HsIdleWidget(); + iw->polishEvent(); + + createSceneWithPages(3, 0); + iw->polishEvent(); + HSCONFIGURATION_SET(setSceneType, HsConfiguration::SceneWallpaper); + iw->polishEvent(); + HSCONFIGURATION_SET(setSceneType, HsConfiguration::PageWallpapers); + + delete iw; + destroySceneAndPages(); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hspage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hspage.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,566 @@ +/* +* 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 "t_hsdomainmodel.h" +#include "hspage.h" +#include "hsscene.h" +#include "hsdomainmodeldatastructures.h" +#include "hswidgethost.h" +#include "hswidgetpositioningonwidgetadd.h" +#include "hswidgetcomponent.h" +#include "hsconfiguration.h" +#include "hsgui.h" +#include "hspagevisual.h" +#include "hswidgetpositioningonorientationchange.h" + +void TestHsDomainModel::testHsPage() +{ + HsPageData pageData; + HsPage *page=HsPage::createInstance(pageData); + QVERIFY(page->databaseId()); + QVERIFY(page->load()); + QCOMPARE(page->widgets().count(),0); + + // we haven't added this to scene. + QCOMPARE(page->pageIndex(),-1); + + QVERIFY(page->isRemovable()); + page->setRemovable(false); + QVERIFY(!page->isRemovable()); + page->setRemovable(true); + QVERIFY(page->isRemovable()); + delete page; +} + + +void TestHsDomainModel::testHsPageLoad() +{ + HsPage *page = new HsPage(); + QVERIFY(!page->load()); + delete page; + + HsPageData pageData; + pageData.indexPosition = 0; + page = HsPage::createInstance(pageData); + QVERIFY(page); + int pageId = page->databaseId(); + delete page; + + page = new HsPage(); + page->setDatabaseId(pageId); + QVERIFY(page->load()); + QVERIFY(page->wallpaper()); + QVERIFY(page->deleteFromDatabase()); + delete page; + + page = HsPage::createInstance(pageData); + QVERIFY(page); + pageId = page->databaseId(); + delete page; + page = new HsPage(); + page->setDatabaseId(pageId); + QVERIFY(page->load()); + + QVERIFY(page->deleteFromDatabase()); + delete page; + +} + +void TestHsDomainModel::testHsPageContentRects() +{ + HsPageData pageData; + pageData.indexPosition = 0; + HsPage *page = HsPage::createInstance(pageData); + QVERIFY(page->databaseId()); + QVERIFY(page->load()); + QCOMPARE(page->widgets().count(),0); + HsScene::instance()->addPage(page); + HsGui *stored = HsGui::takeInstance(); + + HbInstance::instance(); + HbMainWindow mainWindow; + HbView *view = mainWindow.addView(page->visual()); + mainWindow.views().first()->setContentFullScreen(); + mainWindow.show(); + HsGui *gui = HsGui::instance(); + // crashes symbian test +#ifndef Q_OS_SYMBIAN + QEventLoop waitUntilMainWindowCreated; + QTimer eventLoopTimer; + eventLoopTimer.setInterval(15000); + eventLoopTimer.setSingleShot(true); + connect(&mainWindow, SIGNAL(viewReady()), + &waitUntilMainWindowCreated, SLOT(quit())); + connect(&eventLoopTimer, SIGNAL(timeout()), + &waitUntilMainWindowCreated, SLOT(quit())); + eventLoopTimer.start(); + waitUntilMainWindowCreated.exec(); + eventLoopTimer.stop(); +#endif + QRectF layoutRect = mainWindow.layoutRect(); + qreal pageMargin = HSCONFIGURATION_GET(pageMargin); + QRectF expectecRect; + + //Test global rect + expectecRect = layoutRect; + expectecRect.setTop(64); + expectecRect.adjust(pageMargin, pageMargin, -pageMargin, -pageMargin); + QRectF contentGeometry = page->contentGeometry(); + QCOMPARE(contentGeometry, expectecRect); + + //Test global rect at different orientation - improves branch coverage + expectecRect = layoutRect; + expectecRect.setWidth(layoutRect.height()); + expectecRect.setHeight(layoutRect.width()); + expectecRect.setTop(64); + expectecRect.adjust(pageMargin, pageMargin, -pageMargin, -pageMargin); + Qt::Orientation orientation = + //HsScene::instance()->mainWindow()->orientation() == + gui->orientation() == + Qt::Vertical ? Qt::Horizontal : Qt::Vertical; + contentGeometry = page->contentGeometry(orientation); + QCOMPARE(contentGeometry, expectecRect); + + //Test local rect + expectecRect = layoutRect; + expectecRect.setTop(64); + expectecRect.moveTopLeft(QPointF(0,0)); + expectecRect.adjust(pageMargin, pageMargin, -pageMargin, -pageMargin); + QRectF contentRect = page->contentRect(); + QCOMPARE(contentRect, expectecRect); + + mainWindow.hide(); + mainWindow.removeView(view); + delete HsGui::takeInstance(); + if(stored) { + HsGui::setInstance(stored); + } + HsScene::instance()->removePage(page); + delete page; +} + +void TestHsDomainModel::testHsPageAddRemoveWidget() +{ + HsWidgetPositioningOnWidgetAdd::setInstance( + new HsAnchorPointInBottomRight); + + HsPageData pageData; + pageData.indexPosition = 0; + HsPage *page = HsPage::createInstance(pageData); + QVERIFY(page); + int pageId = page->databaseId(); + + HsWidgetData widgetData; + widgetData.pageId = pageId; + widgetData.uri = "uri1"; + HsWidgetHost *widget = HsWidgetHost::createInstance(widgetData); + QVERIFY(widget); + + widget->setPage(page); + QVERIFY(!page->addNewWidget(0)); + QVERIFY(page->addNewWidget(widget)); + QVERIFY(page->addNewWidget(widget)); + QCOMPARE(page->newWidgets().count(), 1); + QCOMPARE(page->widgets().count(), 0); + + page->layoutNewWidgets(); + QCOMPARE(page->newWidgets().count(), 0); + QCOMPARE(page->widgets().count(), 1); + QCOMPARE(page->newWidgets().count(), 0); + QCOMPARE(page->widgets().count(), 1); + page->resetNewWidgets(); + + HsWidgetHost *widget2 = HsWidgetHost::createInstance(widgetData); + QVERIFY(widget2); + widget2->setPage(page); + QVERIFY(page->addNewWidget(widget2)); + QCOMPARE(page->newWidgets().count(),1); + QCOMPARE(page->widgets().count(),1); + + // test layouting for landscape orientation + HsGui::instance()->setOrientation(Qt::Horizontal); + // active widget for branch testing + HsScene::instance()->setActiveWidget(widget); + page->layoutNewWidgets(); + // set active widget to original + HsScene::instance()->setActiveWidget(0); + + QCOMPARE(page->newWidgets().count(), 0); + QCOMPARE(page->widgets().count(), 2); + QCOMPARE(page->newWidgets().count(), 0); + HsGui::instance()->setOrientation(Qt::Vertical); + + page->layoutNewWidgets(); + QCOMPARE(page->newWidgets().count(), 0); + QCOMPARE(page->widgets().count(), 2); + + QVERIFY(!page->removeWidget(0)); + QVERIFY(page->removeWidget(widget2)); + + delete page; + + page = new HsPage(); + page->setDatabaseId(pageId); + QVERIFY(page->load()); + QVERIFY(page->deleteFromDatabase()); + delete page; + + HsWidgetPositioningOnWidgetAdd::setInstance(0); + +} + + +void TestHsDomainModel::testHsPageAddExistingWidget() +{ + HsWidgetPositioningOnWidgetAdd::setInstance( + new HsAnchorPointInBottomRight); + + HsPageData pageData; + + pageData.indexPosition = 0; + HsPage *page = HsPage::createInstance(pageData); + QVERIFY(page); + int pageId = page->databaseId(); + + pageData.indexPosition = 1; + HsPage *page2 = HsPage::createInstance(pageData); + QVERIFY(page2); + int pageId2 = page2->databaseId(); + + HsWidgetData widgetData; + widgetData.pageId = pageId; + widgetData.uri = "mockwidgetplugin"; + + HsWidgetHost *widget = HsWidgetHost::createInstance(widgetData); + QVERIFY(widget); + widget->setPage(page); + QVERIFY(page->addNewWidget(widget)); + + HsWidgetHost *widget2 = HsWidgetHost::createInstance(widgetData); + QVERIFY(widget2); + widget2->setPage(page); + QVERIFY(page->addNewWidget(widget2)); + + // coverages up with active widget + HsScene::instance()->setActiveWidget(widget); + page->layoutNewWidgets(); + QCOMPARE(page->widgets().count(), 2); + HsScene::instance()->setActiveWidget(0); + + QVERIFY(page->removeWidget(widget2)); + QVERIFY(page2->addExistingWidget(widget2)); + QVERIFY(page2->addExistingWidget(widget2)); + + QVERIFY(!page->addExistingWidget(NULL)); + + delete page; + + page = new HsPage(); + page->setDatabaseId(pageId); + QVERIFY(page->load()); + // Widget doesn't have presentation yet. + QCOMPARE(page->widgets().count(), 0); + QCOMPARE(page->mNewWidgets.count(), 1); + page2 = new HsPage(); + page2->setDatabaseId(pageId2); + QVERIFY(page2->load()); + // Widget doesn't have presentation yet. + QCOMPARE(page2->widgets().count(), 0); + QCOMPARE(page2->mNewWidgets.count(), 1); + delete page; + delete page2; + + HsWidgetPositioningOnWidgetAdd::setInstance(0); + +} + + +void TestHsDomainModel::testHsPageWidgetFinished() +{ + HsWidgetPositioningOnWidgetAdd::setInstance( + new HsAnchorPointInBottomRight); + + HsPageData pageData; + HsPage *page=HsPage::createInstance(pageData); + QVERIFY(page); + int pageId = page->databaseId(); + HsScene::instance()->mActivePage = page; + + HsWidgetData widgetData; + widgetData.pageId = pageId; + widgetData.uri = "mockwidgetplugin"; + + HsWidgetHost *widget = HsWidgetHost::createInstance(widgetData); + QVERIFY(widget); + widget->setPage(page); + widget->startWidget(); + QVERIFY(widget->mStateMachine->isRunning()); + QVERIFY(page->addNewWidget(widget)); + page->layoutNewWidgets(); + + widget->onFinished(); + qApp->processEvents(); + + QCOMPARE(page->newWidgets().count(),0); + QCOMPARE(page->widgets().count(),0); + + // new widget + widget = HsWidgetHost::createInstance(widgetData); + QVERIFY(widget); + widget->setPage(page); + widget->startWidget(); + QVERIFY(widget->mStateMachine->isRunning()); + QVERIFY(page->addNewWidget(widget)); + QCOMPARE(page->newWidgets().count(),1); + QCOMPARE(page->widgets().count(),0); + + widget->onFinished(); + qApp->processEvents(); + + QCOMPARE(page->newWidgets().count(),0); + QCOMPARE(page->widgets().count(),0); + + delete page; + + HsWidgetPositioningOnWidgetAdd::setInstance(0); +} + +void TestHsDomainModel::testHsPageIsActivePage() +{ + HsPageData pageData; + pageData.indexPosition = 0; + HsPage *page = HsPage::createInstance(pageData); + QVERIFY(page); + + QVERIFY(!page->isActivePage()); + QVERIFY(page->isDefaultPage()); + delete page; +} + +void TestHsDomainModel::testHsPageWidgetSignals() +{ + HsPageData pageData; + HsPage *page = HsPage::createInstance(pageData); + QVERIFY(page); + + HsWidgetData widgetData; + widgetData.pageId = page->databaseId(); + widgetData.uri = "mockwidgetplugin"; + HsWidgetHost *widget = HsWidgetHost::createInstance(widgetData); + QVERIFY(widget); + + page->addExistingWidget(widget); + widget->setPage(page); + widget->startWidget(); + + QCOMPARE(page->mWidgets.count(), 1); + QCOMPARE(page->mUnavailableWidgets.count(), 0); + + emit widget->mComponent->unavailable(); + + QCOMPARE(page->mWidgets.count(), 0); + QCOMPARE(page->mUnavailableWidgets.count(), 1); + + emit widget->mComponent->available(); + + QCOMPARE(page->mWidgets.count(), 1); + QCOMPARE(page->mUnavailableWidgets.count(), 0); + + // test unavailability when new widgets exists + HsWidgetHost *widget2 = HsWidgetHost::createInstance(widgetData); + page->addNewWidget(widget2); + widget2->setPage(page); + widget2->startWidget(); + QCOMPARE(page->mWidgets.count(), 1); + QCOMPARE(page->mNewWidgets.count(), 1); + QCOMPARE(page->mUnavailableWidgets.count(), 0); + emit widget2->mComponent->unavailable(); + QCOMPARE(page->mWidgets.count(), 0); + QCOMPARE(page->mNewWidgets.count(), 0); + QCOMPARE(page->mUnavailableWidgets.count(), 2); + page->removeWidget(widget); + page->removeWidget(widget2); + + delete page; +} + +void TestHsDomainModel::testHsPageOrientationChange() +{ + HsWidgetPositioningOnWidgetAdd::setInstance( + new HsAnchorPointInBottomRight); + + HsWidgetPositioningOnOrientationChange::setInstance( + new HsAdvancedWidgetPositioningOnOrientationChange); + + HsPageData pageData; + HsPage *page = HsPage::createInstance(pageData); + QVERIFY(page); + + // test when no widgets on page + page->onOrientationChanged(Qt::Horizontal); + + // add existing widget + HsWidgetData widgetData; + widgetData.pageId = page->databaseId(); + widgetData.uri = "mockwidgetplugin"; + HsWidgetHost *existingWidget = HsWidgetHost::createInstance(widgetData); + QVERIFY(existingWidget); + page->addExistingWidget(existingWidget); + + // add new widget without presentation + HsWidgetData widgetData2; + widgetData2.pageId = page->databaseId(); + widgetData2.uri = "mockwidgetplugintoosmall"; + HsWidgetHost *newWidget = HsWidgetHost::createInstance(widgetData2); + QVERIFY(newWidget); + page->addNewWidget(newWidget); + newWidget->removePresentation(Qt::Horizontal); + + page->onOrientationChanged(Qt::Horizontal); + page->onOrientationChanged(Qt::Vertical); + + delete page; + HsWidgetPositioningOnOrientationChange::setInstance(0); + HsWidgetPositioningOnWidgetAdd::setInstance(0); +} + +void TestHsDomainModel::testHsPageDeleteFromDatabase() +{ + HsWidgetPositioningOnWidgetAdd::setInstance( + new HsAnchorPointInBottomRight); + + HsPageData pageData; + pageData.indexPosition = 0; + HsPage *page = HsPage::createInstance(pageData); + HsWidgetData widgetData; + widgetData.pageId = page->databaseId(); + widgetData.uri = "mockwidgetplugin"; + HsWidgetHost *widget = HsWidgetHost::createInstance(widgetData); + + // new widgets not deleted + page->addNewWidget(widget); + QCOMPARE(page->newWidgets().count(), 1); + page->deleteFromDatabase(); + QCOMPARE(page->newWidgets().count(), 0); + + // widgets not deleted + page->addNewWidget(widget); + + // test set online when new widgets exists + page->setOnline(); + page->layoutNewWidgets(); + // test show widgets + page->showWidgets(); + // test hide widgets + page->hideWidgets(); + // test set online when widgets exists + page->setOnline(); + + QCOMPARE(page->mWidgets.count(), 1); + QVERIFY(page->deleteFromDatabase()); + QCOMPARE(page->mWidgets.count(), 0); + + // unavailable widgets not deleted + page->mUnavailableWidgets.append(widget); + QCOMPARE(page->mUnavailableWidgets.count(), 1); + QVERIFY(page->deleteFromDatabase()); + QCOMPARE(page->mUnavailableWidgets.count(), 0); + + delete widget; + delete page; + +} + +void TestHsDomainModel::testHsPageOnPageMarginChanged() +{ + HsWidgetPositioningOnWidgetAdd::setInstance( + new HsAnchorPointInBottomRight); + + + //Create empty page + HsPageData pageData; + pageData.indexPosition = 0; + HsPage *page = HsPage::createInstance(pageData); + QVERIFY(page); + int pageId = page->databaseId(); + page->onPageMarginChanged("dummy"); + page->onPageMarginChanged("pageMargin"); //No widgets + + //Add first widget + HsWidgetData widgetData; + widgetData.pageId = pageId; + widgetData.uri = "uri1"; + HsWidgetHost *widget = HsWidgetHost::createInstance(widgetData); + QVERIFY(widget); + widget->setPage(page); + QVERIFY(!page->addNewWidget(0)); + QVERIFY(page->addNewWidget(widget)); + QVERIFY(page->addNewWidget(widget)); + QCOMPARE(page->newWidgets().count(), 1); + QCOMPARE(page->widgets().count(), 0); + page->onPageMarginChanged("pageMargin"); // Only mNewWidgets + page->layoutNewWidgets(); + QCOMPARE(page->newWidgets().count(), 0); + QCOMPARE(page->widgets().count(), 1); + QCOMPARE(page->newWidgets().count(), 0); + QCOMPARE(page->widgets().count(), 1); + page->resetNewWidgets(); + + //Add second widget + HsWidgetHost *widget2 = HsWidgetHost::createInstance(widgetData); + QVERIFY(widget2); + widget2->setPage(page); + QVERIFY(page->addNewWidget(widget2)); + QCOMPARE(page->newWidgets().count(),1); + QCOMPARE(page->widgets().count(),1); + page->onPageMarginChanged("pageMargin"); // Both mWidgets and mNewWidgets + page->layoutNewWidgets(); + page->onPageMarginChanged("pageMargin"); //Only mWidgets + QCOMPARE(page->newWidgets().count(), 0); + QCOMPARE(page->widgets().count(), 2); + + delete page; + + HsWidgetPositioningOnWidgetAdd::setInstance(0); +} + +void TestHsDomainModel::testHsPageIndex() +{ + HsPageData pageData; + pageData.indexPosition = 0; + HsPage *page = HsPage::createInstance(pageData); + QVERIFY(page->load()); + QCOMPARE(page->mPageVisual->pageIndex(),-1); + HsScene::instance()->addPage(page); + QCOMPARE(page->mPageVisual->pageIndex(),0); + + pageData.indexPosition = 1; + HsPage *page2 = HsPage::createInstance(pageData); + QVERIFY(page2->load()); + HsScene::instance()->addPage(page2); + QCOMPARE(page2->mPageVisual->pageIndex(),1); + + HsScene::instance()->removePage(page); + delete page; + HsScene::instance()->removePage(page2); + delete page2; +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hspagenewwidgetlayout.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hspagenewwidgetlayout.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,82 @@ +/* +* 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 "t_hsdomainmodel.h" +#include "hswidgetpositioningonwidgetadd.h" +#include "hspagenewwidgetlayout.h" +#include "hswidgethost.h" +#include "hsscene.h" +#include "hspage.h" + +void TestHsDomainModel::testHsPageNewWidgetLayout() +{ + HsWidgetPositioningOnWidgetAdd::setInstance( + new HsAnchorPointInBottomRight); + + HsPageNewWidgetLayout *layout = new HsPageNewWidgetLayout(); + + HsPageData pageData; + HsPage *page = HsPage::createInstance(pageData); + QVERIFY(page); + + // add new widget + HsWidgetData widgetData; + widgetData.pageId = page->databaseId(); + widgetData.uri = "mockwidgetplugin"; + HsWidgetHost *newWidget = HsWidgetHost::createInstance(widgetData); + QVERIFY(newWidget); + page->addNewWidget(newWidget); + + // add existing widget + HsWidgetData widgetData2; + widgetData2.pageId = page->databaseId(); + widgetData2.uri = "mockwidgetplugintoosmall"; + HsWidgetHost *existingWidget = HsWidgetHost::createInstance(widgetData2); + QVERIFY(existingWidget); + page->addExistingWidget(existingWidget); + + HsScene::instance()->mActivePage = page; + layout->addItem(newWidget); + QVERIFY(layout->count() == 1); + layout->setGeometry(QRectF()); + layout->removeAt(0); + QVERIFY(layout->count() == 0); + QVERIFY(layout->sizeHint(Qt::NSizeHints) == QSizeF()); + + delete layout; + delete newWidget; + delete existingWidget; + HsWidgetPositioningOnWidgetAdd::setInstance(0); +} + +void TestHsDomainModel::testHsPageNewWidgetLayoutWithPosition() +{ + HsWidgetPositioningOnWidgetAdd::setInstance( + new HsAnchorPointInBottomRight); + HsPageNewWidgetLayout *layout = new HsPageNewWidgetLayout(); + + HsWidgetHost *widget = new HsWidgetHost(1); + HsPage *page = new HsPage; + HsScene::instance()->mActivePage = page; + layout->addItem(widget); + layout->mTouchPoint = QPointF(100, 100); + layout->setGeometry(QRectF()); + + delete layout; + delete widget; + HsWidgetPositioningOnWidgetAdd::setInstance(0); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hspagetoucharea.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hspagetoucharea.cpp Mon Sep 20 10:19: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: +* +*/ + +#include +#include +#include + +#include "t_hsdomainmodel.h" +#include "hspagetoucharea.h" + + +void TestHsDomainModel::testPageTouchAreaConstruction() +{ + HsPageTouchArea *pageTouchArea = new HsPageTouchArea(); + QVERIFY(pageTouchArea); + delete pageTouchArea; +} + +void TestHsDomainModel::testPageTouchAreaGestureEvent() +{ + HsPageTouchArea *pageTouchArea = new HsPageTouchArea(); + QList QGestureList; + // test empty gesture list + pageTouchArea->gestureEvent(new QGestureEvent(QGestureList)); + + // test tapAndHold + HbTapAndHoldGesture *tapAndHoldGesture = new HbTapAndHoldGesture(); + QGestureList << tapAndHoldGesture; + QGestureEvent *gestureEvent = new QGestureEvent(QGestureList); + pageTouchArea->gestureEvent(gestureEvent); + + QGestureList.clear(); + + // test pan + HbPanGesture *panGesture = new HbPanGesture(); + QGestureList << panGesture; + gestureEvent = new QGestureEvent(QGestureList); + pageTouchArea->gestureEvent(gestureEvent); + + QGestureList.clear(); + + // test tap + HbTapGesture *tapGesture = new HbTapGesture(); + QGestureList << tapGesture; + gestureEvent = new QGestureEvent(QGestureList); + pageTouchArea->gestureEvent(gestureEvent); + + delete tapAndHoldGesture; + delete panGesture; + delete tapGesture; + + delete pageTouchArea; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsscene.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hsscene.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,167 @@ +/* +* 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 "t_hsdomainmodel.h" +#include "hsscene.h" +#include "hsdomainmodeldatastructures.h" +#include "hswidgethost.h" +#include "hspage.h" +#include "hsconfiguration.h" + +void TestHsDomainModel::testSceneDefaultValues() +{ + HsScene *scene = new HsScene; + + QCOMPARE(scene->databaseId(), -1); + QCOMPARE(scene->pages().count(), 0); + QVERIFY(scene->isOnline()); + + QVERIFY(!scene->wallpaper()); + + QVERIFY(!scene->activeWidget()); + QVERIFY(!scene->activePage()); + QCOMPARE(scene->activePageIndex(), -1); + QVERIFY(!scene->setActivePageIndex(1)); + QVERIFY(!scene->setActivePageIndex(-1)); + QVERIFY(!scene->setActivePage(0)); + + QVERIFY(!scene->removePage(0)); + QVERIFY(!scene->addPage(0)); + + delete scene; +} + +void TestHsDomainModel::testSceneStaticInterface() +{ + HsScene *stored = HsScene::takeInstance(); + + HsScene *scene = new HsScene; + QVERIFY(!HsScene::instance()); + HsScene::setInstance(scene); + QVERIFY(HsScene::instance() == scene); + HsScene::setInstance(scene); + QVERIFY(HsScene::instance() == scene); + HsScene *scene2 = HsScene::takeInstance(); + QVERIFY(!HsScene::instance()); + QVERIFY(scene == scene2); + delete scene; + + HsScene::setInstance(stored); +} + +void TestHsDomainModel::testSceneLoad() +{ + // no page + HsScene *scene = HsScene::instance(); + QVERIFY(!scene->load()); + + createPagesToDatabase(1); + scene = HsScene::instance(); + HSCONFIGURATION_SET(setSceneType, HsConfiguration::SceneWallpaper); + QVERIFY(scene->load()); + QVERIFY(scene->wallpaper()); + // set configuration back to original + HSCONFIGURATION_SET(setSceneType, HsConfiguration::PageWallpapers); + destroySceneAndPages(); +} + + +void TestHsDomainModel::testSceneAddPages() +{ + createSceneWithPages(0, 0); + HsScene *scene = HsScene::instance(); + HsPage *page = new HsPage(); + QVERIFY(!scene->addPage(page)); + delete page; + + HsPageData pageData; + pageData.indexPosition = 0; + page = HsPage::createInstance(pageData); + QVERIFY(scene->addPage(page)); + QVERIFY(scene->setActivePage(page)); + QVERIFY(scene->setActivePageIndex(0)); + QVERIFY(scene->addPage(page)); + QCOMPARE(scene->pages().count(), 1); + + // add page to left + HsPageData pageData2; + pageData2.indexPosition = 0; + HsPage *page2 = HsPage::createInstance(pageData2); + QVERIFY(scene->addPage(page2)); + QCOMPARE(scene->pages().count(), 2); + QVERIFY(scene->removePage(page2)); + QCOMPARE(scene->pages().count(), 1); + + int dbId = page->databaseId(); + page->setDatabaseId(dbId-1); + QVERIFY(scene->removePage(page)); + page->setDatabaseId(dbId); + QVERIFY(scene->removePage(page)); + QVERIFY(!scene->setActivePage(page)); + QCOMPARE(scene->pages().count(), 0); + + delete HsScene::mInstance; + HsScene::mInstance = 0; +} + + +void TestHsDomainModel::testSceneOnline() +{ + createSceneWithPages(3,0); + HsScene *scene = HsScene::instance(); + + HsWidgetData widgetData; + widgetData.pageId = HsScene::instance()->activePage()->databaseId(); + widgetData.uri = "mockwidgetplugin"; + + HsWidgetHost *widget = HsWidgetHost::createInstance(widgetData); + QVERIFY(widget); + widget->setPage(HsScene::instance()->activePage()); + widget->startWidget(); + QVERIFY(widget->mStateMachine->isRunning()); + HsScene::instance()->activePage()->addNewWidget(widget); + + QVERIFY(widget->mWidget->property("isOnline").isValid()); + QVERIFY(widget->mWidget->property("isOnline").toBool()); + scene->setOnline(true); + QVERIFY(widget->mWidget->property("isOnline").toBool()); + scene->setOnline(false); + QVERIFY(!widget->mWidget->property("isOnline").toBool()); + + QVERIFY(!scene->activeWidget()); + scene->setActiveWidget(widget); + QCOMPARE(scene->activeWidget(), widget); + + delete HsScene::mInstance; + HsScene::mInstance = 0; +} + +void TestHsDomainModel::testSceneEventFilter() +{ + createSceneWithPages(3, 0); + HsScene *scene = HsScene::instance(); + + QEvent activateEvent(QEvent::ApplicationActivate); + QEvent deactivateEvent(QEvent::ApplicationDeactivate); + QEvent randomEvent(QEvent::AccessibilityHelp); + + scene->eventFilter(0, &activateEvent); + scene->eventFilter(0, &deactivateEvent); + scene->eventFilter(0, &randomEvent); + + destroySceneAndPages(); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswallpaper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswallpaper.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,174 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include "t_hsdomainmodel.h" +#include "hswallpaper.h" +#include "hsscene.h" +#include "hspage.h" + +void TestHsDomainModel::testHsWallpaperConstruction() +{ + { + HsSceneWallpaper wallpaper(HsScene::instance()); + QVERIFY(!wallpaper.parent()); + } + + HsPage *page = new HsPage(); + page->setDatabaseId(1); + { + HbWidget parent; + HsPageWallpaper wallpaper(page, &parent); + QVERIFY(wallpaper.parentItem() == &parent); + } + + HsPageWallpaper *pagewallpaper = new HsPageWallpaper(page); + QVERIFY(pagewallpaper); + QVERIFY(!pagewallpaper->parent()); + delete pagewallpaper; + + HbWidget *parent = new HbWidget(); + HsSceneWallpaper *scenewallpaper = new HsSceneWallpaper(HsScene::instance(), parent); + QVERIFY(scenewallpaper); + QVERIFY(scenewallpaper->parentItem() == parent); + delete parent; + + delete page; +} + +void TestHsDomainModel::testHsWallpaperSetNRemoveDefaultImage() +{ + //Default image is set already at construction phase while scene DB id + //is not set. + QVERIFY(QFile::exists(sourceTestWallpaper())); + HsSceneWallpaper *wallpaper = new HsSceneWallpaper(HsScene::instance()); + QVERIFY(QDir::toNativeSeparators(wallpaper->mPortraitImagePath) == sourceTestWallpaper()); + wallpaper->setDefaultImage(); //Coverage improvement. Default image already set at construction phase. + QVERIFY(QDir::toNativeSeparators(wallpaper->mPortraitImagePath) == sourceTestWallpaper()); + QVERIFY(wallpaper->mIsDefaultImage); + wallpaper->remove(); + QVERIFY(!wallpaper->mIsDefaultImage); + QVERIFY(wallpaper->mPortraitImagePath.isEmpty()); + QVERIFY(wallpaper->mLandscapeImagePath.isEmpty()); + delete wallpaper; +} + +void TestHsDomainModel::testHsWallpaperSetNRemoveImage() +{ + mWallpaperTypeScene = false; //Use page wallpaper at this test + //Prepare test case by checking that source file exists and + //deleting any page specific wallpapers existing in target folder + QVERIFY(QFile::exists(sourceTestWallpaper())); + cleanupTargetWallpaperFiles(); + + HsPage *page = new HsPage(); + page->setDatabaseId(1); + //Construction phase sets default image since Id based image does not exist, yet. + HsPageWallpaper *wallpaper = new HsPageWallpaper(page); + QVERIFY(QDir::toNativeSeparators(wallpaper->mPortraitImagePath) == sourceTestWallpaper()); + + //TEST EMPTY SOURCE STRING + QSignalSpy setImageFailedSpy(wallpaper, SIGNAL(imageSetFailed())); + wallpaper->setImage(QString()); + QCOMPARE(setImageFailedSpy.count(), 1); + + QSignalSpy imageSetSpy(wallpaper, SIGNAL(imageSet())); + QEventLoop waitFinished; + QTimer eventLoopTimer; + eventLoopTimer.setInterval(15000); + eventLoopTimer.setSingleShot(true); + connect(wallpaper, SIGNAL(imageSet()), &waitFinished, SLOT(quit())); + connect(&eventLoopTimer, SIGNAL(timeout()), &waitFinished, SLOT(quit())); + //TEST SETIMAGE + wallpaper->setImage(sourceTestWallpaper()); + eventLoopTimer.start(); + waitFinished.exec(); + + QCOMPARE(imageSetSpy.count(), 1); + QVERIFY(eventLoopTimer.isActive()); + eventLoopTimer.stop(); + + //Now we have Id based images. + QVERIFY(QDir::toNativeSeparators(wallpaper->mPortraitImagePath) == targetPortraitTestWallpaper()); + QVERIFY(QDir::toNativeSeparators(wallpaper->mLandscapeImagePath) == targetLandscapeTestWallpaper()); + QVERIFY(QFile::exists(targetPortraitTestWallpaper())); + QVERIFY(QFile::exists(targetLandscapeTestWallpaper())); + + //TEST REMOVE + wallpaper->remove(); + QVERIFY(wallpaper->mPortraitImagePath.isEmpty()); + QVERIFY(wallpaper->mLandscapeImagePath.isEmpty()); + QVERIFY(!QFile::exists(targetPortraitTestWallpaper())); + QVERIFY(!QFile::exists(targetLandscapeTestWallpaper())); + + delete wallpaper; + delete page; +} + +void TestHsDomainModel::testHsWallpaperLoaderFailed() +{ + cleanupTargetWallpaperFiles(); + + HsPage *page = new HsPage(); + page->setDatabaseId(1); + //Construction phase sets default image since Id based image does not exist, yet. + HsPageWallpaper *wallpaper = new HsPageWallpaper(page); + QSignalSpy loaderFailedSpy(wallpaper, SIGNAL(imageSetFailed())); + wallpaper->onLoaderFailed(); + QCOMPARE(loaderFailedSpy.count(), 1); + + delete wallpaper; + delete page; +} + +void TestHsDomainModel::testHsWallpaperScene() +{ + cleanupTargetWallpaperFiles(); + //Construction phase sets default image since Id based image does not exist, yet. + HsSceneWallpaper *wallpaper = new HsSceneWallpaper(HsScene::instance()); + QVariantHash papers = wallpaper->createTargets("."); + QVERIFY(papers.count()==2); + wallpaper->setScene(0); + QVERIFY(HsScene::instance() == wallpaper->mScene); + + delete wallpaper; +} +void TestHsDomainModel::testHsWallpaperPage() +{ + cleanupTargetWallpaperFiles(); + + HsPage *page = new HsPage(); + page->setDatabaseId(1); + //Construction phase sets default image since Id based image does not exist, yet. + HsPageWallpaper *wallpaper = new HsPageWallpaper(page); + wallpaper->setPage(0); + QVERIFY(page == wallpaper->mPage); + delete wallpaper; + delete page; +} + +void TestHsDomainModel::testHsWallpaperSetImages() +{ + HsPageWallpaper wp(0); + QSignalSpy spyIS(&wp, SIGNAL(imageSet())); + QSignalSpy spyISF(&wp, SIGNAL(imageSetFailed())); + + wp.setImages(QString(), QString()); + + QCOMPARE(spyIS.count(), 0); + QCOMPARE(spyISF.count(), 1); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswallpaperloader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswallpaperloader.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,173 @@ +/* +* 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: +* +*/ + + +#include +#include +#include +#include +#include +#include + +#include "t_hsdomainmodel.h" +#include "hswallpaperloader.h" +#include "hswallpaperloaderthread.h" + +void TestHsDomainModel::testHsWallpaperLoaderConstruction() +{ + { + HsWallpaperLoader loader; + QVERIFY(!loader.parent()); + } + + { + QObject parent; + HsWallpaperLoader loader(&parent); + QVERIFY(loader.parent() == &parent); + } + + HsWallpaperLoader *loader = new HsWallpaperLoader; + QVERIFY(loader); + QVERIFY(!loader->parent()); + delete loader; + + QObject *parent = new QObject(); + loader = new HsWallpaperLoader(parent); + QVERIFY(loader); + QVERIFY(loader->parent() == parent); + delete parent; +} + +void TestHsDomainModel::testHsWallpaperLoaderStartWithFinished() +{ + //Test preparation + cleanupTargetWallpaperFiles(); + + HsWallpaperLoader *loader = new HsWallpaperLoader; + QSignalSpy finishedSpy(loader, SIGNAL(finished())); + + //TEST START WITHOUT THREADS + loader->start(); + QCOMPARE(finishedSpy.count(), 1); + QVERIFY(!loader->isRunning()); + finishedSpy.clear(); + + //TEST START WITH ONE THREAD SUCCESSFUL + //Check that test file exist + QVERIFY(QFile::exists(sourceTestWallpaper())); + loader->setSourcePath(sourceTestWallpaper()); + + QVariantHash targets; + targets.insert(tempTestWallpaper(), QSize(360, 640)); + loader->setTargets(targets); + + QEventLoop waitFinished; + QTimer eventLoopTimer; + eventLoopTimer.setInterval(15000); + eventLoopTimer.setSingleShot(true); + connect(loader, SIGNAL(finished()), &waitFinished, SLOT(quit())); + connect(&eventLoopTimer, SIGNAL(timeout()), &waitFinished, SLOT(quit())); + loader->start(); + QVERIFY(loader->isRunning()); + eventLoopTimer.start(); + waitFinished.exec(); + + QCOMPARE(finishedSpy.count(), 1); + QVERIFY(eventLoopTimer.isActive()); + eventLoopTimer.stop(); + + QVERIFY(!loader->isRunning()); + //Check that temp file is created and result is true + QVERIFY(QFile::exists(tempTestWallpaper())); + //Clear created temp file + cleanupTargetWallpaperFiles(); + + delete loader; +} + +void TestHsDomainModel::testHsWallpaperLoaderStartWithFailed() +{ + //Test preparation + cleanupTargetWallpaperFiles(); + + HsWallpaperLoader *loader = new HsWallpaperLoader; + QSignalSpy failedSpy(loader, SIGNAL(failed())); + + //TEST START WITH ONE FAILING THREAD AND ONE SUCCESSFUL + QVERIFY(QFile::exists(sourceTestWallpaper())); + loader->setSourcePath(sourceTestWallpaper()); + + QVariantHash targets; + targets.insert(tempTestWallpaper(), QSize(360, 640)); + targets.insert(QString(), QSize(640, 360)); //Save fails for empty string in thread + loader->setTargets(targets); + + QEventLoop waitFailed; + QTimer eventLoopTimer; + eventLoopTimer.setInterval(15000); + eventLoopTimer.setSingleShot(true); + connect(loader, SIGNAL(failed()), &waitFailed, SLOT(quit())); + connect(&eventLoopTimer, SIGNAL(timeout()), &waitFailed, SLOT(quit())); + loader->start(); + QVERIFY(loader->isRunning()); + eventLoopTimer.start(); + waitFailed.exec(); + + QCOMPARE(failedSpy.count(), 1); + QVERIFY(eventLoopTimer.isActive()); + eventLoopTimer.stop(); + + QVERIFY(!loader->isRunning()); + //Check that temp file is created and result is true + QVERIFY(QFile::exists(tempTestWallpaper())); + + //Clear created temp file + cleanupTargetWallpaperFiles(); + delete loader; + +} + +void TestHsDomainModel::testHsWallpaperLoaderCancel() +{ + //Test preparation + cleanupTargetWallpaperFiles(); + + HsWallpaperLoader *loader = new HsWallpaperLoader; + QSignalSpy failedSpy(loader, SIGNAL(failed())); + QSignalSpy finishedSpy(loader, SIGNAL(finished())); + + //TEST START WITH ONE FAILING THREAD AND ONE SUCCESSFUL + QVERIFY(QFile::exists(sourceTestWallpaper())); + loader->setSourcePath(sourceTestWallpaper()); + + QVariantHash targets; + targets.insert(tempTestWallpaper(), QSize(360, 640)); + targets.insert(QString(), QSize(640, 360)); //This fails due to empty target file path. + loader->setTargets(targets); + + loader->start(); + QVERIFY(loader->isRunning()); + loader->cancel(); + QVERIFY(!loader->isRunning()); + QCOMPARE(failedSpy.count(), 0); + QCOMPARE(finishedSpy.count(), 0); + + //Clear temp file if it was created + cleanupTargetWallpaperFiles(); + + delete loader; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswallpaperloaderthread.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswallpaperloaderthread.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,81 @@ +/* +* 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: +* +*/ + +#include +#include +#include + +#include "t_hsdomainmodel.h" +#include "hswallpaperloaderthread.h" + +void TestHsDomainModel::testHsWallpaperLoaderThreadConstruction() +{ + { + HsWallpaperLoaderThread thread; + QVERIFY(!thread.parent()); + } + + { + QObject parent; + HsWallpaperLoaderThread thread(&parent); + QVERIFY(thread.parent() == &parent); + } + + HsWallpaperLoaderThread *thread = new HsWallpaperLoaderThread; + QVERIFY(thread); + QVERIFY(!thread->parent()); + delete thread; + + QObject *parent = new QObject(); + thread = new HsWallpaperLoaderThread(parent); + QVERIFY(thread); + QVERIFY(thread->parent() == parent); + delete parent; +} + +void TestHsDomainModel::testHsWallpaperLoaderThreadRun() +{ + //Test preparation + cleanupTargetWallpaperFiles(); + + HsWallpaperLoaderThread *thread = new HsWallpaperLoaderThread; + + //TEST OF FILE WHICH DOES NOT EXIST + QVERIFY(!QFile::exists(notExistingTestWallpaper())); + thread->setSourcePath(notExistingTestWallpaper()); + thread->setTargetSize(QSize(360, 640)); + thread->setTargetPath(tempTestWallpaper()); + thread->run(); + //Check that temp file is not created and result is false + QVERIFY(!thread->result()); + QVERIFY(!QFile::exists(tempTestWallpaper())); + + //TEST OF FILE WHICH EXISTS + //Check that test file exist + QVERIFY(QFile::exists(sourceTestWallpaper())); + thread->setSourcePath(sourceTestWallpaper()); + thread->setTargetSize(QSize(360, 640)); + thread->setTargetPath(tempTestWallpaper()); + thread->run(); + //Check that temp file is created and result is true + QVERIFY(thread->result()); + QVERIFY(QFile::exists(tempTestWallpaper())); + //Clear created temp file + cleanupTargetWallpaperFiles(); + + delete thread; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswidgetcomponent.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswidgetcomponent.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Wallpaper test. +* +*/ + + +#include "t_hsdomainmodel.h" +#include "hswidgetcomponent.h" + +#include "caentry.h" +#include "hsapp_defs.h" +/*! + +*/ +void TestHsDomainModel::testWidgetComponent() +{ + QScopedPointer compo(new HsWidgetComponent("mockwidgetplugin")); + QVERIFY(!compo.isNull()); + QString path = compo->rootPath(); + QVERIFY(!compo->isAvailable()); // is not in ca store + QVERIFY(compo->uri() == "mockwidgetplugin"); + compo->uninstallTranslator(); +} + + +void TestHsDomainModel::testWidgetComponentEmits() +{ + + QScopedPointer compo(new HsWidgetComponent("mockwidgetplugin")); + + QSignalSpy aboutToUninstallSpy(compo.data(),SIGNAL(aboutToUninstall())); + QSignalSpy uninstalledSpy(compo.data(),SIGNAL(uninstalled())); + QSignalSpy unavailableSpy(compo.data(),SIGNAL(unavailable())); + QSignalSpy availableSpy(compo.data(),SIGNAL(available())); + QSignalSpy updatedSpy(compo.data(),SIGNAL(updated())); + + compo->emitAboutToUninstall(); + QVERIFY(aboutToUninstallSpy.count() == 1); + // should not emit again + compo->emitAboutToUninstall(); + QVERIFY(aboutToUninstallSpy.count() == 1); + + compo->emitUninstalled(); + QVERIFY(uninstalledSpy.count() == 1); + // should not emit again + compo->emitUninstalled(); + QVERIFY(uninstalledSpy.count() == 1); + + compo->emitUnavailable(); + QVERIFY(unavailableSpy.count() == 1); + // should not emit again + compo->emitUnavailable(); + QVERIFY(unavailableSpy.count() == 1); + + compo->emitAvailable(); + QVERIFY(availableSpy.count() == 1); + // should not emit again + compo->emitAvailable(); + QVERIFY(availableSpy.count() == 1); + + compo->emitAboutToUninstall(); + compo->emitUpdated(); + QVERIFY(updatedSpy.count() == 1); + // should not emit again + compo->emitUpdated(); + QVERIFY(updatedSpy.count() == 1); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswidgetcomponentdescriptor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswidgetcomponentdescriptor.cpp Mon Sep 20 10:19: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: Wallpaper test. +* +*/ + + +#include "t_hsdomainmodel.h" +#include "hswidgetcomponentdescriptor.h" + +void TestHsDomainModel::testWidgetComponentDescriptor() +{ + HsWidgetComponentDescriptor widgetDescriptor; + + QVERIFY(!widgetDescriptor.isValid()); + + widgetDescriptor.setUri(QString("uri")); + QVERIFY(!widgetDescriptor.isValid()); + + widgetDescriptor.setUri(QString("")); + widgetDescriptor.setTitle(QString("title")); + QVERIFY(!widgetDescriptor.isValid()); + + widgetDescriptor.setUri(QString("uri")); + widgetDescriptor.setTitle(QString("title")); + QVERIFY(widgetDescriptor.isValid()); + + widgetDescriptor.setVersion(QString("foobar")); + QVERIFY(!widgetDescriptor.isValid()); + widgetDescriptor.setVersion(QString("1.0")); + widgetDescriptor.setServiceXml(QString("foobar")); + QVERIFY(widgetDescriptor.isValid()); + + +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswidgetcomponentregistry.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswidgetcomponentregistry.cpp Mon Sep 20 10:19: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: Wallpaper test. +* +*/ + +#include "t_hsdomainmodel.h" +#include "hswidgetcomponentregistry.h" +#include "hswidgetcomponent.h" +#include "hswidgetcomponentdescriptor.h" +#include "caentry.h" +#include "hsapp_defs.h" +/*! + +*/ +void TestHsDomainModel::testWidgetComponentRegistry() +{ + HsWidgetComponent* compo = HsWidgetComponentRegistry::instance()->component("mockwidgetplugin"); + QVERIFY(compo); + QSignalSpy spy(compo,SIGNAL(aboutToUninstall())); + HsWidgetComponentDescriptor widgetDescriptor; + widgetDescriptor.setUri("mockwidgetplugin"); + // this deletes compo + HsWidgetComponentRegistry::instance()->uninstallComponent(widgetDescriptor); + QVERIFY(spy.count()==1); + spy.clear(); + widgetDescriptor.setUri("notfoundwidget"); + HsWidgetComponentRegistry::instance()->uninstallComponent(widgetDescriptor); + QVERIFY(spy.count()==0); +} + +void TestHsDomainModel::testWidgetComponentRegistryOnEntryChanged() +{ + HsWidgetComponent* compo = HsWidgetComponentRegistry::instance()->component("mockwidgetplugin"); + QVERIFY(compo); + CaEntry caEntry; + caEntry.setAttribute(Hs::widgetPathAttributeName, "mockwidgetplugin"); + HsWidgetComponentRegistry::instance()->onEntryChanged(caEntry, AddChangeType); + HsWidgetComponentRegistry::instance()->onEntryChanged(caEntry, RemoveChangeType); + caEntry.setFlags(MissingEntryFlag); + HsWidgetComponentRegistry::instance()->onEntryChanged(caEntry, RemoveChangeType); + HsWidgetComponentRegistry::instance()->onEntryChanged(caEntry, UpdateChangeType); + // invalid. + HsWidgetComponentRegistry::instance()->onEntryChanged(caEntry, (ChangeType) 100); + + // there isnt really a good way to verify results, just calling these functions... + +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswidgethost.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswidgethost.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,298 @@ +/* +* 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 "t_hsdomainmodel.h" +#include "hsdomainmodeldatastructures.h" +#include "hswidgethost.h" +#include "hswidgethostvisual.h" +#include "hspage.h" +#include "hsscene.h" +#include "hswidgettoucharea.h" + +void TestHsDomainModel::testHsWidgetHostConstruction() +{ + HsWidgetData data; + data.pageId = 0; + data.uri = "mockwidgetplugin"; + HsWidgetHost *host = HsWidgetHost::createInstance(data); + + QVERIFY(host); + QVERIFY(!host->mPage); + QVERIFY(!host->page()); + QVERIFY(!host->mWidget); + QVERIFY(!host->mIsFinishing); + QVERIFY(!host->mComponent); + QCOMPARE(host->mDatabaseId, 1); + QCOMPARE(host->databaseId(), 1); + QVERIFY(host->mStateMachine); + QVERIFY(!host->mStateMachine->isRunning()); + + delete host; +} + +void TestHsDomainModel::testHsWidgetHostStateMachine() +{ + HsWidgetData data; + data.pageId = 0; + data.uri = "mockwidgetplugin"; + HsWidgetHost *host = HsWidgetHost::createInstance(data); + QVERIFY(host); + + // State machine events. + QSignalSpy event_startAndShowSpy(host, SIGNAL(event_startAndShow())); + QSignalSpy event_startAndHideSpy(host, SIGNAL(event_startAndHide())); + QSignalSpy event_unloadSpy(host, SIGNAL(event_unload())); + QSignalSpy event_showSpy(host, SIGNAL(event_show())); + QSignalSpy event_hideSpy(host, SIGNAL(event_hide())); + QSignalSpy event_removeSpy(host, SIGNAL(event_remove())); + QSignalSpy event_closeSpy(host, SIGNAL(event_close())); + QSignalSpy event_finishedSpy(host, SIGNAL(event_finished())); + QSignalSpy event_faultedSpy(host, SIGNAL(event_faulted())); + + QSignalSpy sm_finished(host->mStateMachine, SIGNAL(finished())); + + // Host events. + QSignalSpy faultedSpy(host, SIGNAL(faulted())); + QSignalSpy finishedSpy(host, SIGNAL(finished())); + + + host->startWidget(); + + QCOMPARE(event_startAndShowSpy.count(), 1); + event_startAndShowSpy.clear(); + + QCOMPARE(faultedSpy.count(), 0); + QCOMPARE(finishedSpy.count(), 0); + + QVERIFY(!host->mIsFinishing); + QVERIFY(host->mComponent); + QVERIFY(host->mWidget); + + host->hideWidget(); + + QCOMPARE(event_hideSpy.count(), 1); + event_hideSpy.clear(); + + host->showWidget(); + + QCOMPARE(event_showSpy.count(), 1); + event_showSpy.clear(); + + host->remove(); // Calls deleteLater() + + QCOMPARE(event_removeSpy.count(), 1); + event_removeSpy.clear(); + + QCOMPARE(sm_finished.count(), 1); + sm_finished.clear(); +} + +void TestHsDomainModel::testHsWidgetHostCloseAndRemove() +{ + HsWidgetData widgetData; + widgetData.pageId = 0; + widgetData.uri = "mockwidgetplugin"; + + { + HsWidgetHost *host = HsWidgetHost::createInstance(widgetData); + QVERIFY(host); + QSignalSpy event_removeSpy(host, SIGNAL(event_remove())); + QSignalSpy event_closeSpy(host, SIGNAL(event_close())); + + host->close(); + QCOMPARE(event_removeSpy.count(), 0); + QCOMPARE(event_closeSpy.count(), 0); + } + + { + HsWidgetHost *host = HsWidgetHost::createInstance(widgetData); + QVERIFY(host); + QSignalSpy event_removeSpy(host, SIGNAL(event_remove())); + QSignalSpy event_closeSpy(host, SIGNAL(event_close())); + + host->remove(); + QCOMPARE(event_removeSpy.count(), 0); + QCOMPARE(event_closeSpy.count(), 0); + } + + { + HsWidgetHost *host = HsWidgetHost::createInstance(widgetData); + QVERIFY(host); + QSignalSpy event_removeSpy(host, SIGNAL(event_remove())); + QSignalSpy event_closeSpy(host, SIGNAL(event_close())); + + host->startWidget(false); + host->close(); + QCOMPARE(event_removeSpy.count(), 0); + QCOMPARE(event_closeSpy.count(), 1); + } + + { + HsWidgetHost *host = HsWidgetHost::createInstance(widgetData); + QVERIFY(host); + QSignalSpy event_removeSpy(host, SIGNAL(event_remove())); + QSignalSpy event_closeSpy(host, SIGNAL(event_close())); + + host->startWidget(); + host->startWidget(); + host->remove(); + QCOMPARE(event_removeSpy.count(), 1); + QCOMPARE(event_closeSpy.count(), 0); + } +} + +void TestHsDomainModel::testHsWidgetHostPage() +{ + HsWidgetData widgetData; + widgetData.pageId = 0; + widgetData.uri = "mockwidgetplugin"; + HsWidgetHost *host = HsWidgetHost::createInstance(widgetData); + QVERIFY(host); + + QVERIFY(!host->page()); + + HsPageData pageData; + pageData.indexPosition = 0; + HsPage *page = HsPage::createInstance(pageData); + QVERIFY(page); + + QVERIFY(host->setPage(page)); + QVERIFY(host->mPage == page); + QVERIFY(host->page() == page); + + QVERIFY(host->setPage(0)); + QVERIFY(!host->mPage); + QVERIFY(!host->page()); + + host->mDatabaseId = -1; + QVERIFY(!host->setPage(page)); + QVERIFY(!host->mPage); + QVERIFY(!host->page()); + + delete page; + + delete host; +} + +void TestHsDomainModel::testHsWidgetHostEffects() +{ + HsWidgetHost *host = new HsWidgetHost(-1); + host->startDragEffect(); + host->startDropEffect(); +} + +void TestHsDomainModel::testHsWidgetHostShowAndHideActions() +{ + HsWidgetHost *host = new HsWidgetHost(-1); + host->action_show(); + host->action_hide(); + host->mIsFinishing = true; + host->action_show(); + host->action_hide(); + delete host; +} + +void TestHsDomainModel::testHsWidgetHostPresentation() +{ + HsWidgetData widgetData; + widgetData.pageId = 0; + widgetData.uri = "mockwidgetplugin"; + HsWidgetHost *host = HsWidgetHost::createInstance(widgetData); + QVERIFY(host); + host->startWidget(); + + HsWidgetPresentationData data; + data.orientation = Qt::Vertical; + data.x = data.y = data.zValue = 0; + + QVERIFY(host->savePresentation(data)); + QVERIFY(host->getPresentation(data)); + + host->removePresentation(Qt::Vertical); + + QVERIFY(!host->getPresentation(data)); + + host->remove(); +} + +void TestHsDomainModel::testHsWidgetHostOnError() +{ + HsWidgetHost *host = new HsWidgetHost(-1); + QSignalSpy event_faultedSpy(host, SIGNAL(event_faulted())); + host->onError(); + QCOMPARE(event_faultedSpy.count(), 1); + QVERIFY(host->mIsFinishing); + delete host; +} + +void TestHsDomainModel::testHsWidgetHostOnSetPreferences() +{ + HsWidgetData widgetData; + widgetData.pageId = 0; + widgetData.uri = "mockwidgetplugin"; + HsWidgetHost *host = HsWidgetHost::createInstance(widgetData); + QVERIFY(host); + host->startWidget(); + host->onSetPreferences(QStringList()); + host->onSetPreferences(QStringList() << "mypref"); + host->remove(); +} + +void TestHsDomainModel::testHsWidgetHostShape() +{ + HsWidgetData widgetData; + widgetData.pageId = 0; + widgetData.uri = "mockwidgetplugin"; + HsWidgetHost *host = HsWidgetHost::createInstance(widgetData); + QVERIFY(host); + host->startWidget(); + host->remove(); +} + +void TestHsDomainModel::testHsWidgetHostShapeInvalidValues() +{ + HsWidgetData widgetData; + widgetData.pageId = 0; + widgetData.uri = "mockwidgetplugincheater"; + HsWidgetHost *host = HsWidgetHost::createInstance(widgetData); + QVERIFY(host); + host->startWidget(); + host->remove(); +} + +void TestHsDomainModel::testHsWidgetHostGestureEvent() +{ + HsWidgetHost *host = new HsWidgetHost(-1); + QList gestureList; + + // test pan + HbPanGesture *panGesture = new HbPanGesture(); + gestureList << panGesture; + QGestureEvent *gestureEvent = new QGestureEvent(gestureList); + Qt::GestureState state = panGesture->state(); + host->visual()->gestureEvent(gestureEvent); + + delete panGesture; + delete host; +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswidgethostvisual.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswidgethostvisual.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,155 @@ +/* +* 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 "t_hsdomainmodel.h" +#include "hsdomainmodeldatastructures.h" +#include "hswidgethost.h" +#include "hswidgethostvisual.h" +#include "hspage.h" +#include "hsscene.h" +#include "hswidgettoucharea.h" +#include "hshostedwidgetfactory.h" +#include "hsconfiguration.h" + +void TestHsDomainModel::testHsWidgetHostVisualConstruction() +{ + HsWidgetHostVisual *visual = new HsWidgetHostVisual(); + + QVERIFY(visual); + QVERIFY(!visual->mWidget); + delete visual; +} + + +void TestHsDomainModel::testHsWidgetHostVisualShape() +{ + HsWidgetData data; + data.pageId = 0; + data.uri = "mockwidgetplugin"; + HsWidgetHost *host = HsWidgetHost::createInstance(data); + + host->startWidget(); + QPainterPath path = host->visual()->shape(); + QCOMPARE(path.boundingRect(),QRectF(QPointF(0,0), HsConfiguration::instance()->minimumWidgetSizeInPixels())); + + host->visual()->mWidget->resize(QSizeF(100,100)); + path = host->visual()->shape(); + QCOMPARE(path.boundingRect(),QRectF(0,0,100,100)); + + + host->remove(); + + data.pageId = 0; + data.uri = "mockwidgetplugintoobig"; + host = HsWidgetHost::createInstance(data); + host->startWidget(); + path = host->visual()->shape(); + QCOMPARE(path.boundingRect(),QRectF(QPointF(0,0), HsConfiguration::instance()->maximumWidgetSizeInPixels())); + host->remove(); +} + +void TestHsDomainModel::testHsWidgetHostVisualSetWidget() +{ + QObject *widget = HsHostedWidgetFactory::instance()->createWidget("mockwidgetplugin"); + HsWidgetHostVisual *visual = new HsWidgetHostVisual(); + visual->setWidget(widget); + QVERIFY(visual->mWidget == widget); + delete visual; +} + +void TestHsDomainModel::testHsWidgetHostVisualSetVisualModel() +{ + HsWidgetHost *host = new HsWidgetHost(-1); + HsWidgetHostVisual *visual = new HsWidgetHostVisual(); + visual->setVisualModel(host); + QVERIFY(visual->mVisualModel == host); + delete visual; + host->remove(); +} + +void TestHsDomainModel::testHsWidgetHostVisualEffects() +{ + HsWidgetData data; + data.pageId = 0; + data.uri = "mockwidgetplugin"; + HsWidgetHost *host = HsWidgetHost::createInstance(data); + + host->startWidget(); + host->visual()->startDragEffect(); + host->visual()->startDropEffect(); + host->remove(); +} + + +void TestHsDomainModel::testHsWidgetHostVisualEventFilter() +{ + HsWidgetHostVisual *visual = new HsWidgetHostVisual(); + QSignalSpy resizedSpy(visual, SIGNAL(resized())); + QEvent *someEvent = new QEvent(QEvent::ApplicationActivated); + visual->eventFilter(0, someEvent); + QCOMPARE(resizedSpy.count(), 0); + delete visual; + delete someEvent; +} + + +void TestHsDomainModel::testHsWidgetHostVisualGestureEvent() +{ + HsWidgetHostVisual *visual = new HsWidgetHostVisual(); + QList gestureList; + + // test empty gesture list + visual->gestureEvent(new QGestureEvent(gestureList)); + + // test pan + HbPanGesture *panGesture = new HbPanGesture(); + gestureList << panGesture; + QGestureEvent *gestureEvent = new QGestureEvent(gestureList); + visual->gestureEvent(gestureEvent); + + delete panGesture; + delete visual; +} + +void TestHsDomainModel::testHsWidgetHostVisualSetupTouchArea() +{ + HsWidgetHostVisual *visual = new HsWidgetHostVisual(); + visual->setupTouchArea(); + delete visual; +} + +void TestHsDomainModel::testHsWidgetHostVisualSetupEffects() +{ + HsWidgetHostVisual *visual = new HsWidgetHostVisual(); + visual->setupEffects(); + delete visual; +} + +void TestHsDomainModel::testHsWidgetHostVisualSetNewSize() +{ + HsWidgetHostVisual *visual = new HsWidgetHostVisual(); + visual->setNewSize(QSizeF(100,100)); + QVERIFY(visual->size() == QSizeF(100,100)); + delete visual; +} + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswidgetpositioningonwidgetadd.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswidgetpositioningonwidgetadd.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,256 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef ONLY_MENU_TESTCASES + +#include +#include + +#include "t_hsdomainmodel.h" +#include "hsconfiguration.h" +#include "hsgui.h" +#include "hswidgetpositioningonwidgetadd.h" + +inline bool hsRectCompare(const QRectF& p1, const QRectF& p2) +{ + const qreal offset = 0.1; + bool rectsAreSame = (qAbs(p1.x()-p2.x()) < offset) && (qAbs(p1.y()-p2.y()) < offset) && (qAbs(p1.width()-p2.width()) < offset) && (qAbs(p1.height()-p2.height()) < offset); + if ( !rectsAreSame) { + qDebug() << "rects are not the same: actual" << p1 << "expected" << p2; + } + return rectsAreSame; +} + +Q_DECLARE_METATYPE(QList) + +void TestHsDomainModel::testWidgetPositioningOnWidgetAddChangeInstance() +{ + QVERIFY(!HsWidgetPositioningOnWidgetAdd::instance()); + HsWidgetPositioningOnWidgetAdd::setInstance(0); + QVERIFY(!HsWidgetPositioningOnWidgetAdd::instance()); + HsWidgetPositioningOnWidgetAdd *c = new HsAnchorPointInBottomRight; + HsWidgetPositioningOnWidgetAdd::setInstance(c); + QVERIFY(HsWidgetPositioningOnWidgetAdd::instance() == c); + HsWidgetPositioningOnWidgetAdd::setInstance(0); + QVERIFY(!HsWidgetPositioningOnWidgetAdd::instance()); +} + +void TestHsDomainModel::testHsAnchorPointInBottomRight_data() +{ + QTest::addColumn("contentArea"); + QTest::addColumn >("widgets"); + QTest::addColumn >("expectedWidgets"); + + QTest::newRow("square") + << QRectF(0, 0, 100, 100) + << (QList() << QRectF(0, 0, 10, 10) << QRectF(50, 50, 10, 10) << QRectF(50, 50, 20, 10) << QRectF(50, 50, 10, 10)) + << (QList() << QRectF(45, 45, 10, 10) << QRectF(30.8579, 30.8579, 10, 10) << QRectF(6.71573, 16.7157, 20, 10) << QRectF(2.57359, 2.57359, 10, 10)); + + QTest::newRow("portrait") + << QRectF(0, 0, 50, 100) + << (QList() << QRectF(0, 0, 10, 10) << QRectF(50, 50, 10, 10) << QRectF(50, 50, 10, 20) << QRectF(50, 50, 10, 10)) + << (QList() << QRectF(20, 50, 10, 10) << QRectF(8.45299, 26.906, 10, 10) << QRectF(40,80, 10, 20) << QRectF(28.453, 66.906, 10, 10)); + + QTest::newRow("landscape") + << QRectF(0, 0, 100, 50) + << (QList() << QRectF(0, 0, 20, 10) << QRectF(50, 50, 20, 10) << QRectF(50, 50, 10, 20) << QRectF(50, 50, 10, 10)) + << (QList() << QRectF(40, 20, 20, 10) << QRectF(23.6701, 11.835, 20, 10) << QRectF(90, 30, 10, 20) << QRectF(73.6701, 31.835, 10, 10)); + + QTest::newRow("out of rect") + << QRectF(0, 0, 100, 100) + << (QList() << QRectF(0, 0, 200, 200) ) + << (QList() << QRectF(0, 0, 200, 200) ); +} + +void TestHsDomainModel::testHsAnchorPointInBottomRight() +{ + QFETCH(QRectF, contentArea); + QFETCH(QList, widgets); + QFETCH(QList, expectedWidgets); + + HsWidgetPositioningOnWidgetAdd *converter = + new HsAnchorPointInBottomRight; + + QList convertedWidgets = + converter->convert(contentArea, QList(), + widgets, QPointF()); + + QCOMPARE(convertedWidgets.count(), + expectedWidgets.count()); + + for (int i = 0; i < expectedWidgets.count(); ++i) { + QVERIFY(hsRectCompare(convertedWidgets.at(i),expectedWidgets.at(i))); + } + + delete converter; +} + +void TestHsDomainModel::testHsWidgetOrganizerCase1_data() +{ + // Case 1: anchorDistance = 5, searchRowByRow, portrait + QTest::addColumn("contentArea"); + QTest::addColumn >("existingWidgets"); + QTest::addColumn >("widgets"); + QTest::addColumn >("expectedWidgets"); + + // empty parameters + QTest::newRow("case1.1") + << QRectF() << QList() << QList() << QList(); + + // invalid parameters + QTest::newRow("case1.2") + << QRectF(0, 0, 100, 100) << QList() + << (QList() << QRectF(0, 0, 10, 10) << QRectF(0, 0, 10, 10) << QRectF(0, 0, 10, 10)) + << (QList() << QRectF(0, 0, 10, 10) << QRectF(15, 0, 10, 10) << QRectF(30, 0, 10, 10)); + + // basic set of similar size rects to simple content area's first row + QTest::newRow("case1.3") + << QRectF(54, 763, 24, 5434) + << (QList() << QRectF(343, 321, 1034, 102) << QRectF(3320, 3420, 1430, 1043) << QRectF(0, 43, 10, 997)) + << (QList() << QRectF(322, 12, 835, 623) << QRectF(624, 56, 536, 895) << QRectF(31, 423, 32, 9823)) + << QList(); + + // set of similar height rects to simple content area on multiple rows + QTest::newRow("case1.4") + << QRectF(0, 0, 100, 100) << QList() + << (QList() << QRectF(0, 0, 40, 10) << QRectF(0, 0, 50, 10) << QRectF(0, 0, 95, 10) << QRectF(0, 0, 50, 10) << QRectF(0, 0, 10, 10)) + << (QList() << QRectF(0, 0, 40, 10) << QRectF(45, 0, 50, 10) << QRectF(0, 15, 95, 10) << QRectF(0, 30, 50, 10) << QRectF(55, 30, 10, 10)); + + // set of random size rects to simple content area on multiple rows + QTest::newRow("case1.5") + << QRectF(0, 0, 100, 100) << QList() + << (QList() << QRectF(0, 0, 13, 22) << QRectF(0, 0, 59, 39) << QRectF(0, 0, 93, 8) << QRectF(0, 0, 44, 17) << QRectF(0, 0, 22, 31)) + << (QList() << QRectF(85, 0, 13, 22) << QRectF(0, 0, 59, 39) << QRectF(0, 60, 93, 8) << QRectF(0, 40, 44, 17) << QRectF(60, 0, 22, 31)); + + // set of random size rects to simple content area on multiple rows with existing widgets + QTest::newRow("case1.6") + << QRectF(0, 0, 100, 100) + << (QList() << QRectF(42, 16, 14, 11) << QRectF(9, 12, 13, 62) << QRectF(55, 65, 20, 20) << QRectF(70, 20, 13, 11) << QRectF(30, 90, 22, 8)) + << (QList() << QRectF(0, 0, 13, 22) << QRectF(0, 0, 42, 34) << QRectF(0, 0, 54, 8) << QRectF(0, 0, 32, 17) << QRectF(0, 0, 27, 24)) + << (QList() << QRectF(25, 0, 13, 22) << QRectF(25, 30, 42, 34) << QRectF(0, 75, 54, 8) << QRectF(60, 0, 32, 17) << QRectF(70, 35, 27, 24)); + +} + +void TestHsDomainModel::testHsWidgetOrganizerCase1() +{ + QFETCH(QRectF, contentArea); + QFETCH(QList, existingWidgets); + QFETCH(QList, widgets); + QFETCH(QList, expectedWidgets); + + HsWidgetOrganizer *widgetOrganizer = + new HsWidgetOrganizer(5, HsConfiguration::SearchRowByRow); + + QList convertedWidgets = widgetOrganizer->convert(contentArea, existingWidgets, + widgets, QPointF()); + // Verify amount + QCOMPARE(convertedWidgets.count(), expectedWidgets.count()); + // Compare calculated and expected values + for (int i = 0; i < expectedWidgets.count(); ++i) { + QVERIFY(hsRectCompare(convertedWidgets.at(i), expectedWidgets.at(i))); + } + + delete widgetOrganizer; +} + +void TestHsDomainModel::testHsWidgetOrganizerCase2_data() +{ + // CASE 2: anchorDistance = 5, searchColumnByColumn, landscape + QTest::addColumn("contentArea"); + QTest::addColumn >("existingWidgets"); + QTest::addColumn >("widgets"); + QTest::addColumn >("expectedWidgets"); + + // basic set of similar size rects to simple content area's first column + QTest::newRow("case2.1") + << QRectF(0, 0, 100, 100) << QList() + << (QList() << QRectF(0, 0, 10, 10) << QRectF(0, 0, 10, 10) << QRectF(0, 0, 10, 10)) + << (QList() << QRectF(0, 0, 10, 10) << QRectF(0, 15, 10, 10) << QRectF(0, 30, 10, 10)); + + // set of random size rects to simple content area on multiple columns with existing widgets + QTest::newRow("case2.2") + << QRectF(0, 0, 100, 100) + << (QList() << QRectF(20, 0, 14, 18) << QRectF(68, 0, 13, 21) << QRectF(32, 30, 14, 53) << QRectF(62, 60, 31, 13) << QRectF(90, 33, 9, 8)) + << (QList() << QRectF(0, 0, 43, 12) << QRectF(0, 0, 20, 16) << QRectF(0, 0, 14, 25) << QRectF(0, 0, 22, 47) << QRectF(0, 0, 24, 11)) + << (QList() << QRectF(15, 85, 43, 12) << QRectF(35, 0, 20, 16) << QRectF(0, 70, 14, 25) << QRectF(0, 20, 22, 47) << QRectF(50, 25, 24, 11)); +} + +void TestHsDomainModel::testHsWidgetOrganizerCase2() +{ + QFETCH(QRectF, contentArea); + QFETCH(QList, existingWidgets); + QFETCH(QList, widgets); + QFETCH(QList, expectedWidgets); + + mainWindow.setOrientation(Qt::Horizontal); + HsWidgetOrganizer *widgetOrganizer = + new HsWidgetOrganizer(5, HsConfiguration::SearchColumnByColumn); + QList convertedWidgets = widgetOrganizer->convert(contentArea, existingWidgets, + widgets, QPointF()); + QCOMPARE(convertedWidgets.count(), expectedWidgets.count()); + for (int i = 0; i < expectedWidgets.count(); ++i) { + QVERIFY(hsRectCompare(convertedWidgets.at(i), expectedWidgets.at(i))); + } + + delete widgetOrganizer; + // set orientation back to normal + mainWindow.setOrientation(Qt::Vertical); +} + +void TestHsDomainModel::testHsWidgetOrganizerCase3_data() +{ + // CASE 3: anchorDistance = 1, searchRowByRow, portrait + QTest::addColumn("contentArea"); + QTest::addColumn >("existingWidgets"); + QTest::addColumn >("widgets"); + QTest::addColumn >("expectedWidgets"); + + // basic set of similar size rects to simple content area's first column + QTest::newRow("case3.1") + << QRectF(0, 0, 100, 100) << QList() + << (QList() << QRectF(0, 0, 10, 10) << QRectF(0, 0, 10, 10) << QRectF(0, 0, 10, 10)) + << (QList() << QRectF(0, 0, 10, 10) << QRectF(11, 0, 10, 10) << QRectF(22, 0, 10, 10)); + + // set of random size rects to simple content area on multiple columns with existing widgets + QTest::newRow("case3.2") + << QRectF(0, 0, 100, 100) + << (QList() << QRectF(10, 0, 14, 22) << QRectF(64, 0, 14, 34) << QRectF(0, 54, 34, 14) << QRectF(74, 69, 26, 12) << QRectF(41, 80, 11, 20)) + << (QList() << QRectF(0, 0, 46, 16) << QRectF(0, 0, 40, 19) << QRectF(0, 0, 38, 53) << QRectF(0, 0, 20, 40) << QRectF(0, 0, 38, 25)) + << (QList() << QRectF(53, 82, 46, 16) << QRectF(0, 80, 40, 19) << QRectF(25, 0, 38, 53) << QRectF(79, 0, 20, 40) << QRectF(35, 54, 38, 25)); + +} + +void TestHsDomainModel::testHsWidgetOrganizerCase3() +{ + QFETCH(QRectF, contentArea); + QFETCH(QList, existingWidgets); + QFETCH(QList, widgets); + QFETCH(QList, expectedWidgets); + + HsWidgetOrganizer *widgetOrganizer = + new HsWidgetOrganizer(1, HsConfiguration::SearchRowByRow); + QList convertedWidgets = widgetOrganizer->convert(contentArea, existingWidgets, + widgets, QPointF()); + QCOMPARE(convertedWidgets.count(), expectedWidgets.count()); + for (int i = 0; i < expectedWidgets.count(); ++i) { + QVERIFY(hsRectCompare(convertedWidgets.at(i), expectedWidgets.at(i))); + } + + delete widgetOrganizer; +} + +#endif // ONLY_MENU_TESTCASES diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswidgettoucharea.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/t_hswidgettoucharea.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,90 @@ +/* +* 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: +* +*/ + +#include +#include + +#include "t_hsdomainmodel.h" +#include "hswidgethost.h" +#include "hswidgettoucharea.h" +#include "hsscene.h" + + + +void TestHsDomainModel::testWidgetTouchAreaConstruction() +{ + HsWidgetHost *widget = new HsWidgetHost(-1); + HsWidgetTouchArea *widgetTouchArea = new HsWidgetTouchArea(widget->visual()); + QVERIFY(widgetTouchArea); + delete widgetTouchArea; +} + +void TestHsDomainModel::testWidgetTouchAreaSceneEvent() +{ + HsWidgetHost *widget = new HsWidgetHost(-1); + HsWidgetTouchArea *widgetTouchArea = new HsWidgetTouchArea(widget->visual()); + HsScene *scene = HsScene::instance(); + + // test shape fetch + QPainterPath *path = new QPainterPath(widgetTouchArea->shape()); + QVERIFY(path); + delete path; + + QSignalSpy widgetTapStartedSpy(scene, SIGNAL(widgetTapStarted(QPointF,HsWidgetHost*))); + QSignalSpy widgetMoveFinishedSpy(scene, SIGNAL(widgetMoveFinished(const QPointF &, HsWidgetHost*))); + + // test touch begin + QTouchEvent::TouchPoint touchPoint; + QList touchPoints; + touchPoints.append(touchPoint); + QTouchEvent *touchEvent = new QTouchEvent(QEvent::TouchBegin); + touchEvent->setTouchPoints(touchPoints); + widgetTouchArea->sceneEvent(touchEvent); + QCOMPARE(widgetTapStartedSpy.count(), 1); + + delete widgetTouchArea; + delete widget; +} + + +void TestHsDomainModel::testWidgetTouchAreaGestureEvent() +{ + HsWidgetHost *widget = new HsWidgetHost(-1); + HsWidgetTouchArea *widgetTouchArea = new HsWidgetTouchArea(widget->visual()); + QList gestureList; + + // test empty gesture list + widgetTouchArea->gestureEvent(new QGestureEvent(gestureList)); + + // test tapAndHold (not real test as gestures need to be created using qesturerecognizer + HbTapAndHoldGesture *tapAndHoldGesture = new HbTapAndHoldGesture(); + gestureList << tapAndHoldGesture; + QGestureEvent *gestureEvent = new QGestureEvent(gestureList); + widgetTouchArea->gestureEvent(gestureEvent); + + gestureList.clear(); + + // test pan + HbPanGesture *panGesture = new HbPanGesture(); + gestureList << panGesture; + gestureEvent = new QGestureEvent(gestureList); + widgetTouchArea->gestureEvent(gestureEvent); + + delete tapAndHoldGesture; + delete panGesture; + delete widgetTouchArea; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/testcontentservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/testcontentservice.cpp Mon Sep 20 10:19: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: +* +*/ + +#include "t_hsdomainmodel.h" +#include "hscontentservice.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void TestHsDomainModel::testCreateNDeleteWidget() +{ + createSceneWithPages(); + + HsContentService contentService; + + QVariantHash params; + + params["uri"]= "invalidmockwidgetplugin"; + QVERIFY(!contentService.createWidget(params)); + + //this has to be uri1 because of mocked factory + params["uri"]= "mockwidgetplugin"; + QVERIFY(contentService.createWidget(params)); + + QVERIFY(!HsContentService::instance()->addWidget(QString(), QVariantHash())); + + destroySceneAndPages(); +} + +void TestHsDomainModel::testContentServiceStaticInterface() +{ + QVERIFY(HsContentService::instance()); +} + + +void TestHsDomainModel::testContentServiceWidgetCount() +{ + createSceneWithPages(); + HsContentService *contentService = HsContentService::instance(); + QVERIFY(contentService); + int count = 0; + QVERIFY(contentService->widgets("testing", QVariantHash(), count)); + + +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/testshortcutservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/src/testshortcutservice.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include + +#include "hsshortcutservice.h" +#include "hsshortcutservice_p.h" +#include "t_hsdomainmodel.h" + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void TestHsDomainModel::testShortcutService() +{ + QStateMachine *machine = new QStateMachine; + + HsShortcutService *scService = HsShortcutService::instance(machine); + + QCOMPARE(scService->isItemShortcutWidget(0), false); + + QVERIFY(HsShortcutService::instance()); + + scService->executeCollectionAction(0, QString(""));//how to test this? + delete machine; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/t_hsdomainmodel.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/t_hsdomainmodel.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,96 @@ +# +# 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/*.h + +SOURCES += ./src/*.cpp + +HEADERS += ../../../hsutils/inc/hspropertyanimationwrapper.h \ + ../../../hsutils/inc/hswidgetpositioningonorientationchange.h \ + ../../../hsutils/inc/hsmenueventfactory.h \ + ../../../hsutils/inc/hsmenuevent.h \ + ../../../hsutils/inc/hspageindicator.h \ + ../../../hsutils/inc/hspageindicatoritem.h \ + ../../../hsutils/inc/hstrashbinwidget.h \ + ../../../hsutils/inc/hssnapline.h \ + ./../../inc/hscontentservice.h \ + ./../../inc/hsdatabase.h \ + ./../../inc/hsdomainmodel_global.h \ + ./../../inc/hspage.h \ + ./../../inc/hspagevisual.h \ + ./../../inc/hspagetoucharea.h \ + ./../../inc/hspagenewwidgetlayout.h \ + ./../../inc/hsscene.h \ + ./../../inc/hsshortcutservice.h \ + ./../../inc/hsshortcutservice_p.h \ + ./../../inc/hswallpaper.h \ + ./../../inc/hswallpaperloader.h \ + ./../../inc/hswallpaperloaderthread.h \ + ./../../inc/hshostedwidgetfactory.h \ + ./../../inc/hswidgethost.h \ + ./../../inc/hswidgethostvisual.h \ + ./../../inc/hswidgettoucharea.h \ + ./../../inc/hsdomainmodeldatastructures.h \ + ./../../inc/hswidgetcomponentregistry.h \ + ./../../inc/hswidgetcomponent.h \ + ./../../inc/hswidgetcomponentdescriptor.h \ + ./../../inc/hsbackuprestoreobserver.h \ + ./../../inc/hsconfiguration.h \ + ./../../inc/hsgui.h \ + ./../../inc/hsidlewidget.h \ + ./../../inc/hsdocumentloader.h \ + ./../../inc/hswidgetpositioningonwidgetadd.h + +SOURCES += ../../../hsutils/src/hswidgetpositioningonorientationchange.cpp \ + ../../../hsutils/src/hsmenueventfactory.cpp \ + ../../../hsutils/src/hsmenuevent.cpp \ + ../../../hsutils/src/hspageindicator.cpp \ + ../../../hsutils/src/hspageindicatoritem.cpp \ + ../../../hsutils/src/hstrashbinwidget.cpp \ + ../../../hsutils/src/hssnapline.cpp \ + ./../../src/hscontentservice.cpp \ + ./../../src/hsdatabase.cpp \ + ./../../src/hspage.cpp \ + ./../../src/hspagevisual.cpp \ + ./../../src/hspagetoucharea.cpp \ + ./../../src/hspagenewwidgetlayout.cpp \ + ./../../src/hsscene.cpp \ + ./../../src/hsshortcutservice.cpp \ + ./../../src/hswallpaper.cpp \ + ./../../src/hswallpaperloader.cpp \ + ./../../src/hswallpaperloaderthread.cpp \ + ./../../src/hshostedwidgetfactory.cpp \ + ./../../src/hswidgethost.cpp \ + ./../../src/hswidgethostvisual.cpp \ + ./../../src/hswidgettoucharea.cpp \ + ./../../src/hswidgetcomponentregistry.cpp \ + ./../../src/hswidgetcomponent.cpp \ + ./../../src/hswidgetcomponentdescriptor.cpp \ + ./../../src/hsbackuprestoreobserver.cpp \ + ./../../src/hsconfiguration.cpp \ + ./../../src/hsgui.cpp \ + ./../../src/hsidlewidget.cpp \ + ./../../src/hsdocumentloader.cpp \ + ./../../src/hswidgetpositioningonwidgetadd.cpp + +symbian: { +HEADERS += ./../../inc/hsbackuprestoreobserver_p.h \ + ./../../inc/hsbackuprestoreactivecallback.h \ + $${EPOCROOT}epoc32/include/connect/abclient.h +SOURCES += ./../../src/hsbackuprestoreactivecallback.cpp +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/t_hsdomainmodel.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/t_hsdomainmodel/t_hsdomainmodel.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,89 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = app + +CONFIG(debug, debug|release) { + LIBS += -L./../../../../../bin/debug -lcaclient + DESTDIR = debug +} +else { + LIBS += -L./../../../../../bin/release -lcaclient + DESTDIR = release +} + + + +CONFIG += debug_and_release \ + console + +CONFIG += hb mobility +MOBILITY = serviceframework + +HB += hbfeedback + +coverage:DEFINES += COVERAGE_MEASUREMENT + +QT += testlib \ + xml \ + sql + +DEFINES += HOMESCREEN_TEST \ + HSDOMAINMODEL_TEST \ + HSUTILS_TEST + +DEPENDPATH += .\ + ./src \ + ./inc + +INCLUDEPATH += .\ + ./inc \ + ../../inc \ + ../../../inc \ + ../../../hsutils/inc \ + ../../../hsapplication/inc + +exists(../../../../../homescreensrv) { +INCLUDEPATH += ../../../../../homescreensrv/homescreensrv_plat/contentstorage_api + +} else { +INCLUDEPATH += $${EPOCROOT}sf/mw/homescreensrv/homescreensrv_plat/contentstorage_api +} + +RESOURCES += ../../hsdomainmodel_win.qrc + +symbian: { + CONFIG += symbian_test + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + TARGET.UID3 = 0x20022F59 + TARGET.CAPABILITY = CAP_APPLICATION AllFiles + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB + TARGET.EPOCALLOWDLLDATA=1 + + LIBS += -lxqsettingsmanager + + INCLUDEPATH +=$${EPOCROOT}epoc32/include/connect + include(installs_symbian.pri) + + MMP_RULES += SMPSAFE +} + +include(t_hsdomainmodel.pri) + +win32:include(installs_win32.pri) + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsdomainmodel/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsdomainmodel/tsrc/tsrc.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,21 @@ +# +# 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 = mockwidgetplugin mockwidgetplugintoobig mockwidgetplugintoosmall mockwidgetplugincheater t_hsdomainmodel + +CONFIG += ordered + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hshomescreenclientplugin/hshomescreenclientplugin.pro --- a/homescreenapp/hshomescreenclientplugin/hshomescreenclientplugin.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hshomescreenclientplugin/hshomescreenclientplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -32,6 +32,7 @@ TARGET.UID3 = 0x20022F72 LIBS += -lxqservice LIBS += -lxqserviceutil + MMP_RULES += SMPSAFE } win32: { diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hshomescreenclientplugin/tsrc/t_hshomescreenclientplugin/decision_cov_emulator.pl --- a/homescreenapp/hshomescreenclientplugin/tsrc/t_hshomescreenclientplugin/decision_cov_emulator.pl Mon Sep 13 13:03:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +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: Script for running branch coverage test -# - -#USAGE: -# Usage: decision_cov.pl [-make=command] -# -make=instrument || run || ctcpost - -# import module -use Getopt::Long; - -# read options -my $make = "all"; -my $success = GetOptions ("make=s" => \$make); - -if($make) { - if (($make eq "instrument") || ($make eq "all")) { - system("del mon.sym"); - system("del mon.dat"); - system("del profile.txt"); - system("rmdir /s /q CTCFUNCTION"); - system("rmdir /s /q CTCDECISION"); - system("call qmake -config coverage"); - system("call sbs -c winscw_udeb.test"); - system("call sbs -c winscw_udeb.test clean"); - system("call sbs -c winscw_udeb clean"); - system("call sbs -c winscw_udeb"); - system("call ctcwrap -i fd -2comp -no-conf-check -C EXCLUDE=* -C NO_EXCLUDE=./../../src/* sbs -c winscw_udeb.test"); - } - if (($make eq "run") || ($make eq "all")) { - system("call \\epoc32\\release\\winscw\\udeb\\t_hshomescreenclientplugin.exe -o c:\\t_hshomescreenclientplugin.log"); - } - if (($make eq "ctcpost") || ($make eq "all")) { - system("call ctcpost -ff -p profile.txt"); - system("call ctc2html -nsb -i profile.txt -o CTCFUNCTION"); - system("call del profile.txt"); - system("call ctcpost -fd -p profile.txt"); - system("call ctc2html -nsb -i profile.txt -o CTCDECISION"); - system("call del profile.txt"); - } -} -print "END.\n"; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hshomescreenclientplugin/tsrc/t_hshomescreenclientplugin/inc/t_hshomescreenclientplugin.h --- a/homescreenapp/hshomescreenclientplugin/tsrc/t_hshomescreenclientplugin/inc/t_hshomescreenclientplugin.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hshomescreenclientplugin/tsrc/t_hshomescreenclientplugin/inc/t_hshomescreenclientplugin.h Mon Sep 20 10:19:07 2010 +0300 @@ -40,6 +40,7 @@ void testAddWidget(); void testAddInvalidWidget(); void testSetWallpaper(); + void testSetWallpaper2(); void testOnRequestError(); signals: diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hshomescreenclientplugin/tsrc/t_hshomescreenclientplugin/src/t_hshomescreenclientplugin.cpp --- a/homescreenapp/hshomescreenclientplugin/tsrc/t_hshomescreenclientplugin/src/t_hshomescreenclientplugin.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hshomescreenclientplugin/tsrc/t_hshomescreenclientplugin/src/t_hshomescreenclientplugin.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -109,6 +109,27 @@ // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // +void HsHomescreenClientPluginTest::testSetWallpaper2() +{ + HsHomescreenClient *client = new HsHomescreenClient; + + QSignalSpy requestFinishedSpy(client, SIGNAL(requestFinished())); + + bool result = client->setWallpaper("wallpaper", "wallpaper"); + + // but emit correct signals + connect(this, SIGNAL(onRequestCompletedTest(QVariant)), client, SLOT(onRequestCompleted(QVariant))); + emit onRequestCompletedTest(true); + + QVERIFY(requestFinishedSpy.count()); + QVERIFY(client->mRequestResult); + + delete client; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// void HsHomescreenClientPluginTest::testOnRequestError() { HsHomescreenClient *client = new HsHomescreenClient; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hshomescreenclientplugin/tsrc/t_hshomescreenclientplugin/t_hshomescreenclientplugin.pro --- a/homescreenapp/hshomescreenclientplugin/tsrc/t_hshomescreenclientplugin/t_hshomescreenclientplugin.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hshomescreenclientplugin/tsrc/t_hshomescreenclientplugin/t_hshomescreenclientplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -51,6 +51,8 @@ TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB LIBS += -lxqservice LIBS += -lxqserviceutil + + MMP_RULES += SMPSAFE } else { error("Only Symbian supported!") } diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsmenuclientplugin/hsmenuclientplugin.pro --- a/homescreenapp/hsmenuclientplugin/hsmenuclientplugin.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsmenuclientplugin/hsmenuclientplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -34,6 +34,8 @@ symbian: { TARGET.UID3 = 0x20028715 + + MMP_RULES += SMPSAFE } include(../common.pri) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsmenuclientplugin/src/hsmenuclient.cpp --- a/homescreenapp/hsmenuclientplugin/src/hsmenuclient.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsmenuclientplugin/src/hsmenuclient.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -18,16 +18,15 @@ #include #include +#include +#include +#include +#include + #include "hsapp_defs.h" -#include "caquery.h" -#include "caentry.h" -#include "caicondescription.h" -#include "caservice.h" - #include "hsmenuclient.h" #include "hsmenuclient_p.h" - /*! \class HsMenuClient \ingroup group_hsmenuclient diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsmenuclientplugin/tsrc/t_hsmenuclientplugin/inc/caservice_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsmenuclientplugin/tsrc/t_hsmenuclientplugin/inc/caservice_p.h Mon Sep 20 10:19: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: caservice_p.h + * + */ + +#ifndef CASERVICE_PRIVATE_H +#define CASERVICE_PRIVATE_H + +#include +#include + +class QString; +class CaQuery; +class CaServicePrivate +{ + +public: + ~CaServicePrivate() { + clearAll(); + } + + QList< QSharedPointer > mCreatedEntries; + QList< QSharedPointer > mReturnedEntries; + int mEntryToRemove; + QSharedPointer mUpdatedEntry; + CaQuery* mQueryPassedToGetList; + + void AddEntriesForUpdate(); + void clearAll(); + static CaServicePrivate& instance() { + static CaServicePrivate caServicePrivate; + return caServicePrivate; + } + +private: + + explicit CaServicePrivate(): mUpdatedEntry (NULL), mQueryPassedToGetList (NULL) + { + } +}; + +#endif //CASERVICE_PRIVATE_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsmenuclientplugin/tsrc/t_hsmenuclientplugin/inc/t_hsmenuclientplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsmenuclientplugin/tsrc/t_hsmenuclientplugin/inc/t_hsmenuclientplugin.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Tests for hsmenuclientplugin class. +* +*/ + +#ifndef T_HSMMENUCLIENTPLUGINTEST_H +#define T_HSMMENUCLIENTPLUGINTEST_H + +#include +#include + +#ifdef Q_OS_SYMBIAN +#include +#endif//Q_OS_SYMBIAN + +#include "caservice_p.h" //mock +/** +* @test Test class for homescreen::hsutils modules. +*/ +class HsMenuClientPluginTest : public QObject +{ + Q_OBJECT + +private slots: + + void initTestCase(); + void init(); + + void testCreateEntry(); + void testCreateLocalizedEntry(); + void testUpdateEntry(); + void testRemoveEntry(); + void testListEntry(); + + + /** + * cleanup + */ + void cleanupTestCase(); + void cleanup(); + +private: + CaServicePrivate *mCaServicePrivateMock; + +}; + +#endif //T_HSMMENUCLIENTPLUGINTEST_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsmenuclientplugin/tsrc/t_hsmenuclientplugin/src/caservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsmenuclientplugin/tsrc/t_hsmenuclientplugin/src/caservice.cpp Mon Sep 20 10:19: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: caservice.cpp + * + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "hsapp_defs.h" +#include "t_hsmenuclientplugin.h" +#include "hsmenuclient.h" + + +// ======== MEMBER FUNCTIONS ======== + +/*! + + \class CaService. + \brief This class operates on data, anable creating and inserting new entry + to DB, removing entry from DB, update entry or get entry from DB, executeC + command on entry and create notifier to notify client about changes onto DB. + + CaService class uses singleton design pattern, so that it contains static + method called instance() to get instance of a class. + + \code + QSharedPointer service = CaService::instance(); + \endcode + + For every operations on data is used always one instantiation of a class. + Below are examples how to create data and work on those ones. + + */ + +// Initialization of a static member variable. +//QWeakPointer CaService::m_instance = QWeakPointer(); + +/*! + Constructor. + \param parent pointer to a parent. It defaults to NULL. + */ +CaService::CaService(QObject *parent) : + QObject(parent), m_d(&CaServicePrivate::instance()) +{ + +} + +/*! + Returns a pointer to the instance of the CaService class. + \retval A pointer to the instance of the CaService class. + */ +QSharedPointer CaService::instance() +{ + static QSharedPointer instance (new CaService); + return instance; +} + +/*! + Destructor. + */ +CaService::~CaService() +{ + +} + +// HELP METHODS + +void CaServicePrivate::clearAll() +{ + mEntryToRemove = -1; + + mUpdatedEntry.clear(); + + delete mQueryPassedToGetList; + mQueryPassedToGetList = NULL; + + mCreatedEntries.clear(); + mReturnedEntries.clear(); +} + +void CaServicePrivate::AddEntriesForUpdate() +{ + QSharedPointer item0 (new CaEntry()); + + // this will be updated: + QSharedPointer item1 (new CaEntry()); + item1->setText("ModuleTestTApp"); + item1->setDescription("Unit test app for HsClientPlugin"); + + item1->setAttribute(hsitemLaunchUri, "appto://2002DCEC?"); + item1->setAttribute(hsitemPublisherId, "tappModuleTest"); + item1->setAttribute(hsitemLaunchUri, "hsclockwidgetplugin"); + + item1->setEntryTypeName(Hs::templatedApplicationTypeName); + item1->setFlags(VisibleEntryFlag); + + CaIconDescription iconDescription1; + iconDescription1.setFilename("iconFileName"); + iconDescription1.setSkinId("iconSkinId"); + iconDescription1.setApplicationId("268458321"); //Bluetouth app UID + item1->setIconDescription(iconDescription1); + + mCreatedEntries << item0; + mCreatedEntries << item1; +} +QSharedPointer CaService::getEntry(int entryId) const +{ + return m_d->mCreatedEntries.at(entryId); +} + + +bool CaService::updateEntry(const CaEntry &entry) const +{ + m_d->mUpdatedEntry.clear(); + m_d->mUpdatedEntry = QSharedPointer(new CaEntry(entry)); + return true; +} + +QSharedPointer CaService::createEntry(const CaEntry &entry) const +{ + QSharedPointer newEntry(new CaEntry(entry)); + m_d->mCreatedEntries << newEntry; + return newEntry; +} + + +bool CaService::removeEntry(int entryId) const +{ + m_d->mEntryToRemove = entryId; + + return true; +} + + +QList< QSharedPointer > CaService::getEntries( + const QList &entryIdList) const +{ + Q_UNUSED(entryIdList); + QList< QSharedPointer > result; + return result; + +} + +QList< QSharedPointer > CaService::getEntries(const CaQuery &query) const +{ + // store the query for verification + m_d->mQueryPassedToGetList = new CaQuery (query); + + // return mock list of 2 entires + QSharedPointer item1 (new CaEntry()); + item1->setText("ModuleTestTApp1"); + item1->setDescription("Unit test app for HsClientPlugin1"); + item1->setAttribute(hsitemLaunchUri, "appto://1002DCEC?"); + item1->setAttribute(hsitemPublisherId, "tappModuleTest1"); + item1->setAttribute(hsitemLaunchUri, "hsclockwidgetplugin1"); + item1->setEntryTypeName(Hs::templatedApplicationTypeName); + item1->setFlags(VisibleEntryFlag); + CaIconDescription iconDescription1; + iconDescription1.setFilename("iconFileName1"); + iconDescription1.setSkinId("iconSkinId1"); + iconDescription1.setApplicationId("168458321"); + item1->setIconDescription(iconDescription1); + + QSharedPointer item2 (new CaEntry()); + item2->setText("ModuleTestTApp2"); + item2->setDescription("Unit test app for HsClientPlugin2"); + item2->setAttribute(hsitemLaunchUri, "appto://2002DCEC?"); + item2->setAttribute(hsitemPublisherId, "tappModuleTest2"); + item2->setAttribute(hsitemLaunchUri, "hsclockwidgetplugin2"); + item2->setEntryTypeName(Hs::templatedApplicationTypeName); + item2->setFlags(VisibleEntryFlag); + CaIconDescription iconDescription2; + iconDescription2.setFilename("iconFileName2"); + iconDescription2.setSkinId("iconSkinId2"); + iconDescription2.setApplicationId("268458321"); + item2->setIconDescription(iconDescription2); + + // store items for verification + m_d->mReturnedEntries << item1 << item2; + + // return copies to caller + QList< QSharedPointer > resultList; + resultList << item1; + resultList << item2; + + return resultList; +} + +QList CaService::getEntryIds(const CaQuery &query) const +{ + Q_UNUSED(query); + QList result; + return result; + +} + + + +bool CaService::removeEntry(const CaEntry &entry) const +{ + return removeEntry(entry.id()); +} + + +bool CaService::removeEntries(const QList &entryIdList) const +{ + Q_UNUSED(entryIdList); + return true; +} + + +bool CaService::removeEntries( + const QList< QSharedPointer > &entryList) const +{ + Q_UNUSED(entryList); + return true; +} + +bool CaService::touch(const CaEntry &entry) const +{ + Q_UNUSED(entry); + return true; +} + + +bool CaService::insertEntryIntoGroup(int groupId, int entryId, + int beforeEntryId) const +{ + Q_UNUSED(groupId); + Q_UNUSED(entryId); + Q_UNUSED(beforeEntryId); + return true; +} + + +bool CaService::insertEntryIntoGroup( + const CaEntry &group, const CaEntry &entry, int beforeEntryId) const +{ + Q_UNUSED(group); + Q_UNUSED(entry); + Q_UNUSED(beforeEntryId); + return true; +} + + +bool CaService::insertEntriesIntoGroup(int groupId, + const QList &entryIdList, int beforeEntryId) const +{ + Q_UNUSED(groupId); + Q_UNUSED(entryIdList); + Q_UNUSED(beforeEntryId); + return true; +} + + +bool CaService::insertEntriesIntoGroup(const CaEntry &group, + const QList< QSharedPointer > &entryList, + int beforeEntryId) const +{ + Q_UNUSED(group); + Q_UNUSED(entryList); + Q_UNUSED(beforeEntryId); + return true; +} + + +bool CaService::removeEntryFromGroup(int groupId, int entryId) const +{ + Q_UNUSED(groupId); + Q_UNUSED(entryId); + return true; +} + + +bool CaService::removeEntryFromGroup(const CaEntry &group, + const CaEntry &entry) const +{ + Q_UNUSED(group); + Q_UNUSED(entry); + return true; +} + + +bool CaService::removeEntriesFromGroup(int groupId, + const QList &entryIdList) const +{ + Q_UNUSED(groupId); + Q_UNUSED(entryIdList); + return true; +} + + +bool CaService::removeEntriesFromGroup(const CaEntry &group, + const QList< QSharedPointer > &entryList) const +{ + Q_UNUSED(group); + Q_UNUSED(entryList); + return true; +} + + +bool CaService::appendEntryToGroup(int groupId, int entryId) const +{ + Q_UNUSED(groupId); + Q_UNUSED(entryId); + return true; +} + + +bool CaService::appendEntryToGroup(const CaEntry &group, + const CaEntry &entry) const +{ + Q_UNUSED(group); + Q_UNUSED(entry); + return true; +} + + +bool CaService::appendEntriesToGroup(int groupId, + const QList &entryIdList) const +{ + Q_UNUSED(groupId); + Q_UNUSED(entryIdList); + return true; +} + + +bool CaService::appendEntriesToGroup(const CaEntry &group, + const QList< QSharedPointer > &entryList) const +{ + Q_UNUSED(group); + Q_UNUSED(entryList); + return true; +} + + +bool CaService::prependEntryToGroup(int groupId, int entryId) const +{ + Q_UNUSED(groupId); + Q_UNUSED(entryId); + return true; +} + + +bool CaService::prependEntryToGroup(const CaEntry &group, + const CaEntry &entry) const +{ + Q_UNUSED(group); + Q_UNUSED(entry); + return true; +} + +bool CaService::prependEntriesToGroup(int groupId, + const QList &entryIdList) const +{ + Q_UNUSED(groupId); + Q_UNUSED(entryIdList); + return true; +} + +bool CaService::prependEntriesToGroup(const CaEntry &group, + const QList< QSharedPointer > &entryList) const +{ + Q_UNUSED(group); + Q_UNUSED(entryList); + return true; +} + +int CaService::executeCommand(int entryId, const QString &command, + QObject* receiver, const char* member) const +{ + Q_UNUSED(entryId); + Q_UNUSED(command); + Q_UNUSED(receiver); + Q_UNUSED(member); + return 0; +} + +int CaService::executeCommand(const CaEntry &entry, const QString &command, + QObject* receiver, const char* member) const +{ + Q_UNUSED(entry); + Q_UNUSED(command); + Q_UNUSED(receiver); + Q_UNUSED(member); + return 0; +} + +CaNotifier *CaService::createNotifier(const CaNotifierFilter &filter) const +{ + Q_UNUSED(filter); + return NULL; +} + + +bool CaService::customSort(int groupId, QList &entryIdList) const +{ + Q_UNUSED(entryIdList); + return true; +} + +ErrorCode CaService::lastError() const +{ + return NoErrorCode; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsmenuclientplugin/tsrc/t_hsmenuclientplugin/src/t_hsmenuclientplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsmenuclientplugin/tsrc/t_hsmenuclientplugin/src/t_hsmenuclientplugin.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,349 @@ +/* +* 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 test class for test library. +* +*/ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include "t_hsmenuclientplugin.h" +#include "hsmenuclient.h" + +const QString hsItemId("id"); + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void HsMenuClientPluginTest::initTestCase() +{ + mCaServicePrivateMock = &CaServicePrivate::instance(); +// mainWindow(); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void HsMenuClientPluginTest::init() +{ + mCaServicePrivateMock->clearAll(); +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void HsMenuClientPluginTest::cleanupTestCase() +{ + +// delete mainWindow(); + +} + +void HsMenuClientPluginTest::cleanup() +{ + mCaServicePrivateMock->clearAll(); + qApp->processEvents(); +} + +void HsMenuClientPluginTest::testCreateEntry() +{ + #ifdef Q_OS_SYMBIAN + #ifdef UT_MEMORY_CHECK + __UHEAP_MARK; + #endif//UT_MEMORY_CHECK + #endif//Q_OS_SYMBIAN + { + QList list; + QMap map; + map[hsItemName] = "ModuleTestTApp"; + map[hsItemDescription] = "Unit test app for HsClientPlugin"; + + map[hsitemLaunchUri] = "appto://2002DCEC?"; + map[hsitemPublisherId] = "tappModuleTest"; + map[hsItemWidgetUri] = "hsclockwidgetplugin"; + + map[hsIconFileName] = "Z:\\private\\20022F35\\import\\widgetregistry\\20022F6C\\tclock.png"; + map[hsIconName] = "qtg_large_applications_user"; + map[hsIconApplicationId] = "268458321"; + + + + HsMenuClient *publisher = new HsMenuClient(); + QVERIFY(publisher->add(map)); + + QSharedPointer res_entry = mCaServicePrivateMock->mCreatedEntries[0]; + + + QCOMPARE(res_entry->entryTypeName(), + QString(Hs::templatedApplicationTypeName)); + QCOMPARE(res_entry->role(), ItemEntryRole); + QCOMPARE(res_entry->text(), map[hsItemName].toString()); + QCOMPARE(res_entry->description(), map[hsItemDescription].toString()); + + QCOMPARE(res_entry->attributes().count(), 3); + QCOMPARE(res_entry->attribute(hsitemLaunchUri), map[hsitemLaunchUri].toString()); + QCOMPARE(res_entry->attribute(hsitemPublisherId), map[hsitemPublisherId].toString()); + QCOMPARE(res_entry->attribute(hsItemWidgetUri), map[hsItemWidgetUri].toString()); + + // icon + QCOMPARE(res_entry->iconDescription().filename(), map[hsIconFileName].toString()); + QCOMPARE(res_entry->iconDescription().skinId(),map[hsIconName].toString()); + QCOMPARE(res_entry->iconDescription().applicationId(), map[hsIconApplicationId].toString()); + + QCOMPARE(res_entry->flags(), VisibleEntryFlag); // Visible by default, entry not removable + + delete publisher; + + } + #ifdef Q_OS_SYMBIAN + #ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; + #endif//UT_MEMORY_CHECK + #endif//Q_OS_SYMBIAN +} + +void HsMenuClientPluginTest::testCreateLocalizedEntry() +{ + #ifdef Q_OS_SYMBIAN + #ifdef UT_MEMORY_CHECK + __UHEAP_MARK; + #endif//UT_MEMORY_CHECK + #endif//Q_OS_SYMBIAN + { + QList list; + QMap map; + QString testName("Games"); + QString testDesc(""); + map[hsItemName] = "ModuleTestTApp"; + map[hsItemLocName] = "loc://emailTest/txt_applib_dblist_games"; + map[hsItemDescription] = "Unit test app for HsClientPlugin"; + map[hsItemLocDescription] = "loc://emailTest/txt_applib_subtitle_office"; + + map[hsitemLaunchUri] = "appto://2002DCEC?"; + map[hsitemPublisherId] = "tappModuleTest"; + map[hsItemWidgetUri] = "hsclockwidgetplugin"; + + map[hsIconFileName] = "Z:\\private\\20022F35\\import\\widgetregistry\\20022F6C\\tclock.png"; + map[hsIconName] = "qtg_large_applications_user"; + map[hsIconApplicationId] = "268458321"; + + + + HsMenuClient *publisher = new HsMenuClient(); + QVERIFY(publisher->add(map)); + + QSharedPointer res_entry = mCaServicePrivateMock->mCreatedEntries[0]; + + + QCOMPARE(res_entry->entryTypeName(), + QString(Hs::templatedApplicationTypeName)); + QCOMPARE(res_entry->role(), ItemEntryRole); + QCOMPARE(res_entry->text(), map[hsItemLocName].toString()); + QCOMPARE(res_entry->description(), map[hsItemLocDescription].toString()); + + QCOMPARE(res_entry->attribute(hsitemLaunchUri), map[hsitemLaunchUri].toString()); + QCOMPARE(res_entry->attribute(hsitemPublisherId), map[hsitemPublisherId].toString()); + QCOMPARE(res_entry->attribute(hsItemWidgetUri), map[hsItemWidgetUri].toString()); + + // icon + QCOMPARE(res_entry->iconDescription().filename(), map[hsIconFileName].toString()); + QCOMPARE(res_entry->iconDescription().skinId(),map[hsIconName].toString()); + QCOMPARE(res_entry->iconDescription().applicationId(), map[hsIconApplicationId].toString()); + + QCOMPARE(res_entry->flags(), VisibleEntryFlag); // Visible by default, entry not removable + + delete publisher; + + } + #ifdef Q_OS_SYMBIAN + #ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; + #endif//UT_MEMORY_CHECK + #endif//Q_OS_SYMBIAN +} + +void HsMenuClientPluginTest::testUpdateEntry() +{ + #ifdef Q_OS_SYMBIAN + #ifdef UT_MEMORY_CHECK + __UHEAP_MARK; + #endif//UT_MEMORY_CHECK + #endif//Q_OS_SYMBIAN + { + QMap map; + map[hsItemId] = 1; // entry id == 1, entry to update + + map[hsItemName] = "UpdatedName"; + map[hsItemDescription] = "UpdatedDescription"; + + map[hsitemLaunchUri] = "appto://102828D6?"; + map[hsitemPublisherId] = "tappModuleTestUpdated"; + map[hsItemWidgetUri] = "hsclockwidgetpluginUpdated"; + + map[hsIconFileName] = "Z:\\private\\20022F35\\import\\widgetregistry\\20022F6C\\UpdatedClockIcon.png"; + map[hsIconName] = "qtg_large_applications_user_updated"; + map[hsIconApplicationId] = "123458321"; + + // create original entry to be updated + mCaServicePrivateMock->AddEntriesForUpdate(); + + QScopedPointer publisher (new HsMenuClient()); + QVERIFY(publisher->add(map)); + + // from mock + QSharedPointer res_entry = mCaServicePrivateMock->mCreatedEntries[1]; + + QCOMPARE(res_entry->entryTypeName(), + QString(Hs::templatedApplicationTypeName)); + QCOMPARE(res_entry->role(), ItemEntryRole); + QCOMPARE(res_entry->flags(), VisibleEntryFlag); // Visible by default, entry not removable + + QCOMPARE(res_entry->text(), map[hsItemName].toString()); + QCOMPARE(res_entry->description(), map[hsItemDescription].toString()); + QCOMPARE(res_entry->attributes().count(), 3); + QCOMPARE(res_entry->attribute(hsitemLaunchUri), map[hsitemLaunchUri].toString()); + QCOMPARE(res_entry->attribute(hsitemPublisherId), map[hsitemPublisherId].toString()); + QCOMPARE(res_entry->attribute(hsItemWidgetUri), map[hsItemWidgetUri].toString()); + + // icon + QCOMPARE(res_entry->iconDescription().filename(), map[hsIconFileName].toString()); + QCOMPARE(res_entry->iconDescription().skinId(),map[hsIconName].toString()); + QCOMPARE(res_entry->iconDescription().applicationId(), map[hsIconApplicationId].toString()); + } + #ifdef Q_OS_SYMBIAN + #ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; + #endif//UT_MEMORY_CHECK + #endif//Q_OS_SYMBIAN +} + +void HsMenuClientPluginTest::testRemoveEntry() +{ + #ifdef Q_OS_SYMBIAN + #ifdef UT_MEMORY_CHECK + __UHEAP_MARK; + #endif//UT_MEMORY_CHECK + #endif//Q_OS_SYMBIAN + { + QMap map; + map[hsItemName] = "ModuleTestTApp"; + map[hsitemLaunchUri] = "appto://2002DCEC?"; + map[hsitemPublisherId] = "tappModuleTest"; + map[hsItemDescription] = "Unit test app for HsClientPlugin"; + map[hsIconApplicationId] = "268458321"; + + HsMenuClient *publisher = new HsMenuClient(); + bool result = publisher->remove(map); + QVERIFY(!result); + + mCaServicePrivateMock->mEntryToRemove = -1; + map[hsItemId] = 1; // entry id == 1 + result = publisher->remove(map); + QCOMPARE(mCaServicePrivateMock->mEntryToRemove, map[hsItemId].toInt()); + delete publisher; + } + #ifdef Q_OS_SYMBIAN + #ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; + #endif//UT_MEMORY_CHECK + #endif//Q_OS_SYMBIAN +} + +void HsMenuClientPluginTest::testListEntry() +{ + #ifdef Q_OS_SYMBIAN + #ifdef UT_MEMORY_CHECK + __UHEAP_MARK; + #endif//UT_MEMORY_CHECK + #endif//Q_OS_SYMBIAN + { + QMap map; + map[hsItemName] = "Name"; + map[hsItemDescription] = "Description"; + + map[hsitemLaunchUri] = "appto://102828D6?"; + map[hsitemPublisherId] = "tappModuleTest"; + map[hsItemWidgetUri] = "hsclockwidgetplugin"; + map[hsIconFileName] = "Z:\\private\\20022F35\\import\\widgetregistry\\20022F6C\\clockIcon.png"; + map[hsIconName] = "qtg_large_applications_user"; + map[hsIconApplicationId] = "223458321"; + + HsMenuClient *publisher = new HsMenuClient(); + QList list; + list = publisher->getList(map); + + // verify query passed to GetEntries + QCOMPARE(mCaServicePrivateMock->mQueryPassedToGetList->flagsOn(), VisibleEntryFlag); + QCOMPARE(mCaServicePrivateMock->mQueryPassedToGetList->entryRoles(), ItemEntryRole); + QCOMPARE(mCaServicePrivateMock->mQueryPassedToGetList->entryTypeNames(), + QStringList(Hs::templatedApplicationTypeName)); + + QCOMPARE(mCaServicePrivateMock->mQueryPassedToGetList->attribute(hsItemName), QString()); // not used + QCOMPARE(mCaServicePrivateMock->mQueryPassedToGetList->attribute(hsItemDescription), QString()); // not used + + QCOMPARE(mCaServicePrivateMock->mQueryPassedToGetList->attribute(hsitemLaunchUri), + map.value(hsitemLaunchUri).toString()); + QCOMPARE(mCaServicePrivateMock->mQueryPassedToGetList->attribute(hsitemPublisherId), + map.value(hsitemPublisherId).toString()); + QCOMPARE(mCaServicePrivateMock->mQueryPassedToGetList->attribute(hsItemWidgetUri), + map.value(hsItemWidgetUri).toString()); + QCOMPARE(mCaServicePrivateMock->mQueryPassedToGetList->attribute(hsIconFileName), + map.value(hsIconFileName).toString()); + QCOMPARE(mCaServicePrivateMock->mQueryPassedToGetList->attribute(hsIconName), + map.value(hsIconName).toString()); + QCOMPARE(mCaServicePrivateMock->mQueryPassedToGetList->attribute(hsIconApplicationId), + map.value(hsIconApplicationId).toString()); + + // Verify if all values are added to the map + QVERIFY(list.count() == 2); + QSharedPointer res_entry = mCaServicePrivateMock->mReturnedEntries[0]; + QCOMPARE(res_entry->id(), list.at(0).value(hsItemId).toInt()); + QCOMPARE(res_entry->text(), list.at(0).value(hsItemName).toString()); + QCOMPARE(res_entry->description(), list.at(0).value(hsItemDescription).toString()); + QCOMPARE(res_entry->attribute(hsitemLaunchUri), list.at(0).value(hsitemLaunchUri).toString()); + QCOMPARE(res_entry->attribute(hsitemPublisherId), list.at(0).value(hsitemPublisherId).toString()); + QCOMPARE(res_entry->attribute(hsItemWidgetUri), list.at(0).value(hsItemWidgetUri).toString()); + QCOMPARE(res_entry->iconDescription().filename(), list.at(0).value(hsIconFileName).toString()); + QCOMPARE(res_entry->iconDescription().skinId(),list.at(0).value(hsIconName).toString()); + QCOMPARE(res_entry->iconDescription().applicationId(), list.at(0).value(hsIconApplicationId).toString()); + + res_entry = mCaServicePrivateMock->mReturnedEntries[1]; + QCOMPARE(res_entry->id(), list.at(1).value(hsItemId).toInt()); + QCOMPARE(res_entry->text(), list.at(1).value(hsItemName).toString()); + QCOMPARE(res_entry->description(), list.at(1).value(hsItemDescription).toString()); + QCOMPARE(res_entry->attribute(hsitemLaunchUri), list.at(1).value(hsitemLaunchUri).toString()); + QCOMPARE(res_entry->attribute(hsitemPublisherId), list.at(1).value(hsitemPublisherId).toString()); + QCOMPARE(res_entry->attribute(hsItemWidgetUri), list.at(1).value(hsItemWidgetUri).toString()); + QCOMPARE(res_entry->iconDescription().filename(), list.at(1).value(hsIconFileName).toString()); + QCOMPARE(res_entry->iconDescription().skinId(),list.at(1).value(hsIconName).toString()); + QCOMPARE(res_entry->iconDescription().applicationId(), list.at(1).value(hsIconApplicationId).toString()); + delete publisher; + } + #ifdef Q_OS_SYMBIAN + #ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; + #endif//UT_MEMORY_CHECK + #endif//Q_OS_SYMBIAN +} + +QTEST_MAIN(HsMenuClientPluginTest) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsmenuclientplugin/tsrc/t_hsmenuclientplugin/t_hsmenuclientplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsmenuclientplugin/tsrc/t_hsmenuclientplugin/t_hsmenuclientplugin.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,23 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +#Header files +HEADERS += ./inc/*.h \ + ../../inc/*.h \ + ../../../../homescreen_plat/homescreenclient_api/hsmenuclient.h + +#Source files +SOURCES += ./src/*.cpp \ + ../../src/*.cpp diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsmenuclientplugin/tsrc/t_hsmenuclientplugin/t_hsmenuclientplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsmenuclientplugin/tsrc/t_hsmenuclientplugin/t_hsmenuclientplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,66 @@ +# +# 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 = app + +include(../../../common.pri) + +CONFIG += debug_and_release \ + console \ + hb \ + mobility + +MOBILITY = serviceframework + +coverage:DEFINES += COVERAGE_MEASUREMENT + +QT += testlib +LIBS += -lcaclient + +DEFINES += HSDOMAINMODEL_TEST\ + HSMENUCLIENTPLUGIN_UNITTEST + +win32: { +DEFINES += CACLIENT_TEST +} + +DEPENDPATH += .\ + ./src \ + ./inc \ + ../../src \ + ../../inc + +INCLUDEPATH += .\ + ./inc \ + ../../inc \ + ../../../../homescreen_plat/homescreenclient_api + +symbian: { + ### get rid of localization warnings + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + ### + CONFIG += symbian_test + coverage: CONFIG -= symbian_test + TARGET.UID3 = 20028716 + TARGET.CAPABILITY = CAP_APPLICATION AllFiles + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB + + MMP_RULES += SMPSAFE +} + +include(t_hsmenuclientplugin.pri) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsmenuclientplugin/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsmenuclientplugin/tsrc/tsrc.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,21 @@ +# +# 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 += t_hsmenuclientplugin + +CONFIG += ordered + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/bwins/hsutilsu.def --- a/homescreenapp/hsutils/bwins/hsutilsu.def Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsutils/bwins/hsutilsu.def Mon Sep 20 10:19:07 2010 +0300 @@ -1,83 +1,83 @@ EXPORTS ?trUtf8@HsSnapLine@@SA?AVQString@@PBD0@Z @ 1 NONAME ; class QString HsSnapLine::trUtf8(char const *, char const *) ?createOpenAppLibraryEvent@HsMenuEventFactory@@SAPAVQEvent@@W4HsMenuMode@Hs@@VQVariant@@@Z @ 2 NONAME ; class QEvent * HsMenuEventFactory::createOpenAppLibraryEvent(enum Hs::HsMenuMode, class QVariant) - ?instance@HsWidgetPositioningOnWidgetAdd@@SAPAV1@XZ @ 3 NONAME ; class HsWidgetPositioningOnWidgetAdd * HsWidgetPositioningOnWidgetAdd::instance(void) - ?trUtf8@HsTitleResolver@@SA?AVQString@@PBD0@Z @ 4 NONAME ; class QString HsTitleResolver::trUtf8(char const *, char const *) - ?convert@HsAnchorPointInBottomRight@@UAE?AV?$QList@VQRectF@@@@ABVQRectF@@ABV2@1ABVQPointF@@@Z @ 5 NONAME ; class QList HsAnchorPointInBottomRight::convert(class QRectF const &, class QList const &, class QList const &, class QPointF const &) - ?tr@HsTitleResolver@@SA?AVQString@@PBD0@Z @ 6 NONAME ; class QString HsTitleResolver::tr(char const *, char const *) - ?setEasingCurve@HsPropertyAnimationWrapper@@QAEXABVQEasingCurve@@@Z @ 7 NONAME ; void HsPropertyAnimationWrapper::setEasingCurve(class QEasingCurve const &) - ?convert@HsAdvancedWidgetPositioningOnOrientationChange@@UAE?AV?$QList@VQRectF@@@@ABVQRectF@@ABV2@0@Z @ 8 NONAME ; class QList HsAdvancedWidgetPositioningOnOrientationChange::convert(class QRectF const &, class QList const &, class QRectF const &) - ?show@HsMessageBoxWrapper@@QAEXXZ @ 9 NONAME ; void HsMessageBoxWrapper::show(void) - ?staticMetaObject@HsPageIndicator@@2UQMetaObject@@B @ 10 NONAME ; struct QMetaObject const HsPageIndicator::staticMetaObject - ?createAddAppsFromCollectionViewEvent@HsMenuEventFactory@@SAPAVQEvent@@HH@Z @ 11 NONAME ; class QEvent * HsMenuEventFactory::createAddAppsFromCollectionViewEvent(int, int) - ?tr@HsImageFetcherClient@@SA?AVQString@@PBD0@Z @ 12 NONAME ; class QString HsImageFetcherClient::tr(char const *, char const *) - ?metaObject@HsTrashBinWidget@@UBEPBUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const * HsTrashBinWidget::metaObject(void) const - ??1HsSnapLine@@UAE@XZ @ 14 NONAME ; HsSnapLine::~HsSnapLine(void) - ?trUtf8@HsSnapLine@@SA?AVQString@@PBD0H@Z @ 15 NONAME ; class QString HsSnapLine::trUtf8(char const *, char const *, int) - ?qt_metacall@HsTitleResolver@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 16 NONAME ; int HsTitleResolver::qt_metacall(enum QMetaObject::Call, int, void * *) - ?metaObject@HsImageFetcherClient@@UBEPBUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const * HsImageFetcherClient::metaObject(void) const - ?setInstance@HsWidgetPositioningOnWidgetMove@@SAXPAV1@@Z @ 18 NONAME ; void HsWidgetPositioningOnWidgetMove::setInstance(class HsWidgetPositioningOnWidgetMove *) - ?extendVerticalLineToIncludeInactiveRect@HsSnapToLines@@AAEXXZ @ 19 NONAME ; void HsSnapToLines::extendVerticalLineToIncludeInactiveRect(void) - ?getFadeOutDuration@HsSnapLine@@AAEHXZ @ 20 NONAME ; int HsSnapLine::getFadeOutDuration(void) - ?eventType@HsMenuEvent@@SA?AW4Type@QEvent@@XZ @ 21 NONAME ; enum QEvent::Type HsMenuEvent::eventType(void) - ?tr@HsImageFetcherClient@@SA?AVQString@@PBD0H@Z @ 22 NONAME ; class QString HsImageFetcherClient::tr(char const *, char const *, int) - ?qt_metacast@HsPageIndicator@@UAEPAXPBD@Z @ 23 NONAME ; void * HsPageIndicator::qt_metacast(char const *) - ??0HsMessageBoxWrapper@@QAE@PAVQObject@@@Z @ 24 NONAME ; HsMessageBoxWrapper::HsMessageBoxWrapper(class QObject *) - ??0HsMenuEvent@@QAE@W4OperationType@0@ABV?$QMap@VQString@@VQVariant@@@@@Z @ 25 NONAME ; HsMenuEvent::HsMenuEvent(enum HsMenuEvent::OperationType, class QMap const &) - ?actionOnFadeOutAnimationStop@HsSnapLine@@AAEXXZ @ 26 NONAME ; void HsSnapLine::actionOnFadeOutAnimationStop(void) - ?qt_metacall@HsMessageBoxWrapper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 27 NONAME ; int HsMessageBoxWrapper::qt_metacall(enum QMetaObject::Call, int, void * *) - ?staticMetaObject@HsImageFetcherClient@@2UQMetaObject@@B @ 28 NONAME ; struct QMetaObject const HsImageFetcherClient::staticMetaObject - ?trUtf8@HsMessageBoxWrapper@@SA?AVQString@@PBD0@Z @ 29 NONAME ; class QString HsMessageBoxWrapper::trUtf8(char const *, char const *) - ?close@HsMessageBoxWrapper@@QAEXXZ @ 30 NONAME ; void HsMessageBoxWrapper::close(void) - ?qt_metacast@HsSnapLine@@UAEPAXPBD@Z @ 31 NONAME ; void * HsSnapLine::qt_metacast(char const *) - ?extendHorizontalLineToIncludeInactiveRect@HsSnapToLines@@AAEXXZ @ 32 NONAME ; void HsSnapToLines::extendHorizontalLineToIncludeInactiveRect(void) - ?fetchFailed@HsImageFetcherClient@@IAEXHABVQString@@@Z @ 33 NONAME ; void HsImageFetcherClient::fetchFailed(int, class QString const &) - ??1HsTitleResolver@@UAE@XZ @ 34 NONAME ; HsTitleResolver::~HsTitleResolver(void) - ?trUtf8@HsSpinnerDialog@@SA?AVQString@@PBD0@Z @ 35 NONAME ; class QString HsSpinnerDialog::trUtf8(char const *, char const *) - ?checkInactiveRectBetterFitForHorizontalSnapping@HsSnapToLines@@AAEXMM@Z @ 36 NONAME ; void HsSnapToLines::checkInactiveRectBetterFitForHorizontalSnapping(float, float) - ?tr@HsPropertyAnimationWrapper@@SA?AVQString@@PBD0H@Z @ 37 NONAME ; class QString HsPropertyAnimationWrapper::tr(char const *, char const *, int) - ?setQueryText@HsMessageBoxWrapper@@QAEXABVQString@@@Z @ 38 NONAME ; void HsMessageBoxWrapper::setQueryText(class QString const &) - ??1HsMenuEventTransition@@UAE@XZ @ 39 NONAME ; HsMenuEventTransition::~HsMenuEventTransition(void) - ?tr@HsSpinnerDialog@@SA?AVQString@@PBD0@Z @ 40 NONAME ; class QString HsSpinnerDialog::tr(char const *, char const *) - ?fadeInAnimationFinished@HsSnapLine@@AAEXXZ @ 41 NONAME ; void HsSnapLine::fadeInAnimationFinished(void) - ?checkInactiveRectLieAboveOrBelowOfMovingRect@HsSnapToLines@@AAEXXZ @ 42 NONAME ; void HsSnapToLines::checkInactiveRectLieAboveOrBelowOfMovingRect(void) - ?setHeader@HsMessageBoxWrapper@@QAEXABVQString@@@Z @ 43 NONAME ; void HsMessageBoxWrapper::setHeader(class QString const &) - ?setSpacing@HsPageIndicator@@QAEXM@Z @ 44 NONAME ; void HsPageIndicator::setSpacing(float) - ??_EHsImageFetcherClient@@UAE@I@Z @ 45 NONAME ; HsImageFetcherClient::~HsImageFetcherClient(unsigned int) - ?qt_metacast@HsPropertyAnimationWrapper@@UAEPAXPBD@Z @ 46 NONAME ; void * HsPropertyAnimationWrapper::qt_metacast(char const *) - ?createPreviewHSWidgetEvent@HsMenuEventFactory@@SAPAVQEvent@@HABVQString@@00@Z @ 47 NONAME ; class QEvent * HsMenuEventFactory::createPreviewHSWidgetEvent(int, class QString const &, class QString const &, class QString const &) - ??1HsMenuEvent@@UAE@XZ @ 48 NONAME ; HsMenuEvent::~HsMenuEvent(void) - ?tr@HsMessageBoxWrapper@@SA?AVQString@@PBD0@Z @ 49 NONAME ; class QString HsMessageBoxWrapper::tr(char const *, char const *) - ?createCollectionDeletedEvent@HsMenuEventFactory@@SAPAVQEvent@@XZ @ 50 NONAME ; class QEvent * HsMenuEventFactory::createCollectionDeletedEvent(void) - ?tr@HsImageGridWidget@@SA?AVQString@@PBD0@Z @ 51 NONAME ; class QString HsImageGridWidget::tr(char const *, char const *) - ?createUninstallApplicationEvent@HsMenuEventFactory@@SAPAVQEvent@@H@Z @ 52 NONAME ; class QEvent * HsMenuEventFactory::createUninstallApplicationEvent(int) - ?data@HsMenuEvent@@QBE?AV?$QMap@VQString@@VQVariant@@@@XZ @ 53 NONAME ; class QMap HsMenuEvent::data(void) const - ??1HsMenuDialogFactory@@UAE@XZ @ 54 NONAME ; HsMenuDialogFactory::~HsMenuDialogFactory(void) - ?operation@HsMenuEvent@@QBE?AW4OperationType@1@XZ @ 55 NONAME ; enum HsMenuEvent::OperationType HsMenuEvent::operation(void) const - ?setBackward@HsPropertyAnimationWrapper@@QAEXXZ @ 56 NONAME ; void HsPropertyAnimationWrapper::setBackward(void) - ?qt_metacast@HsSpinnerDialog@@UAEPAXPBD@Z @ 57 NONAME ; void * HsSpinnerDialog::qt_metacast(char const *) - ?getStaticMetaObject@HsPageIndicator@@SAABUQMetaObject@@XZ @ 58 NONAME ; struct QMetaObject const & HsPageIndicator::getStaticMetaObject(void) - ?compareBottomOfMovingRectForSnapping@HsSnapToLines@@AAEXXZ @ 59 NONAME ; void HsSnapToLines::compareBottomOfMovingRectForSnapping(void) - ?createUnknownEvent@HsMenuEventFactory@@SAPAVQEvent@@XZ @ 60 NONAME ; class QEvent * HsMenuEventFactory::createUnknownEvent(void) - ??1HsPropertyAnimationWrapper@@UAE@XZ @ 61 NONAME ; HsPropertyAnimationWrapper::~HsPropertyAnimationWrapper(void) - ?onNetworkNameChanged@HsTitleResolver@@AAEXABVQString@@@Z @ 62 NONAME ; void HsTitleResolver::onNetworkNameChanged(class QString const &) - ?metaObject@HsMessageBoxWrapper@@UBEPBUQMetaObject@@XZ @ 63 NONAME ; struct QMetaObject const * HsMessageBoxWrapper::metaObject(void) const - ?createAppDetailsViewEvent@HsMenuEventFactory@@SAPAVQEvent@@H@Z @ 64 NONAME ; class QEvent * HsMenuEventFactory::createAppDetailsViewEvent(int) - ?setEndValue@HsPropertyAnimationWrapper@@QAEXABVQVariant@@@Z @ 65 NONAME ; void HsPropertyAnimationWrapper::setEndValue(class QVariant const &) - ??_EHsSnapLine@@UAE@I@Z @ 66 NONAME ; HsSnapLine::~HsSnapLine(unsigned int) - ?setContent@HsImageGridWidget@@QAEXABVQStringList@@@Z @ 67 NONAME ; void HsImageGridWidget::setContent(class QStringList const &) - ?staticMetaObject@XQAIWGetImageClient@@2UQMetaObject@@B @ 68 NONAME ; struct QMetaObject const XQAIWGetImageClient::staticMetaObject - ?qt_metacall@HsPropertyAnimationWrapper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 69 NONAME ; int HsPropertyAnimationWrapper::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacast@HsMessageBoxWrapper@@UAEPAXPBD@Z @ 70 NONAME ; void * HsMessageBoxWrapper::qt_metacast(char const *) - ?createArrangeAllCollectionsEvent@HsMenuEventFactory@@SAPAVQEvent@@H@Z @ 71 NONAME ; class QEvent * HsMenuEventFactory::createArrangeAllCollectionsEvent(int) - ?fetch@XQAIWGetImageClient@@QAEXXZ @ 72 NONAME ; void XQAIWGetImageClient::fetch(void) - ?metaObject@HsPropertyAnimationWrapper@@UBEPBUQMetaObject@@XZ @ 73 NONAME ; struct QMetaObject const * HsPropertyAnimationWrapper::metaObject(void) const - ?isAnimationRunning@HsPageIndicator@@QBE_NXZ @ 74 NONAME ; bool HsPageIndicator::isAnimationRunning(void) const - ?getIndexForCoordinate@HsWidgetOrganizer@@AAEHVQPointF@@@Z @ 75 NONAME ; int HsWidgetOrganizer::getIndexForCoordinate(class QPointF) - ?createAppSettingsViewEvent@HsMenuEventFactory@@SAPAVQEvent@@H@Z @ 76 NONAME ; class QEvent * HsMenuEventFactory::createAppSettingsViewEvent(int) - ?trUtf8@HsImageGridWidget@@SA?AVQString@@PBD0@Z @ 77 NONAME ; class QString HsImageGridWidget::trUtf8(char const *, char const *) - ??1HsAnchorPointInCenter@@UAE@XZ @ 78 NONAME ; HsAnchorPointInCenter::~HsAnchorPointInCenter(void) - ?createDeleteCollectionEvent@HsMenuEventFactory@@SAPAVQEvent@@H@Z @ 79 NONAME ; class QEvent * HsMenuEventFactory::createDeleteCollectionEvent(int) + ?trUtf8@HsTitleResolver@@SA?AVQString@@PBD0@Z @ 3 NONAME ; class QString HsTitleResolver::trUtf8(char const *, char const *) + ?tr@HsTitleResolver@@SA?AVQString@@PBD0@Z @ 4 NONAME ; class QString HsTitleResolver::tr(char const *, char const *) + ?setEasingCurve@HsPropertyAnimationWrapper@@QAEXABVQEasingCurve@@@Z @ 5 NONAME ; void HsPropertyAnimationWrapper::setEasingCurve(class QEasingCurve const &) + ?convert@HsAdvancedWidgetPositioningOnOrientationChange@@UAE?AV?$QList@VQRectF@@@@ABVQRectF@@ABV2@0@Z @ 6 NONAME ; class QList HsAdvancedWidgetPositioningOnOrientationChange::convert(class QRectF const &, class QList const &, class QRectF const &) + ?show@HsMessageBoxWrapper@@QAEXXZ @ 7 NONAME ; void HsMessageBoxWrapper::show(void) + ?staticMetaObject@HsPageIndicator@@2UQMetaObject@@B @ 8 NONAME ; struct QMetaObject const HsPageIndicator::staticMetaObject + ?qt_metacall@HsImageHandlingClient@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 9 NONAME ; int HsImageHandlingClient::qt_metacall(enum QMetaObject::Call, int, void * *) + ?createAddAppsFromCollectionViewEvent@HsMenuEventFactory@@SAPAVQEvent@@HH@Z @ 10 NONAME ; class QEvent * HsMenuEventFactory::createAddAppsFromCollectionViewEvent(int, int) + ?metaObject@HsTrashBinWidget@@UBEPBUQMetaObject@@XZ @ 11 NONAME ; struct QMetaObject const * HsTrashBinWidget::metaObject(void) const + ??1HsSnapLine@@UAE@XZ @ 12 NONAME ; HsSnapLine::~HsSnapLine(void) + ?trUtf8@HsSnapLine@@SA?AVQString@@PBD0H@Z @ 13 NONAME ; class QString HsSnapLine::trUtf8(char const *, char const *, int) + ?qt_metacall@HsTitleResolver@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 14 NONAME ; int HsTitleResolver::qt_metacall(enum QMetaObject::Call, int, void * *) + ?setInstance@HsWidgetPositioningOnWidgetMove@@SAXPAV1@@Z @ 15 NONAME ; void HsWidgetPositioningOnWidgetMove::setInstance(class HsWidgetPositioningOnWidgetMove *) + ?extendVerticalLineToIncludeInactiveRect@HsSnapToLines@@AAEXXZ @ 16 NONAME ; void HsSnapToLines::extendVerticalLineToIncludeInactiveRect(void) + ?handleOk@HsImageHandlingClient@@AAEXABVQVariant@@@Z @ 17 NONAME ; void HsImageHandlingClient::handleOk(class QVariant const &) + ?getFadeOutDuration@HsSnapLine@@AAEHXZ @ 18 NONAME ; int HsSnapLine::getFadeOutDuration(void) + ?eventType@HsMenuEvent@@SA?AW4Type@QEvent@@XZ @ 19 NONAME ; enum QEvent::Type HsMenuEvent::eventType(void) + ?createOpenInstalledViewEvent@HsMenuEventFactory@@SAPAVQEvent@@HVQString@@@Z @ 20 NONAME ; class QEvent * HsMenuEventFactory::createOpenInstalledViewEvent(int, class QString) + ?qt_metacast@HsPageIndicator@@UAEPAXPBD@Z @ 21 NONAME ; void * HsPageIndicator::qt_metacast(char const *) + ??0HsMessageBoxWrapper@@QAE@PAVQObject@@@Z @ 22 NONAME ; HsMessageBoxWrapper::HsMessageBoxWrapper(class QObject *) + ??0HsMenuEvent@@QAE@W4OperationType@0@ABV?$QMap@VQString@@VQVariant@@@@@Z @ 23 NONAME ; HsMenuEvent::HsMenuEvent(enum HsMenuEvent::OperationType, class QMap const &) + ?actionOnFadeOutAnimationStop@HsSnapLine@@AAEXXZ @ 24 NONAME ; void HsSnapLine::actionOnFadeOutAnimationStop(void) + ?qt_metacall@HsMessageBoxWrapper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 25 NONAME ; int HsMessageBoxWrapper::qt_metacall(enum QMetaObject::Call, int, void * *) + ?trUtf8@HsMessageBoxWrapper@@SA?AVQString@@PBD0@Z @ 26 NONAME ; class QString HsMessageBoxWrapper::trUtf8(char const *, char const *) + ?close@HsMessageBoxWrapper@@QAEXXZ @ 27 NONAME ; void HsMessageBoxWrapper::close(void) + ?qt_metacast@HsSnapLine@@UAEPAXPBD@Z @ 28 NONAME ; void * HsSnapLine::qt_metacast(char const *) + ?extendHorizontalLineToIncludeInactiveRect@HsSnapToLines@@AAEXXZ @ 29 NONAME ; void HsSnapToLines::extendHorizontalLineToIncludeInactiveRect(void) + ??1HsTitleResolver@@UAE@XZ @ 30 NONAME ; HsTitleResolver::~HsTitleResolver(void) + ?fetch@HsImageHandlingClient@@QAEXXZ @ 31 NONAME ; void HsImageHandlingClient::fetch(void) + ?acceptActionIndex@HsMenuDialogFactory@@SAHXZ @ 32 NONAME ; int HsMenuDialogFactory::acceptActionIndex(void) + ?trUtf8@HsSpinnerDialog@@SA?AVQString@@PBD0@Z @ 33 NONAME ; class QString HsSpinnerDialog::trUtf8(char const *, char const *) + ?checkInactiveRectBetterFitForHorizontalSnapping@HsSnapToLines@@AAEXMM@Z @ 34 NONAME ; void HsSnapToLines::checkInactiveRectBetterFitForHorizontalSnapping(float, float) + ?tr@HsPropertyAnimationWrapper@@SA?AVQString@@PBD0H@Z @ 35 NONAME ; class QString HsPropertyAnimationWrapper::tr(char const *, char const *, int) + ?setQueryText@HsMessageBoxWrapper@@QAEXABVQString@@@Z @ 36 NONAME ; void HsMessageBoxWrapper::setQueryText(class QString const &) + ??1HsMenuEventTransition@@UAE@XZ @ 37 NONAME ; HsMenuEventTransition::~HsMenuEventTransition(void) + ?tr@HsSpinnerDialog@@SA?AVQString@@PBD0@Z @ 38 NONAME ; class QString HsSpinnerDialog::tr(char const *, char const *) + ?fadeInAnimationFinished@HsSnapLine@@AAEXXZ @ 39 NONAME ; void HsSnapLine::fadeInAnimationFinished(void) + ?checkInactiveRectLieAboveOrBelowOfMovingRect@HsSnapToLines@@AAEXXZ @ 40 NONAME ; void HsSnapToLines::checkInactiveRectLieAboveOrBelowOfMovingRect(void) + ?setHeader@HsMessageBoxWrapper@@QAEXABVQString@@@Z @ 41 NONAME ; void HsMessageBoxWrapper::setHeader(class QString const &) + ?setSpacing@HsPageIndicator@@QAEXM@Z @ 42 NONAME ; void HsPageIndicator::setSpacing(float) + ?qt_metacast@HsPropertyAnimationWrapper@@UAEPAXPBD@Z @ 43 NONAME ; void * HsPropertyAnimationWrapper::qt_metacast(char const *) + ?createPreviewHSWidgetEvent@HsMenuEventFactory@@SAPAVQEvent@@HABVQString@@00@Z @ 44 NONAME ; class QEvent * HsMenuEventFactory::createPreviewHSWidgetEvent(int, class QString const &, class QString const &, class QString const &) + ??1HsMenuEvent@@UAE@XZ @ 45 NONAME ; HsMenuEvent::~HsMenuEvent(void) + ?tr@HsMessageBoxWrapper@@SA?AVQString@@PBD0@Z @ 46 NONAME ; class QString HsMessageBoxWrapper::tr(char const *, char const *) + ?createCollectionDeletedEvent@HsMenuEventFactory@@SAPAVQEvent@@XZ @ 47 NONAME ; class QEvent * HsMenuEventFactory::createCollectionDeletedEvent(void) + ?tr@HsImageGridWidget@@SA?AVQString@@PBD0@Z @ 48 NONAME ; class QString HsImageGridWidget::tr(char const *, char const *) + ?createUninstallApplicationEvent@HsMenuEventFactory@@SAPAVQEvent@@H@Z @ 49 NONAME ; class QEvent * HsMenuEventFactory::createUninstallApplicationEvent(int) + ?data@HsMenuEvent@@QBE?AV?$QMap@VQString@@VQVariant@@@@XZ @ 50 NONAME ; class QMap HsMenuEvent::data(void) const + ??1HsMenuDialogFactory@@UAE@XZ @ 51 NONAME ; HsMenuDialogFactory::~HsMenuDialogFactory(void) + ?operation@HsMenuEvent@@QBE?AW4OperationType@1@XZ @ 52 NONAME ; enum HsMenuEvent::OperationType HsMenuEvent::operation(void) const + ?setBackward@HsPropertyAnimationWrapper@@QAEXXZ @ 53 NONAME ; void HsPropertyAnimationWrapper::setBackward(void) + ?qt_metacast@HsSpinnerDialog@@UAEPAXPBD@Z @ 54 NONAME ; void * HsSpinnerDialog::qt_metacast(char const *) + ?getStaticMetaObject@HsPageIndicator@@SAABUQMetaObject@@XZ @ 55 NONAME ; struct QMetaObject const & HsPageIndicator::getStaticMetaObject(void) + ?compareBottomOfMovingRectForSnapping@HsSnapToLines@@AAEXXZ @ 56 NONAME ; void HsSnapToLines::compareBottomOfMovingRectForSnapping(void) + ?createUnknownEvent@HsMenuEventFactory@@SAPAVQEvent@@XZ @ 57 NONAME ; class QEvent * HsMenuEventFactory::createUnknownEvent(void) + ??1HsPropertyAnimationWrapper@@UAE@XZ @ 58 NONAME ; HsPropertyAnimationWrapper::~HsPropertyAnimationWrapper(void) + ?onNetworkNameChanged@HsTitleResolver@@AAEXABVQString@@@Z @ 59 NONAME ; void HsTitleResolver::onNetworkNameChanged(class QString const &) + ?metaObject@HsMessageBoxWrapper@@UBEPBUQMetaObject@@XZ @ 60 NONAME ; struct QMetaObject const * HsMessageBoxWrapper::metaObject(void) const + ?createAppDetailsViewEvent@HsMenuEventFactory@@SAPAVQEvent@@H@Z @ 61 NONAME ; class QEvent * HsMenuEventFactory::createAppDetailsViewEvent(int) + ?setEndValue@HsPropertyAnimationWrapper@@QAEXABVQVariant@@@Z @ 62 NONAME ; void HsPropertyAnimationWrapper::setEndValue(class QVariant const &) + ??_EHsSnapLine@@UAE@I@Z @ 63 NONAME ; HsSnapLine::~HsSnapLine(unsigned int) + ?setContent@HsImageGridWidget@@QAEXABVQStringList@@@Z @ 64 NONAME ; void HsImageGridWidget::setContent(class QStringList const &) + ?staticMetaObject@XQAIWGetImageClient@@2UQMetaObject@@B @ 65 NONAME ; struct QMetaObject const XQAIWGetImageClient::staticMetaObject + ?qt_metacall@HsPropertyAnimationWrapper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 66 NONAME ; int HsPropertyAnimationWrapper::qt_metacall(enum QMetaObject::Call, int, void * *) + ?handleError@HsImageHandlingClient@@AAEXHABVQString@@@Z @ 67 NONAME ; void HsImageHandlingClient::handleError(int, class QString const &) + ?qt_metacast@HsMessageBoxWrapper@@UAEPAXPBD@Z @ 68 NONAME ; void * HsMessageBoxWrapper::qt_metacast(char const *) + ?createArrangeAllCollectionsEvent@HsMenuEventFactory@@SAPAVQEvent@@H@Z @ 69 NONAME ; class QEvent * HsMenuEventFactory::createArrangeAllCollectionsEvent(int) + ?rejectActionIndex@HsMenuDialogFactory@@SAHXZ @ 70 NONAME ; int HsMenuDialogFactory::rejectActionIndex(void) + ?fetch@XQAIWGetImageClient@@QAEXXZ @ 71 NONAME ; void XQAIWGetImageClient::fetch(void) + ?metaObject@HsPropertyAnimationWrapper@@UBEPBUQMetaObject@@XZ @ 72 NONAME ; struct QMetaObject const * HsPropertyAnimationWrapper::metaObject(void) const + ?isAnimationRunning@HsPageIndicator@@QBE_NXZ @ 73 NONAME ; bool HsPageIndicator::isAnimationRunning(void) const + ?createAppSettingsViewEvent@HsMenuEventFactory@@SAPAVQEvent@@H@Z @ 74 NONAME ; class QEvent * HsMenuEventFactory::createAppSettingsViewEvent(int) + ?trUtf8@HsImageGridWidget@@SA?AVQString@@PBD0@Z @ 75 NONAME ; class QString HsImageGridWidget::trUtf8(char const *, char const *) + ??0HsImageHandlingClient@@QAE@PAVQObject@@@Z @ 76 NONAME ; HsImageHandlingClient::HsImageHandlingClient(class QObject *) + ?staticMetaObject@HsImageHandlingClient@@2UQMetaObject@@B @ 77 NONAME ; struct QMetaObject const HsImageHandlingClient::staticMetaObject + ?createDeleteCollectionEvent@HsMenuEventFactory@@SAPAVQEvent@@H@Z @ 78 NONAME ; class QEvent * HsMenuEventFactory::createDeleteCollectionEvent(int) + ?edit@HsImageHandlingClient@@QAEXABVQString@@@Z @ 79 NONAME ; void HsImageHandlingClient::edit(class QString const &) ?trUtf8@HsSpinnerDialog@@SA?AVQString@@PBD0H@Z @ 80 NONAME ; class QString HsSpinnerDialog::trUtf8(char const *, char const *, int) ?metaObject@XQAIWGetImageClient@@UBEPBUQMetaObject@@XZ @ 81 NONAME ; struct QMetaObject const * XQAIWGetImageClient::metaObject(void) const ?fadeOutAnimationFinished@HsSnapLine@@AAEXXZ @ 82 NONAME ; void HsSnapLine::fadeOutAnimationFinished(void) @@ -89,190 +89,180 @@ ??1HsSpinnerDialog@@UAE@XZ @ 88 NONAME ; HsSpinnerDialog::~HsSpinnerDialog(void) ?checkInactiveRectPositionToHorizontalLine@HsSnapToLines@@AAEXXZ @ 89 NONAME ; void HsSnapToLines::checkInactiveRectPositionToHorizontalLine(void) ?qt_metacall@HsPageIndicator@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 90 NONAME ; int HsPageIndicator::qt_metacall(enum QMetaObject::Call, int, void * *) - ?setInstance@HsWidgetPositioningOnOrientationChange@@SAXPAV1@@Z @ 91 NONAME ; void HsWidgetPositioningOnOrientationChange::setInstance(class HsWidgetPositioningOnOrientationChange *) - ?run@HsSnapToLines@@UAE?AVResult@HsWidgetPositioningOnWidgetMove@@ABVQRectF@@@Z @ 92 NONAME ; class HsWidgetPositioningOnWidgetMove::Result HsSnapToLines::run(class QRectF const &) - ?staticMetaObject@HsPropertyAnimationWrapper@@2UQMetaObject@@B @ 93 NONAME ; struct QMetaObject const HsPropertyAnimationWrapper::staticMetaObject - ?createOpenCollectionFromAppLibraryEvent@HsMenuEventFactory@@SAPAVQEvent@@HABVQString@@@Z @ 94 NONAME ; class QEvent * HsMenuEventFactory::createOpenCollectionFromAppLibraryEvent(int, class QString const &) - ?staticMetaObject@HsSnapLine@@2UQMetaObject@@B @ 95 NONAME ; struct QMetaObject const HsSnapLine::staticMetaObject - ?start@HsPropertyAnimationWrapper@@QAEXXZ @ 96 NONAME ; void HsPropertyAnimationWrapper::start(void) - ??_EHsTrashBinWidget@@UAE@I@Z @ 97 NONAME ; HsTrashBinWidget::~HsTrashBinWidget(unsigned int) - ?startFadeInAnimation@HsSnapLine@@AAEXXZ @ 98 NONAME ; void HsSnapLine::startFadeInAnimation(void) - ?metaObject@HsSnapLine@@UBEPBUQMetaObject@@XZ @ 99 NONAME ; struct QMetaObject const * HsSnapLine::metaObject(void) const - ??1XQAIWGetImageClient@@UAE@XZ @ 100 NONAME ; XQAIWGetImageClient::~XQAIWGetImageClient(void) - ??_EHsPropertyAnimationWrapper@@UAE@I@Z @ 101 NONAME ; HsPropertyAnimationWrapper::~HsPropertyAnimationWrapper(unsigned int) - ?activeItemIndex@HsPageIndicator@@QBEHXZ @ 102 NONAME ; int HsPageIndicator::activeItemIndex(void) const - ?isFadeInAnimationRunning@HsSnapLine@@ABE_NXZ @ 103 NONAME ; bool HsSnapLine::isFadeInAnimationRunning(void) const - ?qt_metacall@HsSnapLine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 104 NONAME ; int HsSnapLine::qt_metacall(enum QMetaObject::Call, int, void * *) - ?layoutItems@HsPageIndicator@@AAEXXZ @ 105 NONAME ; void HsPageIndicator::layoutItems(void) - ?trUtf8@HsMessageBoxWrapper@@SA?AVQString@@PBD0H@Z @ 106 NONAME ; class QString HsMessageBoxWrapper::trUtf8(char const *, char const *, int) - ?metaObject@HsSpinnerDialog@@UBEPBUQMetaObject@@XZ @ 107 NONAME ; struct QMetaObject const * HsSpinnerDialog::metaObject(void) const - ?getStaticMetaObject@HsImageGridWidget@@SAABUQMetaObject@@XZ @ 108 NONAME ; struct QMetaObject const & HsImageGridWidget::getStaticMetaObject(void) - ?setConfiguration@HsSnapToLines@@UAEXABV?$QHash@VQString@@VQVariant@@@@@Z @ 109 NONAME ; void HsSnapToLines::setConfiguration(class QHash const &) - ?trUtf8@HsPageIndicator@@SA?AVQString@@PBD0@Z @ 110 NONAME ; class QString HsPageIndicator::trUtf8(char const *, char const *) - ?metaObject@HsTitleResolver@@UBEPBUQMetaObject@@XZ @ 111 NONAME ; struct QMetaObject const * HsTitleResolver::metaObject(void) const - ?titleChanged@HsTitleResolver@@IAEXABVQString@@@Z @ 112 NONAME ; void HsTitleResolver::titleChanged(class QString const &) - ?tr@HsPageIndicator@@SA?AVQString@@PBD0@Z @ 113 NONAME ; class QString HsPageIndicator::tr(char const *, char const *) - ?convert@HsWidgetOrganizer@@UAE?AV?$QList@VQRectF@@@@ABVQRectF@@ABV2@1ABVQPointF@@@Z @ 114 NONAME ; class QList HsWidgetOrganizer::convert(class QRectF const &, class QList const &, class QList const &, class QPointF const &) - ?tr@HsPropertyAnimationWrapper@@SA?AVQString@@PBD0@Z @ 115 NONAME ; class QString HsPropertyAnimationWrapper::tr(char const *, char const *) - ?onStatusChanged@HsTitleResolver@@AAEXW4HsDeviceInfoStatus@HsDeviceInfoListener@@@Z @ 116 NONAME ; void HsTitleResolver::onStatusChanged(enum HsDeviceInfoListener::HsDeviceInfoStatus) - ?createUninstallFailedEvent@HsMenuEventFactory@@SAPAVQEvent@@H@Z @ 117 NONAME ; class QEvent * HsMenuEventFactory::createUninstallFailedEvent(int) - ?createVerticalLine@HsSnapToLines@@AAEXXZ @ 118 NONAME ; void HsSnapToLines::createVerticalLine(void) - ?trUtf8@XQAIWGetImageClient@@SA?AVQString@@PBD0H@Z @ 119 NONAME ; class QString XQAIWGetImageClient::trUtf8(char const *, char const *, int) - ?actionOnFadeInAnimationStop@HsSnapLine@@AAEXXZ @ 120 NONAME ; void HsSnapLine::actionOnFadeInAnimationStop(void) - ?qt_metacast@HsTrashBinWidget@@UAEPAXPBD@Z @ 121 NONAME ; void * HsTrashBinWidget::qt_metacast(char const *) - ?createNewCollectionEvent@HsMenuEventFactory@@SAPAVQEvent@@XZ @ 122 NONAME ; class QEvent * HsMenuEventFactory::createNewCollectionEvent(void) - ?createOpenHomeScreenEvent@HsMenuEventFactory@@SAPAVQEvent@@XZ @ 123 NONAME ; class QEvent * HsMenuEventFactory::createOpenHomeScreenEvent(void) - ?checkInactiveRectPositionToVerticalLine@HsSnapToLines@@AAEXXZ @ 124 NONAME ; void HsSnapToLines::checkInactiveRectPositionToVerticalLine(void) - ?findImages@XQAIWGetImageClient@@AAEXABVQString@@ABVQStringList@@AAV3@@Z @ 125 NONAME ; void XQAIWGetImageClient::findImages(class QString const &, class QStringList const &, class QStringList &) - ??_EHsMenuDialogFactory@@UAE@I@Z @ 126 NONAME ; HsMenuDialogFactory::~HsMenuDialogFactory(unsigned int) - ??1HsWidgetPositioningOnWidgetAdd@@UAE@XZ @ 127 NONAME ; HsWidgetPositioningOnWidgetAdd::~HsWidgetPositioningOnWidgetAdd(void) - ?createInstallationLogEvent@HsMenuEventFactory@@SAPAVQEvent@@XZ @ 128 NONAME ; class QEvent * HsMenuEventFactory::createInstallationLogEvent(void) - ?extendVerticalLine@HsSnapToLines@@AAEXXZ @ 129 NONAME ; void HsSnapToLines::extendVerticalLine(void) - ?stop@HsSpinnerDialog@@QAEXXZ @ 130 NONAME ; void HsSpinnerDialog::stop(void) - ?stop@HsPropertyAnimationWrapper@@QAEXXZ @ 131 NONAME ; void HsPropertyAnimationWrapper::stop(void) - ?tr@HsSpinnerDialog@@SA?AVQString@@PBD0H@Z @ 132 NONAME ; class QString HsSpinnerDialog::tr(char const *, char const *, int) - ?getStaticMetaObject@HsSnapLine@@SAABUQMetaObject@@XZ @ 133 NONAME ; struct QMetaObject const & HsSnapLine::getStaticMetaObject(void) - ?handleError@HsImageFetcherClient@@AAEXHABVQString@@@Z @ 134 NONAME ; void HsImageFetcherClient::handleError(int, class QString const &) - ?searchHeightSpace@HsWidgetOrganizer@@AAE_NH@Z @ 135 NONAME ; bool HsWidgetOrganizer::searchHeightSpace(int) - ?tr@HsTitleResolver@@SA?AVQString@@PBD0H@Z @ 136 NONAME ; class QString HsTitleResolver::tr(char const *, char const *, int) - ?setPropertyName@HsPropertyAnimationWrapper@@QAEXABVQByteArray@@@Z @ 137 NONAME ; void HsPropertyAnimationWrapper::setPropertyName(class QByteArray const &) - ?checkInactiveRectBetterFitForVerticalSnapping@HsSnapToLines@@AAEXMM@Z @ 138 NONAME ; void HsSnapToLines::checkInactiveRectBetterFitForVerticalSnapping(float, float) - ?onDialogClosed@HsMessageBoxWrapper@@AAEXH@Z @ 139 NONAME ; void HsMessageBoxWrapper::onDialogClosed(int) - ?createRenameCollectionEvent@HsMenuEventFactory@@SAPAVQEvent@@H@Z @ 140 NONAME ; class QEvent * HsMenuEventFactory::createRenameCollectionEvent(int) - ?tr@HsTrashBinWidget@@SA?AVQString@@PBD0@Z @ 141 NONAME ; class QString HsTrashBinWidget::tr(char const *, char const *) - ?getStaticMetaObject@XQAIWGetImageClient@@SAABUQMetaObject@@XZ @ 142 NONAME ; struct QMetaObject const & XQAIWGetImageClient::getStaticMetaObject(void) - ?getStaticMetaObject@HsTrashBinWidget@@SAABUQMetaObject@@XZ @ 143 NONAME ; struct QMetaObject const & HsTrashBinWidget::getStaticMetaObject(void) - ?removeItem@HsPageIndicator@@QAEXH@Z @ 144 NONAME ; void HsPageIndicator::removeItem(int) - ?mInstance@HsWidgetPositioningOnOrientationChange@@0PAV1@A @ 145 NONAME ; class HsWidgetPositioningOnOrientationChange * HsWidgetPositioningOnOrientationChange::mInstance - ?staticMetaObject@HsSpinnerDialog@@2UQMetaObject@@B @ 146 NONAME ; struct QMetaObject const HsSpinnerDialog::staticMetaObject - ?setDuration@HsPropertyAnimationWrapper@@QAEXH@Z @ 147 NONAME ; void HsPropertyAnimationWrapper::setDuration(int) - ??_EXQAIWGetImageClient@@UAE@I@Z @ 148 NONAME ; XQAIWGetImageClient::~XQAIWGetImageClient(unsigned int) - ??0HsImageFetcherClient@@QAE@PAVQObject@@@Z @ 149 NONAME ; HsImageFetcherClient::HsImageFetcherClient(class QObject *) - ??_EHsMessageBoxWrapper@@UAE@I@Z @ 150 NONAME ; HsMessageBoxWrapper::~HsMessageBoxWrapper(unsigned int) - ?tr@HsTrashBinWidget@@SA?AVQString@@PBD0H@Z @ 151 NONAME ; class QString HsTrashBinWidget::tr(char const *, char const *, int) - ?setTargetObject@HsPropertyAnimationWrapper@@QAEXPAVQObject@@@Z @ 152 NONAME ; void HsPropertyAnimationWrapper::setTargetObject(class QObject *) - ??0HsTrashBinWidget@@QAE@PAVQGraphicsItem@@@Z @ 153 NONAME ; HsTrashBinWidget::HsTrashBinWidget(class QGraphicsItem *) - ?compareLeftSideOfMovingRectForSnapping@HsSnapToLines@@AAEXXZ @ 154 NONAME ; void HsSnapToLines::compareLeftSideOfMovingRectForSnapping(void) - ?fetch@HsImageFetcherClient@@QAEXXZ @ 155 NONAME ; void HsImageFetcherClient::fetch(void) + ?trUtf8@HsImageHandlingClient@@SA?AVQString@@PBD0H@Z @ 91 NONAME ; class QString HsImageHandlingClient::trUtf8(char const *, char const *, int) + ?setInstance@HsWidgetPositioningOnOrientationChange@@SAXPAV1@@Z @ 92 NONAME ; void HsWidgetPositioningOnOrientationChange::setInstance(class HsWidgetPositioningOnOrientationChange *) + ?run@HsSnapToLines@@UAE?AVResult@HsWidgetPositioningOnWidgetMove@@ABVQRectF@@@Z @ 93 NONAME ; class HsWidgetPositioningOnWidgetMove::Result HsSnapToLines::run(class QRectF const &) + ?staticMetaObject@HsPropertyAnimationWrapper@@2UQMetaObject@@B @ 94 NONAME ; struct QMetaObject const HsPropertyAnimationWrapper::staticMetaObject + ?fetchFailed@HsImageHandlingClient@@IAEXHABVQString@@@Z @ 95 NONAME ; void HsImageHandlingClient::fetchFailed(int, class QString const &) + ?createOpenCollectionFromAppLibraryEvent@HsMenuEventFactory@@SAPAVQEvent@@HABVQString@@@Z @ 96 NONAME ; class QEvent * HsMenuEventFactory::createOpenCollectionFromAppLibraryEvent(int, class QString const &) + ?staticMetaObject@HsSnapLine@@2UQMetaObject@@B @ 97 NONAME ; struct QMetaObject const HsSnapLine::staticMetaObject + ?start@HsPropertyAnimationWrapper@@QAEXXZ @ 98 NONAME ; void HsPropertyAnimationWrapper::start(void) + ??_EHsTrashBinWidget@@UAE@I@Z @ 99 NONAME ; HsTrashBinWidget::~HsTrashBinWidget(unsigned int) + ?startFadeInAnimation@HsSnapLine@@AAEXXZ @ 100 NONAME ; void HsSnapLine::startFadeInAnimation(void) + ?tr@HsImageHandlingClient@@SA?AVQString@@PBD0H@Z @ 101 NONAME ; class QString HsImageHandlingClient::tr(char const *, char const *, int) + ?metaObject@HsSnapLine@@UBEPBUQMetaObject@@XZ @ 102 NONAME ; struct QMetaObject const * HsSnapLine::metaObject(void) const + ??1XQAIWGetImageClient@@UAE@XZ @ 103 NONAME ; XQAIWGetImageClient::~XQAIWGetImageClient(void) + ??_EHsPropertyAnimationWrapper@@UAE@I@Z @ 104 NONAME ; HsPropertyAnimationWrapper::~HsPropertyAnimationWrapper(unsigned int) + ?activeItemIndex@HsPageIndicator@@QBEHXZ @ 105 NONAME ; int HsPageIndicator::activeItemIndex(void) const + ?isFadeInAnimationRunning@HsSnapLine@@ABE_NXZ @ 106 NONAME ; bool HsSnapLine::isFadeInAnimationRunning(void) const + ?qt_metacall@HsSnapLine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 107 NONAME ; int HsSnapLine::qt_metacall(enum QMetaObject::Call, int, void * *) + ?layoutItems@HsPageIndicator@@AAEXXZ @ 108 NONAME ; void HsPageIndicator::layoutItems(void) + ?trUtf8@HsMessageBoxWrapper@@SA?AVQString@@PBD0H@Z @ 109 NONAME ; class QString HsMessageBoxWrapper::trUtf8(char const *, char const *, int) + ?metaObject@HsSpinnerDialog@@UBEPBUQMetaObject@@XZ @ 110 NONAME ; struct QMetaObject const * HsSpinnerDialog::metaObject(void) const + ?getStaticMetaObject@HsImageGridWidget@@SAABUQMetaObject@@XZ @ 111 NONAME ; struct QMetaObject const & HsImageGridWidget::getStaticMetaObject(void) + ?trUtf8@HsImageHandlingClient@@SA?AVQString@@PBD0@Z @ 112 NONAME ; class QString HsImageHandlingClient::trUtf8(char const *, char const *) + ?setConfiguration@HsSnapToLines@@UAEXABV?$QHash@VQString@@VQVariant@@@@@Z @ 113 NONAME ; void HsSnapToLines::setConfiguration(class QHash const &) + ??_EHsImageHandlingClient@@UAE@I@Z @ 114 NONAME ; HsImageHandlingClient::~HsImageHandlingClient(unsigned int) + ?trUtf8@HsPageIndicator@@SA?AVQString@@PBD0@Z @ 115 NONAME ; class QString HsPageIndicator::trUtf8(char const *, char const *) + ?metaObject@HsTitleResolver@@UBEPBUQMetaObject@@XZ @ 116 NONAME ; struct QMetaObject const * HsTitleResolver::metaObject(void) const + ?titleChanged@HsTitleResolver@@IAEXABVQString@@@Z @ 117 NONAME ; void HsTitleResolver::titleChanged(class QString const &) + ?tr@HsPageIndicator@@SA?AVQString@@PBD0@Z @ 118 NONAME ; class QString HsPageIndicator::tr(char const *, char const *) + ?tr@HsPropertyAnimationWrapper@@SA?AVQString@@PBD0@Z @ 119 NONAME ; class QString HsPropertyAnimationWrapper::tr(char const *, char const *) + ?onStatusChanged@HsTitleResolver@@AAEXW4HsDeviceInfoStatus@HsDeviceInfoListener@@@Z @ 120 NONAME ; void HsTitleResolver::onStatusChanged(enum HsDeviceInfoListener::HsDeviceInfoStatus) + ?createUninstallFailedEvent@HsMenuEventFactory@@SAPAVQEvent@@H@Z @ 121 NONAME ; class QEvent * HsMenuEventFactory::createUninstallFailedEvent(int) + ?createVerticalLine@HsSnapToLines@@AAEXXZ @ 122 NONAME ; void HsSnapToLines::createVerticalLine(void) + ?trUtf8@XQAIWGetImageClient@@SA?AVQString@@PBD0H@Z @ 123 NONAME ; class QString XQAIWGetImageClient::trUtf8(char const *, char const *, int) + ?actionOnFadeInAnimationStop@HsSnapLine@@AAEXXZ @ 124 NONAME ; void HsSnapLine::actionOnFadeInAnimationStop(void) + ?qt_metacast@HsTrashBinWidget@@UAEPAXPBD@Z @ 125 NONAME ; void * HsTrashBinWidget::qt_metacast(char const *) + ?createNewCollectionEvent@HsMenuEventFactory@@SAPAVQEvent@@XZ @ 126 NONAME ; class QEvent * HsMenuEventFactory::createNewCollectionEvent(void) + ?createOpenHomeScreenEvent@HsMenuEventFactory@@SAPAVQEvent@@XZ @ 127 NONAME ; class QEvent * HsMenuEventFactory::createOpenHomeScreenEvent(void) + ?checkInactiveRectPositionToVerticalLine@HsSnapToLines@@AAEXXZ @ 128 NONAME ; void HsSnapToLines::checkInactiveRectPositionToVerticalLine(void) + ?metaObject@HsImageHandlingClient@@UBEPBUQMetaObject@@XZ @ 129 NONAME ; struct QMetaObject const * HsImageHandlingClient::metaObject(void) const + ?findImages@XQAIWGetImageClient@@AAEXABVQString@@ABVQStringList@@AAV3@@Z @ 130 NONAME ; void XQAIWGetImageClient::findImages(class QString const &, class QStringList const &, class QStringList &) + ??_EHsMenuDialogFactory@@UAE@I@Z @ 131 NONAME ; HsMenuDialogFactory::~HsMenuDialogFactory(unsigned int) + ?createInstallationLogEvent@HsMenuEventFactory@@SAPAVQEvent@@XZ @ 132 NONAME ; class QEvent * HsMenuEventFactory::createInstallationLogEvent(void) + ?extendVerticalLine@HsSnapToLines@@AAEXXZ @ 133 NONAME ; void HsSnapToLines::extendVerticalLine(void) + ?stop@HsSpinnerDialog@@QAEXXZ @ 134 NONAME ; void HsSpinnerDialog::stop(void) + ?stop@HsPropertyAnimationWrapper@@QAEXXZ @ 135 NONAME ; void HsPropertyAnimationWrapper::stop(void) + ?tr@HsSpinnerDialog@@SA?AVQString@@PBD0H@Z @ 136 NONAME ; class QString HsSpinnerDialog::tr(char const *, char const *, int) + ?getStaticMetaObject@HsSnapLine@@SAABUQMetaObject@@XZ @ 137 NONAME ; struct QMetaObject const & HsSnapLine::getStaticMetaObject(void) + ?tr@HsTitleResolver@@SA?AVQString@@PBD0H@Z @ 138 NONAME ; class QString HsTitleResolver::tr(char const *, char const *, int) + ?setPropertyName@HsPropertyAnimationWrapper@@QAEXABVQByteArray@@@Z @ 139 NONAME ; void HsPropertyAnimationWrapper::setPropertyName(class QByteArray const &) + ?checkInactiveRectBetterFitForVerticalSnapping@HsSnapToLines@@AAEXMM@Z @ 140 NONAME ; void HsSnapToLines::checkInactiveRectBetterFitForVerticalSnapping(float, float) + ?onDialogClosed@HsMessageBoxWrapper@@AAEXH@Z @ 141 NONAME ; void HsMessageBoxWrapper::onDialogClosed(int) + ?createRenameCollectionEvent@HsMenuEventFactory@@SAPAVQEvent@@H@Z @ 142 NONAME ; class QEvent * HsMenuEventFactory::createRenameCollectionEvent(int) + ?tr@HsTrashBinWidget@@SA?AVQString@@PBD0@Z @ 143 NONAME ; class QString HsTrashBinWidget::tr(char const *, char const *) + ?getStaticMetaObject@XQAIWGetImageClient@@SAABUQMetaObject@@XZ @ 144 NONAME ; struct QMetaObject const & XQAIWGetImageClient::getStaticMetaObject(void) + ?getStaticMetaObject@HsTrashBinWidget@@SAABUQMetaObject@@XZ @ 145 NONAME ; struct QMetaObject const & HsTrashBinWidget::getStaticMetaObject(void) + ?removeItem@HsPageIndicator@@QAEXH@Z @ 146 NONAME ; void HsPageIndicator::removeItem(int) + ?mInstance@HsWidgetPositioningOnOrientationChange@@0PAV1@A @ 147 NONAME ; class HsWidgetPositioningOnOrientationChange * HsWidgetPositioningOnOrientationChange::mInstance + ?staticMetaObject@HsSpinnerDialog@@2UQMetaObject@@B @ 148 NONAME ; struct QMetaObject const HsSpinnerDialog::staticMetaObject + ?setDuration@HsPropertyAnimationWrapper@@QAEXH@Z @ 149 NONAME ; void HsPropertyAnimationWrapper::setDuration(int) + ??_EXQAIWGetImageClient@@UAE@I@Z @ 150 NONAME ; XQAIWGetImageClient::~XQAIWGetImageClient(unsigned int) + ??_EHsMessageBoxWrapper@@UAE@I@Z @ 151 NONAME ; HsMessageBoxWrapper::~HsMessageBoxWrapper(unsigned int) + ?tr@HsTrashBinWidget@@SA?AVQString@@PBD0H@Z @ 152 NONAME ; class QString HsTrashBinWidget::tr(char const *, char const *, int) + ?setTargetObject@HsPropertyAnimationWrapper@@QAEXPAVQObject@@@Z @ 153 NONAME ; void HsPropertyAnimationWrapper::setTargetObject(class QObject *) + ??0HsTrashBinWidget@@QAE@PAVQGraphicsItem@@@Z @ 154 NONAME ; HsTrashBinWidget::HsTrashBinWidget(class QGraphicsItem *) + ?compareLeftSideOfMovingRectForSnapping@HsSnapToLines@@AAEXXZ @ 155 NONAME ; void HsSnapToLines::compareLeftSideOfMovingRectForSnapping(void) ?instance@HsWidgetPositioningOnWidgetMove@@SAPAV1@XZ @ 156 NONAME ; class HsWidgetPositioningOnWidgetMove * HsWidgetPositioningOnWidgetMove::instance(void) ?staticMetaObject@HsMessageBoxWrapper@@2UQMetaObject@@B @ 157 NONAME ; struct QMetaObject const HsMessageBoxWrapper::staticMetaObject - ?qt_metacast@HsImageFetcherClient@@UAEPAXPBD@Z @ 158 NONAME ; void * HsImageFetcherClient::qt_metacast(char const *) - ?trUtf8@HsImageFetcherClient@@SA?AVQString@@PBD0@Z @ 159 NONAME ; class QString HsImageFetcherClient::trUtf8(char const *, char const *) - ?fetchCompleted@HsImageFetcherClient@@IAEXABVQString@@@Z @ 160 NONAME ; void HsImageFetcherClient::fetchCompleted(class QString const &) - ?start@HsSpinnerDialog@@QAEXXZ @ 161 NONAME ; void HsSpinnerDialog::start(void) - ?isFadeOutAnimationRunning@HsSnapLine@@ABE_NXZ @ 162 NONAME ; bool HsSnapLine::isFadeOutAnimationRunning(void) const - ?trUtf8@HsPropertyAnimationWrapper@@SA?AVQString@@PBD0@Z @ 163 NONAME ; class QString HsPropertyAnimationWrapper::trUtf8(char const *, char const *) - ?createSnappableRectangles@HsSnapToLines@@AAEXABV?$QList@VQRectF@@@@@Z @ 164 NONAME ; void HsSnapToLines::createSnappableRectangles(class QList const &) - ?staticMetaObject@HsImageGridWidget@@2UQMetaObject@@B @ 165 NONAME ; struct QMetaObject const HsImageGridWidget::staticMetaObject - ??_EHsTitleResolver@@UAE@I@Z @ 166 NONAME ; HsTitleResolver::~HsTitleResolver(unsigned int) - ?setForward@HsPropertyAnimationWrapper@@QAEXXZ @ 167 NONAME ; void HsPropertyAnimationWrapper::setForward(void) - ?convert@HsAnchorPointInCenter@@UAE?AV?$QList@VQRectF@@@@ABVQRectF@@ABV2@1ABVQPointF@@@Z @ 168 NONAME ; class QList HsAnchorPointInCenter::convert(class QRectF const &, class QList const &, class QList const &, class QPointF const &) - ??1HsSnapToLines@@UAE@XZ @ 169 NONAME ; HsSnapToLines::~HsSnapToLines(void) - ?staticMetaObject@HsTrashBinWidget@@2UQMetaObject@@B @ 170 NONAME ; struct QMetaObject const HsTrashBinWidget::staticMetaObject - ?title@HsTitleResolver@@QAE?AVQString@@XZ @ 171 NONAME ; class QString HsTitleResolver::title(void) - ??_EHsWidgetPositioningOnWidgetAdd@@UAE@I@Z @ 172 NONAME ; HsWidgetPositioningOnWidgetAdd::~HsWidgetPositioningOnWidgetAdd(unsigned int) - ??_EHsMenuEventTransition@@UAE@I@Z @ 173 NONAME ; HsMenuEventTransition::~HsMenuEventTransition(unsigned int) - ?tr@HsSnapLine@@SA?AVQString@@PBD0@Z @ 174 NONAME ; class QString HsSnapLine::tr(char const *, char const *) - ?setPagePresentation@HsSnapToLines@@UAEXABVQRectF@@ABV?$QList@VQRectF@@@@0@Z @ 175 NONAME ; void HsSnapToLines::setPagePresentation(class QRectF const &, class QList const &, class QRectF const &) - ?trUtf8@HsTrashBinWidget@@SA?AVQString@@PBD0H@Z @ 176 NONAME ; class QString HsTrashBinWidget::trUtf8(char const *, char const *, int) - ?trUtf8@HsImageFetcherClient@@SA?AVQString@@PBD0H@Z @ 177 NONAME ; class QString HsImageFetcherClient::trUtf8(char const *, char const *, int) - ??_EHsMenuEvent@@UAE@I@Z @ 178 NONAME ; HsMenuEvent::~HsMenuEvent(unsigned int) - ??1HsTrashBinWidget@@UAE@XZ @ 179 NONAME ; HsTrashBinWidget::~HsTrashBinWidget(void) - ?compareTopOfMovingRectForSnapping@HsSnapToLines@@AAEXXZ @ 180 NONAME ; void HsSnapToLines::compareTopOfMovingRectForSnapping(void) - ??_EHsSnapToLines@@UAE@I@Z @ 181 NONAME ; HsSnapToLines::~HsSnapToLines(unsigned int) - ?itemCount@HsPageIndicator@@QBEHXZ @ 182 NONAME ; int HsPageIndicator::itemCount(void) const - ?checkInactiveRectLieLeftOrRightOfMovingRect@HsSnapToLines@@AAEXXZ @ 183 NONAME ; void HsSnapToLines::checkInactiveRectLieLeftOrRightOfMovingRect(void) - ??1HsImageFetcherClient@@UAE@XZ @ 184 NONAME ; HsImageFetcherClient::~HsImageFetcherClient(void) - ?createAddAppsFromApplicationsViewEvent@HsMenuEventFactory@@SAPAVQEvent@@W4HsSortAttribute@Hs@@H@Z @ 185 NONAME ; class QEvent * HsMenuEventFactory::createAddAppsFromApplicationsViewEvent(enum Hs::HsSortAttribute, int) - ??1HsWidgetPositioningOnOrientationChange@@UAE@XZ @ 186 NONAME ; HsWidgetPositioningOnOrientationChange::~HsWidgetPositioningOnOrientationChange(void) - ?metaObject@HsImageGridWidget@@UBEPBUQMetaObject@@XZ @ 187 NONAME ; struct QMetaObject const * HsImageGridWidget::metaObject(void) const - ?checkInactiveRectVerticalEdgesInRange@HsSnapToLines@@AAEXM@Z @ 188 NONAME ; void HsSnapToLines::checkInactiveRectVerticalEdgesInRange(float) - ?imageSelectionCancelled@XQAIWGetImageClient@@AAEXXZ @ 189 NONAME ; void XQAIWGetImageClient::imageSelectionCancelled(void) - ?gridItemActivated@HsImageGridWidget@@AAEXABVQModelIndex@@@Z @ 190 NONAME ; void HsImageGridWidget::gridItemActivated(class QModelIndex const &) - ?markReservedAnchors@HsWidgetOrganizer@@AAE_NXZ @ 191 NONAME ; bool HsWidgetOrganizer::markReservedAnchors(void) - ?createRemoveAppFromCollectionEvent@HsMenuEventFactory@@SAPAVQEvent@@HH@Z @ 192 NONAME ; class QEvent * HsMenuEventFactory::createRemoveAppFromCollectionEvent(int, int) - ??1HsWidgetPositioningOnWidgetMove@@UAE@XZ @ 193 NONAME ; HsWidgetPositioningOnWidgetMove::~HsWidgetPositioningOnWidgetMove(void) - ?trUtf8@HsPageIndicator@@SA?AVQString@@PBD0H@Z @ 194 NONAME ; class QString HsPageIndicator::trUtf8(char const *, char const *, int) - ??0HsSpinnerDialog@@QAE@PAVQGraphicsItem@@@Z @ 195 NONAME ; HsSpinnerDialog::HsSpinnerDialog(class QGraphicsItem *) - ?createOpenCollectionEvent@HsMenuEventFactory@@SAPAVQEvent@@HABVQString@@@Z @ 196 NONAME ; class QEvent * HsMenuEventFactory::createOpenCollectionEvent(int, class QString const &) - ?initialize@HsPageIndicator@@QAEXHH@Z @ 197 NONAME ; void HsPageIndicator::initialize(int, int) - ??1HsPageIndicator@@UAE@XZ @ 198 NONAME ; HsPageIndicator::~HsPageIndicator(void) - ?instance@HsWidgetPositioningOnOrientationChange@@SAPAV1@XZ @ 199 NONAME ; class HsWidgetPositioningOnOrientationChange * HsWidgetPositioningOnOrientationChange::instance(void) - ?createAddToHomeScreenEvent@HsMenuEventFactory@@SAPAVQEvent@@HW4HsMenuMode@Hs@@VQVariant@@@Z @ 200 NONAME ; class QEvent * HsMenuEventFactory::createAddToHomeScreenEvent(int, enum Hs::HsMenuMode, class QVariant) - ?getFadeInDuration@HsSnapLine@@AAEHXZ @ 201 NONAME ; int HsSnapLine::getFadeInDuration(void) - ?getAnchorPoint@HsWidgetOrganizer@@AAE_NABVQSizeF@@@Z @ 202 NONAME ; bool HsWidgetOrganizer::getAnchorPoint(class QSizeF const &) - ?fetchCompleted@XQAIWGetImageClient@@IAEXABVQString@@@Z @ 203 NONAME ; void XQAIWGetImageClient::fetchCompleted(class QString const &) - ?requestCompleted@XQAIWGetImageClient@@AAEXABVQVariant@@@Z @ 204 NONAME ; void XQAIWGetImageClient::requestCompleted(class QVariant const &) - ?initAnchors@HsWidgetOrganizer@@AAE_NABVQSizeF@@@Z @ 205 NONAME ; bool HsWidgetOrganizer::initAnchors(class QSizeF const &) - ?accepted@HsMessageBoxWrapper@@IAEXXZ @ 206 NONAME ; void HsMessageBoxWrapper::accepted(void) - ?getStaticMetaObject@HsMessageBoxWrapper@@SAABUQMetaObject@@XZ @ 207 NONAME ; struct QMetaObject const & HsMessageBoxWrapper::getStaticMetaObject(void) - ?qt_metacast@XQAIWGetImageClient@@UAEPAXPBD@Z @ 208 NONAME ; void * XQAIWGetImageClient::qt_metacast(char const *) - ??_EHsImageGridWidget@@UAE@I@Z @ 209 NONAME ; HsImageGridWidget::~HsImageGridWidget(unsigned int) - ?hideLine@HsSnapLine@@QAEXXZ @ 210 NONAME ; void HsSnapLine::hideLine(void) - ?metaObject@HsPageIndicator@@UBEPBUQMetaObject@@XZ @ 211 NONAME ; struct QMetaObject const * HsPageIndicator::metaObject(void) const - ?imageSelected@XQAIWGetImageClient@@AAEXABVQString@@@Z @ 212 NONAME ; void XQAIWGetImageClient::imageSelected(class QString const &) - ?setActiveItemIndex@HsPageIndicator@@QAEXH@Z @ 213 NONAME ; void HsPageIndicator::setActiveItemIndex(int) - ?trUtf8@HsImageGridWidget@@SA?AVQString@@PBD0H@Z @ 214 NONAME ; class QString HsImageGridWidget::trUtf8(char const *, char const *, int) - ?getStaticMetaObject@HsImageFetcherClient@@SAABUQMetaObject@@XZ @ 215 NONAME ; struct QMetaObject const & HsImageFetcherClient::getStaticMetaObject(void) - ?createOpenInstalledViewEvent@HsMenuEventFactory@@SAPAVQEvent@@XZ @ 216 NONAME ; class QEvent * HsMenuEventFactory::createOpenInstalledViewEvent(void) - ??0HsSnapLine@@QAE@PAVQGraphicsItem@@@Z @ 217 NONAME ; HsSnapLine::HsSnapLine(class QGraphicsItem *) - ?startFadeOutAnimation@HsSnapLine@@AAEXXZ @ 218 NONAME ; void HsSnapLine::startFadeOutAnimation(void) - ?imageSelected@HsImageGridWidget@@IAEXABVQString@@@Z @ 219 NONAME ; void HsImageGridWidget::imageSelected(class QString const &) - ?getStaticMetaObject@HsTitleResolver@@SAABUQMetaObject@@XZ @ 220 NONAME ; struct QMetaObject const & HsTitleResolver::getStaticMetaObject(void) - ?trUtf8@XQAIWGetImageClient@@SA?AVQString@@PBD0@Z @ 221 NONAME ; class QString XQAIWGetImageClient::trUtf8(char const *, char const *) - ?stopFadeInAnimation@HsSnapLine@@AAEXXZ @ 222 NONAME ; void HsSnapLine::stopFadeInAnimation(void) - ?create@HsMenuDialogFactory@@UBEPAVHbMessageBox@@ABVQString@@W4Options@1@@Z @ 223 NONAME ; class HbMessageBox * HsMenuDialogFactory::create(class QString const &, enum HsMenuDialogFactory::Options) const - ?lenghtInAnchorPoints@HsWidgetOrganizer@@AAEHVQVariant@@@Z @ 224 NONAME ; int HsWidgetOrganizer::lenghtInAnchorPoints(class QVariant) - ?createArrangeCollectionEvent@HsMenuEventFactory@@SAPAVQEvent@@HH@Z @ 225 NONAME ; class QEvent * HsMenuEventFactory::createArrangeCollectionEvent(int, int) - ?deactivate@HsTrashBinWidget@@QAEXXZ @ 226 NONAME ; void HsTrashBinWidget::deactivate(void) - ?qt_metacast@HsImageGridWidget@@UAEPAXPBD@Z @ 227 NONAME ; void * HsImageGridWidget::qt_metacast(char const *) - ?isForward@HsPropertyAnimationWrapper@@QBE_NXZ @ 228 NONAME ; bool HsPropertyAnimationWrapper::isForward(void) const - ?tr@HsPageIndicator@@SA?AVQString@@PBD0H@Z @ 229 NONAME ; class QString HsPageIndicator::tr(char const *, char const *, int) - ?eventTest@HsMenuEventTransition@@MAE_NPAVQEvent@@@Z @ 230 NONAME ; bool HsMenuEventTransition::eventTest(class QEvent *) - ?qt_metacall@HsImageGridWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 231 NONAME ; int HsImageGridWidget::qt_metacall(enum QMetaObject::Call, int, void * *) - ?showLine@HsSnapLine@@QAEXABVQLineF@@@Z @ 232 NONAME ; void HsSnapLine::showLine(class QLineF const &) - ?tr@HsMessageBoxWrapper@@SA?AVQString@@PBD0H@Z @ 233 NONAME ; class QString HsMessageBoxWrapper::tr(char const *, char const *, int) - ?qt_metacall@XQAIWGetImageClient@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 234 NONAME ; int XQAIWGetImageClient::qt_metacall(enum QMetaObject::Call, int, void * *) - ??0XQAIWGetImageClient@@QAE@XZ @ 235 NONAME ; XQAIWGetImageClient::XQAIWGetImageClient(void) - ?handleOk@HsImageFetcherClient@@AAEXABVQVariant@@@Z @ 236 NONAME ; void HsImageFetcherClient::handleOk(class QVariant const &) - ??0HsMenuEventTransition@@QAE@W4OperationType@HsMenuEvent@@PAVQState@@1@Z @ 237 NONAME ; HsMenuEventTransition::HsMenuEventTransition(enum HsMenuEvent::OperationType, class QState *, class QState *) - ?fetchFailed@XQAIWGetImageClient@@IAEXHABVQString@@@Z @ 238 NONAME ; void XQAIWGetImageClient::fetchFailed(int, class QString const &) - ??0HsTitleResolver@@QAE@PAVQObject@@@Z @ 239 NONAME ; HsTitleResolver::HsTitleResolver(class QObject *) - ?setConfiguration@HsSnapLine@@QAEXABV?$QHash@VQString@@VQVariant@@@@@Z @ 240 NONAME ; void HsSnapLine::setConfiguration(class QHash const &) - ??_EHsPageIndicator@@UAE@I@Z @ 241 NONAME ; HsPageIndicator::~HsPageIndicator(unsigned int) - ?stopFadeOutAnimation@HsSnapLine@@AAEXXZ @ 242 NONAME ; void HsSnapLine::stopFadeOutAnimation(void) - ??_EHsWidgetPositioningOnOrientationChange@@UAE@I@Z @ 243 NONAME ; HsWidgetPositioningOnOrientationChange::~HsWidgetPositioningOnOrientationChange(unsigned int) - ?setUpActions@HsMenuDialogFactory@@ABEXPAVHbMessageBox@@ABVQStringList@@@Z @ 244 NONAME ; void HsMenuDialogFactory::setUpActions(class HbMessageBox *, class QStringList const &) const - ?compareRightSideOfMovingRectForSnapping@HsSnapToLines@@AAEXXZ @ 245 NONAME ; void HsSnapToLines::compareRightSideOfMovingRectForSnapping(void) - ?isRunning@HsPropertyAnimationWrapper@@QAE_NXZ @ 246 NONAME ; bool HsPropertyAnimationWrapper::isRunning(void) - ?mInstance@HsWidgetPositioningOnWidgetMove@@0PAV1@A @ 247 NONAME ; class HsWidgetPositioningOnWidgetMove * HsWidgetPositioningOnWidgetMove::mInstance - ?tr@XQAIWGetImageClient@@SA?AVQString@@PBD0@Z @ 248 NONAME ; class QString XQAIWGetImageClient::tr(char const *, char const *) - ?getAnchorCoordinates@HsWidgetOrganizer@@AAE?AVQPointF@@H@Z @ 249 NONAME ; class QPointF HsWidgetOrganizer::getAnchorCoordinates(int) - ?finished@HsPropertyAnimationWrapper@@IAEXXZ @ 250 NONAME ; void HsPropertyAnimationWrapper::finished(void) - ?addItem@HsPageIndicator@@QAEXH@Z @ 251 NONAME ; void HsPageIndicator::addItem(int) - ??0HsPageIndicator@@QAE@MPAVQGraphicsItem@@@Z @ 252 NONAME ; HsPageIndicator::HsPageIndicator(float, class QGraphicsItem *) - ?rejected@HsMessageBoxWrapper@@IAEXXZ @ 253 NONAME ; void HsMessageBoxWrapper::rejected(void) - ?tr@XQAIWGetImageClient@@SA?AVQString@@PBD0H@Z @ 254 NONAME ; class QString XQAIWGetImageClient::tr(char const *, char const *, int) - ?trUtf8@HsPropertyAnimationWrapper@@SA?AVQString@@PBD0H@Z @ 255 NONAME ; class QString HsPropertyAnimationWrapper::trUtf8(char const *, char const *, int) - ?qt_metacall@HsSpinnerDialog@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 256 NONAME ; int HsSpinnerDialog::qt_metacall(enum QMetaObject::Call, int, void * *) - ?mInstance@HsWidgetPositioningOnWidgetAdd@@0PAV1@A @ 257 NONAME ; class HsWidgetPositioningOnWidgetAdd * HsWidgetPositioningOnWidgetAdd::mInstance - ??1HsMessageBoxWrapper@@UAE@XZ @ 258 NONAME ; HsMessageBoxWrapper::~HsMessageBoxWrapper(void) - ?setInstance@HsWidgetPositioningOnWidgetAdd@@SAXPAV1@@Z @ 259 NONAME ; void HsWidgetPositioningOnWidgetAdd::setInstance(class HsWidgetPositioningOnWidgetAdd *) - ?qt_metacast@HsTitleResolver@@UAEPAXPBD@Z @ 260 NONAME ; void * HsTitleResolver::qt_metacast(char const *) - ??_EHsWidgetPositioningOnWidgetMove@@UAE@I@Z @ 261 NONAME ; HsWidgetPositioningOnWidgetMove::~HsWidgetPositioningOnWidgetMove(unsigned int) - ?extendHorizontalLine@HsSnapToLines@@AAEXXZ @ 262 NONAME ; void HsSnapToLines::extendHorizontalLine(void) - ?qt_metacall@HsTrashBinWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 263 NONAME ; int HsTrashBinWidget::qt_metacall(enum QMetaObject::Call, int, void * *) - ?searchWidthSpace@HsWidgetOrganizer@@AAE_NABVQSizeF@@@Z @ 264 NONAME ; bool HsWidgetOrganizer::searchWidthSpace(class QSizeF const &) - ??1HsImageGridWidget@@UAE@XZ @ 265 NONAME ; HsImageGridWidget::~HsImageGridWidget(void) - ??_EHsAnchorPointInCenter@@UAE@I@Z @ 266 NONAME ; HsAnchorPointInCenter::~HsAnchorPointInCenter(unsigned int) - ?getStaticMetaObject@HsSpinnerDialog@@SAABUQMetaObject@@XZ @ 267 NONAME ; struct QMetaObject const & HsSpinnerDialog::getStaticMetaObject(void) - ?staticMetaObject@HsTitleResolver@@2UQMetaObject@@B @ 268 NONAME ; struct QMetaObject const HsTitleResolver::staticMetaObject - ?checkInactiveRectHorizontalEdgesInRange@HsSnapToLines@@AAEXM@Z @ 269 NONAME ; void HsSnapToLines::checkInactiveRectHorizontalEdgesInRange(float) - ??0HsPropertyAnimationWrapper@@QAE@PAVQObject@@@Z @ 270 NONAME ; HsPropertyAnimationWrapper::HsPropertyAnimationWrapper(class QObject *) - ?createHorizontalLine@HsSnapToLines@@AAEXXZ @ 271 NONAME ; void HsSnapToLines::createHorizontalLine(void) - ?tr@HsSnapLine@@SA?AVQString@@PBD0H@Z @ 272 NONAME ; class QString HsSnapLine::tr(char const *, char const *, int) - ?qt_metacall@HsImageFetcherClient@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 273 NONAME ; int HsImageFetcherClient::qt_metacall(enum QMetaObject::Call, int, void * *) - ??_EHsSpinnerDialog@@UAE@I@Z @ 274 NONAME ; HsSpinnerDialog::~HsSpinnerDialog(unsigned int) - ??0HsImageGridWidget@@QAE@ABVQStringList@@PAVQGraphicsItem@@@Z @ 275 NONAME ; HsImageGridWidget::HsImageGridWidget(class QStringList const &, class QGraphicsItem *) - ?tr@HsImageGridWidget@@SA?AVQString@@PBD0H@Z @ 276 NONAME ; class QString HsImageGridWidget::tr(char const *, char const *, int) + ?start@HsSpinnerDialog@@QAEXXZ @ 158 NONAME ; void HsSpinnerDialog::start(void) + ?isFadeOutAnimationRunning@HsSnapLine@@ABE_NXZ @ 159 NONAME ; bool HsSnapLine::isFadeOutAnimationRunning(void) const + ?trUtf8@HsPropertyAnimationWrapper@@SA?AVQString@@PBD0@Z @ 160 NONAME ; class QString HsPropertyAnimationWrapper::trUtf8(char const *, char const *) + ?createSnappableRectangles@HsSnapToLines@@AAEXABV?$QList@VQRectF@@@@@Z @ 161 NONAME ; void HsSnapToLines::createSnappableRectangles(class QList const &) + ?staticMetaObject@HsImageGridWidget@@2UQMetaObject@@B @ 162 NONAME ; struct QMetaObject const HsImageGridWidget::staticMetaObject + ??_EHsTitleResolver@@UAE@I@Z @ 163 NONAME ; HsTitleResolver::~HsTitleResolver(unsigned int) + ?setForward@HsPropertyAnimationWrapper@@QAEXXZ @ 164 NONAME ; void HsPropertyAnimationWrapper::setForward(void) + ??1HsSnapToLines@@UAE@XZ @ 165 NONAME ; HsSnapToLines::~HsSnapToLines(void) + ?staticMetaObject@HsTrashBinWidget@@2UQMetaObject@@B @ 166 NONAME ; struct QMetaObject const HsTrashBinWidget::staticMetaObject + ?title@HsTitleResolver@@QAE?AVQString@@XZ @ 167 NONAME ; class QString HsTitleResolver::title(void) + ?handleEditorError@HsImageHandlingClient@@AAEXHABVQString@@@Z @ 168 NONAME ; void HsImageHandlingClient::handleEditorError(int, class QString const &) + ??_EHsMenuEventTransition@@UAE@I@Z @ 169 NONAME ; HsMenuEventTransition::~HsMenuEventTransition(unsigned int) + ?tr@HsSnapLine@@SA?AVQString@@PBD0@Z @ 170 NONAME ; class QString HsSnapLine::tr(char const *, char const *) + ?setPagePresentation@HsSnapToLines@@UAEXABVQRectF@@ABV?$QList@VQRectF@@@@0@Z @ 171 NONAME ; void HsSnapToLines::setPagePresentation(class QRectF const &, class QList const &, class QRectF const &) + ?trUtf8@HsTrashBinWidget@@SA?AVQString@@PBD0H@Z @ 172 NONAME ; class QString HsTrashBinWidget::trUtf8(char const *, char const *, int) + ??_EHsMenuEvent@@UAE@I@Z @ 173 NONAME ; HsMenuEvent::~HsMenuEvent(unsigned int) + ??1HsTrashBinWidget@@UAE@XZ @ 174 NONAME ; HsTrashBinWidget::~HsTrashBinWidget(void) + ?compareTopOfMovingRectForSnapping@HsSnapToLines@@AAEXXZ @ 175 NONAME ; void HsSnapToLines::compareTopOfMovingRectForSnapping(void) + ??_EHsSnapToLines@@UAE@I@Z @ 176 NONAME ; HsSnapToLines::~HsSnapToLines(unsigned int) + ??1HsImageHandlingClient@@UAE@XZ @ 177 NONAME ; HsImageHandlingClient::~HsImageHandlingClient(void) + ?itemCount@HsPageIndicator@@QBEHXZ @ 178 NONAME ; int HsPageIndicator::itemCount(void) const + ?checkInactiveRectLieLeftOrRightOfMovingRect@HsSnapToLines@@AAEXXZ @ 179 NONAME ; void HsSnapToLines::checkInactiveRectLieLeftOrRightOfMovingRect(void) + ?createAddAppsFromApplicationsViewEvent@HsMenuEventFactory@@SAPAVQEvent@@W4HsSortAttribute@Hs@@H@Z @ 180 NONAME ; class QEvent * HsMenuEventFactory::createAddAppsFromApplicationsViewEvent(enum Hs::HsSortAttribute, int) + ??1HsWidgetPositioningOnOrientationChange@@UAE@XZ @ 181 NONAME ; HsWidgetPositioningOnOrientationChange::~HsWidgetPositioningOnOrientationChange(void) + ?metaObject@HsImageGridWidget@@UBEPBUQMetaObject@@XZ @ 182 NONAME ; struct QMetaObject const * HsImageGridWidget::metaObject(void) const + ?checkInactiveRectVerticalEdgesInRange@HsSnapToLines@@AAEXM@Z @ 183 NONAME ; void HsSnapToLines::checkInactiveRectVerticalEdgesInRange(float) + ?imageSelectionCancelled@XQAIWGetImageClient@@AAEXXZ @ 184 NONAME ; void XQAIWGetImageClient::imageSelectionCancelled(void) + ?gridItemActivated@HsImageGridWidget@@AAEXABVQModelIndex@@@Z @ 185 NONAME ; void HsImageGridWidget::gridItemActivated(class QModelIndex const &) + ?createRemoveAppFromCollectionEvent@HsMenuEventFactory@@SAPAVQEvent@@HH@Z @ 186 NONAME ; class QEvent * HsMenuEventFactory::createRemoveAppFromCollectionEvent(int, int) + ?fetchCompleted@HsImageHandlingClient@@IAEXABVQString@@@Z @ 187 NONAME ; void HsImageHandlingClient::fetchCompleted(class QString const &) + ??1HsWidgetPositioningOnWidgetMove@@UAE@XZ @ 188 NONAME ; HsWidgetPositioningOnWidgetMove::~HsWidgetPositioningOnWidgetMove(void) + ?handleEditorOk@HsImageHandlingClient@@AAEXABVQVariant@@@Z @ 189 NONAME ; void HsImageHandlingClient::handleEditorOk(class QVariant const &) + ??0HsSpinnerDialog@@QAE@PAVQGraphicsItem@@@Z @ 190 NONAME ; HsSpinnerDialog::HsSpinnerDialog(class QGraphicsItem *) + ?trUtf8@HsPageIndicator@@SA?AVQString@@PBD0H@Z @ 191 NONAME ; class QString HsPageIndicator::trUtf8(char const *, char const *, int) + ?createOpenCollectionEvent@HsMenuEventFactory@@SAPAVQEvent@@HABVQString@@@Z @ 192 NONAME ; class QEvent * HsMenuEventFactory::createOpenCollectionEvent(int, class QString const &) + ?initialize@HsPageIndicator@@QAEXHH@Z @ 193 NONAME ; void HsPageIndicator::initialize(int, int) + ??1HsPageIndicator@@UAE@XZ @ 194 NONAME ; HsPageIndicator::~HsPageIndicator(void) + ?instance@HsWidgetPositioningOnOrientationChange@@SAPAV1@XZ @ 195 NONAME ; class HsWidgetPositioningOnOrientationChange * HsWidgetPositioningOnOrientationChange::instance(void) + ?createAddToHomeScreenEvent@HsMenuEventFactory@@SAPAVQEvent@@HW4HsMenuMode@Hs@@VQVariant@@@Z @ 196 NONAME ; class QEvent * HsMenuEventFactory::createAddToHomeScreenEvent(int, enum Hs::HsMenuMode, class QVariant) + ?createBackFromInstalledViewEvent@HsMenuEventFactory@@SAPAVQEvent@@HVQString@@@Z @ 197 NONAME ; class QEvent * HsMenuEventFactory::createBackFromInstalledViewEvent(int, class QString) + ?getFadeInDuration@HsSnapLine@@AAEHXZ @ 198 NONAME ; int HsSnapLine::getFadeInDuration(void) + ?fetchCompleted@XQAIWGetImageClient@@IAEXABVQString@@@Z @ 199 NONAME ; void XQAIWGetImageClient::fetchCompleted(class QString const &) + ?requestCompleted@XQAIWGetImageClient@@AAEXABVQVariant@@@Z @ 200 NONAME ; void XQAIWGetImageClient::requestCompleted(class QVariant const &) + ?accepted@HsMessageBoxWrapper@@IAEXXZ @ 201 NONAME ; void HsMessageBoxWrapper::accepted(void) + ?getStaticMetaObject@HsMessageBoxWrapper@@SAABUQMetaObject@@XZ @ 202 NONAME ; struct QMetaObject const & HsMessageBoxWrapper::getStaticMetaObject(void) + ?qt_metacast@XQAIWGetImageClient@@UAEPAXPBD@Z @ 203 NONAME ; void * XQAIWGetImageClient::qt_metacast(char const *) + ??_EHsImageGridWidget@@UAE@I@Z @ 204 NONAME ; HsImageGridWidget::~HsImageGridWidget(unsigned int) + ?hideLine@HsSnapLine@@QAEXXZ @ 205 NONAME ; void HsSnapLine::hideLine(void) + ?metaObject@HsPageIndicator@@UBEPBUQMetaObject@@XZ @ 206 NONAME ; struct QMetaObject const * HsPageIndicator::metaObject(void) const + ?imageSelected@XQAIWGetImageClient@@AAEXABVQString@@@Z @ 207 NONAME ; void XQAIWGetImageClient::imageSelected(class QString const &) + ?setActiveItemIndex@HsPageIndicator@@QAEXH@Z @ 208 NONAME ; void HsPageIndicator::setActiveItemIndex(int) + ?trUtf8@HsImageGridWidget@@SA?AVQString@@PBD0H@Z @ 209 NONAME ; class QString HsImageGridWidget::trUtf8(char const *, char const *, int) + ??0HsSnapLine@@QAE@PAVQGraphicsItem@@@Z @ 210 NONAME ; HsSnapLine::HsSnapLine(class QGraphicsItem *) + ?getStaticMetaObject@HsImageHandlingClient@@SAABUQMetaObject@@XZ @ 211 NONAME ; struct QMetaObject const & HsImageHandlingClient::getStaticMetaObject(void) + ?startFadeOutAnimation@HsSnapLine@@AAEXXZ @ 212 NONAME ; void HsSnapLine::startFadeOutAnimation(void) + ?editorFailed@HsImageHandlingClient@@IAEXHABVQString@@@Z @ 213 NONAME ; void HsImageHandlingClient::editorFailed(int, class QString const &) + ?editorCompleted@HsImageHandlingClient@@IAEXXZ @ 214 NONAME ; void HsImageHandlingClient::editorCompleted(void) + ?imageSelected@HsImageGridWidget@@IAEXABVQString@@@Z @ 215 NONAME ; void HsImageGridWidget::imageSelected(class QString const &) + ?getStaticMetaObject@HsTitleResolver@@SAABUQMetaObject@@XZ @ 216 NONAME ; struct QMetaObject const & HsTitleResolver::getStaticMetaObject(void) + ?trUtf8@XQAIWGetImageClient@@SA?AVQString@@PBD0@Z @ 217 NONAME ; class QString XQAIWGetImageClient::trUtf8(char const *, char const *) + ?stopFadeInAnimation@HsSnapLine@@AAEXXZ @ 218 NONAME ; void HsSnapLine::stopFadeInAnimation(void) + ?create@HsMenuDialogFactory@@UBEPAVHbMessageBox@@ABVQString@@W4Options@1@@Z @ 219 NONAME ; class HbMessageBox * HsMenuDialogFactory::create(class QString const &, enum HsMenuDialogFactory::Options) const + ?createArrangeCollectionEvent@HsMenuEventFactory@@SAPAVQEvent@@HH@Z @ 220 NONAME ; class QEvent * HsMenuEventFactory::createArrangeCollectionEvent(int, int) + ?deactivate@HsTrashBinWidget@@QAEXXZ @ 221 NONAME ; void HsTrashBinWidget::deactivate(void) + ?qt_metacast@HsImageGridWidget@@UAEPAXPBD@Z @ 222 NONAME ; void * HsImageGridWidget::qt_metacast(char const *) + ?isForward@HsPropertyAnimationWrapper@@QBE_NXZ @ 223 NONAME ; bool HsPropertyAnimationWrapper::isForward(void) const + ?tr@HsPageIndicator@@SA?AVQString@@PBD0H@Z @ 224 NONAME ; class QString HsPageIndicator::tr(char const *, char const *, int) + ?tr@HsImageHandlingClient@@SA?AVQString@@PBD0@Z @ 225 NONAME ; class QString HsImageHandlingClient::tr(char const *, char const *) + ?eventTest@HsMenuEventTransition@@MAE_NPAVQEvent@@@Z @ 226 NONAME ; bool HsMenuEventTransition::eventTest(class QEvent *) + ?qt_metacall@HsImageGridWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 227 NONAME ; int HsImageGridWidget::qt_metacall(enum QMetaObject::Call, int, void * *) + ?showLine@HsSnapLine@@QAEXABVQLineF@@@Z @ 228 NONAME ; void HsSnapLine::showLine(class QLineF const &) + ?tr@HsMessageBoxWrapper@@SA?AVQString@@PBD0H@Z @ 229 NONAME ; class QString HsMessageBoxWrapper::tr(char const *, char const *, int) + ?qt_metacall@XQAIWGetImageClient@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 230 NONAME ; int XQAIWGetImageClient::qt_metacall(enum QMetaObject::Call, int, void * *) + ??0XQAIWGetImageClient@@QAE@XZ @ 231 NONAME ; XQAIWGetImageClient::XQAIWGetImageClient(void) + ??0HsMenuEventTransition@@QAE@W4OperationType@HsMenuEvent@@PAVQState@@1@Z @ 232 NONAME ; HsMenuEventTransition::HsMenuEventTransition(enum HsMenuEvent::OperationType, class QState *, class QState *) + ?fetchFailed@XQAIWGetImageClient@@IAEXHABVQString@@@Z @ 233 NONAME ; void XQAIWGetImageClient::fetchFailed(int, class QString const &) + ??0HsTitleResolver@@QAE@PAVQObject@@@Z @ 234 NONAME ; HsTitleResolver::HsTitleResolver(class QObject *) + ?setConfiguration@HsSnapLine@@QAEXABV?$QHash@VQString@@VQVariant@@@@@Z @ 235 NONAME ; void HsSnapLine::setConfiguration(class QHash const &) + ??_EHsPageIndicator@@UAE@I@Z @ 236 NONAME ; HsPageIndicator::~HsPageIndicator(unsigned int) + ?stopFadeOutAnimation@HsSnapLine@@AAEXXZ @ 237 NONAME ; void HsSnapLine::stopFadeOutAnimation(void) + ??_EHsWidgetPositioningOnOrientationChange@@UAE@I@Z @ 238 NONAME ; HsWidgetPositioningOnOrientationChange::~HsWidgetPositioningOnOrientationChange(unsigned int) + ?setUpActions@HsMenuDialogFactory@@ABEXPAVHbMessageBox@@ABVQStringList@@@Z @ 239 NONAME ; void HsMenuDialogFactory::setUpActions(class HbMessageBox *, class QStringList const &) const + ?compareRightSideOfMovingRectForSnapping@HsSnapToLines@@AAEXXZ @ 240 NONAME ; void HsSnapToLines::compareRightSideOfMovingRectForSnapping(void) + ?isRunning@HsPropertyAnimationWrapper@@QAE_NXZ @ 241 NONAME ; bool HsPropertyAnimationWrapper::isRunning(void) + ?mInstance@HsWidgetPositioningOnWidgetMove@@0PAV1@A @ 242 NONAME ; class HsWidgetPositioningOnWidgetMove * HsWidgetPositioningOnWidgetMove::mInstance + ?tr@XQAIWGetImageClient@@SA?AVQString@@PBD0@Z @ 243 NONAME ; class QString XQAIWGetImageClient::tr(char const *, char const *) + ?finished@HsPropertyAnimationWrapper@@IAEXXZ @ 244 NONAME ; void HsPropertyAnimationWrapper::finished(void) + ?addItem@HsPageIndicator@@QAEXH@Z @ 245 NONAME ; void HsPageIndicator::addItem(int) + ??0HsPageIndicator@@QAE@MPAVQGraphicsItem@@@Z @ 246 NONAME ; HsPageIndicator::HsPageIndicator(float, class QGraphicsItem *) + ?rejected@HsMessageBoxWrapper@@IAEXXZ @ 247 NONAME ; void HsMessageBoxWrapper::rejected(void) + ?tr@XQAIWGetImageClient@@SA?AVQString@@PBD0H@Z @ 248 NONAME ; class QString XQAIWGetImageClient::tr(char const *, char const *, int) + ?trUtf8@HsPropertyAnimationWrapper@@SA?AVQString@@PBD0H@Z @ 249 NONAME ; class QString HsPropertyAnimationWrapper::trUtf8(char const *, char const *, int) + ?qt_metacall@HsSpinnerDialog@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 250 NONAME ; int HsSpinnerDialog::qt_metacall(enum QMetaObject::Call, int, void * *) + ??1HsMessageBoxWrapper@@UAE@XZ @ 251 NONAME ; HsMessageBoxWrapper::~HsMessageBoxWrapper(void) + ?qt_metacast@HsTitleResolver@@UAEPAXPBD@Z @ 252 NONAME ; void * HsTitleResolver::qt_metacast(char const *) + ??_EHsWidgetPositioningOnWidgetMove@@UAE@I@Z @ 253 NONAME ; HsWidgetPositioningOnWidgetMove::~HsWidgetPositioningOnWidgetMove(unsigned int) + ?extendHorizontalLine@HsSnapToLines@@AAEXXZ @ 254 NONAME ; void HsSnapToLines::extendHorizontalLine(void) + ?qt_metacall@HsTrashBinWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 255 NONAME ; int HsTrashBinWidget::qt_metacall(enum QMetaObject::Call, int, void * *) + ??1HsImageGridWidget@@UAE@XZ @ 256 NONAME ; HsImageGridWidget::~HsImageGridWidget(void) + ?qt_metacast@HsImageHandlingClient@@UAEPAXPBD@Z @ 257 NONAME ; void * HsImageHandlingClient::qt_metacast(char const *) + ?getStaticMetaObject@HsSpinnerDialog@@SAABUQMetaObject@@XZ @ 258 NONAME ; struct QMetaObject const & HsSpinnerDialog::getStaticMetaObject(void) + ?staticMetaObject@HsTitleResolver@@2UQMetaObject@@B @ 259 NONAME ; struct QMetaObject const HsTitleResolver::staticMetaObject + ?checkInactiveRectHorizontalEdgesInRange@HsSnapToLines@@AAEXM@Z @ 260 NONAME ; void HsSnapToLines::checkInactiveRectHorizontalEdgesInRange(float) + ??0HsPropertyAnimationWrapper@@QAE@PAVQObject@@@Z @ 261 NONAME ; HsPropertyAnimationWrapper::HsPropertyAnimationWrapper(class QObject *) + ?createHorizontalLine@HsSnapToLines@@AAEXXZ @ 262 NONAME ; void HsSnapToLines::createHorizontalLine(void) + ?tr@HsSnapLine@@SA?AVQString@@PBD0H@Z @ 263 NONAME ; class QString HsSnapLine::tr(char const *, char const *, int) + ??_EHsSpinnerDialog@@UAE@I@Z @ 264 NONAME ; HsSpinnerDialog::~HsSpinnerDialog(unsigned int) + ??0HsImageGridWidget@@QAE@ABVQStringList@@PAVQGraphicsItem@@@Z @ 265 NONAME ; HsImageGridWidget::HsImageGridWidget(class QStringList const &, class QGraphicsItem *) + ?tr@HsImageGridWidget@@SA?AVQString@@PBD0H@Z @ 266 NONAME ; class QString HsImageGridWidget::tr(char const *, char const *, int) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/eabi/hsutilsu.def --- a/homescreenapp/hsutils/eabi/hsutilsu.def Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsutils/eabi/hsutilsu.def Mon Sep 20 10:19:07 2010 +0300 @@ -108,196 +108,183 @@ _ZN17HsImageGridWidgetD0Ev @ 107 NONAME _ZN17HsImageGridWidgetD1Ev @ 108 NONAME _ZN17HsImageGridWidgetD2Ev @ 109 NONAME - _ZN17HsWidgetOrganizer11initAnchorsERK6QSizeF @ 110 NONAME - _ZN17HsWidgetOrganizer14getAnchorPointERK6QSizeF @ 111 NONAME - _ZN17HsWidgetOrganizer16searchWidthSpaceERK6QSizeF @ 112 NONAME - _ZN17HsWidgetOrganizer17searchHeightSpaceEi @ 113 NONAME - _ZN17HsWidgetOrganizer19markReservedAnchorsEv @ 114 NONAME - _ZN17HsWidgetOrganizer20getAnchorCoordinatesEi @ 115 NONAME - _ZN17HsWidgetOrganizer20lenghtInAnchorPointsE8QVariant @ 116 NONAME - _ZN17HsWidgetOrganizer21getIndexForCoordinateE7QPointF @ 117 NONAME - _ZN17HsWidgetOrganizer7convertERK6QRectFRK5QListIS0_ES6_RK7QPointF @ 118 NONAME - _ZN18HsMenuEventFactory18createUnknownEventEv @ 119 NONAME - _ZN18HsMenuEventFactory24createNewCollectionEventEv @ 120 NONAME - _ZN18HsMenuEventFactory25createAppDetailsViewEventEi @ 121 NONAME - _ZN18HsMenuEventFactory25createOpenAppLibraryEventEN2Hs10HsMenuModeE8QVariant @ 122 NONAME - _ZN18HsMenuEventFactory25createOpenCollectionEventEiRK7QString @ 123 NONAME - _ZN18HsMenuEventFactory25createOpenHomeScreenEventEv @ 124 NONAME - _ZN18HsMenuEventFactory26createAddToHomeScreenEventEiN2Hs10HsMenuModeE8QVariant @ 125 NONAME - _ZN18HsMenuEventFactory26createAppSettingsViewEventEi @ 126 NONAME - _ZN18HsMenuEventFactory26createInstallationLogEventEv @ 127 NONAME - _ZN18HsMenuEventFactory26createPreviewHSWidgetEventEiRK7QStringS2_S2_ @ 128 NONAME - _ZN18HsMenuEventFactory26createUninstallFailedEventEi @ 129 NONAME - _ZN18HsMenuEventFactory27createDeleteCollectionEventEi @ 130 NONAME - _ZN18HsMenuEventFactory27createRenameCollectionEventEi @ 131 NONAME - _ZN18HsMenuEventFactory28createArrangeCollectionEventEii @ 132 NONAME - _ZN18HsMenuEventFactory28createCollectionDeletedEventEv @ 133 NONAME - _ZN18HsMenuEventFactory28createOpenInstalledViewEventEv @ 134 NONAME - _ZN18HsMenuEventFactory31createUninstallApplicationEventEi @ 135 NONAME - _ZN18HsMenuEventFactory32createArrangeAllCollectionsEventEi @ 136 NONAME - _ZN18HsMenuEventFactory34createRemoveAppFromCollectionEventEii @ 137 NONAME - _ZN18HsMenuEventFactory36createAddAppsFromCollectionViewEventEii @ 138 NONAME - _ZN18HsMenuEventFactory38createAddAppsFromApplicationsViewEventEN2Hs15HsSortAttributeEi @ 139 NONAME - _ZN18HsMenuEventFactory39createOpenCollectionFromAppLibraryEventEiRK7QString @ 140 NONAME - _ZN19HsMenuDialogFactoryD0Ev @ 141 NONAME - _ZN19HsMenuDialogFactoryD1Ev @ 142 NONAME - _ZN19HsMenuDialogFactoryD2Ev @ 143 NONAME - _ZN19HsMessageBoxWrapper11qt_metacallEN11QMetaObject4CallEiPPv @ 144 NONAME - _ZN19HsMessageBoxWrapper11qt_metacastEPKc @ 145 NONAME - _ZN19HsMessageBoxWrapper12setQueryTextERK7QString @ 146 NONAME - _ZN19HsMessageBoxWrapper14onDialogClosedEi @ 147 NONAME - _ZN19HsMessageBoxWrapper16staticMetaObjectE @ 148 NONAME DATA 16 - _ZN19HsMessageBoxWrapper19getStaticMetaObjectEv @ 149 NONAME - _ZN19HsMessageBoxWrapper4showEv @ 150 NONAME - _ZN19HsMessageBoxWrapper5closeEv @ 151 NONAME - _ZN19HsMessageBoxWrapper8acceptedEv @ 152 NONAME - _ZN19HsMessageBoxWrapper8rejectedEv @ 153 NONAME - _ZN19HsMessageBoxWrapper9setHeaderERK7QString @ 154 NONAME - _ZN19HsMessageBoxWrapperC1EP7QObject @ 155 NONAME - _ZN19HsMessageBoxWrapperC2EP7QObject @ 156 NONAME - _ZN19HsMessageBoxWrapperD0Ev @ 157 NONAME - _ZN19HsMessageBoxWrapperD1Ev @ 158 NONAME - _ZN19HsMessageBoxWrapperD2Ev @ 159 NONAME - _ZN19XQAIWGetImageClient10findImagesERK7QStringRK11QStringListRS3_ @ 160 NONAME - _ZN19XQAIWGetImageClient11fetchFailedEiRK7QString @ 161 NONAME - _ZN19XQAIWGetImageClient11qt_metacallEN11QMetaObject4CallEiPPv @ 162 NONAME - _ZN19XQAIWGetImageClient11qt_metacastEPKc @ 163 NONAME - _ZN19XQAIWGetImageClient13imageSelectedERK7QString @ 164 NONAME - _ZN19XQAIWGetImageClient14fetchCompletedERK7QString @ 165 NONAME - _ZN19XQAIWGetImageClient16requestCompletedERK8QVariant @ 166 NONAME - _ZN19XQAIWGetImageClient16staticMetaObjectE @ 167 NONAME DATA 16 - _ZN19XQAIWGetImageClient19getStaticMetaObjectEv @ 168 NONAME - _ZN19XQAIWGetImageClient23imageSelectionCancelledEv @ 169 NONAME - _ZN19XQAIWGetImageClient5fetchEv @ 170 NONAME - _ZN19XQAIWGetImageClientC1Ev @ 171 NONAME - _ZN19XQAIWGetImageClientC2Ev @ 172 NONAME - _ZN19XQAIWGetImageClientD0Ev @ 173 NONAME - _ZN19XQAIWGetImageClientD1Ev @ 174 NONAME - _ZN19XQAIWGetImageClientD2Ev @ 175 NONAME - _ZN20HsImageFetcherClient11fetchFailedEiRK7QString @ 176 NONAME - _ZN20HsImageFetcherClient11handleErrorEiRK7QString @ 177 NONAME - _ZN20HsImageFetcherClient11qt_metacallEN11QMetaObject4CallEiPPv @ 178 NONAME - _ZN20HsImageFetcherClient11qt_metacastEPKc @ 179 NONAME - _ZN20HsImageFetcherClient14fetchCompletedERK7QString @ 180 NONAME - _ZN20HsImageFetcherClient16staticMetaObjectE @ 181 NONAME DATA 16 - _ZN20HsImageFetcherClient19getStaticMetaObjectEv @ 182 NONAME - _ZN20HsImageFetcherClient5fetchEv @ 183 NONAME - _ZN20HsImageFetcherClient8handleOkERK8QVariant @ 184 NONAME - _ZN20HsImageFetcherClientC1EP7QObject @ 185 NONAME - _ZN20HsImageFetcherClientC2EP7QObject @ 186 NONAME - _ZN20HsImageFetcherClientD0Ev @ 187 NONAME - _ZN20HsImageFetcherClientD1Ev @ 188 NONAME - _ZN20HsImageFetcherClientD2Ev @ 189 NONAME - _ZN21HsAnchorPointInCenter7convertERK6QRectFRK5QListIS0_ES6_RK7QPointF @ 190 NONAME - _ZN21HsMenuEventTransition9eventTestEP6QEvent @ 191 NONAME - _ZN21HsMenuEventTransitionC1EN11HsMenuEvent13OperationTypeEP6QStateS3_ @ 192 NONAME - _ZN21HsMenuEventTransitionC2EN11HsMenuEvent13OperationTypeEP6QStateS3_ @ 193 NONAME - _ZN26HsAnchorPointInBottomRight7convertERK6QRectFRK5QListIS0_ES6_RK7QPointF @ 194 NONAME - _ZN26HsPropertyAnimationWrapper10setForwardEv @ 195 NONAME - _ZN26HsPropertyAnimationWrapper11qt_metacallEN11QMetaObject4CallEiPPv @ 196 NONAME - _ZN26HsPropertyAnimationWrapper11qt_metacastEPKc @ 197 NONAME - _ZN26HsPropertyAnimationWrapper11setBackwardEv @ 198 NONAME - _ZN26HsPropertyAnimationWrapper11setDurationEi @ 199 NONAME - _ZN26HsPropertyAnimationWrapper11setEndValueERK8QVariant @ 200 NONAME - _ZN26HsPropertyAnimationWrapper14setEasingCurveERK12QEasingCurve @ 201 NONAME - _ZN26HsPropertyAnimationWrapper15setPropertyNameERK10QByteArray @ 202 NONAME - _ZN26HsPropertyAnimationWrapper15setTargetObjectEP7QObject @ 203 NONAME - _ZN26HsPropertyAnimationWrapper16staticMetaObjectE @ 204 NONAME DATA 16 - _ZN26HsPropertyAnimationWrapper19getStaticMetaObjectEv @ 205 NONAME - _ZN26HsPropertyAnimationWrapper4stopEv @ 206 NONAME - _ZN26HsPropertyAnimationWrapper5startEv @ 207 NONAME - _ZN26HsPropertyAnimationWrapper8finishedEv @ 208 NONAME - _ZN26HsPropertyAnimationWrapper9isRunningEv @ 209 NONAME - _ZN26HsPropertyAnimationWrapperC1EP7QObject @ 210 NONAME - _ZN26HsPropertyAnimationWrapperC2EP7QObject @ 211 NONAME - _ZN26HsPropertyAnimationWrapperD0Ev @ 212 NONAME - _ZN26HsPropertyAnimationWrapperD1Ev @ 213 NONAME - _ZN26HsPropertyAnimationWrapperD2Ev @ 214 NONAME - _ZN30HsWidgetPositioningOnWidgetAdd11setInstanceEPS_ @ 215 NONAME - _ZN30HsWidgetPositioningOnWidgetAdd8instanceEv @ 216 NONAME - _ZN30HsWidgetPositioningOnWidgetAdd9mInstanceE @ 217 NONAME DATA 4 - _ZN31HsWidgetPositioningOnWidgetMove11setInstanceEPS_ @ 218 NONAME - _ZN31HsWidgetPositioningOnWidgetMove8instanceEv @ 219 NONAME - _ZN31HsWidgetPositioningOnWidgetMove9mInstanceE @ 220 NONAME DATA 4 - _ZN38HsWidgetPositioningOnOrientationChange11setInstanceEPS_ @ 221 NONAME - _ZN38HsWidgetPositioningOnOrientationChange8instanceEv @ 222 NONAME - _ZN38HsWidgetPositioningOnOrientationChange9mInstanceE @ 223 NONAME DATA 4 - _ZN46HsAdvancedWidgetPositioningOnOrientationChange7convertERK6QRectFRK5QListIS0_ES2_ @ 224 NONAME - _ZNK10HsSnapLine10metaObjectEv @ 225 NONAME - _ZNK10HsSnapLine24isFadeInAnimationRunningEv @ 226 NONAME - _ZNK10HsSnapLine25isFadeOutAnimationRunningEv @ 227 NONAME - _ZNK11HsMenuEvent4dataEv @ 228 NONAME - _ZNK11HsMenuEvent9operationEv @ 229 NONAME - _ZNK15HsPageIndicator10metaObjectEv @ 230 NONAME - _ZNK15HsPageIndicator15activeItemIndexEv @ 231 NONAME - _ZNK15HsPageIndicator18isAnimationRunningEv @ 232 NONAME - _ZNK15HsPageIndicator9itemCountEv @ 233 NONAME - _ZNK15HsSpinnerDialog10metaObjectEv @ 234 NONAME - _ZNK15HsTitleResolver10metaObjectEv @ 235 NONAME - _ZNK16HsTrashBinWidget10metaObjectEv @ 236 NONAME - _ZNK17HsImageGridWidget10metaObjectEv @ 237 NONAME - _ZNK19HsMenuDialogFactory12setUpActionsEP12HbMessageBoxRK11QStringList @ 238 NONAME - _ZNK19HsMenuDialogFactory6createERK7QStringNS_7OptionsE @ 239 NONAME - _ZNK19HsMessageBoxWrapper10metaObjectEv @ 240 NONAME - _ZNK19XQAIWGetImageClient10metaObjectEv @ 241 NONAME - _ZNK20HsImageFetcherClient10metaObjectEv @ 242 NONAME - _ZNK26HsPropertyAnimationWrapper10metaObjectEv @ 243 NONAME - _ZNK26HsPropertyAnimationWrapper9isForwardEv @ 244 NONAME - _ZTI10HsSnapLine @ 245 NONAME - _ZTI11HsMenuEvent @ 246 NONAME - _ZTI13HsSnapToLines @ 247 NONAME - _ZTI15HsPageIndicator @ 248 NONAME - _ZTI15HsSpinnerDialog @ 249 NONAME - _ZTI15HsTitleResolver @ 250 NONAME - _ZTI16HsTrashBinWidget @ 251 NONAME - _ZTI17HsImageGridWidget @ 252 NONAME - _ZTI17HsWidgetOrganizer @ 253 NONAME - _ZTI19HsMenuDialogFactory @ 254 NONAME - _ZTI19HsMessageBoxWrapper @ 255 NONAME - _ZTI19XQAIWGetImageClient @ 256 NONAME - _ZTI20HsImageFetcherClient @ 257 NONAME - _ZTI21HsAnchorPointInCenter @ 258 NONAME - _ZTI21HsMenuEventTransition @ 259 NONAME - _ZTI26HsAnchorPointInBottomRight @ 260 NONAME - _ZTI26HsPropertyAnimationWrapper @ 261 NONAME - _ZTI30HsWidgetPositioningOnWidgetAdd @ 262 NONAME - _ZTI31HsWidgetPositioningOnWidgetMove @ 263 NONAME - _ZTI38HsWidgetPositioningOnOrientationChange @ 264 NONAME - _ZTI46HsAdvancedWidgetPositioningOnOrientationChange @ 265 NONAME - _ZTV10HsSnapLine @ 266 NONAME - _ZTV11HsMenuEvent @ 267 NONAME - _ZTV13HsSnapToLines @ 268 NONAME - _ZTV15HsPageIndicator @ 269 NONAME - _ZTV15HsSpinnerDialog @ 270 NONAME - _ZTV15HsTitleResolver @ 271 NONAME - _ZTV16HsTrashBinWidget @ 272 NONAME - _ZTV17HsImageGridWidget @ 273 NONAME - _ZTV17HsWidgetOrganizer @ 274 NONAME - _ZTV19HsMenuDialogFactory @ 275 NONAME - _ZTV19HsMessageBoxWrapper @ 276 NONAME - _ZTV19XQAIWGetImageClient @ 277 NONAME - _ZTV20HsImageFetcherClient @ 278 NONAME - _ZTV21HsAnchorPointInCenter @ 279 NONAME - _ZTV21HsMenuEventTransition @ 280 NONAME - _ZTV26HsAnchorPointInBottomRight @ 281 NONAME - _ZTV26HsPropertyAnimationWrapper @ 282 NONAME - _ZTV46HsAdvancedWidgetPositioningOnOrientationChange @ 283 NONAME - _ZThn16_N15HsPageIndicatorD0Ev @ 284 NONAME - _ZThn16_N15HsPageIndicatorD1Ev @ 285 NONAME - _ZThn16_N15HsSpinnerDialogD0Ev @ 286 NONAME - _ZThn16_N15HsSpinnerDialogD1Ev @ 287 NONAME - _ZThn16_N16HsTrashBinWidgetD0Ev @ 288 NONAME - _ZThn16_N16HsTrashBinWidgetD1Ev @ 289 NONAME - _ZThn16_N17HsImageGridWidgetD0Ev @ 290 NONAME - _ZThn16_N17HsImageGridWidgetD1Ev @ 291 NONAME - _ZThn8_N10HsSnapLineD0Ev @ 292 NONAME - _ZThn8_N10HsSnapLineD1Ev @ 293 NONAME - _ZThn8_N15HsPageIndicatorD0Ev @ 294 NONAME - _ZThn8_N15HsPageIndicatorD1Ev @ 295 NONAME - _ZThn8_N15HsSpinnerDialogD0Ev @ 296 NONAME - _ZThn8_N15HsSpinnerDialogD1Ev @ 297 NONAME - _ZThn8_N16HsTrashBinWidgetD0Ev @ 298 NONAME - _ZThn8_N16HsTrashBinWidgetD1Ev @ 299 NONAME - _ZThn8_N17HsImageGridWidgetD0Ev @ 300 NONAME - _ZThn8_N17HsImageGridWidgetD1Ev @ 301 NONAME + _ZN18HsMenuEventFactory18createUnknownEventEv @ 110 NONAME + _ZN18HsMenuEventFactory24createNewCollectionEventEv @ 111 NONAME + _ZN18HsMenuEventFactory25createAppDetailsViewEventEi @ 112 NONAME + _ZN18HsMenuEventFactory25createOpenAppLibraryEventEN2Hs10HsMenuModeE8QVariant @ 113 NONAME + _ZN18HsMenuEventFactory25createOpenCollectionEventEiRK7QString @ 114 NONAME + _ZN18HsMenuEventFactory25createOpenHomeScreenEventEv @ 115 NONAME + _ZN18HsMenuEventFactory26createAddToHomeScreenEventEiN2Hs10HsMenuModeE8QVariant @ 116 NONAME + _ZN18HsMenuEventFactory26createAppSettingsViewEventEi @ 117 NONAME + _ZN18HsMenuEventFactory26createInstallationLogEventEv @ 118 NONAME + _ZN18HsMenuEventFactory26createPreviewHSWidgetEventEiRK7QStringS2_S2_ @ 119 NONAME + _ZN18HsMenuEventFactory26createUninstallFailedEventEi @ 120 NONAME + _ZN18HsMenuEventFactory27createDeleteCollectionEventEi @ 121 NONAME + _ZN18HsMenuEventFactory27createRenameCollectionEventEi @ 122 NONAME + _ZN18HsMenuEventFactory28createArrangeCollectionEventEii @ 123 NONAME + _ZN18HsMenuEventFactory28createCollectionDeletedEventEv @ 124 NONAME + _ZN18HsMenuEventFactory28createOpenInstalledViewEventEi7QString @ 125 NONAME + _ZN18HsMenuEventFactory31createUninstallApplicationEventEi @ 126 NONAME + _ZN18HsMenuEventFactory32createArrangeAllCollectionsEventEi @ 127 NONAME + _ZN18HsMenuEventFactory32createBackFromInstalledViewEventEi7QString @ 128 NONAME + _ZN18HsMenuEventFactory34createRemoveAppFromCollectionEventEii @ 129 NONAME + _ZN18HsMenuEventFactory36createAddAppsFromCollectionViewEventEii @ 130 NONAME + _ZN18HsMenuEventFactory38createAddAppsFromApplicationsViewEventEN2Hs15HsSortAttributeEi @ 131 NONAME + _ZN18HsMenuEventFactory39createOpenCollectionFromAppLibraryEventEiRK7QString @ 132 NONAME + _ZN19HsMenuDialogFactory17acceptActionIndexEv @ 133 NONAME + _ZN19HsMenuDialogFactory17rejectActionIndexEv @ 134 NONAME + _ZN19HsMenuDialogFactoryD0Ev @ 135 NONAME + _ZN19HsMenuDialogFactoryD1Ev @ 136 NONAME + _ZN19HsMenuDialogFactoryD2Ev @ 137 NONAME + _ZN19HsMessageBoxWrapper11qt_metacallEN11QMetaObject4CallEiPPv @ 138 NONAME + _ZN19HsMessageBoxWrapper11qt_metacastEPKc @ 139 NONAME + _ZN19HsMessageBoxWrapper12setQueryTextERK7QString @ 140 NONAME + _ZN19HsMessageBoxWrapper14onDialogClosedEi @ 141 NONAME + _ZN19HsMessageBoxWrapper16staticMetaObjectE @ 142 NONAME DATA 16 + _ZN19HsMessageBoxWrapper19getStaticMetaObjectEv @ 143 NONAME + _ZN19HsMessageBoxWrapper4showEv @ 144 NONAME + _ZN19HsMessageBoxWrapper5closeEv @ 145 NONAME + _ZN19HsMessageBoxWrapper8acceptedEv @ 146 NONAME + _ZN19HsMessageBoxWrapper8rejectedEv @ 147 NONAME + _ZN19HsMessageBoxWrapper9setHeaderERK7QString @ 148 NONAME + _ZN19HsMessageBoxWrapperC1EP7QObject @ 149 NONAME + _ZN19HsMessageBoxWrapperC2EP7QObject @ 150 NONAME + _ZN19HsMessageBoxWrapperD0Ev @ 151 NONAME + _ZN19HsMessageBoxWrapperD1Ev @ 152 NONAME + _ZN19HsMessageBoxWrapperD2Ev @ 153 NONAME + _ZN19XQAIWGetImageClient10findImagesERK7QStringRK11QStringListRS3_ @ 154 NONAME + _ZN19XQAIWGetImageClient11fetchFailedEiRK7QString @ 155 NONAME + _ZN19XQAIWGetImageClient11qt_metacallEN11QMetaObject4CallEiPPv @ 156 NONAME + _ZN19XQAIWGetImageClient11qt_metacastEPKc @ 157 NONAME + _ZN19XQAIWGetImageClient13imageSelectedERK7QString @ 158 NONAME + _ZN19XQAIWGetImageClient14fetchCompletedERK7QString @ 159 NONAME + _ZN19XQAIWGetImageClient16requestCompletedERK8QVariant @ 160 NONAME + _ZN19XQAIWGetImageClient16staticMetaObjectE @ 161 NONAME DATA 16 + _ZN19XQAIWGetImageClient19getStaticMetaObjectEv @ 162 NONAME + _ZN19XQAIWGetImageClient23imageSelectionCancelledEv @ 163 NONAME + _ZN19XQAIWGetImageClient5fetchEv @ 164 NONAME + _ZN19XQAIWGetImageClientC1Ev @ 165 NONAME + _ZN19XQAIWGetImageClientC2Ev @ 166 NONAME + _ZN19XQAIWGetImageClientD0Ev @ 167 NONAME + _ZN19XQAIWGetImageClientD1Ev @ 168 NONAME + _ZN19XQAIWGetImageClientD2Ev @ 169 NONAME + _ZN21HsImageHandlingClient11fetchFailedEiRK7QString @ 170 NONAME + _ZN21HsImageHandlingClient11handleErrorEiRK7QString @ 171 NONAME + _ZN21HsImageHandlingClient11qt_metacallEN11QMetaObject4CallEiPPv @ 172 NONAME + _ZN21HsImageHandlingClient11qt_metacastEPKc @ 173 NONAME + _ZN21HsImageHandlingClient12editorFailedEiRK7QString @ 174 NONAME + _ZN21HsImageHandlingClient14fetchCompletedERK7QString @ 175 NONAME + _ZN21HsImageHandlingClient14handleEditorOkERK8QVariant @ 176 NONAME + _ZN21HsImageHandlingClient15editorCompletedEv @ 177 NONAME + _ZN21HsImageHandlingClient16staticMetaObjectE @ 178 NONAME DATA 16 + _ZN21HsImageHandlingClient17handleEditorErrorEiRK7QString @ 179 NONAME + _ZN21HsImageHandlingClient19getStaticMetaObjectEv @ 180 NONAME + _ZN21HsImageHandlingClient4editERK7QString @ 181 NONAME + _ZN21HsImageHandlingClient5fetchEv @ 182 NONAME + _ZN21HsImageHandlingClient8handleOkERK8QVariant @ 183 NONAME + _ZN21HsImageHandlingClientC1EP7QObject @ 184 NONAME + _ZN21HsImageHandlingClientC2EP7QObject @ 185 NONAME + _ZN21HsImageHandlingClientD0Ev @ 186 NONAME + _ZN21HsImageHandlingClientD1Ev @ 187 NONAME + _ZN21HsImageHandlingClientD2Ev @ 188 NONAME + _ZN21HsMenuEventTransition9eventTestEP6QEvent @ 189 NONAME + _ZN21HsMenuEventTransitionC1EN11HsMenuEvent13OperationTypeEP6QStateS3_ @ 190 NONAME + _ZN21HsMenuEventTransitionC2EN11HsMenuEvent13OperationTypeEP6QStateS3_ @ 191 NONAME + _ZN26HsPropertyAnimationWrapper10setForwardEv @ 192 NONAME + _ZN26HsPropertyAnimationWrapper11qt_metacallEN11QMetaObject4CallEiPPv @ 193 NONAME + _ZN26HsPropertyAnimationWrapper11qt_metacastEPKc @ 194 NONAME + _ZN26HsPropertyAnimationWrapper11setBackwardEv @ 195 NONAME + _ZN26HsPropertyAnimationWrapper11setDurationEi @ 196 NONAME + _ZN26HsPropertyAnimationWrapper11setEndValueERK8QVariant @ 197 NONAME + _ZN26HsPropertyAnimationWrapper14setEasingCurveERK12QEasingCurve @ 198 NONAME + _ZN26HsPropertyAnimationWrapper15setPropertyNameERK10QByteArray @ 199 NONAME + _ZN26HsPropertyAnimationWrapper15setTargetObjectEP7QObject @ 200 NONAME + _ZN26HsPropertyAnimationWrapper16staticMetaObjectE @ 201 NONAME DATA 16 + _ZN26HsPropertyAnimationWrapper19getStaticMetaObjectEv @ 202 NONAME + _ZN26HsPropertyAnimationWrapper4stopEv @ 203 NONAME + _ZN26HsPropertyAnimationWrapper5startEv @ 204 NONAME + _ZN26HsPropertyAnimationWrapper8finishedEv @ 205 NONAME + _ZN26HsPropertyAnimationWrapper9isRunningEv @ 206 NONAME + _ZN26HsPropertyAnimationWrapperC1EP7QObject @ 207 NONAME + _ZN26HsPropertyAnimationWrapperC2EP7QObject @ 208 NONAME + _ZN26HsPropertyAnimationWrapperD0Ev @ 209 NONAME + _ZN26HsPropertyAnimationWrapperD1Ev @ 210 NONAME + _ZN26HsPropertyAnimationWrapperD2Ev @ 211 NONAME + _ZN31HsWidgetPositioningOnWidgetMove11setInstanceEPS_ @ 212 NONAME + _ZN31HsWidgetPositioningOnWidgetMove8instanceEv @ 213 NONAME + _ZN31HsWidgetPositioningOnWidgetMove9mInstanceE @ 214 NONAME DATA 4 + _ZN38HsWidgetPositioningOnOrientationChange11setInstanceEPS_ @ 215 NONAME + _ZN38HsWidgetPositioningOnOrientationChange8instanceEv @ 216 NONAME + _ZN38HsWidgetPositioningOnOrientationChange9mInstanceE @ 217 NONAME DATA 4 + _ZN46HsAdvancedWidgetPositioningOnOrientationChange7convertERK6QRectFRK5QListIS0_ES2_ @ 218 NONAME + _ZNK10HsSnapLine10metaObjectEv @ 219 NONAME + _ZNK10HsSnapLine24isFadeInAnimationRunningEv @ 220 NONAME + _ZNK10HsSnapLine25isFadeOutAnimationRunningEv @ 221 NONAME + _ZNK11HsMenuEvent4dataEv @ 222 NONAME + _ZNK11HsMenuEvent9operationEv @ 223 NONAME + _ZNK15HsPageIndicator10metaObjectEv @ 224 NONAME + _ZNK15HsPageIndicator15activeItemIndexEv @ 225 NONAME + _ZNK15HsPageIndicator18isAnimationRunningEv @ 226 NONAME + _ZNK15HsPageIndicator9itemCountEv @ 227 NONAME + _ZNK15HsSpinnerDialog10metaObjectEv @ 228 NONAME + _ZNK15HsTitleResolver10metaObjectEv @ 229 NONAME + _ZNK16HsTrashBinWidget10metaObjectEv @ 230 NONAME + _ZNK17HsImageGridWidget10metaObjectEv @ 231 NONAME + _ZNK19HsMenuDialogFactory12setUpActionsEP12HbMessageBoxRK11QStringList @ 232 NONAME + _ZNK19HsMenuDialogFactory6createERK7QStringNS_7OptionsE @ 233 NONAME + _ZNK19HsMessageBoxWrapper10metaObjectEv @ 234 NONAME + _ZNK19XQAIWGetImageClient10metaObjectEv @ 235 NONAME + _ZNK21HsImageHandlingClient10metaObjectEv @ 236 NONAME + _ZNK26HsPropertyAnimationWrapper10metaObjectEv @ 237 NONAME + _ZNK26HsPropertyAnimationWrapper9isForwardEv @ 238 NONAME + _ZTI10HsSnapLine @ 239 NONAME + _ZTI11HsMenuEvent @ 240 NONAME + _ZTI13HsSnapToLines @ 241 NONAME + _ZTI15HsPageIndicator @ 242 NONAME + _ZTI15HsSpinnerDialog @ 243 NONAME + _ZTI15HsTitleResolver @ 244 NONAME + _ZTI16HsTrashBinWidget @ 245 NONAME + _ZTI17HsImageGridWidget @ 246 NONAME + _ZTI19HsMenuDialogFactory @ 247 NONAME + _ZTI19HsMessageBoxWrapper @ 248 NONAME + _ZTI19XQAIWGetImageClient @ 249 NONAME + _ZTI21HsImageHandlingClient @ 250 NONAME + _ZTI21HsMenuEventTransition @ 251 NONAME + _ZTI26HsPropertyAnimationWrapper @ 252 NONAME + _ZTI31HsWidgetPositioningOnWidgetMove @ 253 NONAME + _ZTI38HsWidgetPositioningOnOrientationChange @ 254 NONAME + _ZTI46HsAdvancedWidgetPositioningOnOrientationChange @ 255 NONAME + _ZTV10HsSnapLine @ 256 NONAME + _ZTV11HsMenuEvent @ 257 NONAME + _ZTV13HsSnapToLines @ 258 NONAME + _ZTV15HsPageIndicator @ 259 NONAME + _ZTV15HsSpinnerDialog @ 260 NONAME + _ZTV15HsTitleResolver @ 261 NONAME + _ZTV16HsTrashBinWidget @ 262 NONAME + _ZTV17HsImageGridWidget @ 263 NONAME + _ZTV19HsMenuDialogFactory @ 264 NONAME + _ZTV19HsMessageBoxWrapper @ 265 NONAME + _ZTV19XQAIWGetImageClient @ 266 NONAME + _ZTV21HsImageHandlingClient @ 267 NONAME + _ZTV21HsMenuEventTransition @ 268 NONAME + _ZTV26HsPropertyAnimationWrapper @ 269 NONAME + _ZTV46HsAdvancedWidgetPositioningOnOrientationChange @ 270 NONAME + _ZThn16_N15HsPageIndicatorD0Ev @ 271 NONAME + _ZThn16_N15HsPageIndicatorD1Ev @ 272 NONAME + _ZThn16_N15HsSpinnerDialogD0Ev @ 273 NONAME + _ZThn16_N15HsSpinnerDialogD1Ev @ 274 NONAME + _ZThn16_N16HsTrashBinWidgetD0Ev @ 275 NONAME + _ZThn16_N16HsTrashBinWidgetD1Ev @ 276 NONAME + _ZThn16_N17HsImageGridWidgetD0Ev @ 277 NONAME + _ZThn16_N17HsImageGridWidgetD1Ev @ 278 NONAME + _ZThn8_N10HsSnapLineD0Ev @ 279 NONAME + _ZThn8_N10HsSnapLineD1Ev @ 280 NONAME + _ZThn8_N15HsPageIndicatorD0Ev @ 281 NONAME + _ZThn8_N15HsPageIndicatorD1Ev @ 282 NONAME + _ZThn8_N15HsSpinnerDialogD0Ev @ 283 NONAME + _ZThn8_N15HsSpinnerDialogD1Ev @ 284 NONAME + _ZThn8_N16HsTrashBinWidgetD0Ev @ 285 NONAME + _ZThn8_N16HsTrashBinWidgetD1Ev @ 286 NONAME + _ZThn8_N17HsImageGridWidgetD0Ev @ 287 NONAME + _ZThn8_N17HsImageGridWidgetD1Ev @ 288 NONAME diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/hsutils.pro --- a/homescreenapp/hsutils/hsutils.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsutils/hsutils.pro Mon Sep 20 10:19:07 2010 +0300 @@ -34,6 +34,8 @@ symbian: { TARGET.UID3 = 0x20022F3C LIBS+=-lxqservice -lxqserviceutil + + MMP_RULES += SMPSAFE } include(hsutils.pri) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/inc/hsimagefetcherclient.h --- a/homescreenapp/hsutils/inc/hsimagefetcherclient.h Mon Sep 13 13:03:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +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: -* -*/ - -#ifndef HSIMAGEFETCHERCLIENT_H -#define HSIMAGEFETCHERCLIENT_H - -#include - -#ifdef Q_OS_SYMBIAN -#include -#include -#endif // Q_OS_SYMBIAN - -#include "hsutils_global.h" - -class HSUTILS_EXPORT HsImageFetcherClient : public QObject -{ - Q_OBJECT - -public: - HsImageFetcherClient(QObject *parent = 0); - ~HsImageFetcherClient(); - -public slots: - void fetch(); - -private slots: - // Aiw request responses - void handleOk(const QVariant &result); - void handleError(int errorCode, const QString &errorMessage); - -signals: - void fetchCompleted(const QString &imageFile); - void fetchFailed(int errorCode, const QString &errorMessage); - -private: - Q_DISABLE_COPY(HsImageFetcherClient) - -#ifdef Q_OS_SYMBIAN - XQApplicationManager mAppMgr; - XQAiwRequest *mReq; -#endif // Q_OS_SYMBIAN -}; - -#endif // HSIMAGEFETCHERCLIENT_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/inc/hsimagehandlingclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/inc/hsimagehandlingclient.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef HSIMAGEHANDLINGCLIENT_H +#define HSIMAGEHANDLINGCLIENT_H + +#include + +#ifdef Q_OS_SYMBIAN +#include +#include +#endif // Q_OS_SYMBIAN + +#include "hsutils_global.h" + +class HSUTILS_EXPORT HsImageHandlingClient : public QObject +{ + Q_OBJECT + +public: + HsImageHandlingClient(QObject *parent = 0); + ~HsImageHandlingClient(); + +public slots: + void fetch(); + void edit(const QString &imagePath); + +private slots: + // Aiw request responses + void handleOk(const QVariant &result); + void handleError(int errorCode, const QString &errorMessage); + void handleEditorOk(const QVariant& result); + void handleEditorError(int errorCode, const QString &errorMessage); + +signals: + void fetchCompleted(const QString &imageFile); + void fetchFailed(int errorCode, const QString &errorMessage); + void editorCompleted(); + void editorFailed(int errorCode, const QString &errorMessage); + +private: + Q_DISABLE_COPY(HsImageHandlingClient) + +#ifdef Q_OS_SYMBIAN + XQApplicationManager mAppMgr; + XQAiwRequest *mReq; +#endif // Q_OS_SYMBIAN +}; + +#endif // HSIMAGEHANDLINGCLIENT_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/inc/hsmenudialogfactory.h --- a/homescreenapp/hsutils/inc/hsmenudialogfactory.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsutils/inc/hsmenudialogfactory.h Mon Sep 20 10:19:07 2010 +0300 @@ -35,6 +35,8 @@ virtual HbMessageBox *create(const QString &text, Options options = OkCancel) const; virtual ~HsMenuDialogFactory(); + static int acceptActionIndex(); + static int rejectActionIndex(); private: void setUpActions(HbMessageBox *box, const QStringList &translationIdentifiers) const; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/inc/hsmenuevent.h --- a/homescreenapp/hsutils/inc/hsmenuevent.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsutils/inc/hsmenuevent.h Mon Sep 20 10:19:07 2010 +0300 @@ -44,6 +44,7 @@ UninstallApplication, OpenApplicationLibrary, OpenInstalledView, + BackFromInstalledView, OpenHomeScreen, ArrangeCollection, ArrangeAllCollections, diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/inc/hsmenueventfactory.h --- a/homescreenapp/hsutils/inc/hsmenueventfactory.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsutils/inc/hsmenueventfactory.h Mon Sep 20 10:19:07 2010 +0300 @@ -38,7 +38,9 @@ public: - static QEvent *createAddToHomeScreenEvent(int entryId, Hs::HsMenuMode menuMode, QVariant homescreenData = NULL); + static QEvent *createAddToHomeScreenEvent(int entryId, + Hs::HsMenuMode menuMode, + QVariant homescreenData = NULL); static QEvent *createOpenCollectionEvent(int itemId, const QString &collectionType); @@ -53,9 +55,16 @@ static QEvent *createDeleteCollectionEvent(int aItemId); static QEvent *createOpenAppLibraryEvent( - Hs::HsMenuMode menuMode = Hs::NormalHsMenuMode, QVariant homescreenData = NULL); + Hs::HsMenuMode menuMode = Hs::NormalHsMenuMode, + QVariant homescreenData = NULL); + + static QEvent *createBackFromInstalledViewEvent( + int id, + QString collectionType); - static QEvent *createOpenInstalledViewEvent(); + static QEvent *createOpenInstalledViewEvent( + int id = 0, + QString collectionType = ""); static QEvent *createOpenHomeScreenEvent(); diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/inc/hswidgetpositioningonwidgetadd.h --- a/homescreenapp/hsutils/inc/hswidgetpositioningonwidgetadd.h Mon Sep 13 13:03:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +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: -* -*/ - -#ifndef HSWIDGETPOSITIONINGONWIDGETADD_H -#define HSWIDGETPOSITIONINGONWIDGETADD_H - -#include -#include -#include -#include "hsutils_global.h" - -class HsWidgetHost; - -class HSUTILS_EXPORT HsWidgetPositioningOnWidgetAdd -{ -public: - virtual ~HsWidgetPositioningOnWidgetAdd() {} - - virtual QList convert(const QRectF &contentArea, - const QList &existingRects, - const QList &newRects, - const QPointF &startPoint) = 0; - - static void setInstance(HsWidgetPositioningOnWidgetAdd *instance); - static HsWidgetPositioningOnWidgetAdd *instance(); - -private: - static HsWidgetPositioningOnWidgetAdd *mInstance; -}; - -class HSUTILS_EXPORT HsAnchorPointInBottomRight : public HsWidgetPositioningOnWidgetAdd -{ -public: - QList convert(const QRectF &contentArea, - const QList &existingRects, - const QList &newRects, - const QPointF &startPoint); - -}; - -class HSUTILS_EXPORT HsAnchorPointInCenter : public HsWidgetPositioningOnWidgetAdd -{ -public: - QList convert(const QRectF &contentArea, - 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 e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/src/hsimagefetcherclient.cpp --- a/homescreenapp/hsutils/src/hsimagefetcherclient.cpp Mon Sep 13 13:03:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +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: Photos image fetcher client. -* -*/ - - -#include "hsimagefetcherclient.h" - -#include -#include -#include -#ifdef Q_OS_SYMBIAN -#include -#include -#endif // Q_OS_SYMBIAN - -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT - - -/*! - \class HsImageFetcherClient - \ingroup group_hsutils - \brief -*/ - -// --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- -// -#ifdef Q_OS_SYMBIAN -HsImageFetcherClient::HsImageFetcherClient(QObject *parent) - : QObject(parent), - mReq(0) -{ -} -#else -HsImageFetcherClient::HsImageFetcherClient(QObject *parent) - : QObject(parent) -{ -} -#endif // Q_OS_SYMBIAN - -// --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- -// -HsImageFetcherClient::~HsImageFetcherClient() -{ -#ifdef Q_OS_SYMBIAN - delete mReq; -#endif // Q_OS_SYMBIAN -} - -// --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- -// -void HsImageFetcherClient::fetch() -{ -#ifdef Q_OS_SYMBIAN - qDebug() << "HsImageFetcherClient::fetch START"; - - if (mReq) { - delete mReq; - mReq = 0; - } - - mReq = mAppMgr.create(XQI_IMAGE_FETCH, XQOP_IMAGE_FETCH, false); - if (mReq) { - connect(mReq, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&))); - connect(mReq, SIGNAL(requestError(int,const QString&)), this, SLOT(handleError(int,const QString&))); - } else { - qCritical() << "HsImageFetcherClient::fetch -> Create request failed"; - return; - } - - if (!(mReq)->send()) { - qCritical() << "HsImageFetcherClient::fetch -> Send failed" << mReq->lastErrorMessage();; - } - - qDebug() << "HsImageFetcherClient::fetch END"; -#endif // Q_OS_SYMBIAN -} - - - -// Aiw request responses -void HsImageFetcherClient::handleOk(const QVariant &result) -{ -#ifdef Q_OS_SYMBIAN - // disconnect error signal as it will give -4999 (EConnectionClosed) error afterwards even though image - // is fetched successfully - disconnect(mReq, SIGNAL(requestError(int,const QString&)), this, SLOT(handleError(int,const QString&))); - - XQAiwRequest *request = static_cast(sender()); - int implementationId=-1; - implementationId = (request->descriptor().property(XQAiwInterfaceDescriptor::ImplementationId)).toInt(); - - if (result.canConvert()) { - qDebug("HsImageFetcherClient::%x:handleOk result=%s,%s", - implementationId, - result.typeName(), - qPrintable(result.value())); - - emit fetchCompleted(result.value()); - } else if (result.canConvert()) { - QStringList resultList = result.value(); - if (resultList.size() > 0) { - //for debug - QString msg = QString("HsImageFetcherClient::handleOk, size=")+QString::number( resultList.size() )+QString("\n"); - for (int i(0), size(resultList.size()); i < size; ++i) { - msg += QString::number(i) + QString(":") + resultList[i] + QString("\n"); - } - qDebug()<(sender()); - int implementationId = -1; - implementationId = (request->descriptor().property(XQAiwInterfaceDescriptor::ImplementationId)).toInt(); - - qCritical("HsImageFetcherClient::%x:handleError code=%d, errorMessage:%s", - implementationId, errorCode, qPrintable(errorMessage)); - emit fetchFailed(errorCode, errorMessage); -#else - Q_UNUSED(errorCode) - Q_UNUSED(errorMessage) -#endif // Q_OS_SYMBIAN -} - -#ifdef COVERAGE_MEASUREMENT -#pragma CTC ENDSKIP -#endif //COVERAGE_MEASUREMENT diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/src/hsimagehandlingclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/src/hsimagehandlingclient.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,211 @@ +/* +* 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 handling client. +* +*/ + + +#include "hsimagehandlingclient.h" + +#include +#include +#include +#ifdef Q_OS_SYMBIAN +#include +#include +#endif // Q_OS_SYMBIAN +#ifdef FF_IMAGE_EDITOR +#include +#endif //FF_IMAGE_EDITOR + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT + + +/*! + \class HsImageHandlingClient + \ingroup group_hsutils + \brief +*/ + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +#ifdef Q_OS_SYMBIAN +HsImageHandlingClient::HsImageHandlingClient(QObject *parent) + : QObject(parent), + mReq(0) +{ +} +#else +HsImageHandlingClient::HsImageHandlingClient(QObject *parent) + : QObject(parent) +{ +} +#endif // Q_OS_SYMBIAN + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +HsImageHandlingClient::~HsImageHandlingClient() +{ +#ifdef Q_OS_SYMBIAN + delete mReq; +#endif // Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void HsImageHandlingClient::fetch() +{ +#ifdef Q_OS_SYMBIAN + qDebug() << "HsImageHandlingClient::fetch START"; + + if (mReq) { + delete mReq; + mReq = 0; + } + + mReq = mAppMgr.create(XQI_IMAGE_FETCH, XQOP_IMAGE_FETCH, false); + if (mReq) { + connect(mReq, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&))); + connect(mReq, SIGNAL(requestError(int,const QString&)), this, SLOT(handleError(int,const QString&))); + } else { + qCritical() << "HsImageHandlingClient::fetch -> Create request failed"; + return; + } + + if (!(mReq)->send()) { + qCritical() << "HsImageHandlingClient::fetch -> Send failed" << mReq->lastErrorMessage();; + } + + qDebug() << "HsImageHandlingClient::fetch END"; +#endif // Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void HsImageHandlingClient::edit(const QString &imagePath) +{ +#ifdef Q_OS_SYMBIAN + qDebug() << "HsImageHandlingClient::edit START"; + + const QString service = QLatin1String("PhotoEditor"); + const QString interface = QLatin1String("com.nokia.symbian.imageeditor"); + const QString operation = QLatin1String("view(QString,int)"); + + //Connect to service provider + if(mReq == NULL){ + mReq = mAppMgr.create(service, interface, operation, true); + mReq->setEmbedded(true); + mReq->setSynchronous(false); + } + + if(mReq == NULL){ + return; + } + + if (mReq) { + connect(mReq, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleEditorOk(const QVariant&))); + connect(mReq, SIGNAL(requestError(int,const QString&)), this, SLOT(handleEditorError(int,const QString&))); + } else { + qCritical() << "HsImageHandlingClient::edit -> Create request failed"; + return; + } + QList args; + args << imagePath; + args << EEditorHighwayWallpaperCrop; + mReq->setArguments(args); + if (!(mReq)->send()) { + qCritical() << "HsImageHandlingClient::edit -> Send failed" << mReq->lastErrorMessage();; + } + + qDebug() << "HsImageHandlingClient::edit END"; +#endif // Q_OS_SYMBIAN +} + +// Aiw request responses +void HsImageHandlingClient::handleOk(const QVariant &result) +{ +#ifdef Q_OS_SYMBIAN + // disconnect error signal as it will give -4999 (EConnectionClosed) error afterwards even though image + // is fetched successfully + disconnect(mReq, SIGNAL(requestError(int,const QString&)), this, SLOT(handleError(int,const QString&))); + + XQAiwRequest *request = static_cast(sender()); + int implementationId=-1; + implementationId = (request->descriptor().property(XQAiwInterfaceDescriptor::ImplementationId)).toInt(); + + if (result.canConvert()) { + qDebug("HsImageHandlingClient::%x:handleOk result=%s,%s", + implementationId, + result.typeName(), + qPrintable(result.value())); + + emit fetchCompleted(result.value()); + } else if (result.canConvert()) { + QStringList resultList = result.value(); + if (resultList.size() > 0) { + //for debug + QString msg = QString("HsImageHandlingClient::handleOk, size=")+QString::number( resultList.size() )+QString("\n"); + for (int i(0), size(resultList.size()); i < size; ++i) { + msg += QString::number(i) + QString(":") + resultList[i] + QString("\n"); + } + qDebug()<(sender()); + int implementationId = -1; + implementationId = (request->descriptor().property(XQAiwInterfaceDescriptor::ImplementationId)).toInt(); + + qCritical("HsImageHandlingClient::%x:handleError code=%d, errorMessage:%s", + implementationId, errorCode, qPrintable(errorMessage)); + emit fetchFailed(errorCode, errorMessage); +#else + Q_UNUSED(errorCode) + Q_UNUSED(errorMessage) +#endif // Q_OS_SYMBIAN +} + +void HsImageHandlingClient::handleEditorOk(const QVariant& result) +{ + Q_UNUSED(result) + emit editorCompleted(); +} + +void HsImageHandlingClient::handleEditorError(int errorCode, + const QString& errorMessage) +{ + emit editorFailed(errorCode, errorMessage); +} +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/src/hsmenudialogfactory.cpp --- a/homescreenapp/hsutils/src/hsmenudialogfactory.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsutils/src/hsmenudialogfactory.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -108,3 +108,14 @@ box->addAction(action.take()); } } + +int HsMenuDialogFactory::acceptActionIndex() +{ + return 0; +} + +int HsMenuDialogFactory::rejectActionIndex() +{ + return 1; +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/src/hsmenueventfactory.cpp --- a/homescreenapp/hsutils/src/hsmenueventfactory.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsutils/src/hsmenueventfactory.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -135,7 +135,7 @@ */ QEvent *HsMenuEventFactory::createOpenAppLibraryEvent( Hs::HsMenuMode menuMode, - QVariant homescreenData) + QVariant homescreenData) { QVariantMap params; params.insert(Hs::menuModeType, menuMode); @@ -144,13 +144,31 @@ } /*! - Creates an HsMenuEvent::OpenApplicationLibrary event. + Creates an HsMenuEvent::BackFromInstalledView event. - \return Open Applications Library event. + \return Back from installed view event. */ -QEvent *HsMenuEventFactory::createOpenInstalledViewEvent() +QEvent *HsMenuEventFactory::createBackFromInstalledViewEvent( + int id, QString collectionType) { - return new HsMenuEvent(HsMenuEvent::OpenInstalledView); + QVariantMap params; + params.insert(Hs::itemIdKey, id); + params.insert(Hs::entryTypeNameKey, collectionType); + return new HsMenuEvent(HsMenuEvent::BackFromInstalledView, params); +} + +/*! + Creates an HsMenuEvent::OpenInstalledView event. + + \return Open Installed View event. + */ +QEvent *HsMenuEventFactory::createOpenInstalledViewEvent( + int id, QString collectionType) +{ + QVariantMap params; + params.insert(Hs::itemIdKey, id); + params.insert(Hs::entryTypeNameKey, collectionType); + return new HsMenuEvent(HsMenuEvent::OpenInstalledView, params); } /*! @@ -211,7 +229,8 @@ Creates an HsMenuEvent::RemoveAppFromCollection event. \param aItemId Item id of the application to be removed from a collection. - \param aCollectionId Item id of the collection the application is to be removed from. + \param aCollectionId Item id of the collection the application is to be + removed from. \return RemoveAppFromCollection event. */ QEvent *HsMenuEventFactory::createRemoveAppFromCollectionEvent(int aItemId, @@ -227,7 +246,8 @@ Creates an HsMenuEvent::UninstallApplication event. \param aItemId Item id of the application to be removed from a collection. - \param aCollectionId Item id of the collection the application is to be removed from. + \param aCollectionId Item id of the collection the application is to be + removed from. \return UninstallApplication event. */ QEvent *HsMenuEventFactory::createUninstallApplicationEvent(int aItemId) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/src/hswidgetpositioningonwidgetadd.cpp --- a/homescreenapp/hsutils/src/hswidgetpositioningonwidgetadd.cpp Mon Sep 13 13:03:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,454 +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: -* -*/ - -#include -#include -#include -#include - -#include - - -#include "hswidgetpositioningonwidgetadd.h" - -const qreal offset = 40; //TODO: Implement this as configurable parameter - - -/*! - \class HsWidgetPositioningOnWidgetAdd - \ingroup group_hsutils - \brief -*/ - -/*! - \class HsWidgetPositioningOnWidgetAdd - \brief Defines widget positioning on widget add. - - Widget positioning on widget add sets positions for - a set of home screen widgets added from application library. -*/ - -/*! - Sets the positioning \a instance as the current one. - Deletes the existing instance if present. -*/ -void HsWidgetPositioningOnWidgetAdd::setInstance( - HsWidgetPositioningOnWidgetAdd *instance) -{ - if (mInstance) - delete mInstance; - mInstance = instance; -} - -/*! - Returns the current positioning instance. -*/ -HsWidgetPositioningOnWidgetAdd *HsWidgetPositioningOnWidgetAdd::instance() -{ - return mInstance; -} - -/*! - Stores the current positioning instance. -*/ -HsWidgetPositioningOnWidgetAdd *HsWidgetPositioningOnWidgetAdd::mInstance = 0; - -/*! - \class HsAnchorPointInBottomRight - \brief Diagonal widget positioning algorithm. - - Sets widget's lower right corner to follow content area's diagonal. - Widgets are positioned to certain offset to each other. -*/ -QList HsAnchorPointInBottomRight::convert( - const QRectF &contentArea, - const QList &existingRects, - const QList &newRects, - const QPointF &startPoint) -{ - Q_UNUSED(existingRects); - - QList toGeometries; - - //Offset for widgets' bottom right position to each other - qreal k = contentArea.height()/contentArea.width(); //slope of the diagonal - qreal offset_x = offset/(sqrt(k + 1)); - qreal offset_y = k*offset_x; - QPointF offsetPoint(offset_x, offset_y); - - QPointF anchorPoint; - - if(startPoint.isNull()){ - - QLineF diagonal(contentArea.topLeft(), contentArea.bottomRight()); - QLineF widgetRightSide(contentArea.center().x()+ newRects.at(0).width()/2, - contentArea.top(), - 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 newRects; //Return original since undefined error. - //In this case widget's must be wider than the content area. - } - }else{ - anchorPoint = startPoint - offsetPoint; - } - - QRectF widgetRect; - for(int i=0;i HsAnchorPointInCenter::convert( - const QRectF &contentArea, - const QList &existingRects, - const QList &newRects, - const QPointF &startPoint ) -{ - Q_UNUSED(existingRects); - Q_UNUSED(startPoint) - - QList toGeometries; - - //Offset for widgets' centers position to each other - qreal k = contentArea.height()/contentArea.width(); //slope of the diagonal - qreal offset_x = offset/(sqrt(k + 1)); - qreal offset_y = k*offset_x; - QPointF offsetPoint(offset_x, offset_y); - - //First widget to the center of the content area - QPointF anchorPoint = contentArea.center(); - foreach (QRectF g, newRects) { - g.moveCenter(anchorPoint); - toGeometries << g; - anchorPoint -= offsetPoint; - if(!contentArea.contains(anchorPoint)) { - anchorPoint = contentArea.bottomRight(); - } - } - 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; - delete centerAlgorithm; - } - - 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++) { - 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++) { - for (int j = mStartWidthAnchorPoint.y(); j <= (mStartWidthAnchorPoint.y() + contentHeight); 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 -#endif //COVERAGE_MEASUREMENT - diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/src/hswidgetpositioningonwidgetmove.cpp --- a/homescreenapp/hsutils/src/hswidgetpositioningonwidgetmove.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hsutils/src/hswidgetpositioningonwidgetmove.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -488,14 +488,10 @@ */ 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())); - } + qreal top = qMin( mInactiveRectToCompare.top(), mMovingRect.top()); + qreal bottom = qMax(mInactiveRectToCompare.bottom(), mMovingRect.bottom()); + mVerticalLine.setP1(QPointF(mMinDistancePosition, top)); + mVerticalLine.setP2(QPointF(mMinDistancePosition, bottom)); } /*! @@ -785,16 +781,10 @@ */ 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)); - } + qreal left = qMin( mInactiveRectToCompare.left(), mMovingRect.left()); + qreal right = qMax(mInactiveRectToCompare.right(), mMovingRect.right()); + mHorizontalLine.setP1(QPointF(left, mMinDistancePosition)); + mHorizontalLine.setP2(QPointF(right, mMinDistancePosition)); } /*! diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/inc/mocksysteminfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/inc/mocksysteminfo.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,123 @@ +/* +* 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: Mock implementation for system info for testing +* +*/ + + + + +#ifndef QSYSTEMINFO_H +#define QSYSTEMINFO_H + +#include +#include +#include +#include +#include + +class QSystemNetworkInfo : public QObject +{ + Q_OBJECT + Q_ENUMS(NetworkStatus) + Q_ENUMS(NetworkMode) + + +public: + + QSystemNetworkInfo(QObject *parent = 0); + ~QSystemNetworkInfo(); + + enum NetworkStatus { + UndefinedStatus = 0, + NoNetworkAvailable, + EmergencyOnly, + Searching, + Busy, + Connected, + HomeNetwork, + Denied, + Roaming + }; + + enum NetworkMode { + UnknownMode=0, + GsmMode, + CdmaMode, + WcdmaMode, + WlanMode, + EthernetMode, + BluetoothMode, + WimaxMode + }; + Q_DECLARE_FLAGS(NetworkModes, NetworkMode) + + QSystemNetworkInfo::NetworkStatus networkStatus(QSystemNetworkInfo::NetworkMode mode); + static int networkSignalStrength(QSystemNetworkInfo::NetworkMode mode); + static QString networkName(QSystemNetworkInfo::NetworkMode mode); + +signals: + void networkStatusChanged(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus); + void networkNameChanged(QSystemNetworkInfo::NetworkMode,const QString &); + void networkModeChanged(QSystemNetworkInfo::NetworkMode); +private: +}; + + +class QSystemDeviceInfo : public QObject +{ + Q_OBJECT + Q_PROPERTY(Profile currentProfile READ currentProfile) + Q_PROPERTY(SimStatus simStatus READ simStatus) + + Q_ENUMS(SimStatus) + Q_ENUMS(Profile) + +public: + + QSystemDeviceInfo(QObject *parent = 0); + virtual ~QSystemDeviceInfo(); + + enum Profile { + UnknownProfile = 0, + SilentProfile, + NormalProfile, + LoudProfile, + VibProfile, + OfflineProfile, + PowersaveProfile, + CustomProfile + }; + + enum SimStatus { + SimNotAvailable = 0, + SingleSimAvailable, + DualSimAvailable, + SimLocked + }; + + QSystemDeviceInfo::SimStatus simStatus(); + QSystemDeviceInfo::Profile currentProfile(); + +signals: + void currentProfileChanged(QSystemDeviceInfo::Profile); + +private: +}; + + +#endif /*QSYSTEMSINFO_H*/ + +// End of file + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/inc/t_hsutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/inc/t_hsutils.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,157 @@ +/* +* 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: Test class for homescreen::hsutils +* +*/ + +#include +#include +#include +#include +#include +#include +#include "hswidgetpositioningonwidgetmove.h" + +/** +* @test Test class for homescreen::hsutils modules. +*/ +class t_hsUtils : public QObject +{ + Q_OBJECT + +private slots: + + /** + * + */ + void initTestCase(); + +#ifndef ONLY_MENU_TESTCASES + /** + * t_hswidgetpositioningonorientationchange.cpp + */ + void testWidgetPositioningOnOrientationChangeInstance(); + void testAdvancedWidgetPositioningOnOrientationChange_data(); + void testAdvancedWidgetPositioningOnOrientationChange(); + + /** + * t_hswidgetpositioningonwidgetmove.cpp + */ + void testWidgetPositioningOnWidgetMoveInstance(); + void testHsSnapToLinesConstruct(); + void testHsSnapToLines_data(); + void testHsSnapToLines(); + void testHsSnapToLinesSnapDisabled_data(); + void testHsSnapToLinesSnapDisabled(); + + + /** + * t_hspageindicator.cpp + */ + void testPageIndicatorConstruction(); + void testPageIndicatorActiveItem(); + void testPageIndicatorAddRemoveItem(); + void testPageIndicatorAnimations(); + + /** + * t_trashbinwidget.cpp + */ + void testTrashbinWidgetConstruct(); + void testTrashbinWidgetActivation(); + + /** + * t_hssnapline.cpp + */ + void testSnapLineConstruction(); + void testSnapLineSetConfiguration(); + void testShowAndHideHorizontalLine(); + void testShowAndHideVerticalLine(); + void testHideHorizontalLineWhileFadeInAnimationRunning(); + void testHideVerticalLineWhileFadeInAnimationRunning(); + void testShowHorizontalLineWhileFadeOutAnimationRunning(); + void testShowVerticalLineWhileFadeOutAnimationRunning(); + void testShowHorizontalLineAtNewPositionWhileFadeOutAnimationRunning(); + void testShowVerticalLineAtNewPositionWhileFadeOutAnimationRunning(); + + /** + * t_titleresolver.cpp + */ + void testTitleResolver(); + void testTitleResolverOnStatusChanged(); + void testTitleResolverOnNetworkNameChanged(); + + /** + * t_hsdeviceinfolistener.cpp + */ + void testDeviceInfoListener(); + void testDeviceInfoListenerNetworkMode_data(); + void testDeviceInfoListenerNetworkMode(); + void testDeviceInfoListenerOfflineProfile(); + void testDeviceInfoListenerNetworkStatusChanged(); + void testDeviceInfoListenerNetworkNameChanged(); + void testDeviceInfoListenerNetworkCurrentProfileChanged(); + + /** + * t_hsspinnderdialog.cpp + */ + void testSpinnerDialog(); + /** + * t_hsmessageboxwrapper.cpp + */ + void testMessageBoxWrapper(); + /** + * t_hspropertyanimationwrapper.cpp + */ + void testPropertyAnimationWrapper(); + +#else // ONLY_MENU_TESTCASES + /** + * t_hsutils_menuevent.cpp + */ + void testMenuEventConstruction(); + void testMenuEventFactoryCreateAddToHomeScreenEvent(); + void testMenuEventFactoryCreatePreviewHSWidgetEvent(); + void testMenuEventFactoryCreateAppSettingsViewEvent(); + void testMenuEventFactoryCreateAppDetailsViewEvent(); + void testMenuEventFactoryCreateOpenCollectionEvent(); + void testMenuEventFactoryCreateOpenCollectionFromAppLibraryEvent(); + void testMenuEventFactoryCreateRenameCollectionEvent(); + void testMenuEventFactoryCreateNewCollectionEvent(); + void testMenuEventFactoryCreateDeleteCollectionEvent(); + void testMenuEventFactoryCreateCollectionDeletedEvent(); + void testMenuEventFactoryCreateBackFromInstalledViewEvent(); + void testMenuEventFactoryCreateOpenInstalledViewEvent(); + void testMenuEventFactorycCreateOpenAppLibraryEvent(); + void testMenuEventFactoryCreateAddAppsFromApplicationsViewEvent(); + void testMenuEventFactoryCreateAddAppsFromCallectionViewEvent(); + void testMenuEventFactoryCreateRemoveAppFromCollectionEvent(); + void testMenuEventFactoryCreateUninstallApplicationEvent(); + void testMenuEventFactoryCreateInstLogEvent(); + void testMenuEventFactoryCreateUnknownEvent(); + void testMenuEventFactoryOpenHSEvent(); + void testMenuEventTransitionConstruction(); + void testMenuEventTransitionTestCondition(); + void testMenuEventFactoryCreateArrangeCollectionEvent(); + void testMenuEventFactorycreateArrangeAllCollectionsEvent(); + void testMenuEventFactoryCreateUninstallFailedEvent(); + void testMenuDialogFactoryCreate(); +#endif // ONLY_MENU_TESTCASES + + void cleanupTestCase(); + +private: + bool hsLineCompare(QLineF l1, QLineF l2); + bool hsResultCompare(const HsWidgetPositioningOnWidgetMove::Result& sr1, const HsWidgetPositioningOnWidgetMove::Result& sr2); + +}; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/installs_win32.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,26 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +testfiles.path = ../../../../../bin/hstests/ +testfiles.files = ./debug/t_hsutils.exe \ + *.png \ + *.jpg + +testfiles2.path = ./debug/ +testfiles2.files = *.png \ + *.jpg + +INSTALLS += testfiles testfiles2 diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/sis/t_hsutils.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/sis/t_hsutils.pkg Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,36 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; + +; Language +&EN + +; SIS header: name, uid, version +#{"t_hsutils"},(0x20022F4F),1,0,0 + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Supports S60 5th Edition +[0x1028315F], 0, 0, 0, {"S60ProductID"} + +; HS Utils unittest +"/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" + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/sis/t_hsutils_sisx.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/sis/t_hsutils_sisx.bat Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,30 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem +@echo off + +if exist t_hsutils.sisx del t_hsutils.sisx + +makesis t_hsutils.pkg +signsis t_hsutils.sis t_hsutils.sisx ../../../../internal/sis/rd.cer ../../../../internal/sis/rd-key.pem + +if exist t_hsutils.sisx ( +echo t_hsutils.sisx creation SUCCEEDED +del t_hsutils.sis +) + +if not exist t_hsutils.sisx ( +echo t_hsutils.sisx creation FAILED +) \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/src/mocksysteminfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/src/mocksysteminfo.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,81 @@ +/* +* 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: Mock implementation for system info for testing +* +*/ + + +#include + +#include "mocksysteminfo.h" + + +QSystemNetworkInfo::QSystemNetworkInfo(QObject *parent) : QObject(parent) +{ +} +QSystemNetworkInfo::~QSystemNetworkInfo() +{ +} + +QSystemNetworkInfo::NetworkStatus QSystemNetworkInfo::networkStatus(QSystemNetworkInfo::NetworkMode mode) +{ +// property 'testNetworkMode' -> GsmMode / WcdmaMode, others return NoNetworkAvailable +// property 'testNetworkStatus' -> NoNetworkAvailable / Connected / HomeNetwork, others return NoNetworkAvailable + QSystemNetworkInfo::NetworkStatus networkStatus = NoNetworkAvailable; + int modeProperty = property("testNetworkMode").toInt(); + int statusProperty = property("testNetworkStatus").toInt(); + if ( modeProperty == mode ) { + networkStatus = (QSystemNetworkInfo::NetworkStatus) statusProperty; + } + return networkStatus; +} + +int QSystemNetworkInfo::networkSignalStrength(QSystemNetworkInfo::NetworkMode mode) +{ + Q_UNUSED(mode); + return -1; +} + +QString QSystemNetworkInfo::networkName(QSystemNetworkInfo::NetworkMode mode) +{ + Q_UNUSED(mode); + return QString("Testing"); +} + + +QSystemDeviceInfo::QSystemDeviceInfo(QObject *parent) : QObject(parent) +{ +} +QSystemDeviceInfo::~QSystemDeviceInfo() +{ +} + +QSystemDeviceInfo::SimStatus QSystemDeviceInfo::simStatus() +{ + if (property("simAvailable").toBool()) { + return SingleSimAvailable; + } + return SimNotAvailable; +} + +QSystemDeviceInfo::Profile QSystemDeviceInfo::currentProfile() +{ + if (property("offlineMode").toBool()) { + return OfflineProfile; + } + return NormalProfile; +} + +// End of file + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/src/t_hsdeviceinfolistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/src/t_hsdeviceinfolistener.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,172 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Test title resolver. +* +*/ + +#ifndef ONLY_MENU_TESTCASES + +#include "t_hsutils.h" +#include "hsdeviceinfolistener.h" + + +const QString KTestingOperatorName = QString("Testing"); +const QString KTestingOperatorName2 = QString("Testing2"); + + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testDeviceInfoListener() + { + HsDeviceInfoListener *infoListener = new HsDeviceInfoListener(); + QCOMPARE(infoListener->operatorName(), KTestingOperatorName); + QCOMPARE(infoListener->status(), HsDeviceInfoListener::NoService); + QCOMPARE(infoListener->networkStatus(), QSystemNetworkInfo::UndefinedStatus); + infoListener->mNetworkInfo->setProperty("testNetworkMode", QVariant((int)QSystemNetworkInfo::GsmMode)); + infoListener->mNetworkInfo->setProperty("testNetworkStatus", QVariant(QSystemNetworkInfo::Roaming)); + infoListener->updateCurrentNetworkMode(); + QCOMPARE(infoListener->networkStatus(), QSystemNetworkInfo::Roaming); + + delete infoListener; + } + +void t_hsUtils::testDeviceInfoListenerNetworkMode_data() + { + QTest::addColumn("Mode"); + QTest::addColumn("Status"); + QTest::addColumn("Expected"); + QTest::newRow("Gsm1") + << (int)QSystemNetworkInfo::GsmMode + << (int)QSystemNetworkInfo::NoNetworkAvailable + << (int)HsDeviceInfoListener::NoService; + QTest::newRow("Gsm2") + << (int)QSystemNetworkInfo::GsmMode + << (int)QSystemNetworkInfo::Connected + << (int)HsDeviceInfoListener::ServiceAvailable; + QTest::newRow("Gsm3") + << (int)QSystemNetworkInfo::GsmMode + << (int)QSystemNetworkInfo::HomeNetwork + << (int)HsDeviceInfoListener::ServiceAvailable; + QTest::newRow("Gsm4") + << (int)QSystemNetworkInfo::GsmMode + << (int)QSystemNetworkInfo::Roaming + << (int)HsDeviceInfoListener::ServiceAvailable; + QTest::newRow("Wcdma1") + << (int)QSystemNetworkInfo::WcdmaMode + << (int)QSystemNetworkInfo::NoNetworkAvailable + << (int)HsDeviceInfoListener::NoService; + QTest::newRow("Wcdma2") + << (int)QSystemNetworkInfo::WcdmaMode + << (int)QSystemNetworkInfo::Connected + << (int)HsDeviceInfoListener::ServiceAvailable; + QTest::newRow("Wcdma3") + << (int)QSystemNetworkInfo::WcdmaMode + << (int)QSystemNetworkInfo::HomeNetwork + << (int)HsDeviceInfoListener::ServiceAvailable; + QTest::newRow("Wcdma4") + << (int)QSystemNetworkInfo::WcdmaMode + << (int)QSystemNetworkInfo::Roaming + << (int)HsDeviceInfoListener::ServiceAvailable; + + } +void t_hsUtils::testDeviceInfoListenerNetworkMode() + { + QFETCH(int, Mode); + QFETCH(int, Status); + QFETCH(int, Expected); + + HsDeviceInfoListener *infoListener = new HsDeviceInfoListener(); + infoListener->mNetworkInfo->setProperty("testNetworkMode", QVariant(Mode)); + infoListener->mNetworkInfo->setProperty("testNetworkStatus", QVariant(Status)); + infoListener->updateCurrentNetworkMode(); + infoListener->updateStatus(); + QCOMPARE(infoListener->operatorName(), KTestingOperatorName); + QCOMPARE((int)infoListener->status(), Expected); + delete infoListener; + } + +void t_hsUtils::testDeviceInfoListenerOfflineProfile() + { + HsDeviceInfoListener *infoListener = new HsDeviceInfoListener(); + infoListener->mDeviceInfo->setProperty("offlineMode", QVariant(true)); + infoListener->updateCurrentNetworkMode(); + infoListener->updateStatus(); + + if (infoListener->simStatus() == QSystemDeviceInfo::SimNotAvailable) { + QCOMPARE(infoListener->status(), HsDeviceInfoListener::NoService); + } + else { + QCOMPARE(infoListener->status(), HsDeviceInfoListener::OfflineProfile); + } + delete infoListener; + } + +void t_hsUtils::testDeviceInfoListenerNetworkStatusChanged() + { + qRegisterMetaType( + "HsDeviceInfoListener::HsDeviceInfoStatus"); + + HsDeviceInfoListener *infoListener = new HsDeviceInfoListener(); + QSignalSpy spy(infoListener, SIGNAL(statusChanged(HsDeviceInfoListener::HsDeviceInfoStatus))); + + infoListener->onNetworkStatusChanged(QSystemNetworkInfo::GsmMode, QSystemNetworkInfo::Roaming); + QCOMPARE(spy.count(), 0); + + infoListener->mNetworkInfo->setProperty("testNetworkMode", QVariant((int)QSystemNetworkInfo::GsmMode)); + infoListener->mNetworkInfo->setProperty("testNetworkStatus", QVariant(QSystemNetworkInfo::Roaming)); + infoListener->onNetworkStatusChanged(QSystemNetworkInfo::GsmMode, QSystemNetworkInfo::Roaming); + QCOMPARE(spy.count(), 1); + + delete infoListener; + } + +void t_hsUtils::testDeviceInfoListenerNetworkNameChanged() + { + HsDeviceInfoListener *infoListener = new HsDeviceInfoListener(); + QSignalSpy spy(infoListener, SIGNAL(networkNameChanged(const QString &))); + + infoListener->onNetworkNameChanged(QSystemNetworkInfo::GsmMode, KTestingOperatorName2); + // this should not emit anything because UnknownMode + QCOMPARE(spy.count(), 0); + + infoListener->mNetworkInfo->setProperty("testNetworkMode", QVariant((int)QSystemNetworkInfo::GsmMode)); + infoListener->mNetworkInfo->setProperty("testNetworkStatus", QVariant(QSystemNetworkInfo::Roaming)); + infoListener->onNetworkNameChanged(QSystemNetworkInfo::GsmMode, KTestingOperatorName); + QCOMPARE(spy.count(), 1); + QList arguments = spy.takeFirst(); + QCOMPARE(arguments.at(0).toString(), KTestingOperatorName); + + delete infoListener; + } + +void t_hsUtils::testDeviceInfoListenerNetworkCurrentProfileChanged() + { + HsDeviceInfoListener *infoListener = new HsDeviceInfoListener(); + infoListener->mDeviceInfo->setProperty("offlineMode", QVariant(true)); + infoListener->updateCurrentNetworkMode(); + qRegisterMetaType( + "HsDeviceInfoListener::HsDeviceInfoStatus"); + QSignalSpy spy(infoListener, SIGNAL(statusChanged(HsDeviceInfoListener::HsDeviceInfoStatus))); + + infoListener->mDeviceInfo->setProperty("simAvailable", QVariant(true)); + if (infoListener->simStatus() != QSystemDeviceInfo::SimNotAvailable) { + infoListener->onCurrentProfileChanged(QSystemDeviceInfo::OfflineProfile); + QCOMPARE(spy.count(), 1); + } + delete infoListener; + } + +#endif // ONLY_MENU_TESTCASES diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/src/t_hsmenudialogfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/src/t_hsmenudialogfactory.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,54 @@ +/* +* 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: +* +*/ + +#include +#include + +#include +#include +#include +#include "hsmenudialogfactory.h" +#include "t_hsutils.h" + + +#ifdef ONLY_MENU_TESTCASES + +void t_hsUtils::testMenuDialogFactoryCreate() +{ + HsMenuDialogFactory hsMenuDialogFactory; + const QString message("testMessage"); + QScopedPointer box( + hsMenuDialogFactory.create(message, HsMenuDialogFactory::OkCancel)); + + QVERIFY(box); + QCOMPARE(box->text(), message); + QCOMPARE(box->actions().count(), 2); + QCOMPARE(box->actions().at(HsMenuDialogFactory::acceptActionIndex())->text(), + hbTrId("txt_common_button_ok")); + QCOMPARE(box->actions().at(HsMenuDialogFactory::rejectActionIndex())->text(), + hbTrId("txt_common_button_cancel")); + + box.reset( + hsMenuDialogFactory.create(message, HsMenuDialogFactory::Close)); + + QVERIFY(box); + QCOMPARE(box->text(), message); + QCOMPARE(box->actions().count(), 1); + QCOMPARE(box->actions().at(HsMenuDialogFactory::acceptActionIndex())->text(), + hbTrId("txt_common_button_close")); +} +#endif diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/src/t_hsmessageboxwrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/src/t_hsmessageboxwrapper.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,34 @@ +/* +* 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 ONLY_MENU_TESTCASES + +#include "t_hsutils.h" +#include "hsmessageboxwrapper.h" + + +void t_hsUtils::testMessageBoxWrapper() +{ + HsMessageBoxWrapper msgBox; + msgBox.setHeader("Why?"); + msgBox.setQueryText("Do You really want to do it?"); + + emit msgBox.accepted(); + emit msgBox.rejected(); +} + +#endif // ONLY_MENU_TESTCASES diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/src/t_hspageindicator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/src/t_hspageindicator.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,152 @@ +/* +* 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 ONLY_MENU_TESTCASES + +#include "t_hsutils.h" +#include "hspageindicator.h" +#include "hspageindicatoritem.h" + +#include +#include + +void t_hsUtils::testPageIndicatorConstruction() +{ + HsPageIndicator pi(8); + QCOMPARE(pi.itemCount(), 0); + QCOMPARE(pi.activeItemIndex(), -1); + + pi.initialize(-1, -1); + QCOMPARE(pi.itemCount(), 0); + QCOMPARE(pi.activeItemIndex(), -1); + + pi.initialize(0, -1); + QCOMPARE(pi.itemCount(), 0); + QCOMPARE(pi.activeItemIndex(), -1); + + pi.initialize(1, -1); + QCOMPARE(pi.itemCount(), 0); + QCOMPARE(pi.activeItemIndex(), -1); + + pi.initialize(1, 2); + QCOMPARE(pi.itemCount(), 0); + QCOMPARE(pi.activeItemIndex(), -1); + + pi.initialize(3, 1); + QCOMPARE(pi.itemCount(), 3); + QCOMPARE(pi.activeItemIndex(), 1); + + pi.initialize(3, 2); + QCOMPARE(pi.itemCount(), 3); + QCOMPARE(pi.activeItemIndex(), 2); +} + +void t_hsUtils::testPageIndicatorActiveItem() +{ + HsPageIndicator pi(8); + pi.initialize(3, 1); + QCOMPARE(pi.itemCount(), 3); + QCOMPARE(pi.activeItemIndex(), 1); + + pi.setActiveItemIndex(1); + QCOMPARE(pi.activeItemIndex(), 1); + + pi.setActiveItemIndex(0); + QCOMPARE(pi.activeItemIndex(), 0); + + pi.setActiveItemIndex(2); + QCOMPARE(pi.activeItemIndex(), 2); + + pi.setActiveItemIndex(-1); + QCOMPARE(pi.activeItemIndex(), 2); + + pi.setActiveItemIndex(3); + QCOMPARE(pi.activeItemIndex(), 2); + + QCOMPARE(pi.mItems.at(0)->isActive(), false); + QCOMPARE(pi.mItems.at(1)->isActive(), false); + QCOMPARE(pi.mItems.at(2)->isActive(), true); +} + +void t_hsUtils::testPageIndicatorAddRemoveItem() +{ + HsPageIndicator pi(8); + pi.initialize(3, 1); + QCOMPARE(pi.itemCount(), 3); + QCOMPARE(pi.activeItemIndex(), 1); + + pi.addItem(-1); + QCOMPARE(pi.itemCount(), 3); + QCOMPARE(pi.activeItemIndex(), 1); + + pi.addItem(4); + QCOMPARE(pi.itemCount(), 3); + QCOMPARE(pi.activeItemIndex(), 1); + + pi.addItem(0); + QCOMPARE(pi.itemCount(), 4); + QCOMPARE(pi.activeItemIndex(), 0); + + pi.addItem(4); + QCOMPARE(pi.itemCount(), 5); + QCOMPARE(pi.activeItemIndex(), 4); + + pi.addItem(6); + QCOMPARE(pi.itemCount(), 5); + QCOMPARE(pi.activeItemIndex(), 4); + + pi.removeItem(-1); + QCOMPARE(pi.itemCount(), 5); + QCOMPARE(pi.activeItemIndex(), 4); + + pi.removeItem(5); + QCOMPARE(pi.itemCount(), 5); + QCOMPARE(pi.activeItemIndex(), 4); + + pi.removeItem(4); + QCOMPARE(pi.itemCount(), 4); + QCOMPARE(pi.activeItemIndex(), 3); + + pi.removeItem(3); + QCOMPARE(pi.itemCount(), 3); + QCOMPARE(pi.activeItemIndex(), 2); + + pi.removeItem(0); + QCOMPARE(pi.itemCount(), 2); + QCOMPARE(pi.activeItemIndex(), 0); +} + +void t_hsUtils::testPageIndicatorAnimations() +{ + HsPageIndicator pi(8); + pi.initialize(3, 1); + pi.setSpacing(8); + + QCOMPARE(pi.isAnimationRunning(), false); + pi.setActiveItemIndex(0); + QCOMPARE(pi.isAnimationRunning(), true); + + int i = 5; + do { + QTest::qWait(1000); + } while (pi.isAnimationRunning() && --i); + if (!i) { + QFAIL("testPageIndicatorAnimations() failed"); + } +} + +#endif // ONLY_MENU_TESTCASES diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/src/t_hspropertyanimationwrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/src/t_hspropertyanimationwrapper.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef ONLY_MENU_TESTCASES + +#include "t_hsutils.h" +#include "hspropertyanimationwrapper.h" + +class TestObject: public QObject +{ + Q_OBJECT + Q_PROPERTY(int number READ number WRITE setNumber) +public: + TestObject(QObject *parent=0):QObject(parent),mNumber(0){} + int number()const { return mNumber; } + void setNumber(int num) {mNumber = num; } +private: + int mNumber; +}; +#include "t_hspropertyanimationwrapper.moc" + +void t_hsUtils::testPropertyAnimationWrapper() +{ + HsPropertyAnimationWrapper propertyAnimation; + TestObject target; + + propertyAnimation.setTargetObject(&target); + propertyAnimation.setDuration(1); + propertyAnimation.setEndValue(5); + propertyAnimation.setPropertyName("number"); + + QSignalSpy spy(&propertyAnimation,SIGNAL(finished())); + propertyAnimation.start(); + QTest::qWait(100); + + QVERIFY(!propertyAnimation.isRunning()); + QCOMPARE(spy.count(),1); + QVERIFY(target.number() == 5); + propertyAnimation.stop(); + + propertyAnimation.setForward(); + QVERIFY(propertyAnimation.isForward()); + + propertyAnimation.setBackward(); + QVERIFY(!propertyAnimation.isForward()); + + propertyAnimation.setEasingCurve(QEasingCurve::Linear); +} + +#endif // ONLY_MENU_TESTCASES diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/src/t_hssnapline.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/src/t_hssnapline.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,305 @@ +/* +* 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 ONLY_MENU_TESTCASES + +#include "t_hsutils.h" +#include "hssnapline.h" +#include "hsapp_defs.h" + +void t_hsUtils::testSnapLineConstruction() +{ + HsSnapLine sl = HsSnapLine(); + + QVERIFY(sl.mFadeInAnimation); + QVERIFY(sl.mFadeOutAnimation); + + QVERIFY(qFuzzyCompare(sl.mOpacity, 0)); + QCOMPARE(sl.mFadeInAnimationDuration,0); + QCOMPARE(sl.mFadeOutAnimationDuration,0); +} + +void t_hsUtils::testSnapLineSetConfiguration() +{ + HsSnapLine sl = HsSnapLine(); + QVariantHash configuration; + configuration[Hs::snapLineFadeinDuration] = QString::number(1000); + configuration[Hs::snapLineFadeoutDuration] = QString::number(500); + + sl.setConfiguration(configuration); + + QCOMPARE(sl.mFadeInAnimationDuration, 1000); + QCOMPARE(sl.mFadeOutAnimationDuration , 500); +} + +void t_hsUtils::testShowAndHideHorizontalLine() +{ + HsSnapLine slHorizontal = HsSnapLine(); + QVariantHash configuration; + configuration[Hs::snapLineFadeinDuration] = QString::number(1000); + configuration[Hs::snapLineFadeoutDuration] = QString::number(500); + + slHorizontal.setConfiguration(configuration); + + //before showing the line, no animation should be running + QVERIFY(!slHorizontal.isFadeInAnimationRunning()); + QVERIFY(!slHorizontal.isFadeOutAnimationRunning()); + + QLineF horizontalLine(QPointF(100,100), QPointF(200,100)); + slHorizontal.showLine(horizontalLine); + QVERIFY(slHorizontal.isFadeInAnimationRunning()); + QTest::qWait(2000); + QVERIFY(!slHorizontal.isFadeInAnimationRunning()); + + //before hiding the line, fade out animation should not be running + QVERIFY(!slHorizontal.isFadeOutAnimationRunning()); + + slHorizontal.hideLine(); + QVERIFY(slHorizontal.isFadeOutAnimationRunning()); + QTest::qWait(1000); + QVERIFY(!slHorizontal.isFadeOutAnimationRunning()); +} + +void t_hsUtils::testShowAndHideVerticalLine() +{ + HsSnapLine slVertical = HsSnapLine(); + QVariantHash configuration; + configuration[Hs::snapLineFadeinDuration] = QString::number(1000); + configuration[Hs::snapLineFadeoutDuration] = QString::number(500); + + slVertical.setConfiguration(configuration); + + //before showing the line, fade in animation should not be running + QVERIFY(!slVertical.isFadeInAnimationRunning()); + QVERIFY(!slVertical.isFadeOutAnimationRunning()); + + QLineF verticalLine(QPointF(100, 100), QPointF(100, 200)); + slVertical.showLine(verticalLine); + QVERIFY(slVertical.isFadeInAnimationRunning()); + QTest::qWait(2000); + QVERIFY(!slVertical.isFadeInAnimationRunning()); + + //before hiding the line, fade out animation should not be running + QVERIFY(!slVertical.isFadeOutAnimationRunning()); + + slVertical.hideLine(); + QVERIFY(slVertical.isFadeOutAnimationRunning()); + QTest::qWait(1000); + QVERIFY(!slVertical.isFadeOutAnimationRunning()); +} + +void t_hsUtils::testHideHorizontalLineWhileFadeInAnimationRunning() +{ + HsSnapLine slHorizontal = HsSnapLine(); + QVariantHash configuration; + configuration[Hs::snapLineFadeinDuration] = QString::number(1000); + configuration[Hs::snapLineFadeoutDuration] = QString::number(500); + + slHorizontal.setConfiguration(configuration); + + //before showing the line, no animation should be running + QVERIFY(!slHorizontal.isFadeInAnimationRunning()); + QVERIFY(!slHorizontal.isFadeOutAnimationRunning()); + + QLineF horizontalLine(QPointF(100,100), QPointF(200,100)); + slHorizontal.showLine(horizontalLine); + QVERIFY(slHorizontal.isFadeInAnimationRunning()); + //Wait only 250ms and call the hideLine() + QTest::qWait(250); + + //before hiding the line, fade out animation should not be running + QVERIFY(!slHorizontal.isFadeOutAnimationRunning()); + + slHorizontal.hideLine(); + QVERIFY(slHorizontal.isFadeOutAnimationRunning()); + QTest::qWait(1000); + QVERIFY(!slHorizontal.isFadeOutAnimationRunning()); +} + +void t_hsUtils::testHideVerticalLineWhileFadeInAnimationRunning() +{ + HsSnapLine slVertical = HsSnapLine(); + QVariantHash configuration; + configuration[Hs::snapLineFadeinDuration] = QString::number(1000); + configuration[Hs::snapLineFadeoutDuration] = QString::number(500); + + slVertical.setConfiguration(configuration); + + //before showing the line, fade in animation should not be running + QVERIFY(!slVertical.isFadeInAnimationRunning()); + QVERIFY(!slVertical.isFadeOutAnimationRunning()); + + QLineF verticalLine(QPointF(100, 100), QPointF(100, 200)); + slVertical.showLine(verticalLine); + QVERIFY(slVertical.isFadeInAnimationRunning()); + //Wait only 250ms and call the hideLine() + QTest::qWait(250); + + //before hiding the line, fade out animation should not be running + QVERIFY(!slVertical.isFadeOutAnimationRunning()); + + slVertical.hideLine(); + QVERIFY(slVertical.isFadeOutAnimationRunning()); + QTest::qWait(1000); + QVERIFY(!slVertical.isFadeOutAnimationRunning()); +} + +void t_hsUtils::testShowHorizontalLineWhileFadeOutAnimationRunning() +{ + HsSnapLine slHorizontal = HsSnapLine(); + QVariantHash configuration; + configuration[Hs::snapLineFadeinDuration] = QString::number(1000); + configuration[Hs::snapLineFadeoutDuration] = QString::number(500); + + slHorizontal.setConfiguration(configuration); + + //before showing the line, no animation should be running + QVERIFY(!slHorizontal.isFadeInAnimationRunning()); + QVERIFY(!slHorizontal.isFadeOutAnimationRunning()); + + QLineF horizontalLine(QPointF(100,100), QPointF(200,100)); + slHorizontal.showLine(horizontalLine); + QVERIFY(slHorizontal.isFadeInAnimationRunning()); + QTest::qWait(2000); + QVERIFY(!slHorizontal.isFadeInAnimationRunning()); + + //before hiding the line, fade out animation should not be running + QVERIFY(!slHorizontal.isFadeOutAnimationRunning()); + + slHorizontal.hideLine(); + QVERIFY(slHorizontal.isFadeOutAnimationRunning()); + //ShowLine is called to show the line at the same location, where the line was displayed before. + //Wait only 250ms and call the showline() + QTest::qWait(250); + + slHorizontal.showLine(horizontalLine); + QVERIFY(!slHorizontal.isFadeOutAnimationRunning()); + QVERIFY(slHorizontal.isFadeInAnimationRunning()); + QTest::qWait(2000); +} + +void t_hsUtils::testShowVerticalLineWhileFadeOutAnimationRunning() +{ + HsSnapLine slVertical = HsSnapLine(); + QVariantHash configuration; + configuration[Hs::snapLineFadeinDuration] = QString::number(1000); + configuration[Hs::snapLineFadeoutDuration] = QString::number(500); + + slVertical.setConfiguration(configuration); + + //before showing the line, fade in animation should not be running + QVERIFY(!slVertical.isFadeInAnimationRunning()); + QVERIFY(!slVertical.isFadeOutAnimationRunning()); + + QLineF verticalLine(QPointF(100, 100), QPointF(100, 200)); + slVertical.showLine(verticalLine); + QVERIFY(slVertical.isFadeInAnimationRunning()); + QTest::qWait(2000); + QVERIFY(!slVertical.isFadeInAnimationRunning()); + + //before hiding the line, fade out animation should not be running + QVERIFY(!slVertical.isFadeOutAnimationRunning()); + + slVertical.hideLine(); + QVERIFY(slVertical.isFadeOutAnimationRunning()); + //ShowLine is called to show the line at the same location, where the line was displayed before. + //Wait only 250ms and call the showline() + QTest::qWait(250); + + slVertical.showLine(verticalLine); + QVERIFY(!slVertical.isFadeOutAnimationRunning()); + QVERIFY(slVertical.isFadeInAnimationRunning()); + QTest::qWait(2000); +} + +void t_hsUtils::testShowHorizontalLineAtNewPositionWhileFadeOutAnimationRunning() +{ + HsSnapLine slHorizontal = HsSnapLine(); + QVariantHash configuration; + configuration[Hs::snapLineFadeinDuration] = QString::number(1000); + configuration[Hs::snapLineFadeoutDuration] = QString::number(500); + + slHorizontal.setConfiguration(configuration); + + //before showing the line, no animation should be running + QVERIFY(!slHorizontal.isFadeInAnimationRunning()); + QVERIFY(!slHorizontal.isFadeOutAnimationRunning()); + + QLineF horizontalLine(QPointF(100,100), QPointF(200,100)); + slHorizontal.showLine(horizontalLine); + QVERIFY(slHorizontal.isFadeInAnimationRunning()); + QTest::qWait(2000); + QVERIFY(!slHorizontal.isFadeInAnimationRunning()); + + //before hiding the line, fade out animation should not be running + QVERIFY(!slHorizontal.isFadeOutAnimationRunning()); + + slHorizontal.hideLine(); + QVERIFY(slHorizontal.isFadeOutAnimationRunning()); + QTest::qWait(250); + + //construct a new line which is 100 pixels horizontally away from previous horizontal line + QLineF newHorizontalLine(QPointF(100,200), QPointF(200,200)); + slHorizontal.showLine(newHorizontalLine); + QVERIFY(!slHorizontal.isFadeOutAnimationRunning()); + QVERIFY(slHorizontal.isFadeInAnimationRunning()); + QTest::qWait(2000); + QVERIFY(!slHorizontal.isFadeInAnimationRunning()); + //As the line is moved by 1 pixel before display, here the line is translated for comparison + newHorizontalLine.translate(0.0, -1.0); + QVERIFY(newHorizontalLine == slHorizontal.line()); +} + +void t_hsUtils::testShowVerticalLineAtNewPositionWhileFadeOutAnimationRunning() +{ + HsSnapLine slVertical = HsSnapLine(); + QVariantHash configuration; + configuration[Hs::snapLineFadeinDuration] = QString::number(1000); + configuration[Hs::snapLineFadeoutDuration] = QString::number(500); + + slVertical.setConfiguration(configuration); + + //before showing the line, fade in animation should not be running + QVERIFY(!slVertical.isFadeInAnimationRunning()); + QVERIFY(!slVertical.isFadeOutAnimationRunning()); + + QLineF verticalLine(QPointF(100, 100), QPointF(100, 200)); + slVertical.showLine(verticalLine); + QVERIFY(slVertical.isFadeInAnimationRunning()); + QTest::qWait(2000); + QVERIFY(!slVertical.isFadeInAnimationRunning()); + + //before hiding the line, fade out animation should not be running + QVERIFY(!slVertical.isFadeOutAnimationRunning()); + + slVertical.hideLine(); + QVERIFY(slVertical.isFadeOutAnimationRunning()); + QTest::qWait(250); + + //construct a new line which is 100 pixels vertically away from previous vertical line + QLineF newVerticalLine(QPointF(200, 100), QPointF(200, 200)); + slVertical.showLine(newVerticalLine); + QVERIFY(!slVertical.isFadeOutAnimationRunning()); + QVERIFY(slVertical.isFadeInAnimationRunning()); + QTest::qWait(2000); + QVERIFY(!slVertical.isFadeInAnimationRunning()); + //As the line is moved by 1 pixel before display, here the line is translated for comparison + newVerticalLine.translate(-1.0, 0.0); + QVERIFY(newVerticalLine == slVertical.line()); +} + +#endif // ONLY_MENU_TESTCASES diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/src/t_hsspinnerdialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/src/t_hsspinnerdialog.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Test title resolver. +* +*/ +#include +#include + +#include "t_hsutils.h" +#include "hsspinnerdialog.h" + +#ifndef ONLY_MENU_TESTCASES + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testSpinnerDialog() +{ + HbMainWindow mainWindow; + + HsSpinnerDialog *dialog = new HsSpinnerDialog(); + QVERIFY(!dialog->isVisible()); + + dialog->start(); + QVERIFY(dialog->isVisible()); + dialog->stop(); + // dialog deletes itself +} + +#endif // ONLY_MENU_TESTCASES diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/src/t_hstitleresolver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/src/t_hstitleresolver.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Test title resolver. +* +*/ + +#ifndef ONLY_MENU_TESTCASES + +#include "t_hsutils.h" +#include "hstitleresolver.h" + + +const QString KTestingOperatorName = QString("Testing"); +const QString KTestingOperatorName2 = QString("Testing2"); + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testTitleResolver() + { + HsTitleResolver *titleResolver = new HsTitleResolver(); + QCOMPARE(titleResolver->title(), titleResolver->mNoServiceText); + + titleResolver->mDeviceInfoListener->mNetworkInfo->setProperty("testNetworkMode", QVariant((int)QSystemNetworkInfo::GsmMode)); + titleResolver->mDeviceInfoListener->mNetworkInfo->setProperty("testNetworkStatus", QVariant(QSystemNetworkInfo::Roaming)); + titleResolver->mDeviceInfoListener->updateCurrentNetworkMode(); + titleResolver->mDeviceInfoListener->updateStatus(); + + QCOMPARE(titleResolver->title(), KTestingOperatorName); + + titleResolver->mOperatorName.clear(); + titleResolver->mDeviceInfoListener->updateCurrentNetworkMode(); + titleResolver->mDeviceInfoListener->updateStatus(); + QCOMPARE(titleResolver->title(), KTestingOperatorName); + + delete titleResolver; + + } + +void t_hsUtils::testTitleResolverOnStatusChanged() + { + HsTitleResolver *titleResolver = new HsTitleResolver(); + + qRegisterMetaType( + "HsDeviceInfoListener::HsDeviceInfoStatus"); + QSignalSpy spy(titleResolver, SIGNAL(titleChanged(const QString &))); + + titleResolver->onStatusChanged(HsDeviceInfoListener::ServiceAvailable); + QCOMPARE(spy.count(), 1); + QList arguments = spy.takeFirst(); + QCOMPARE(arguments.at(0).toString(), KTestingOperatorName); + QCOMPARE(titleResolver->title(), KTestingOperatorName); + spy.clear(); + titleResolver->onStatusChanged(HsDeviceInfoListener::ServiceAvailable); + QCOMPARE(spy.count(), 0); + + titleResolver->onStatusChanged(HsDeviceInfoListener::OfflineProfile); + QCOMPARE(spy.count(), 1); + arguments = spy.takeFirst(); + QCOMPARE(arguments.at(0).toString(), titleResolver->mOfflineText); + QCOMPARE(titleResolver->title(), titleResolver->mOfflineText); + + delete titleResolver; + } + +void t_hsUtils::testTitleResolverOnNetworkNameChanged() + { + HsTitleResolver *titleResolver = new HsTitleResolver(); + QCOMPARE(titleResolver->title(), titleResolver->mNoServiceText); + + qRegisterMetaType( + "HsDeviceInfoListener::HsDeviceInfoStatus"); + QSignalSpy spy(titleResolver, SIGNAL(titleChanged(const QString &))); + + titleResolver->onNetworkNameChanged(KTestingOperatorName); + // this should not emit anything because UnknownMode + QCOMPARE(spy.count(), 0); + + titleResolver->mCurrentStatus = HsDeviceInfoListener::ServiceAvailable; + titleResolver->onNetworkNameChanged(KTestingOperatorName2); + QCOMPARE(spy.count(), 1); + QList arguments = spy.takeFirst(); + QCOMPARE(arguments.at(0).toString(), KTestingOperatorName2); + + spy.clear(); + titleResolver->onNetworkNameChanged(KTestingOperatorName); + QCOMPARE(spy.count(), 1); + arguments = spy.takeFirst(); + QCOMPARE(arguments.at(0).toString(), KTestingOperatorName); + + spy.clear(); + titleResolver->onNetworkNameChanged(KTestingOperatorName); + QCOMPARE(spy.count(), 0); + + delete titleResolver; + } + +#endif //ONLY_MENU_TESTCASES diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/src/t_hsutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/src/t_hsutils.cpp Mon Sep 20 10:19: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: Main test class for hsutils library. +* +*/ + + +#include "t_hsutils.h" + + + + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::initTestCase() + { + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::cleanupTestCase() + { + } + + + + +QTEST_MAIN(t_hsUtils) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/src/t_hsutils_menuevent.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/src/t_hsutils_menuevent.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,528 @@ +/* +* 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: +* +*/ + + +#ifdef ONLY_MENU_TESTCASES + +#include + +#include "t_hsutils.h" +#include "hsmenuevent.h" +#include "hsmenueventfactory.h" +#include "hsmenueventtransition.h" +#include "hsapp_defs.h" + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventConstruction() +{ + QVariantMap sourceMap; + sourceMap.insert("my_key", "my_value"); + HsMenuEvent menuEvent(HsMenuEvent::AddToHomeScreen, sourceMap); + + QVariantMap resultMap = menuEvent.data(); + QString value(resultMap.value("my_key").toString()); + HsMenuEvent::OperationType opType = menuEvent.operation(); + + QCOMPARE(value, QString("my_value")); + QCOMPARE(opType, HsMenuEvent::AddToHomeScreen); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateAddToHomeScreenEvent() +{ + + { + const int expectedId = 12345; + const QString expectedEntryTypeName(""); + const QString expectedUri(""); + const QString expectedLibrary(""); + + QSharedPointer + menuEvent(HsMenuEventFactory::createAddToHomeScreenEvent( + expectedId, Hs::NormalHsMenuMode)); + QCOMPARE(static_cast(menuEvent.data())->operation(), + HsMenuEvent::AddToHomeScreen); + + QVariantMap resultMap = static_cast( + menuEvent.data())->data(); + const int id = resultMap.value(Hs::itemIdKey).toInt(); + const QString widgetUri( + resultMap.value(Hs::widgetUriAttributeName).toString()); + const QString widgetLibrary( + resultMap.value(Hs::widgetLibraryAttributeName).toString()); + const QString entryTypeName( + resultMap.value(Hs::entryTypeNameKey).toString()); + + QCOMPARE(expectedId, id); + QCOMPARE(expectedUri, widgetUri); + QCOMPARE(expectedLibrary, widgetLibrary); + QCOMPARE(expectedEntryTypeName, entryTypeName); + } + + { + int expectedEntrId(667); + + QSharedPointer + menuEvent(HsMenuEventFactory::createAddToHomeScreenEvent( + expectedEntrId, Hs::NormalHsMenuMode)); + + QVariantMap resultMap = static_cast( + menuEvent.data())->data(); + + int id(-1) ; + id = resultMap.value(Hs::itemIdKey).toInt(); + + QCOMPARE(expectedEntrId, id); + } + +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreatePreviewHSWidgetEvent() +{ + { + const int expectedId = 12345; + const QString expectedEntryTypeName(""); + const QString expectedUri(""); + const QString expectedLibrary(""); + + QSharedPointer + menuEvent(HsMenuEventFactory::createPreviewHSWidgetEvent(expectedId)); + QCOMPARE(static_cast(menuEvent.data())->operation(), + HsMenuEvent::PreviewHSWidget); + + QVariantMap resultMap = static_cast( + menuEvent.data())->data(); + const int id = resultMap.value(Hs::itemIdKey).toInt(); + const QString widgetUri( + resultMap.value(Hs::widgetUriAttributeName).toString()); + const QString widgetLibrary( + resultMap.value(Hs::widgetLibraryAttributeName).toString()); + const QString entryTypeName( + resultMap.value(Hs::entryTypeNameKey).toString()); + + QCOMPARE(expectedId, id); + QCOMPARE(expectedUri, widgetUri); + QCOMPARE(expectedLibrary, widgetLibrary); + QCOMPARE(expectedEntryTypeName, entryTypeName); + } + + { + const QString expectedEntryTypeName(Hs::widgetTypeName); + const QString expectedUri("dummyUri"); + const QString expectedLibrary("dummyLibraryName"); + + QSharedPointer + menuEvent(HsMenuEventFactory::createPreviewHSWidgetEvent(0, + expectedEntryTypeName, expectedUri, expectedLibrary)); + + QVariantMap resultMap = static_cast( + menuEvent.data())->data(); + + const QString widgetUri( + resultMap.value(Hs::widgetUriAttributeName).toString()); + const QString widgetLibrary( + resultMap.value(Hs::widgetLibraryAttributeName).toString()); + const QString entryTypeName(resultMap.value(Hs::entryTypeNameKey).toString()); + + QCOMPARE(expectedUri, widgetUri); + QCOMPARE(expectedLibrary, widgetLibrary); + QCOMPARE(expectedEntryTypeName, entryTypeName); + } + +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateAppSettingsViewEvent() +{ + int dummyId = 12345; + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory::createAppSettingsViewEvent(dummyId); + QCOMPARE(static_cast(menuEvent)->operation(), + HsMenuEvent::ShowAppSettings); + + QVariantMap resultMap = static_cast(menuEvent)->data(); + int id = resultMap.value(Hs::itemIdKey).toInt(); + QCOMPARE(id, dummyId); + + delete menuEvent; +} +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateAppDetailsViewEvent() +{ + int dummyId = 12345; + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory::createAppDetailsViewEvent(dummyId); + QCOMPARE(static_cast(menuEvent)->operation(), + HsMenuEvent::ShowAppDetails ); + + QVariantMap resultMap = static_cast(menuEvent)->data(); + int id = resultMap.value(Hs::itemIdKey).toInt(); + QCOMPARE(id, dummyId); + + delete menuEvent; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateOpenCollectionEvent() +{ + int dummyId = 12345; + QString dummyType("dummy"); + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory::createOpenCollectionEvent(dummyId, dummyType); + QCOMPARE(static_cast(menuEvent)->operation(), HsMenuEvent::OpenCollection); + + QVariantMap resultMap = static_cast(menuEvent)->data(); + int id = resultMap.value(Hs::itemIdKey).toInt(); + QString type = resultMap.value(Hs::entryTypeNameKey).toString(); + QCOMPARE(id, dummyId); + QCOMPARE(type, dummyType); + + delete menuEvent; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateOpenCollectionFromAppLibraryEvent() +{ + int dummyId = 12345; + QString dummyType("dummy"); + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory::createOpenCollectionFromAppLibraryEvent(dummyId, dummyType); + QCOMPARE(static_cast(menuEvent)->operation(), HsMenuEvent::OpenCollectionFromAppLibrary); + + QVariantMap resultMap = static_cast(menuEvent)->data(); + int id = resultMap.value(Hs::itemIdKey).toInt(); + QString type = resultMap.value(Hs::entryTypeNameKey).toString(); + QCOMPARE(id, dummyId); + QCOMPARE(type, dummyType); + + delete menuEvent; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateRenameCollectionEvent() +{ + int dummyId = 12345; + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory::createRenameCollectionEvent(dummyId); + QCOMPARE(static_cast(menuEvent)->operation(), HsMenuEvent::RenameCollection); + + QVariantMap resultMap = static_cast(menuEvent)->data(); + int id = resultMap.value(Hs::itemIdKey).toInt(); + QCOMPARE(id, dummyId); + + delete menuEvent; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateNewCollectionEvent() +{ + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory::createNewCollectionEvent(); + QCOMPARE(static_cast(menuEvent)->operation(), + HsMenuEvent::CreateCollection); + + QVariantMap resultMap = static_cast(menuEvent)->data(); + int id = resultMap.value(Hs::itemIdKey).toInt(); + QCOMPARE(id, 0); + + delete menuEvent; +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateDeleteCollectionEvent() +{ + int dummyId = 12345; + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory::createDeleteCollectionEvent(dummyId); + QCOMPARE(static_cast(menuEvent)->operation(), HsMenuEvent::DeleteCollection); + + QVariantMap resultMap = static_cast(menuEvent)->data(); + int id = resultMap.value(Hs::itemIdKey).toInt(); + QCOMPARE(id, dummyId); + + delete menuEvent; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateCollectionDeletedEvent() +{ + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory::createCollectionDeletedEvent(); + QCOMPARE(static_cast(menuEvent)->operation(), + HsMenuEvent::CollectionDeleted); + QVERIFY(static_cast(menuEvent)->data().isEmpty()); + delete menuEvent; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateBackFromInstalledViewEvent() +{ + int dummyId = 12345; + QString dummyType("dummy"); + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory::createBackFromInstalledViewEvent( + dummyId, dummyType); + QCOMPARE(static_cast(menuEvent)->operation(), + HsMenuEvent::BackFromInstalledView); + QVariantMap resultMap = static_cast(menuEvent)->data(); + QCOMPARE(resultMap.value(Hs::itemIdKey).toInt(), dummyId); + QCOMPARE(resultMap.value(Hs::entryTypeNameKey).toString(), dummyType); + delete menuEvent; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateOpenInstalledViewEvent() +{ + int dummyId = 12345; + QString dummyType("dummy"); + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory::createOpenInstalledViewEvent( + dummyId, dummyType); + QCOMPARE(static_cast(menuEvent)->operation(), + HsMenuEvent::OpenInstalledView); + QVariantMap resultMap = static_cast(menuEvent)->data(); + QCOMPARE(resultMap.value(Hs::itemIdKey).toInt(), dummyId); + QCOMPARE(resultMap.value(Hs::entryTypeNameKey).toString(), dummyType); + delete menuEvent; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactorycCreateOpenAppLibraryEvent() +{ + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory::createOpenAppLibraryEvent(); + QCOMPARE(static_cast(menuEvent)->operation(), HsMenuEvent::OpenApplicationLibrary); + QVERIFY(!static_cast(menuEvent)->data().isEmpty()); + delete menuEvent; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateAddAppsFromApplicationsViewEvent() +{ + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory:: + createAddAppsFromApplicationsViewEvent( + Hs::NoHsSortAttribute, 0); + QCOMPARE(static_cast(menuEvent)->operation(), + HsMenuEvent::AddAppsToCollection); + QVERIFY(!static_cast(menuEvent)->data().isEmpty()); + delete menuEvent; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateAddAppsFromCallectionViewEvent() +{ + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory:: + createAddAppsFromCollectionViewEvent(0, 0); + QCOMPARE(static_cast(menuEvent)->operation(), + HsMenuEvent::AddAppsToCollection); + QVERIFY(!static_cast(menuEvent)->data().isEmpty()); + delete menuEvent; +} + + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateRemoveAppFromCollectionEvent() +{ + int dummyId = 12345; + int dummyColId = 6789; + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory::createRemoveAppFromCollectionEvent(dummyId, dummyColId); + QCOMPARE(static_cast(menuEvent)->operation(), HsMenuEvent::RemoveAppFromCollection); + + QVariantMap resultMap = static_cast(menuEvent)->data(); + int id = resultMap.value(Hs::itemIdKey).toInt(); + int cid = resultMap.value(Hs::collectionIdKey).toInt(); + QCOMPARE(id, dummyId); + QCOMPARE(cid, dummyColId); + + delete menuEvent; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateUninstallApplicationEvent() +{ + int dummyId = 54321; + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory::createUninstallApplicationEvent(dummyId); + + QCOMPARE(static_cast(menuEvent)->operation(), HsMenuEvent::UninstallApplication ); + + QVariantMap resultMap = static_cast(menuEvent)->data(); + int id = resultMap.value(Hs::itemIdKey).toInt(); + QCOMPARE(id, dummyId); + + delete menuEvent; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateInstLogEvent() +{ + QEvent *menuEvent = HsMenuEventFactory::createInstallationLogEvent(); + QCOMPARE(static_cast(menuEvent)->operation(), + HsMenuEvent::ShowInstallationLog); + QVERIFY(static_cast(menuEvent)->data().isEmpty()); + delete menuEvent; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateUninstallFailedEvent() +{ + int dummyError = 3; + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory::createUninstallFailedEvent(dummyError); + + QCOMPARE(static_cast(menuEvent)->operation(), HsMenuEvent::UninstallationFailed ); + + QVariantMap resultMap = static_cast(menuEvent)->data(); + int error = resultMap.value(Hs::uninstallError).toInt(); + QCOMPARE(error, dummyError); + + delete menuEvent; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryCreateUnknownEvent() +{ + QEvent *menuEvent = HsMenuEventFactory::createUnknownEvent(); + QCOMPARE(static_cast(menuEvent)->operation(), + HsMenuEvent::Unknown); + QVERIFY(static_cast(menuEvent)->data().isEmpty()); + delete menuEvent; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventFactoryOpenHSEvent() +{ + QEvent *menuEvent = HsMenuEventFactory::createOpenHomeScreenEvent(); + QCOMPARE(static_cast(menuEvent)->operation(), + HsMenuEvent::OpenHomeScreen); + QVERIFY(static_cast(menuEvent)->data().isEmpty()); + delete menuEvent; +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventTransitionConstruction() +{ + HsMenuEventTransition transition(HsMenuEvent::AddToHomeScreen, NULL, NULL); + QCOMPARE(transition.mOperation, HsMenuEvent::AddToHomeScreen); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testMenuEventTransitionTestCondition() +{ + QVariantMap sourceMap; + sourceMap.insert("my_key", "my_value"); + HsMenuEvent correctMenuEvent(HsMenuEvent::OpenCollectionFromAppLibrary, sourceMap); + HsMenuEvent wrongMenuEvent(HsMenuEvent::Unknown, sourceMap); + + HsMenuEventTransition transition(HsMenuEvent::OpenCollectionFromAppLibrary, NULL, NULL); + bool correctResult = transition.eventTest(&correctMenuEvent); + bool wrongResult = transition.eventTest(&wrongMenuEvent); + + QCOMPARE(correctResult, true); + QCOMPARE(wrongResult, false); +} + +void t_hsUtils::testMenuEventFactoryCreateArrangeCollectionEvent() +{ + const int topItemId = 12345; + const int collectionId = 11; + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory::createArrangeCollectionEvent(topItemId, collectionId); + QCOMPARE(static_cast(menuEvent)->operation(), + HsMenuEvent::ArrangeCollection); + + QVariantMap resultMap = static_cast(menuEvent)->data(); + const int actualItemId = resultMap.value(Hs::itemIdKey).toInt(); + const int actualCollectionId = resultMap.value(Hs::collectionIdKey).toInt(); + QCOMPARE(actualItemId, topItemId); + QCOMPARE(actualCollectionId, collectionId); + + delete menuEvent; +} + +void t_hsUtils::testMenuEventFactorycreateArrangeAllCollectionsEvent() +{ + const int topItemId = 12345; + QEvent *menuEvent(NULL); + menuEvent = HsMenuEventFactory::createArrangeAllCollectionsEvent(topItemId); + QCOMPARE(static_cast(menuEvent)->operation(), + HsMenuEvent::ArrangeAllCollections); + + QVariantMap resultMap = static_cast(menuEvent)->data(); + const int actualItemId = resultMap.value(Hs::itemIdKey).toInt(); + QCOMPARE(actualItemId, topItemId); + + delete menuEvent; +} + +#endif //ONLY_MENU_TESTCASES diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/src/t_hswidgetpositioningonorientationchange.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/src/t_hswidgetpositioningonorientationchange.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef ONLY_MENU_TESTCASES + +#include "t_hsutils.h" +#include "hswidgetpositioningonorientationchange.h" + +Q_DECLARE_METATYPE(QList) + +void t_hsUtils::testWidgetPositioningOnOrientationChangeInstance() +{ + QVERIFY(!HsWidgetPositioningOnOrientationChange::instance()); + HsWidgetPositioningOnOrientationChange::setInstance(0); + QVERIFY(!HsWidgetPositioningOnOrientationChange::instance()); + HsWidgetPositioningOnOrientationChange *c = new HsAdvancedWidgetPositioningOnOrientationChange; + HsWidgetPositioningOnOrientationChange::setInstance(c); + QVERIFY(HsWidgetPositioningOnOrientationChange::instance() == c); + HsWidgetPositioningOnOrientationChange::setInstance(0); + QVERIFY(!HsWidgetPositioningOnOrientationChange::instance()); +} + +void t_hsUtils::testAdvancedWidgetPositioningOnOrientationChange_data() +{ + QTest::addColumn("fromRect"); + QTest::addColumn >("fromGeometries"); + QTest::addColumn("toRect"); + QTest::addColumn >("toGeometries"); + + QTest::newRow("portrait to landscape1") + << QRectF(0, 0, 100, 200) + << (QList() << QRectF(0, 100, 10, 10) << QRectF(90, 0, 10, 10) << QRectF(90, 190, 10, 10) << QRectF(50, 150, 10, 10)) + << QRectF(0, 0, 200, 100) + << (QList() << QRectF(100, 0, 10, 10) << QRectF(90, 0, 10, 10) << QRectF(190, 90, 10, 10) << QRectF(150, 50, 10, 10)); + + QTest::newRow("portrait to landscape2") + << QRectF(0, 0, 100, 200) + << (QList() << QRectF(0, 94, 10, 10) << QRectF(0, 95, 10, 10) << QRectF(0, 96, 10, 10) << QRectF(-5, 95, 10, 10) << QRectF(-5, 96, 10, 10)) + << QRectF(0, 0, 200, 100) + << (QList() << QRectF(0, 90, 10, 10) << QRectF(100, 0, 10, 10) << QRectF(100, 0, 10, 10) << QRectF(95, 0, 10, 10) << QRectF(95, 0, 10, 10)); + + QTest::newRow("landscape to portrait1") + << QRectF(0, 0, 200, 100) + << (QList() << QRectF(0, 0, 10, 10) << QRectF(100, 0, 10, 10) << QRectF(90, 0, 10, 10) << QRectF(190, 90, 10, 10) << QRectF(150, 50, 10, 10)) + << QRectF(0, 0, 100, 200) + << (QList() << QRectF(0, 0, 10, 10) << QRectF(90, 100, 10, 10) << QRectF(90, 0, 10, 10) << QRectF(90, 190, 10, 10) << QRectF(90, 150, 10, 10)); + + QTest::newRow("landscape to portrait2") + << QRectF(0, 0, 200, 100) + << (QList() << QRectF(94, 0, 10, 10) << QRectF(95, 0, 10, 10) << QRectF(96, 0, 10, 10) << QRectF(95, -5, 10, 10) << QRectF(96, -5, 10, 10)) + << QRectF(0, 0, 100, 200) + << (QList() << QRectF(90, 0, 10, 10) << QRectF(90, 100, 10, 10) << QRectF(90, 100, 10, 10) << QRectF(90, 95, 10, 10) << QRectF(90, 95, 10, 10)); + + QTest::newRow("illegal from points") + << QRectF(0, 0, 100, 100) + << (QList() << QRectF(-50, -50, 10, 10)) + << QRectF(0, 0, 100, 100) + << (QList() << QRectF(0, 0, 10, 10)); + +} + +void t_hsUtils::testAdvancedWidgetPositioningOnOrientationChange() +{ + QFETCH(QRectF, fromRect); + QFETCH(QList, fromGeometries); + QFETCH(QRectF, toRect); + QFETCH(QList, toGeometries); + + HsWidgetPositioningOnOrientationChange *converter = + new HsAdvancedWidgetPositioningOnOrientationChange; + QList convertedGeometries = + converter->convert(fromRect, fromGeometries, toRect); + + QCOMPARE(convertedGeometries.count(), toGeometries.count()); + + for (int i = 0; i < toGeometries.count(); ++i) { + QVERIFY(qFuzzyCompare(1 + toGeometries.at(i).x(), 1 + convertedGeometries.at(i).x())); + QVERIFY(qFuzzyCompare(1 + toGeometries.at(i).y(), 1 + convertedGeometries.at(i).y())); + QVERIFY(qFuzzyCompare(1 + toGeometries.at(i).width(), 1 + convertedGeometries.at(i).width())); + QVERIFY(qFuzzyCompare(1 + toGeometries.at(i).height(), 1 + convertedGeometries.at(i).height())); + } + + delete converter; +} + +#endif // ONLY_MENU_TESTCASES diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/src/t_hswidgetpositioningonwidgetmove.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/src/t_hswidgetpositioningonwidgetmove.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,447 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef ONLY_MENU_TESTCASES + +#include "t_hsutils.h" +#include "hsapp_defs.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// + +#define SNAP_GAP_VALUE 6 +#define SNAP_FORCE_VALUE 30 +#define SNAP_ENABLED_VALUE true +#define SNAP_DISABLED_VALUE false + +Q_DECLARE_METATYPE(QList) +Q_DECLARE_METATYPE(HsWidgetPositioningOnWidgetMove::Result) + +void t_hsUtils::testWidgetPositioningOnWidgetMoveInstance() +{ + QVERIFY(!HsWidgetPositioningOnWidgetMove::instance()); + HsWidgetPositioningOnWidgetMove::setInstance(0); + QVERIFY(!HsWidgetPositioningOnWidgetMove::instance()); + HsWidgetPositioningOnWidgetMove *snapToLines = new HsSnapToLines; + HsWidgetPositioningOnWidgetMove::setInstance(snapToLines); + QVERIFY(HsWidgetPositioningOnWidgetMove::instance() == snapToLines); + HsWidgetPositioningOnWidgetMove::setInstance(0); + QVERIFY(!HsWidgetPositioningOnWidgetMove::instance()); +} + +void t_hsUtils::testHsSnapToLinesConstruct() +{ + HsSnapToLines *sl = new HsSnapToLines(); + + QVERIFY(sl->mContainerRect.isNull()); + + QVERIFY(qFuzzyCompare(sl->mActiveRectWidth, 0)); + QVERIFY(qFuzzyCompare(sl->mActiveRectHeight, 0)); + + QVERIFY(sl->mInactiveSnapRects.isEmpty()); + + QVERIFY(sl->mInactiveRectToCompare.isNull()); + + QVERIFY(sl->mInactiveSnapRectToCompare.rectangle.isNull()); + QVERIFY(sl->mMovingRect.isNull()); + + QVERIFY(qFuzzyCompare(sl->mMinDistancePosition, 0)); + QVERIFY(qFuzzyCompare(sl->mHorizontalSnapPosition, 0)); + QVERIFY(qFuzzyCompare(sl->mVerticalSnapPosition, 0)); + + QVERIFY(!sl->mHorizontalSnapFound); + QVERIFY(sl->mVerticalLine.isNull()); + + QVERIFY(!sl->mVerticalSnapFound); + QVERIFY(sl->mHorizontalLine.isNull()); + + QVERIFY(!sl->mRectLieAbove); + QVERIFY(!sl->mLeftInRange); + QVERIFY(!sl->mRightInRange); + QVERIFY(!sl->mIsBetterFitHorizontalSnap); + QVERIFY(qFuzzyCompare(sl->mDistanceVerticalEdges, 0)); + QVERIFY(qFuzzyCompare(sl->mVerticalEdgeToLeftOfInactiveRect, 0)); + QVERIFY(qFuzzyCompare(sl->mVerticalEdgeToRightOfInactiveRect, 0)); + QVERIFY(qFuzzyCompare(sl->mMinVerticalEdgesDistance, 0)); + QVERIFY(qFuzzyCompare(sl->mVerticalDistance, 0)); + QVERIFY(qFuzzyCompare(sl->mVerticalDistanceFromSelectedRect, 0)); + QVERIFY(qFuzzyCompare(sl->mContainerVerticalEdgeDistance, 0)); + + QVERIFY(!sl->mRectLieLeft); + QVERIFY(!sl->mTopInRange); + QVERIFY(!sl->mBottomInRange); + QVERIFY(!sl->mIsBetterFitVerticalSnap); + QVERIFY(qFuzzyCompare(sl->mDistanceHorizontalEdges, 0)); + QVERIFY(qFuzzyCompare(sl->mHorizontalEdgeToTopOfInactiveRect, 0)); + QVERIFY(qFuzzyCompare(sl->mHorizontalEdgeToBottomOfInactiveRect, 0)); + QVERIFY(qFuzzyCompare(sl->mMinHorizontalEdgesDistance, 0)); + QVERIFY(qFuzzyCompare(sl->mHorizontalDistance, 0)); + QVERIFY(qFuzzyCompare(sl->mHorizontalDistanceFromSelectedRect, 0)); + QVERIFY(qFuzzyCompare(sl->mContainerHorizontalEdgeDistance, 0)); + + QVERIFY(!sl->mSnapEnabled); + QVERIFY(qFuzzyCompare(sl->mSnapForce, 0)); + QVERIFY(qFuzzyCompare(sl->mSnapGap, 0)); + + QVERIFY(!sl->mRectVerticalEdgeLiesInLineWithVerticalLine); + QVERIFY(!sl->mRectLieAboveVerticalLine); + QVERIFY(!sl->mRectLieBelowVerticalLine); + + QVERIFY(!sl->mRectHorizontalEdgeLiesInLineWithHorizontalLine); + QVERIFY(!sl->mRectLieLeftOfHorizontalLine); + QVERIFY(!sl->mRectLiesRightOfHorizontalLine); + + delete sl; +} + +void t_hsUtils::testHsSnapToLines_data() +{ + QTest::addColumn("containerArea"); + QTest::addColumn >("inActiveRects"); + QTest::addColumn("activeRect"); + QTest::addColumn("movingRect"); + QTest::addColumn("expectedResult"); + + { + QTest::newRow("widgetOverlap") + << QRectF(0, 0, 1000, 1000) + << (QList() << QRectF(250, 250, 500, 500) << QRectF(200, 200, 100, 100) << QRectF(700, 200, 100, 100) + << QRectF(700, 700, 100, 100) << QRectF(200, 700, 100, 100)) + << QRectF(0, 0, 800, 150) + << QRectF(100, 100, 880, 165) + << HsWidgetPositioningOnWidgetMove::Result(); + } + + { + QTest::newRow("oneWidgetOutOfSnapDistance") + << QRectF(0, 0, 1000, 1000) + << (QList()) + << QRectF(5, 5, 100, 100) + << QRectF(3, 3, 110, 110) + << HsWidgetPositioningOnWidgetMove::Result(); + } + + { + HsWidgetPositioningOnWidgetMove::Result snapResultCenter; + QTest::newRow("oneWidgetInCenterWithoutSnapping") + << QRectF(0, 0, 1000, 1000) + << (QList()) + << QRectF(5, 5, 200, 200) + << QRectF(390, 390, 200, 200) + << snapResultCenter; + } + + { + //Data for snapping to Left Edge of Inactive Rectangle. + HsWidgetPositioningOnWidgetMove::Result snapResultLeftEdge; + snapResultLeftEdge.hasHorizontalSnap = true; + snapResultLeftEdge.horizontalSnapPosition = 100; + snapResultLeftEdge.verticalSnapLine = QLineF(100, 90, 100, 610); + QTest::newRow("snapToLeftEdgeOfInactiveRect") + << QRectF(0, 0, 1000, 1000) + << (QList() << QRectF(100, 100, 100, 100) << QRectF(175, 75, 100, 150)) + << QRectF(0, 0, 500, 100) + << QRectF(110, 500, 500, 100) + << snapResultLeftEdge; + } + + { + //Data for snapping to Left Edge of Inactive Rectangle, + //one inactive rectangle lies below the moving rectangle + //one inactive rectangle lies above the moving rectangle. This rectangle does not offer big enough space for moving rectangle's width + HsWidgetPositioningOnWidgetMove::Result snapResultLeftEdgeBelowRect; + snapResultLeftEdgeBelowRect.hasHorizontalSnap = true; + snapResultLeftEdgeBelowRect.horizontalSnapPosition = 10 - SNAP_GAP_VALUE; + snapResultLeftEdgeBelowRect.verticalSnapLine = QLineF(560, 910, 560, 390); + QTest::newRow("snapToLeftEdgeOfInactiveRectWhichLiesBelow") + << QRectF(0, 0, 1000, 1000) + << (QList() << QRectF(550, 200, 200, 150) << QRectF(560, 800, 200, 100)) + << QRectF(5, 0, 550, 100) + << QRectF(5, 400, 550, 100) + << snapResultLeftEdgeBelowRect; + } + + { + //Data for snapping to Left Edge of Inactive Rectangle. + //The data is similar to one above, except that the rectangle can fit into the space now. + HsWidgetPositioningOnWidgetMove::Result snapResultLeftEdgeRectLiesAbove; + snapResultLeftEdgeRectLiesAbove.hasHorizontalSnap = true; + snapResultLeftEdgeRectLiesAbove.horizontalSnapPosition = 50 - SNAP_GAP_VALUE; + snapResultLeftEdgeRectLiesAbove.verticalSnapLine = QLineF(550, 510, 550, 190); + QTest::newRow("snapToLeftEdgeOfInactiveRectWhichLiesAbove") + << QRectF(0, 0, 1000, 1000) + << (QList() << QRectF(560, 800, 200, 100) << QRectF(550, 200, 200, 150)) + << QRectF(5, 0, 500, 100) + << QRectF(55, 400, 500, 100) + << snapResultLeftEdgeRectLiesAbove; + } + + { + //Data for snapping to the left Edge of Inactive rect which are already alligned + //and the bottom of already alligned widgets on the bottom + HsWidgetPositioningOnWidgetMove::Result snapResultRectsAllignedOnLeftAndBottom; + snapResultRectsAllignedOnLeftAndBottom.hasHorizontalSnap = true; + snapResultRectsAllignedOnLeftAndBottom.horizontalSnapPosition = 100; + snapResultRectsAllignedOnLeftAndBottom.verticalSnapLine = QLineF(100, 910, 100, 90); + snapResultRectsAllignedOnLeftAndBottom.hasVerticalSnap = true; + snapResultRectsAllignedOnLeftAndBottom.verticalSnapPosition = 820; //The width of the rectangle is 90 + snapResultRectsAllignedOnLeftAndBottom.horizontalSnapLine = QLineF(80, 910, 910, 910); + QTest::newRow("snapToLeftAndBottomEdgeOfTwoAllignedRects") + << QRectF(0, 0, 1000, 1000) + << (QList() << QRectF(100, 400, 150, 125) << QRectF(100, 100, 100, 100) << QRectF(450, 820, 100, 90) << QRectF(750, 750, 150, 160)) + << QRectF(50, 750, 100, 90) + << QRectF(90, 800, 120, 100) + << snapResultRectsAllignedOnLeftAndBottom; + } + + { + //Data for snapping to the Right side of already alligned widgets on the right side + //and top of already alligned widgets + HsWidgetPositioningOnWidgetMove::Result snapResultRectsAllignedOnRightAndTop; + snapResultRectsAllignedOnRightAndTop.hasHorizontalSnap = true; + snapResultRectsAllignedOnRightAndTop.horizontalSnapPosition = 540; + snapResultRectsAllignedOnRightAndTop.verticalSnapLine = QLineF(600, 60, 600, 910); + snapResultRectsAllignedOnRightAndTop.hasVerticalSnap = true; + snapResultRectsAllignedOnRightAndTop.verticalSnapPosition = 50; + snapResultRectsAllignedOnRightAndTop.horizontalSnapLine = QLineF(40, 50, 620, 50); + QTest::newRow("snapToRightAndTopEdgeOfTwoAllignedRects") + << QRectF(0, 0, 1000, 1000) + << (QList() << QRectF(300, 50, 50, 300) << QRectF(500, 500, 100, 100) << QRectF(50, 50, 150, 150) << QRectF(400, 800, 200, 100)) + << QRectF(500, 50, 60, 100) + << QRectF(550, 70, 60, 100) + << snapResultRectsAllignedOnRightAndTop; + } + + { + //Data for snapping to the left Edge of one Inactive rect and top edge of another Inactive rect + //distance of both edges of the rectangle are at the same distance from the edge under comparison + HsWidgetPositioningOnWidgetMove::Result snapResultSameDistanceToMovingEdgesSnapToLeftAndTopEdge; + snapResultSameDistanceToMovingEdgesSnapToLeftAndTopEdge.hasHorizontalSnap = true; + snapResultSameDistanceToMovingEdgesSnapToLeftAndTopEdge.horizontalSnapPosition = 100; + snapResultSameDistanceToMovingEdgesSnapToLeftAndTopEdge.verticalSnapLine = QLineF(100, 450, 100, 90); + snapResultSameDistanceToMovingEdgesSnapToLeftAndTopEdge.hasVerticalSnap = true; + snapResultSameDistanceToMovingEdgesSnapToLeftAndTopEdge.verticalSnapPosition = 380; + snapResultSameDistanceToMovingEdgesSnapToLeftAndTopEdge.horizontalSnapLine = QLineF(70, 380, 690, 380); + QTest::newRow("snapToLeftEdgeAndTopEdgeOfInactiveRectDistanceToMovingRectsEdgesSame") + << QRectF(0, 0, 1000, 1000) + << (QList() << QRectF(100, 100, 200, 100) << QRectF(600, 380, 80, 300)) + << QRectF(0, 0, 40, 40) + << QRectF(80, 400, 40, 40) + << snapResultSameDistanceToMovingEdgesSnapToLeftAndTopEdge; + } + + { + //Data for snapping when the inactive widgets edges are equal distance from the Left and top edge of Moving Rect + HsWidgetPositioningOnWidgetMove::Result snapResultMovingRectLeftAndTopEdgeSameDistance; + snapResultMovingRectLeftAndTopEdgeSameDistance.hasHorizontalSnap = true; + snapResultMovingRectLeftAndTopEdgeSameDistance.horizontalSnapPosition = 80; + snapResultMovingRectLeftAndTopEdgeSameDistance.verticalSnapLine = QLineF(80, 90, 80, 450); + snapResultMovingRectLeftAndTopEdgeSameDistance.hasVerticalSnap = true; + snapResultMovingRectLeftAndTopEdgeSameDistance.verticalSnapPosition = 80; + snapResultMovingRectLeftAndTopEdgeSameDistance.horizontalSnapLine = QLineF(90, 80, 450, 80); + QTest::newRow("movingRectsLeftAndtopEdgeAreEqualDistanceFromInactiveRectsEdges") + << QRectF(0, 0, 1000, 1000) + << (QList() << QRectF(280, 400, 40, 40) << QRectF(80, 400, 40, 40) << QRectF(400, 180, 40, 40) << QRectF(400, 80, 40, 40)) + << QRectF(50, 50, 200, 100) + << QRectF(100, 100, 200, 100) + << snapResultMovingRectLeftAndTopEdgeSameDistance; + } + + { + //Data for snapping the Right and Bootom edge of moving rect which are equal distance from Inactive rects edges + HsWidgetPositioningOnWidgetMove::Result snapResultMovingRectRightAndBottomEdgeSameDistance; + snapResultMovingRectRightAndBottomEdgeSameDistance.hasHorizontalSnap = true; + snapResultMovingRectRightAndBottomEdgeSameDistance.horizontalSnapPosition = 690; + snapResultMovingRectRightAndBottomEdgeSameDistance.verticalSnapLine = QLineF(840, 190, 840, 950); + snapResultMovingRectRightAndBottomEdgeSameDistance.hasVerticalSnap = true; + snapResultMovingRectRightAndBottomEdgeSameDistance.verticalSnapPosition = 710; + snapResultMovingRectRightAndBottomEdgeSameDistance.horizontalSnapLine = QLineF(190, 860, 860, 860); + QTest::newRow("movingRectsRightAndBottomEdgeAreEqualDistanceFromInactiveRectsEdges") + << QRectF(0, 0, 1000, 1000) + << (QList() << QRectF(680, 200, 40, 40) << QRectF(800, 200, 40, 40) << QRectF(800, 900, 40, 40) + << QRectF(200, 670, 40, 40) << QRectF(200, 820, 40, 40)) + << QRectF(650, 640, 150, 150) + << QRectF(700, 690, 150, 150) + << snapResultMovingRectRightAndBottomEdgeSameDistance; + } + + { + //Data for snapping to Right Edge of Inactive Rectangle, inactive rect lies above the Moving rect, + //distance of moving rect's right edge from the inactive widget's right edge is equal to + //the distance of moving widget's left edge from the inactive widget's left edge. + HsWidgetPositioningOnWidgetMove::Result snapResultRightEdge; + snapResultRightEdge.hasHorizontalSnap = true; + snapResultRightEdge.horizontalSnapPosition = 200; + snapResultRightEdge.verticalSnapLine = QLineF(900, 90, 900, 610); + QTest::newRow("snapToRightEdgeOfInactiveRect") + << QRectF(0, 0, 1000, 1000) + << (QList() << QRectF(725, 75, 100, 150) << QRectF(800, 100, 100, 100)) + << QRectF(225, 500, 700, 100) + << QRectF(225, 500, 700, 100) + << snapResultRightEdge; + } + + { + //Data for snapping to Top Edge of Inactive Rectangle. + HsWidgetPositioningOnWidgetMove::Result snapResultTopEdge; + snapResultTopEdge.hasVerticalSnap = true; + snapResultTopEdge.verticalSnapPosition = 100; + snapResultTopEdge.horizontalSnapLine = QLineF(90, 100, 630, 100); + QTest::newRow("snapToTopEdgeOfInactiveRect") + << QRectF(0, 0, 1000, 1000) + << (QList() << QRectF(100, 100, 100, 100) << QRectF(75, 175, 150, 100) << QRectF(100, 600, 100, 100) << QRectF(75, 675, 150, 100)) + << QRectF(400, 120, 200, 400) + << QRectF(400, 120, 220, 440) + << snapResultTopEdge; + } + + { + //Data for snapping to Bottom Edge of Inactive Rectangle. + HsWidgetPositioningOnWidgetMove::Result snapResultBottomEdge; + snapResultBottomEdge.hasVerticalSnap = true; + snapResultBottomEdge.verticalSnapPosition = 315; + snapResultBottomEdge.horizontalSnapLine = QLineF(65, 800, 855, 800); + QTest::newRow("snapToBottomEdgeOfInactiveRect") + << QRectF(0, 0, 1000, 1000) + << (QList() << QRectF(100, 100, 100, 100) << QRectF(75, 175, 150, 100) << QRectF(100, 600, 100, 100) << QRectF(75, 675, 150, 125)) + << QRectF(600, 300, 220, 485) + << QRectF(625, 325, 220, 485) + << snapResultBottomEdge; + } + +} + +void t_hsUtils::testHsSnapToLines() +{ + QFETCH(QRectF, containerArea); + QFETCH(QList, inActiveRects); + QFETCH(QRectF, activeRect); + QFETCH(QRectF, movingRect); + QFETCH(HsWidgetPositioningOnWidgetMove::Result, expectedResult); + + HsWidgetPositioningOnWidgetMove::setInstance(new HsSnapToLines); + + QVariantHash snapConfiguration; + snapConfiguration[Hs::snapEnabled] = QString::number(SNAP_ENABLED_VALUE); + snapConfiguration[Hs::snapForce] = QString::number(SNAP_FORCE_VALUE); + snapConfiguration[Hs::snapGap] = QString::number(SNAP_GAP_VALUE); + + HsWidgetPositioningOnWidgetMove::instance()->setConfiguration(snapConfiguration); + HsWidgetPositioningOnWidgetMove::instance()->setPagePresentation(containerArea, inActiveRects, activeRect); + HsWidgetPositioningOnWidgetMove::Result convertedResult = HsWidgetPositioningOnWidgetMove::instance()->run(movingRect); + + QVERIFY(hsResultCompare(convertedResult, expectedResult)); +} + +void t_hsUtils::testHsSnapToLinesSnapDisabled_data() +{ + QTest::addColumn("containerArea"); + QTest::addColumn< QList >("inActiveRects"); + QTest::addColumn("activeRect"); + QTest::addColumn("movingRect"); + QTest::addColumn("expectedResult"); + + QTest::newRow("SnapDisabled") + << QRectF(0, 0, 1000, 1000) + << (QList()) + << QRectF(5, 5, 200, 200) + << QRectF(380, 380, 200, 200) + << HsWidgetPositioningOnWidgetMove::Result(); +} + +void t_hsUtils::testHsSnapToLinesSnapDisabled() +{ + QFETCH(QRectF, containerArea); + QFETCH(QList, inActiveRects); + QFETCH(QRectF, activeRect); + QFETCH(QRectF, movingRect); + QFETCH(HsWidgetPositioningOnWidgetMove::Result, expectedResult); + + HsWidgetPositioningOnWidgetMove::setInstance(new HsSnapToLines); + + QVariantHash snapConfiguration; + snapConfiguration[Hs::snapEnabled] = QString::number(SNAP_DISABLED_VALUE); + + HsWidgetPositioningOnWidgetMove::instance()->setConfiguration(snapConfiguration); + HsWidgetPositioningOnWidgetMove::instance()->setPagePresentation(containerArea, inActiveRects, activeRect); + HsWidgetPositioningOnWidgetMove::Result convertedResult = HsWidgetPositioningOnWidgetMove::instance()->run(movingRect); + + QVERIFY(hsResultCompare(convertedResult, expectedResult)); +} + +bool t_hsUtils::hsLineCompare(QLineF l1, QLineF l2) +{ + if ((l1.p1() == l2.p1() || l1.p1() == l2.p2()) + && (l1.p2() == l2.p1() || l1.p2() == l2.p2())) { + return true; + } + else { + return false; + } +} + +bool t_hsUtils::hsResultCompare(const HsWidgetPositioningOnWidgetMove::Result& sr1, const HsWidgetPositioningOnWidgetMove::Result& sr2) +{ + bool resultsAreSame = false; + bool horizontalLinesSame = false; + bool verticalLinesSame = false; + + qDebug() << "Converted Result = " <parentItem()); + QVERIFY(widget->mIconItem); + QVERIFY(widget->layout()); + delete widget; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void t_hsUtils::testTrashbinWidgetActivation() +{ + HsTrashBinWidget *widget = new HsTrashBinWidget(); + widget->activate(); + widget->deactivate(); + delete widget; +} + +#endif // ONLY_MENU_TESTCASES diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/t_hsutils.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/t_hsutils.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,23 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +#Header files +HEADERS += ./inc/*.h \ + ../../inc/*.h + + +#Source files +SOURCES += ./src/*.cpp\ + ../../src/*.cpp \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/t_hsutils/t_hsutils.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/t_hsutils/t_hsutils.pro Mon Sep 20 10:19: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: +# + +TEMPLATE = app + +CONFIG(debug, debug|release) { + DESTDIR = ./debug +} else { + DESTDIR = ./release +} + +CONFIG += debug_and_release \ + console + +CONFIG += hb mobility +MOBILITY += systeminfo + +QT += testlib \ + xml \ + sql + +coverage:DEFINES += COVERAGE_MEASUREMENT +bgimage:DEFINES += BG_ENABLED + +DEFINES += HOMESCREEN_TEST \ + HSUTILS_TEST + +DEPENDPATH += .\ + ./src \ + ../src \ + ../inc + +INCLUDEPATH += .\ + ./inc \ + ../../inc \ + ../../../inc \ + ../../../serviceproviders/hsmenuserviceprovider/inc + +tests_applib: { + include(../../../common.pri) + DEFINES += ONLY_MENU_TESTCASES +} + +symbian: { + LIBS+=-lxqservice -lxqserviceutil + CONFIG += symbian_test + tests_applib: { + coverage: CONFIG -= symbian_test + } + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + TARGET.UID3 = 0x20022F4F + TARGET.CAPABILITY = CAP_APPLICATION AllFiles + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB + + MMP_RULES += SMPSAFE +} + +include(t_hsutils.pri) + +win32:include(installs_win32.pri) + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hsutils/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hsutils/tsrc/tsrc.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,24 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs +SUBDIRS = t_hsutils + +CONFIG += ordered + +symbian: { + CONFIG += symbian_test +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/hswidgetuninstaller.pro --- a/homescreenapp/hswidgetuninstaller/hswidgetuninstaller.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/hswidgetuninstaller/hswidgetuninstaller.pro Mon Sep 20 10:19:07 2010 +0300 @@ -47,4 +47,6 @@ LIBS += -lxqserviceutil LIBS += -lapparc LIBS += -lhsdomainmodel + + MMP_RULES += SMPSAFE } diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/empty.manifest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/empty.manifest Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,1 @@ +asfasdfsa diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/fail_new.manifest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/fail_new.manifest Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,9 @@ + + + helloworldwidgetplugin + Hello world + Hello world homescreen widget example + helloworldwidgetplugin.png + false + helloworldwidgetplugin.xml + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/inc/t_hswidgetuninstaller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/inc/t_hswidgetuninstaller.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Test class for hswidgetuninstaller +* +*/ + +#include +#include +#include +#include +#include +#include + +/** +* @test Test class for homescreen::hsutils modules. +*/ +class t_hswidgetuninstaller : public QObject +{ + Q_OBJECT + +private slots: + + void initTestCase(); + void cleanupTestCase(); + + void testWidgetInstallerSender(); + + void testWidgetComponentParser_data(); + void testWidgetComponentParser(); + + +}; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/inc/xqrequestinfo_mock.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/inc/xqrequestinfo_mock.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,34 @@ +/* +* 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: Mock class for XQRequestInfo +* +*/ + +#ifndef XQREQUESTINFO_H +#define XQREQUESTINFO_H + +class XQRequestInfo +{ + public: + XQRequestInfo(){} ; + virtual ~XQRequestInfo(){} ; + + public: + + void setBackground(bool /*on*/) {}; + private: +}; + + +#endif diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/inc/xqservicerequest_mock.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/inc/xqservicerequest_mock.h Mon Sep 20 10:19: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: Mock class for XQServiceRequest +* +*/ + +#ifndef XQSERVICEREQUEST_H +#define XQSERVICEREQUEST_H +#include +#include +#include "xqrequestinfo_mock.h" + +class XQServiceRequest : public QObject +{ + Q_OBJECT + +public: + + XQServiceRequest(const QString& /*service*/, const QString& /*message*/, const bool& synchronous = true){ + Q_UNUSED(synchronous);}; + ~XQServiceRequest(){}; + + bool send(){return true;}; + + void setInfo(const XQRequestInfo &/*info*/){}; + XQRequestInfo info() const{return XQRequestInfo();}; + int latestError() {return 0;}; + + template + inline XQServiceRequest &operator<< (const T &/*var*/) + { + return *this; + } + +private: +}; + +#endif diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/installs_symbian.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/installs_symbian.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,26 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +export.sources = empty.manifest \ + fail_new.manifest \ + ok_new.manifest \ + ok_old.manifest \ + version10.manifest \ + version12.manifest + +export.path = /hsresources/testresources + +DEPLOYMENT += export diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/installs_win32.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,31 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +testfiles.path = ../../../../../bin/hstests/ +testfiles.files = ./debug/t_hswidgetuninstaller.exe \ + *.manifest + +ddepend1.files = ../../../../../bin/debug/caclient.dll \ + ../../../../../bin/debug/hsdomainmodel.dll \ + ../../../../../bin/debug/hsutils.dll +ddepend1.path = ./debug + +rdepend1.files = ../../../../../bin/release/caclient.dll \ + ../../../../../bin/release/hsdomainmodel.dll \ + ../../../../../bin/release/hsutils.dll +rdepend1.path = ./release + +INSTALLS += testfiles ddepend1 rdepend1 diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/ok_new.manifest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/ok_new.manifest Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,10 @@ + + + helloworldwidgetplugin + Hello world + Hello world homescreen widget example + helloworldwidgetplugin.png + false + helloworldwidgetplugin.xml + helloworldtranslation + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/ok_old.manifest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/ok_old.manifest Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,9 @@ + + + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/sis/t_hswidgetinstaller.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/sis/t_hswidgetinstaller.pkg Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,41 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; + +; Language +&EN + +; SIS header: name, uid, version +#{"t_hswidgetuninstaller"},(0x20022F42),1,0,0 + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Supports S60 5th Edition +[0x1028315F], 0, 0, 0, {"S60ProductID"} + +; HS Utils unittest +"/epoc32/release/armv5/urel/t_hswidgetuninstaller.exe" - "c:/sys/bin/t_hswidgetuninstaller.exe" +"/epoc32/data/z/private/10003a3f/import/apps/t_hswidgetuninstaller_reg.rsc" - "c:/private/10003a3f/import/apps/t_hswidgetuninstaller_reg.rsc" +"/epoc32/data/z/resource/apps/t_hswidgetuninstaller.rsc" - "c:/resource/apps/t_hswidgetuninstaller.rsc" +"../empty.manifest" - "c:/private/20022F42/empty.manifest" +"../fail_new.manifest" - "c:/private/20022F42/fail_new.manifest" +"../ok_new.manifest" - "c:/private/20022F42/ok_new.manifest" +"../ok_old.manifest" - "c:/private/20022F42/ok_old.manifest" +"../version10.manifest" - "c:/private/20022F42/version10.manifest" +"../version12.manifest" - "c:/private/20022F42/version12.manifest" diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/sis/t_hswidgetinstaller_sisx.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/sis/t_hswidgetinstaller_sisx.bat Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,30 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem +@echo off + +if exist t_hswidgetinstaller.sisx del t_hswidgetinstaller.sisx + +makesis t_hswidgetinstaller.pkg +signsis t_hswidgetinstaller.sis t_hswidgetinstaller.sisx ../../../../internal/sis/rd.cer ../../../../internal/sis/rd-key.pem + +if exist t_hswidgetinstaller.sisx ( +echo t_hswidgetinstaller.sisx creation SUCCEEDED +del t_hswidgetinstaller.sis +) + +if not exist t_hswidgetinstaller.sisx ( +echo t_hswidgetinstaller.sisx creation FAILED +) \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/src/t_hswidgetuninstaller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/src/t_hswidgetuninstaller.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,77 @@ +/* +* 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: Main test class for hswidgetuninstaller. +* +*/ + + +#include "t_hswidgetuninstaller.h" +#include "hswidgetinstallersender.h" +#include "hswidgetcomponentparser.h" + + + + +void t_hswidgetuninstaller::initTestCase() +{ +#ifndef NFT + QDir::setCurrent("C:/hsresources/testresources"); +#else + QDir::setCurrent("Z:/hsresources/testresources"); +#endif +} + +void t_hswidgetuninstaller::cleanupTestCase() +{ +} + +void t_hswidgetuninstaller::testWidgetInstallerSender() +{ + HsWidgetInstallerSender sender; + HsWidgetComponentDescriptor widgetDescriptor; + QString functionName("widgetUninstalled(QVariantHash)"); + sender.widgetChanged(functionName, widgetDescriptor); + // nothing to verify +} + +void t_hswidgetuninstaller::testWidgetComponentParser_data() +{ + QTest::addColumn("filename"); + QTest::addColumn("expecteduri"); + QTest::addColumn("expectederror"); + QTest::addColumn("expectedtranslationfile"); + QTest::newRow("notfound") << "notfound.manifest" << "" << true << ""; + QTest::newRow("empty.manifest") << "empty.manifest" << "" << true << ""; + QTest::newRow("ok_new") << "ok_new.manifest" << "helloworldwidgetplugin" << false << "helloworldtranslation"; + QTest::newRow("ok_old") << "ok_old.manifest" << "helloworldwidgetplugin" << false << ""; + QTest::newRow("fail_new.manifest") << "fail_new.manifest" << "" << true << ""; + QTest::newRow("version10.manifest") << "version10.manifest" << "helloworldwidgetplugin" << false << ""; + QTest::newRow("version12.manifest") << "version12.manifest" << "" << true << ""; +} + +void t_hswidgetuninstaller::testWidgetComponentParser() +{ + QFETCH(QString, filename); + QFETCH(QString, expecteduri); + QFETCH(bool, expectederror); + QFETCH(QString, expectedtranslationfile); + HsWidgetComponentParser componentParser(filename); + HsWidgetComponentDescriptor widgetDescriptor = componentParser.widgetComponentDescriptor(); + QCOMPARE(widgetDescriptor.uri(), expecteduri); + QCOMPARE(componentParser.error(), expectederror); + QCOMPARE(widgetDescriptor.translationFilename(), expectedtranslationfile); +} + + +QTEST_MAIN(t_hswidgetuninstaller) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/t_hswidgetuninstaller.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/t_hswidgetuninstaller.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,25 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +#Header files + +HEADERS += ./inc/*.h \ + ../../inc/*.h + + +#Source files +SOURCES += ./src/*.cpp\ + ../../src/hswidgetcomponentparser.cpp \ + ../../src/hswidgetinstallersender.cpp diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/t_hswidgetuninstaller.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/t_hswidgetuninstaller.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,71 @@ +# +# 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 = app + +CONFIG(debug, debug|release) { + LIBS += -L./../../../../../bin/debug -lhsdomainmodel + DESTDIR = ./debug +} else { + LIBS += -L./../../../../../bin/release -lhsdomainmodel + DESTDIR = ./release +} + +CONFIG += debug_and_release \ + console + +CONFIG += hb + +QT += testlib \ + xml \ + sql + +coverage:DEFINES += COVERAGE_MEASUREMENT + +DEFINES += HOMESCREEN_TEST + +DEPENDPATH += .\ + ./src \ + ../src \ + ../inc + +INCLUDEPATH += .\ + ./inc \ + ../../inc \ + ../../../inc \ + ../../../hsdomainmodel/inc + + + + +symbian: { + CONFIG += symbian_test + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + TARGET.UID3 = 0x20022F42 + TARGET.CAPABILITY = CAP_APPLICATION AllFiles + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB + + include(installs_symbian.pri) + + MMP_RULES += SMPSAFE +} + +include(t_hswidgetuninstaller.pri) + +win32:include(installs_win32.pri) + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/version10.manifest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/version10.manifest Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,10 @@ + + + helloworldwidgetplugin + helloworldwidgetplugin + Hello world + Hello world homescreen widget example + helloworldwidgetplugin.png + false + helloworldwidgetplugin.xml + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/version12.manifest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/t_hswidgetuninstaller/version12.manifest Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,10 @@ + + + 1.0 + helloworldwidgetplugin + Hello world + Hello world homescreen widget example + helloworldwidgetplugin.png + false + helloworldwidgetplugin.xml + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/hswidgetuninstaller/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/tsrc/tsrc.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,19 @@ +# +# 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 = t_hswidgetuninstaller +CONFIG += ordered +symbian: CONFIG += symbian_test diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/rom/bld.inf --- a/homescreenapp/rom/bld.inf Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/rom/bld.inf Mon Sep 20 10:19:07 2010 +0300 @@ -1,27 +1,17 @@ /* -* ============================================================================== -* Name : bld.inf -* Part of : -* Description : This is a top level bld file to generate all libraries. -* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. +* 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". * -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2 of the License, or (at your option) any later version. +* Initial Contributors: +* Nokia Corporation - initial contribution. * -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. +* Contributors: * -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the -* Free Software Foundation, Inc., 59 Temple Place - Suite 330, -* Boston, MA 02111-1307, USA. -* -* Description : This is a top level bld file to export the data and ROM files +* Description: homescreen core iby file * */ diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/rom/homescreenapp_core.iby --- a/homescreenapp/rom/homescreenapp_core.iby Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/rom/homescreenapp_core.iby Mon Sep 20 10:19:07 2010 +0300 @@ -88,7 +88,5 @@ file=ABI_DIR\BUILD_DIR\hsclockwidgetplugin.dll SHARED_LIB_DIR\hsclockwidgetplugin.dll data=DATAZ_\RESOURCE_FILES_DIR\qt\plugins\homescreen\hsclockwidgetplugin.qtplugin RESOURCE_FILES_DIR\qt\plugins\homescreen\hsclockwidgetplugin.qtplugin data=ZPRIVATE\20022f35\import\widgetregistry\20022F6C\hsclockwidgetplugin.manifest private\20022f35\import\widgetregistry\20022F6C\hsclockwidgetplugin.manifest -data=ZPRIVATE\20022f35\import\widgetregistry\20022F6C\tclock.png private\20022f35\import\widgetregistry\20022F6C\tclock.png -data=ZPRIVATE\20022f35\import\widgetregistry\20022F6C\qtg_graf_hswidget_preview_clock.svg private\20022f35\import\widgetregistry\20022F6C\qtg_graf_hswidget_preview_clock.svg #endif //__HOMESCREENAPP_CORE_IBY__ diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/bwins/hsmenuserviceprovideru.def --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/bwins/hsmenuserviceprovideru.def Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/bwins/hsmenuserviceprovideru.def Mon Sep 20 10:19:07 2010 +0300 @@ -58,4 +58,5 @@ ?removeApplicationFromCollection@HsMenuService@@SA_NHH@Z @ 57 NONAME ; bool HsMenuService::removeApplicationFromCollection(int, int) ?tr@HsMenuItemModel@@SA?AVQString@@PBD0@Z @ 58 NONAME ; class QString HsMenuItemModel::tr(char const *, char const *) ?getStaticMetaObject@HsMenuEntryRemovedHandler@@SAABUQMetaObject@@XZ @ 59 NONAME ; struct QMetaObject const & HsMenuEntryRemovedHandler::getStaticMetaObject(void) + ?executeAction@HsMenuService@@SAHABVCaEntry@@ABVQString@@PAVQObject@@PBD@Z @ 60 NONAME ; int HsMenuService::executeAction(class CaEntry const &, class QString const &, class QObject *, char const *) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/eabi/hsmenuserviceprovideru.def --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/eabi/hsmenuserviceprovideru.def Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/eabi/hsmenuserviceprovideru.def Mon Sep 20 10:19:07 2010 +0300 @@ -62,4 +62,5 @@ _ZTV15HsMenuItemModel @ 61 NONAME _ZTV25HsMenuEntryRemovedHandler @ 62 NONAME _ZTV26HsMenuCollectionsItemModel @ 63 NONAME + _ZN13HsMenuService13executeActionERK7CaEntryRK7QStringP7QObjectPKc @ 64 NONAME diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/hsmenuserviceprovider.pro --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/hsmenuserviceprovider.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/hsmenuserviceprovider.pro Mon Sep 20 10:19:07 2010 +0300 @@ -27,4 +27,5 @@ -lcasoftwareregistry symbian::TARGET.UID3 = 0x20026FA9 +symbian:MMP_RULES += SMPSAFE !symbian:exportResources(./resource/*.png, resource) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuservice.h --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuservice.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuservice.h Mon Sep 20 10:19:07 2010 +0300 @@ -49,7 +49,11 @@ static QStringList getCollectionNames(); static QString getName(int entryId); static int executeAction(int entryId, - const QString &actionName = Hs::openActionIdentifier, + const QString &actionName = Hs::openActionIdentifier, + QObject* receiver = NULL, + const char* member = NULL); + static int executeAction(const CaEntry &entry, + const QString &actionName = Hs::openActionIdentifier, QObject* receiver = NULL, const char* member = NULL); static bool launchTaskSwitcher(); @@ -66,13 +70,13 @@ static bool organizeCollection(int groupId, QList &entryIdList); static int allCollectionsId(); - + static int collectionIdByType(const QString& collectionType); static void touch(int entryId); - + static void touch(const QList &entryIdList); - + static int launchSoftwareUpdate(); private: diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuentryremovedhandler.cpp --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuentryremovedhandler.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuentryremovedhandler.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -31,7 +31,8 @@ /*! Constructor. - \param entryId identifies entry which removal is to be observed. + \param entryId identifies entry which removal is to be observed. If 0 no entry + will 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 @@ -45,7 +46,7 @@ const char *callback): mNotifier(0) { - if (receiver != 0 && callback != 0) { + if (entryId != 0 && receiver != 0 && callback != 0) { connect(this, SIGNAL(notify()), receiver, callback); subscribe(entryId); } diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuservice.cpp --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuservice.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuservice.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -182,7 +182,7 @@ \param actionName string with action name \retval int error code, 0 if no error */ -int HsMenuService::executeAction(int entryId, const QString &actionName, +int HsMenuService::executeAction(int entryId, const QString &actionName, QObject* receiver, const char* member) { qDebug() << "HsMenuService::executeAction entryId:" << entryId @@ -192,6 +192,22 @@ } /*! + Executes action on an item entry + \param entry of this item + \param actionName string with action name + \retval int error code, 0 if no error + */ +int HsMenuService::executeAction(const CaEntry &entry, + const QString &actionName, QObject* receiver, const char* member) +{ + qDebug() << "HsMenuService::executeAction entryId:" << entry.id() + << "actionName:" << actionName; + return CaService::instance()->executeCommand( + entry, actionName, receiver, member); +} + + +/*! Launch task switcher \retval boolean launching status */ diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/caentry.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/caentry.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,123 @@ +/* + * 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: caentry.h + * + */ + +#ifndef CAENTRY_H +#define CAENTRY_H + +#include +#include +#include +#include +#include + +#include "caicondescription.h" +class HbIcon; + +class CaEntry +{ + +public: + mutable EntryRole mCaEntryRole; + mutable int mIdResult; + mutable QString mTextResult; + mutable CaIconDescription mSetCaIconDescription; + mutable EntryFlags mFlagsResult; + mutable QString mEntryTypeNameResult; + mutable QMap mAttributes; + mutable QSizeF mMakeIconSize; + mutable HbIcon mMakeIconResult; + explicit CaEntry(EntryRole entryRole = ItemEntryRole): + mCaEntryRole(entryRole), + mIdResult(0) + { + mCaEntryRole = entryRole; + } + + int id() const + { + return mIdResult; + } + + QString text() const + { + return mTextResult; + } + + void setText(const QString &text) + { + mTextResult = text; + } + + void setIconDescription(const CaIconDescription &iconDescription) + { + mSetCaIconDescription = iconDescription; + } + EntryFlags flags() const + { + return mFlagsResult; + } + void setFlags(EntryFlags flags) + { + mFlagsResult = flags; + } + + QString entryTypeName() const + { + return mEntryTypeNameResult; + } + + void setEntryTypeName(const QString &entryTypeName) + { + mEntryTypeNameResult = entryTypeName; + } + + void setAttribute(const QString &name, const QString &value) + { + mAttributes.insert(name, value); + } + QString attribute(const QString &name) const + { + return mAttributes[name]; + } + + HbIcon makeIcon(const QSizeF &size = QSize(70, 70)) const + { + mMakeIconSize = size; + return mMakeIconResult; + } + + EntryRole role() const + { + return mCaEntryRole; + } + + // test helper, not belonging to ContentStorage CaEntry + void clear() + { + mCaEntryRole = ItemEntryRole; + mIdResult = 0; + mTextResult.clear(); + mSetCaIconDescription.clear(); + mFlagsResult = 0; + mEntryTypeNameResult.clear(); + mAttributes.clear(); + mMakeIconSize.setHeight(-1); + mMakeIconSize.setWidth(-1); + } +}; + +#endif // CAENTRY_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/caicondescription.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/caicondescription.h Mon Sep 20 10:19: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: caicondescription.h + * + */ + +#ifndef CAICONDESCRIPTION_H +#define CAICONDESCRIPTION_H + +#include +#include + +// mocks Content Storage CaIconDescrption +class CaIconDescription +{ + +public: + QString mSetFileName; + void setFilename(const QString &fileName) + { + mSetFileName = fileName; + } + + // test helper, not belonging to Content Storage CaIconDescription + void clear() + { + mSetFileName.clear(); + } +}; + +#endif // CAICONDESCRIPTION_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/caitemmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/caitemmodel.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,180 @@ +/* + * 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: caitemmodel.h + * + */ + +#ifndef CASTANDARDITEMMODEL_H +#define CASTANDARDITEMMODEL_H + +// System includes +#include +#include + +#include "caquery.h" +#include "caentry.h" +// Forward declarations +class CaEntry; + +// mock Class declaration +class CaItemModel: public QAbstractItemModel +{ + +Q_OBJECT + +public: + mutable CaQuery mCaItemModelQuery; + mutable QVariant mDataResult; + mutable QModelIndex mDataIndex; + mutable QModelIndex mIndexResult; + mutable QModelIndex mRootResult; + mutable QModelIndex mParentResult; + mutable int mDataRole; + mutable int mRowCountResult; + mutable int mColumnCountResult; + mutable SortAttribute mSetSortAttribute; + mutable Qt::SortOrder mSetSortOrder; + mutable bool mSecondLineVisibilityResult; + mutable bool mIsAutoUpdateResult; + mutable QSizeF mGetIconSizeResult; + mutable QSharedPointer mEntryResult; + // Data types + enum CaItemRole + { + IdRole = Qt::UserRole + 1, + ParentIdRole, + TypeRole, + FlagsRole, + TextRole,//contains title represented as QString, + FullTextRole //'title description' convinient for operations such as search + }; + + // Function declarations + CaItemModel(const CaQuery &query, QObject *parent = 0): + QAbstractItemModel(parent), + mCaItemModelQuery(query), + mDataRole(0), + mSecondLineVisibilityResult(false), + mIsAutoUpdateResult(false), + mEntryResult(new CaEntry) + { + } + + ~CaItemModel(){} + + int columnCount(const QModelIndex &parent = QModelIndex()) const + { + Q_UNUSED(parent); + return mColumnCountResult; + } + int rowCount(const QModelIndex &parent = QModelIndex()) const + { + Q_UNUSED(parent); + return mRowCountResult; + } + virtual QModelIndex index(int row, int column = 0, + const QModelIndex &parent = QModelIndex()) const + { + Q_UNUSED(parent); + return createIndex(row, column); + } + + virtual QModelIndex parent(const QModelIndex &index) const + { + Q_UNUSED(index); + return mParentResult; + } + + QModelIndex root() const + { + return mRootResult; + } + + virtual QVariant data(const QModelIndex &index, int role = + Qt::DisplayRole) const + { + mDataIndex = index; + mDataRole = role; + return mDataResult; + } + void setAutoUpdate(bool autoUpdate) + { + mIsAutoUpdateResult = autoUpdate; + } + void setSecondLineVisibility(bool secondLineVisible) + { + mSecondLineVisibilityResult = secondLineVisible; + } + bool secondLineVisibility() const + { + return mSecondLineVisibilityResult; + } + + bool isAutoUpdate() const + { + return mIsAutoUpdateResult; + } + + void setSort(SortAttribute sortAttribute, + Qt::SortOrder sortOrder = Qt::AscendingOrder) + { + mSetSortAttribute = sortAttribute; + mSetSortOrder = sortOrder; + } + + void setIconSize(const QSizeF &size) + { + mGetIconSizeResult = size; + } + + QSizeF getIconSize() const + { + return mGetIconSizeResult; + } + void updateModel(){} + void setParentId(int parentId) + { + Q_UNUSED(parentId); + } + void setFlagsOn(const EntryFlags &onFlags) + { + Q_UNUSED(onFlags); + } + void setFlagsOff(const EntryFlags &offFlags) + { + Q_UNUSED(offFlags); + } + QSharedPointer entry(const QModelIndex &index) const + { + Q_UNUSED(index); + return mEntryResult; + } + QList getUninstallingEntriesIds(int componentId) + { + Q_UNUSED(componentId); + QList ids; + ids.append(mEntryResult->id()); + ids.append(4); + return ids; + } + void updateProgress(int id, int valueOfProgress) + { + if (id == mEntryResult->id()) { + mEntryResult->setAttribute(QString("uninstall_progress"), + QString().setNum(valueOfProgress)); + } + } +}; + +#endif // CASTANDARDITEMMODEL_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/canotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/canotifier.h Mon Sep 20 10:19: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: canotifier.h + * + */ + +#ifndef CANOTIFIER_H +#define CANOTIFIER_H + +#include +#include "cadefs.h" +#include "caentry.h" + +class CaNotifier: public QObject +{ +Q_OBJECT + +public: + + explicit CaNotifier() {}; + + virtual ~CaNotifier() {}; + + void issueEntryChanged(int entryId, ChangeType changeType) + { + emit entryChanged(entryId, changeType); + } +signals: + + /*! + A signal emited when the entry is changed. + \param entryId entry id. + \param changeType the type of the change. + */ + void entryChanged(int entryId, ChangeType changeType); + + /*! + A signal emited when the entry is changed. + \param entry changed entry. + \param changeType the type of the change. + */ + void entryChanged(const CaEntry &entry, ChangeType changeType); + + /*! + A signal emited when the entry is touched. + \param id entry id. + */ + void entryTouched(int id); + + /*! + A signal emited when group content is changed. + \param groupId group id. + */ + void groupContentChanged(int groupId); + +protected: + + virtual void connectNotify(const char * signal) { Q_UNUSED(signal); } + + virtual void disconnectNotify(const char * signal) { Q_UNUSED(signal); } + +}; + + +#endif // CANOTIFIER_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/canotifierfilter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/canotifierfilter.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,50 @@ +/* + * 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: canotifierfilter.h + * + */ + +#ifndef CANOTIFIERFILTER_H +#define CANOTIFIERFILTER_H + +#include + +#include + + + +class CaQuery; + +class CaNotifierFilter +{ + +public: + + CaNotifierFilter() {} + virtual ~CaNotifierFilter() {} + + + QList getIds() const {return mIds;} + void setIds(const QList &ids) {mIds = ids;} + + EntryRoles getEntryRole() const; + void setEntryRole(EntryRoles entryRole); + + QStringList getTypeNames() const; + void setTypeNames(const QStringList &typeNames); + + QList mIds; +}; + +#endif // CANOTIFIERFILTER_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/caquery.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/caquery.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,121 @@ +/* + * 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: caquery.h + * + */ + +#ifndef CAQUERY_H +#define CAQUERY_H + +#include +#include +#include +#include +#include "caclient_global.h" +#include "cadefs.h" + +// mocks Content Storage CaQuery +class CaQuery +{ + +public: + CaQuery(): + mSetParentId(0), + mSetSortAttribute(NameSortAttribute), + mSetSortOrder(Qt::AscendingOrder) + {} + + void setEntryRoles(EntryRoles entryRoles); + + void setParentId(int id); + + + void addEntryTypeName(const QString &entryTypeName); + + void setFlagsOn(const EntryFlags &onFlags); + + void setFlagsOff(const EntryFlags &offFlags); + + void setSort(SortAttribute sortAttribute, + Qt::SortOrder sortOrder = Qt::AscendingOrder); + + QMap attributes() const { return QMap(); } + QString attribute(const QString &name) const { + Q_UNUSED(name); + return QString(); } + void setAttribute(const QString &name, const QString &value) { + Q_UNUSED(name); + Q_UNUSED(value); + } + + void removeAttribute(const QString &name) { Q_UNUSED(name); } + + + // test supporting members + mutable int mSetParentId; + mutable EntryRoles mSetEntryRoles; + mutable QList mAddEntryTypeNames; + mutable EntryFlags mSetFlagsOn; + mutable EntryFlags mSetFlagsOff; + mutable SortAttribute mSetSortAttribute; + mutable Qt::SortOrder mSetSortOrder; + mutable QString mQueryId; + + // test helper, not belonging to Content Storage CaQuery + void clear() + { + mSetParentId = 0; + mSetEntryRoles = 0; + mAddEntryTypeNames.clear(); + mSetFlagsOn = 0; + mSetFlagsOff = 0; + mSetSortAttribute = NameSortAttribute; + mSetSortOrder = Qt::AscendingOrder; + } + +}; + +inline void CaQuery::setEntryRoles(EntryRoles entryRoles) +{ + mSetEntryRoles = entryRoles; +} + +inline void CaQuery::setParentId(int id) +{ + mSetParentId = id; +} + + +inline void CaQuery::addEntryTypeName(const QString &entryTypeName) +{ + mAddEntryTypeNames.append(entryTypeName); +} + +inline void CaQuery::setFlagsOn(const EntryFlags &onFlags) +{ + mSetFlagsOn = onFlags; +} + +inline void CaQuery::setFlagsOff(const EntryFlags &offFlags) +{ + mSetFlagsOff = offFlags; +} + +inline void CaQuery::setSort(SortAttribute sortAttribute, + Qt::SortOrder sortOrder) +{ + mSetSortAttribute = sortAttribute; + mSetSortOrder = sortOrder; +} +#endif // CAQUERY_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/caservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/caservice.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,318 @@ +/* + * 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: caservice.h + * + */ + +#ifndef CASERVICE_H +#define CASERVICE_H + +#include +#include +#include +#include +#include +#include + + +#include "caservice.h" +#include "caquery.h" +#include "caentry.h" +#include "canotifier.h" +#include "canotifierfilter.h" +#include "cadefs.h" + +typedef QList< QSharedPointer > CaEntryList; + +// mocks Content Storage's CaService +class CaService: public QObject +{ + Q_OBJECT + + explicit CaService(QObject *parent = 0); + + ~CaService(); +public: + + + static QSharedPointer instance(); + + // mock only those methods of original CaService that are used in the module + QSharedPointer getEntry(int entryId) const; + QList< QSharedPointer > getEntries(const CaQuery &query) const; + QList getEntryIds(const CaQuery &query) const; + + QSharedPointer createEntry(const CaEntry &entry) const; + + bool removeEntry(int entryId) const; + bool updateEntry(const CaEntry &entry) const; + bool touch(const CaEntry &entry) const; + bool removeEntryFromGroup(int groupId, int entryId) const; + bool appendEntryToGroup(int groupId, int entryId) const; + bool appendEntriesToGroup(int groupId, + const QList &entryIdList) const; + + int executeCommand(int entryId, const QString &command = + caCmdOpen, QObject* receiver = NULL, const char* member = NULL) const; + int executeCommand(const CaEntry &entry, const QString &command = + caCmdOpen, QObject* receiver = NULL, const char* member = NULL) const; + + + bool customSort(int groupId, QList &entryIdList) const; + + CaNotifier * createNotifier(const CaNotifierFilter &filter) const; + + mutable int mGetEntryId; + mutable QSharedPointer mGetEntryResult; + mutable CaQuery mGetEntriesQuery; + mutable QList< QSharedPointer > mGetEntriesResult; + mutable CaQuery mGetEntryIdQuery; + mutable QList mGetEntryIdsResult; + mutable CaEntry mCreatedEntry; + mutable QSharedPointermCreateEntryResult; + + mutable int mRemoveEntryId; + mutable bool mRemoveEntryForIdResult; + + mutable CaEntry mUpdateEntry; + mutable bool mUpdateEntryResult; + + mutable CaEntry mTouchEntry; + mutable QList mTouchEntriesId; + mutable bool mTouchResult; + + mutable int mRemoveGroupId; + mutable int mRemoveEntryFromGroupId; + mutable bool mRemoveEntryFromGroupResult; + + mutable int mAppendGroupId; + mutable int mAppenEntryId; + mutable bool mAppendEntryToGroupResult; + + mutable int mAppendListGroupId; + mutable QList mAppendEntryIdList; + mutable bool mAppendEntriesToGroupResult; + + mutable int mExecuteEntryId; + mutable QString mExecuteCommand; + mutable int mExecuteCommandResult; + + mutable CaEntry mExecuteEntry; + + mutable int mCustomSortGroupId; + mutable QList mCustomSortEntryIdList; + mutable bool mCustomSortResult; + + mutable CaNotifierFilter mCreateNotifierFilter; + mutable CaNotifier *mCreateNotifierResult; + + // helper for tests, not belonging to CaService + void clear() + { + mGetEntryId = 0; + mGetEntryResult.clear(); + mGetEntriesQuery.clear(); + mGetEntriesResult.clear(); + mGetEntryIdQuery.clear(); + mGetEntryIdsResult.clear(); + mCreatedEntry.clear(); + mCreateEntryResult.clear(); + mRemoveEntryId = 0; + mRemoveEntryForIdResult = false; + + mUpdateEntry.clear(); + mUpdateEntryResult = false; + + mTouchEntry.clear(); + mTouchEntriesId.clear(); + mTouchResult = false; + + mRemoveGroupId = 0; + mRemoveEntryFromGroupId = 0; + mRemoveEntryFromGroupResult = false; + + mAppendGroupId = 0; + mAppenEntryId = 0; + mAppendEntryToGroupResult = false; + + mAppendListGroupId = 0; + mAppendEntryIdList.clear(); + mAppendEntriesToGroupResult = false; + + mExecuteEntryId = 0; + mExecuteCommand.clear(); + mExecuteCommandResult = -333; + + mCustomSortGroupId = 0; + mCustomSortEntryIdList.clear(); + mCustomSortResult = false; + + mCreateNotifierFilter = CaNotifierFilter(); + mCreateNotifierResult = 0; + } +private: + Q_DISABLE_COPY(CaService) + friend class QtSharedPointer::ExternalRefCount; +}; + + + + + +inline CaService::CaService(QObject *parent) : + QObject(parent), + mGetEntryId(0), + mRemoveEntryId(0), + mRemoveEntryForIdResult(false), + mUpdateEntryResult(false), + mTouchResult(false), + mRemoveGroupId(0), + mRemoveEntryFromGroupId(0), + mRemoveEntryFromGroupResult(false), + mAppendGroupId(0), + mAppenEntryId(0), + mAppendEntryToGroupResult(false), + mAppendListGroupId(0), + mAppendEntriesToGroupResult(false), + mExecuteEntryId(0), + mExecuteCommandResult(false), + mCustomSortGroupId(0), + mCustomSortResult(false), + mCreateNotifierResult(0) + +{ +} + +inline QSharedPointer CaService::instance() +{ + static QSharedPointer service(new CaService); + return service; +} + +inline CaService::~CaService() +{ +} + +inline QSharedPointer CaService::getEntry(int entryId) const +{ + mGetEntryId = entryId; + if (!mGetEntryResult.isNull()) { + mGetEntryResult->mIdResult = entryId; + } + return mGetEntryResult; +} + + +inline QList< QSharedPointer > CaService::getEntries(const CaQuery &query) const +{ + mGetEntriesQuery = query; + return mGetEntriesResult; +} + +inline QList CaService::getEntryIds(const CaQuery &query) const +{ + mGetEntryIdQuery = query; + return mGetEntryIdsResult; +} + +inline QSharedPointer CaService::createEntry(const CaEntry &entry) const +{ + mCreatedEntry = entry; + return mCreateEntryResult; +} + +inline bool CaService::removeEntry(int entryId) const +{ + mRemoveEntryId = entryId; + return mRemoveEntryForIdResult; +} + + +inline bool CaService::updateEntry(const CaEntry &entry) const +{ + mUpdateEntry = entry; + return mUpdateEntryResult; +} + +inline bool CaService::touch(const CaEntry &entry) const +{ + if (entry.flags() & RemovableEntryFlag && + (entry.flags() & UsedEntryFlag) == 0 && + entry.role() == ItemEntryRole && + entry.entryTypeName() != QString("package")) { //packageTypeName + mTouchEntry = entry; + mTouchEntriesId.append(entry.id()); + return mTouchResult; + } else { + return true; + } +} + +inline bool CaService::removeEntryFromGroup(int groupId, int entryId) const +{ + mRemoveGroupId = groupId; + mRemoveEntryFromGroupId = entryId; + return mRemoveEntryFromGroupResult; +} + +inline bool CaService::appendEntryToGroup(int groupId, int entryId) const +{ + mAppendGroupId = groupId; + mAppenEntryId = entryId; + return mAppendEntryToGroupResult; +} + +inline bool CaService::appendEntriesToGroup(int groupId, + const QList &entryIdList) const +{ + mAppendListGroupId = groupId; + mAppendEntryIdList = entryIdList; + return mAppendEntriesToGroupResult; +} + +inline int CaService::executeCommand(int entryId, const QString &command, + QObject* receiver, const char* member) const +{ + Q_UNUSED(receiver); + Q_UNUSED(member); + mExecuteEntryId = entryId; + mExecuteCommand = command; + return mExecuteCommandResult; +} + +inline int CaService::executeCommand(const CaEntry &entry, const QString &command, + QObject* receiver, const char* member) const +{ + Q_UNUSED(receiver); + Q_UNUSED(member); + mExecuteEntry = entry; + mExecuteCommand = command; + return mExecuteCommandResult; +} + +inline bool CaService::customSort(int groupId, QList &entryIdList) const +{ + mCustomSortGroupId = groupId; + mCustomSortEntryIdList = entryIdList; + return mCustomSortResult; +} + +inline CaNotifier * CaService::createNotifier(const CaNotifierFilter &filter) const +{ + mCreateNotifierFilter = filter; + return mCreateNotifierResult; +} + + +#endif // CASERVICE_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/t_hsmenuentryremovedcallback.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/t_hsmenuentryremovedcallback.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,35 @@ +/* +* 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: Tests for HomeScreenStateProvider class. +* +*/ + +#ifndef T_HS_MENU_ENTRY_REMOVED_CALLBACK_H +#define T_HS_MENU_ENTRY_REMOVED_CALLBACK_H + +#include + +class T_HsMenuEntryRemovedCallback: public QObject +{ + Q_OBJECT +public: + T_HsMenuEntryRemovedCallback(): mCallsCount(0) {} + int callsCount() {return mCallsCount;} +public slots: + void callback() { ++mCallsCount;}; +private: + int mCallsCount; +}; + +#endif diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/t_hsmenuserviceprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/inc/t_hsmenuserviceprovider.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Tests for HomeScreenStateProvider class. +* +*/ + + +#ifndef T_HSMCSSTATES_H +#define T_HSMCSSTATES_H +#include +#ifdef Q_OS_SYMBIAN +#include +#include +#endif + + +class HsMenuItemModel; +/** +* @test Test class for menuservice modules. +*/ +class MenuServiceTest : public QObject +{ + Q_OBJECT + +private slots: + + + /** + * initialize + */ + void initTestCase(); + /* + * Tests + */ + void MenuService_getAllApplicationsModel(); + void MenuService_getAllCollectionsModel(); + void MenuService_getInstalledModel(); + void MenuService_getCollectionModel(); + void MenuService_getCollectionNames(); + void MenuService_getName(); + void MenuService_executeAction(); + void MenuService_executeActionEntry(); +#ifdef Q_OS_SYMBIAN + void MenuService_launchTS(); +#endif//Q_OS_SYMBIAN + void MenuService_createCollection(); + void MenuService_renameCollection(); + void MenuService_removeCollection(); + void MenuService_addApplicationsToCollection(); + void MenuService_removeApplicationFromCollection(); + void MenuService_organizeCollection(); + void MenuService_touchAction(); + void MenuService_touchListOfIdsAction(); + void MenuService_launchSoftwareUpdate(); + void MenuService_collectionIdByType(); + + + void HsMenuItemModel_construction(); + void HsMenuItemModel_setSort(); + void HsMenuItemModel_getData(); + void HsMenuItemModel_newIconNeeded(); + void HsMenuItemModel_uninstallChange(); + void HsMenuItemModel_preloadIcons(); + + void HsIconsIdleLoader_construction(); + + void HsMenuCollectionsItemModel_construction(); + void HsMenuCollectionsItemModel_getData(); + void HsMenuCollectionsItemModel_getSecondLine(); + + void HsMenuEntryRemovedHandlerTest_data(); + void HsMenuEntryRemovedHandlerTest(); + + + /** + * cleanup + */ + void cleanup(); + void cleanupTestCase(); + +private: + + int getId(HsMenuItemModel *model , int index); + +private: +#ifdef Q_OS_SYMBIAN + void startThread(); + void stopThread(); + RThread iThread; +#endif //Q_OS_SYMBIAN +}; + +#endif diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/installs_unix.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/installs_unix.pri Mon Sep 20 10:19: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: +# + +testfiles.path = ../../../../../../bin/hstests/ + + +testfiles.files = ./release/t_hsmenuserviceprovider + + + + + +statemachinedllrel.path = ./release/ + + +statemachinedllrel.files = ../../../../../hsstatemachine/release/*.so* + + + + + +statemachinedlldebug.path = ./debug/ + + +statemachinedlldebug.files = ../../../../../hsstatemachine/debug/*.so + + + + + +INSTALLS += testfiles statemachinedllrel statemachinedlldebug + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/installs_win32.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,34 @@ +# +# 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: +# + +testfiles.path = ../../../../../../bin/debug/ + +testfiles.files = ./release/t_hsmenuserviceprovider.exe \ + +testfiles.files = ./debug/t_hsmenuserviceprovider.exe \ + + +statemachinedllrel.path = ./release/ + +statemachinedllrel.files = ../../../../../core/hsstatemachine/release/*.dll + + + +statemachinedlldebug.path = ./debug/ + +statemachinedlldebug.files = ../../../../../core/hsstatemachine/debug/*.dll + +INSTALLS += testfiles #statemachinedllrel statemachinedlldebug diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/src/t_hsmenuentryremovedhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/src/t_hsmenuentryremovedhandler.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,74 @@ +/* + * 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: + * + */ + +#include +#include + +#include "t_hsmenuserviceprovider.h" +#include "hsmenuentryremovedhandler.h" +#include "t_hsmenuentryremovedcallback.h" +#include +#include "caservice.h" +#include "canotifier.h" +#include "canotifierfilter.h" + + + +void MenuServiceTest::HsMenuEntryRemovedHandlerTest_data() +{ + // define testing data table + QTest::addColumn("subscribedId"); + QTest::addColumn("notifiedChangeType"); + QTest::addColumn("notificationsCount"); + QTest::addColumn("callbacksCount"); + // prepare concrete rows for testing + // id changeType + QTest::newRow("non_matching_id") << 0 << static_cast(RemoveChangeType) << 1 << 0; + + QTest::newRow("non_matching_change_type") << 1 << static_cast(AddChangeType) << 1 << 0; + + QTest::newRow("many_notifications") << 1 << static_cast(RemoveChangeType) << 3 << 1; + + QTest::newRow("one_notification") << 1 << static_cast(RemoveChangeType) << 1 << 1; + + QTest::newRow("no_notification") << 1 << static_cast(RemoveChangeType) << 0 << 0; +} + +void MenuServiceTest::HsMenuEntryRemovedHandlerTest() +{ + QFETCH(int, subscribedId); + QFETCH(int, notifiedChangeType); + QFETCH(int, notificationsCount); + QFETCH(int, callbacksCount); + + QPointer caNotifierMock(new CaNotifier()); + CaService::instance()->mCreateNotifierResult = caNotifierMock.data(); + + T_HsMenuEntryRemovedCallback callbackObj; + HsMenuEntryRemovedHandler handler(subscribedId, &callbackObj, SLOT(callback())); + + QSignalSpy spy(&handler, SIGNAL(notify())); + + for (int i = 0 ; i < notificationsCount && !caNotifierMock.isNull(); ++i) { + caNotifierMock->issueEntryChanged(subscribedId, + static_cast(notifiedChangeType)); + qApp->processEvents(); + } + + QCOMPARE(callbackObj.callsCount(), callbacksCount); + QCOMPARE(spy.count(), callbackObj.callsCount()); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/src/t_menuitemmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/src/t_menuitemmodel.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,330 @@ +/* +* 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 "caquery.h" +#include +#include "hsmenuservice.h" +#include "hsmenucollectionsitemmodel.h" +#include "hsmenuitemmodel.h" +#include "hsmenuserviceutils.h" +#include "t_hsmenuserviceprovider.h" +#include "hsiconsidleloader.h" + +void MenuServiceTest::HsMenuItemModel_construction() +{ + QScopedPointer parent(new QObject); + CaQuery query; + query.mQueryId = "__HsMenuItemModel_construction_CaQuery"; + HsMenuItemModel model(query, parent.data()); + QCOMPARE(model.mCaItemModelQuery.mQueryId, query.mQueryId); + QCOMPARE(model.QObject::parent(), parent.data()); + QVERIFY(model.getIconSize().isValid()); +} + +void MenuServiceTest::HsMenuItemModel_setSort() +{ + HsMenuItemModel model(CaQuery(), this); + + { + const Hs::HsSortAttribute sortAttribute = Hs::NoHsSortAttribute; + + model.setSort(sortAttribute); + QCOMPARE(model.mSetSortAttribute, HsMenuServiceUtils::sortBy(sortAttribute)); + QCOMPARE(model.mSetSortOrder, HsMenuServiceUtils::sortOrder(sortAttribute)); + } + { + const Hs::HsSortAttribute sortAttribute = Hs::DescendingNameHsSortAttribute; + + model.setSort(sortAttribute); + QCOMPARE(model.mSetSortAttribute, HsMenuServiceUtils::sortBy(sortAttribute)); + QCOMPARE(model.mSetSortOrder, HsMenuServiceUtils::sortOrder(sortAttribute)); + } +} + +void MenuServiceTest::HsMenuItemModel_getData() +{ + HsMenuItemModel model(CaQuery(), this); + + Qt::ItemDataRole role = Qt::DecorationRole; + const QModelIndex index = model.index(0, 0); + const QVariant expectedDecoration(QString("entryText")); + QList expectedResult; + expectedResult << expectedDecoration; + expectedResult << HbIcon(Hs::newIconId); + + model.mRootResult = index; + model.mEntryResult->mFlagsResult = 0; + model.mEntryResult->mEntryTypeNameResult = Hs::collectionDownloadedTypeName; + model.setSecondLineVisibility(true); + model.mDataResult = QVariant(expectedDecoration); + + QList actualResult = model.data(index, role).toList(); + + QCOMPARE(actualResult.at(0).toString(), + expectedDecoration.toString()); + QCOMPARE(actualResult.at(1).value().iconName(), + QString(Hs::newIconId)); + + QCOMPARE(model.data(index), model.mDataResult); +} + + +void MenuServiceTest::HsMenuItemModel_newIconNeeded() +{ + HsMenuItemModel model(CaQuery(), this); + + const QModelIndex index = model.index(0, 0); + model.mRootResult = index; + model.mEntryResult->mFlagsResult = 0; + model.mEntryResult->mEntryTypeNameResult = Hs::collectionDownloadedTypeName; + model.setSecondLineVisibility(true); + QVERIFY(model.newIconNeeded(index)); + + model.mRootResult = QModelIndex(); // invalid + QVERIFY(!model.root().isValid() && + !model.newIconNeeded(index)); + + model.mRootResult = index; + model.mEntryResult->mFlagsResult = UsedEntryFlag; + QVERIFY((model.entry(index)->flags() & UsedEntryFlag) && + !model.newIconNeeded(index)); + + model.mEntryResult->mFlagsResult = 0; + model.mEntryResult->mEntryTypeNameResult = ""; + QVERIFY((model.entry(index)->entryTypeName() != Hs::collectionDownloadedTypeName ) && + !model.newIconNeeded(index)); + +} + + +void MenuServiceTest::HsMenuItemModel_uninstallChange() +{ + HsMenuItemModel model(CaQuery(), this); + const QModelIndex index = model.index(0, 0); + model.mRootResult = index; + model.mEntryResult->mFlagsResult = 0; + model.mEntryResult->setAttribute(QString("component_id"), + QString().setNum(1)); + + model.uninstallChange(1, 5); + QCOMPARE(model.mComponentId, 1); + QCOMPARE(model.mIds.count(), 2); + QCOMPARE(model.mEntryResult->attribute( + QString("uninstall_progress")), QString("5")); + + model.uninstallChange(1, 20); + QCOMPARE(model.mEntryResult->attribute( + QString("uninstall_progress")), QString("20")); +} + +void MenuServiceTest::HsMenuCollectionsItemModel_construction() +{ + QScopedPointer parent(new QObject); + CaQuery query; + query.mQueryId = "__HsMenuCollectionItemModel_construction_CaQuery"; + HsMenuCollectionsItemModel model(query, parent.data()); + QCOMPARE(model.mCaItemModelQuery.mQueryId, query.mQueryId); + QCOMPARE(model.QObject::parent(), parent.data()); + QVERIFY(model.getIconSize().isValid()); +} + + + +void MenuServiceTest::HsMenuCollectionsItemModel_getData() +{ + HsMenuCollectionsItemModel model(CaQuery(), this); + + const QModelIndex index = model.index(0, 0); + const QString expectedText("entryText"); + const QString expectedSecondLine(hbTrId("txt_applib_dblist_downloaded_val_empty")); + + model.mRootResult = index; + model.mEntryResult->mFlagsResult = 0; + model.mEntryResult->mTextResult = expectedText; + model.setSecondLineVisibility(true); + + QList actualResult = model.data(index).toList(); + + QCOMPARE(actualResult.at(0).toString(), + expectedText); + QCOMPARE(actualResult.at(1).toString(), + expectedSecondLine); + + + Qt::ItemDataRole role = Qt::DecorationRole; + const QVariant expectedData; + + model.mDataResult = expectedData; + QCOMPARE(model.data(index, role), expectedData); + + model.setSecondLineVisibility(false); + QCOMPARE(model.data(index), expectedData); +} +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +void MenuServiceTest::HsMenuCollectionsItemModel_getSecondLine() +{ + HsMenuCollectionsItemModel model(CaQuery(), this); + Qt::ItemDataRole role = Qt::DisplayRole; + model.setSecondLineVisibility(true); + const QModelIndex index = model.index(0, 0); + + // set up mock data + + // make up 2 items to be stored in a collection + QSharedPointer collectionItemA(new CaEntry); + QString collectionItemAName("A"); + collectionItemA->mTextResult = collectionItemAName; + QSharedPointer collectionItemB(new CaEntry); + QString collectionItemBName("B"); + collectionItemB->mTextResult = collectionItemBName; + + // make sure CaService will return the 2 entries on getEntries call + CaService::instance()->mGetEntriesResult.append(collectionItemA); + CaService::instance()->mGetEntriesResult.append(collectionItemB); + + QString expectedSecondLine(hbTrId("txt_applib_dblist_val_ln_new_applications", + CaService::instance()->mGetEntriesResult.count())); + + // make data() call getSecondLine for 'downloaded' collection + model.mEntryResult->setEntryTypeName(Hs::collectionDownloadedTypeName); + model.mEntryResult->mIdResult = 5; // just to have any id + + QString actualSecondLine = model.data(index, role).toList().at(1).toString(); + + QCOMPARE(actualSecondLine, expectedSecondLine); + + // check what CaQuery was prepared by getSecondLine() + CaQuery resultQuery = CaService::instance()->mGetEntriesQuery; + QCOMPARE(resultQuery.mSetParentId, model.mEntryResult->mIdResult); + QCOMPARE(resultQuery.mSetEntryRoles, ItemEntryRole); + const EntryFlags expectedCollectionDownloadedFlags = + RemovableEntryFlag | VisibleEntryFlag; + QCOMPARE(resultQuery.mSetFlagsOn, expectedCollectionDownloadedFlags); + + + // case for static collection + const EntryFlags expectedCollectionFlag = VisibleEntryFlag; + expectedSecondLine = collectionItemAName + "," + collectionItemBName; + + model.mEntryResult->setEntryTypeName(Hs::collectionTypeName); + + actualSecondLine = model.data(index, role).toList().at(1).toString(); + + QCOMPARE(actualSecondLine, expectedSecondLine); + + resultQuery = CaService::instance()->mGetEntriesQuery; + QCOMPARE(resultQuery.mSetFlagsOn, expectedCollectionFlag); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void MenuServiceTest::HsMenuItemModel_preloadIcons() +{ + HsMenuItemModel model(CaQuery(), this); + + // set up mock data + Qt::ItemDataRole role = Qt::DecorationRole; + const QModelIndex index = model.index(0, 0); + const QVariant expectedDecoration(QString("entryText")); + QList expectedResult; + expectedResult << expectedDecoration; + expectedResult << HbIcon(Hs::newIconId); + model.mRootResult = index; + model.mEntryResult->mFlagsResult = 0; + model.mEntryResult->mEntryTypeNameResult = Hs::collectionDownloadedTypeName; + model.setSecondLineVisibility(true); + model.mDataResult = QVariant(expectedDecoration); + model.mRowCountResult = 1; // i.e. how many rows the mock model pretends to have + QList actualResult = model.data(index, role).toList(); + model.mEntryResult->mMakeIconResult = HbIcon(Hs::newIconId); + + // verify mock setup + QCOMPARE(actualResult.at(0).toString(), + expectedDecoration.toString()); + QCOMPARE(actualResult.at(1).value().iconName(), + QString(Hs::newIconId)); + QCOMPARE(model.data(index), model.mDataResult); + + // invoke icon preloader construction + model.preloadIcons(); + QVERIFY(model.mIconsIdleLoader); + + // invoke icon preloading + + model.mIconsIdleLoader->processWhenIdle(); + + // compare what has been logged in mock object with referece data + QCOMPARE(model.mEntryResult->mMakeIconSize, model.getIconSize()); + QCOMPARE(model.mEntryResult->mMakeIconResult.iconName(), + QString(Hs::newIconId)); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void MenuServiceTest::HsIconsIdleLoader_construction() +{ + // precondtitons - prepare model + HsMenuItemModel model(CaQuery(), this); + + // set up mock data + Qt::ItemDataRole role = Qt::DecorationRole; + const QModelIndex index = model.index(0, 0); + const QVariant expectedDecoration(QString("entryText")); + QList expectedResult; + expectedResult << expectedDecoration; + expectedResult << HbIcon(Hs::newIconId); + model.mRootResult = index; + model.mEntryResult->mFlagsResult = 0; + model.mEntryResult->mEntryTypeNameResult = Hs::collectionDownloadedTypeName; + model.setSecondLineVisibility(true); + model.mDataResult = QVariant(expectedDecoration); + model.mRowCountResult = 1; // i.e. how many rows the mock model pretends to have + QList actualResult = model.data(index, role).toList(); + model.mEntryResult->mMakeIconResult = HbIcon(Hs::newIconId); + + QCOMPARE(actualResult.at(0).toString(), + expectedDecoration.toString()); + QCOMPARE(actualResult.at(1).value().iconName(), + QString(Hs::newIconId)); + + QCOMPARE(model.data(index), model.mDataResult); + + // test + HsIconsIdleLoader *iconsIdleLoader = new HsIconsIdleLoader(&model); + + QVERIFY(iconsIdleLoader->mModel); + QVERIFY(iconsIdleLoader->mTimer); + QVERIFY(iconsIdleLoader->mTimer->isActive()); + QTest::qWait(10000); + QVERIFY(!iconsIdleLoader->mTimer->isActive()); + + delete iconsIdleLoader; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +int MenuServiceTest::getId(HsMenuItemModel *model , int idx) +{ + return model->data(model->index(idx), CaItemModel::IdRole).toInt(); +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/src/t_menuservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/src/t_menuservice.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,864 @@ +/* + * 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: Main test class for hsHomeScreenStateProvider library. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "caitemmodel.h" +#include "hsmenuitemmodel.h" +#include "caservice.h" +#include "hsmenuservice.h" +#include "hsmenuserviceutils.h" +#include "t_hsmenuserviceprovider.h" + +QTM_USE_NAMESPACE + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::MenuService_getAllApplicationsModel() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + const Hs::HsSortAttribute + defaultSortAttribute(Hs::DescendingNameHsSortAttribute); + + QScopedPointer + model(HsMenuService::getAllApplicationsModel()); + + CaQuery actualQuery = model->mCaItemModelQuery; + CaQuery expectedQuery; + expectedQuery.setEntryRoles(ItemEntryRole); + expectedQuery.addEntryTypeName(Hs::applicationTypeName); + expectedQuery.addEntryTypeName(Hs::urlTypeName); + expectedQuery.addEntryTypeName(Hs::widgetTypeName); + expectedQuery.addEntryTypeName(Hs::templatedApplicationTypeName); + expectedQuery.setFlagsOn(VisibleEntryFlag); + expectedQuery.setFlagsOff(MissingEntryFlag); + expectedQuery.setSort(HsMenuServiceUtils::sortBy(defaultSortAttribute), + HsMenuServiceUtils::sortOrder(defaultSortAttribute)); + QCOMPARE(actualQuery.mSetEntryRoles, expectedQuery.mSetEntryRoles); + QCOMPARE(actualQuery.mAddEntryTypeNames, + expectedQuery.mAddEntryTypeNames); + QCOMPARE(actualQuery.mSetFlagsOn, expectedQuery.mSetFlagsOn); + QCOMPARE(actualQuery.mSetFlagsOff, expectedQuery.mSetFlagsOff); + QCOMPARE(actualQuery.mSetSortAttribute, + expectedQuery.mSetSortAttribute); + QCOMPARE(actualQuery.mSetSortOrder, expectedQuery.mSetSortOrder); + + // check non-default sort attribute + const Hs::HsSortAttribute + ascendingSortAttribute(Hs::AscendingNameHsSortAttribute); + + model.reset( + HsMenuService::getAllApplicationsModel(ascendingSortAttribute)); + + actualQuery = model->mCaItemModelQuery; + + expectedQuery.setSort( + HsMenuServiceUtils::sortBy(ascendingSortAttribute), + HsMenuServiceUtils::sortOrder(ascendingSortAttribute)); + + QCOMPARE(actualQuery.mSetSortAttribute, + expectedQuery.mSetSortAttribute); + QCOMPARE(actualQuery.mSetSortOrder, expectedQuery.mSetSortOrder); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif + +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::MenuService_getAllCollectionsModel() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + const int allCollectionId = 8; + // ensure HsMenuService::allCollectionId will return + // non zero value, if it does not already + CaService::instance()->mGetEntryIdsResult.clear(); + CaService::instance()->mGetEntryIdsResult << allCollectionId; + + QScopedPointer + model(HsMenuService::getAllCollectionsModel()); + + CaQuery actualQuery = model->mCaItemModelQuery; + + CaQuery expectedQuery; + expectedQuery.setParentId(HsMenuService::allCollectionsId()); + expectedQuery.setFlagsOn(VisibleEntryFlag); + expectedQuery.setFlagsOff(MissingEntryFlag); + + QCOMPARE(actualQuery.mSetParentId, expectedQuery.mSetParentId); + QCOMPARE(actualQuery.mSetFlagsOn, expectedQuery.mSetFlagsOn); + QCOMPARE(actualQuery.mSetFlagsOff, expectedQuery.mSetFlagsOff); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::MenuService_getInstalledModel() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + const Hs::HsSortAttribute + defaultSortAttribute(Hs::DescendingNameHsSortAttribute); + + QScopedPointer + model(HsMenuService::getInstalledModel()); + + CaQuery actualQuery = model->mCaItemModelQuery; + + CaQuery expectedQuery; + expectedQuery.addEntryTypeName(Hs::packageTypeName); + expectedQuery.setFlagsOn(VisibleEntryFlag | RemovableEntryFlag); + expectedQuery.setFlagsOff(MissingEntryFlag); + expectedQuery.setSort(HsMenuServiceUtils::sortBy(defaultSortAttribute), + HsMenuServiceUtils::sortOrder(defaultSortAttribute)); + + QCOMPARE(actualQuery.mAddEntryTypeNames, + expectedQuery.mAddEntryTypeNames); + QCOMPARE(actualQuery.mSetFlagsOn, expectedQuery.mSetFlagsOn); + QCOMPARE(actualQuery.mSetFlagsOff, expectedQuery.mSetFlagsOff); + QCOMPARE(actualQuery.mSetSortAttribute, + expectedQuery.mSetSortAttribute); + QCOMPARE(actualQuery.mSetSortOrder, expectedQuery.mSetSortOrder); + + + // check non-default sort attribute + model.reset( + HsMenuService::getInstalledModel(Hs::CustomHsSortAttribute)); + + actualQuery = model->mCaItemModelQuery; + + expectedQuery.setSort( + HsMenuServiceUtils::sortBy(Hs::CustomHsSortAttribute), + HsMenuServiceUtils::sortOrder(Hs::CustomHsSortAttribute)); + + QCOMPARE(actualQuery.mSetSortAttribute, + expectedQuery.mSetSortAttribute); + QCOMPARE(actualQuery.mSetSortOrder, expectedQuery.mSetSortOrder); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::MenuService_getCollectionModel() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + const Hs::HsSortAttribute + defaultSortAttribute(Hs::LatestOnTopHsSortAttribute); + const QString defaultCollectionType(Hs::collectionTypeName); + const int collectionId = 7; + + QScopedPointer + model(HsMenuService::getCollectionModel(collectionId)); + + CaQuery actualQuery = model->mCaItemModelQuery; + + CaQuery expectedQuery; + expectedQuery.setParentId(collectionId); + expectedQuery.setFlagsOn(VisibleEntryFlag); + expectedQuery.setFlagsOff(MissingEntryFlag); + expectedQuery.setSort( + HsMenuServiceUtils::sortBy(defaultSortAttribute), + HsMenuServiceUtils::sortOrder(defaultSortAttribute)); + + + // check with non-default parameters + model.reset(HsMenuService::getCollectionModel(collectionId, + Hs::NoHsSortAttribute, Hs::collectionDownloadedTypeName)); + + actualQuery = model->mCaItemModelQuery; + + expectedQuery.setParentId(collectionId); + expectedQuery.setFlagsOn(RemovableEntryFlag | VisibleEntryFlag); + expectedQuery.setFlagsOff(MissingEntryFlag); + expectedQuery.setSort( + HsMenuServiceUtils::sortBy(Hs::NoHsSortAttribute), + HsMenuServiceUtils::sortOrder(Hs::NoHsSortAttribute)); + + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::MenuService_getCollectionNames() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + + + + QSharedPointer collectionA(new CaEntry); + collectionA->mTextResult = "A"; + QSharedPointer collectionB(new CaEntry); + collectionB->mTextResult = "B"; + + CaService::instance()->mGetEntriesResult.clear(); + CaService::instance()->mGetEntriesResult << collectionA; + CaService::instance()->mGetEntriesResult << collectionB; + + QStringList expectedNames; + expectedNames << collectionA->text(); + expectedNames << collectionB->text(); + + CaQuery expectedQuery; + expectedQuery.setParentId(HsMenuService::allCollectionsId()); + expectedQuery.setFlagsOn(VisibleEntryFlag); + expectedQuery.setFlagsOff(MissingEntryFlag); + + QStringList actualNames = HsMenuService::getCollectionNames(); + + QCOMPARE(actualNames, expectedNames); + + CaQuery actualQuery = CaService::instance()->mGetEntriesQuery; + QCOMPARE(actualQuery.mSetParentId, expectedQuery.mSetParentId); + QCOMPARE(actualQuery.mSetFlagsOn, expectedQuery.mSetFlagsOn); + QCOMPARE(actualQuery.mSetFlagsOff, expectedQuery.mSetFlagsOff); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::MenuService_getName() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + const int expectedEntryId = 5989; + + QString actualName = HsMenuService::getName(expectedEntryId); + CaService::instance()->mGetEntryResult.clear(); + + QCOMPARE(CaService::instance()->mGetEntryId, expectedEntryId); + QCOMPARE(actualName, QString()); + + CaService::instance()->mGetEntryResult = + QSharedPointer(new CaEntry); + const QString expectedName = "ABCD"; + CaService::instance()->mGetEntryResult->mTextResult = expectedName; + + actualName = HsMenuService::getName(expectedEntryId); + + QCOMPARE(actualName, expectedName); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::MenuService_executeAction() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + QSharedPointer service = CaService::instance(); + + // first case: command fails for entryId=19 and + // "invalidName" action + service->mExecuteCommandResult = -333; + QString commandName = "invalidName"; + int entryId = 19; + + QVERIFY(!(HsMenuService::executeAction(entryId, commandName)==0)); + QCOMPARE(service->mExecuteEntryId, entryId); + QCOMPARE(service->mExecuteCommand, commandName); + + // now pretend CaService accepted the command above + // so HsMenuService accepts it too + service->mExecuteCommandResult = 0; + QVERIFY(HsMenuService::executeAction(entryId, commandName)==0); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::MenuService_executeActionEntry() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + QSharedPointer service = CaService::instance(); + + // first case: command fails for entryId=19 and + // "invalidName" action + service->mExecuteCommandResult = -333; + QString commandName = "invalidName"; + CaEntry entry; + + QVERIFY(!(HsMenuService::executeAction(entry, commandName)==0)); + QCOMPARE(service->mExecuteCommand, commandName); + + // now pretend CaService accepted the command above + // so HsMenuService accepts it too + service->mExecuteCommandResult = 0; + QVERIFY(HsMenuService::executeAction(entry, commandName)==0); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +#ifdef Q_OS_SYMBIAN +void MenuServiceTest::MenuService_launchTS() +{ +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif + { + QVERIFY(HsMenuService::launchTaskSwitcher()); + } +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +} +#endif//Q_OS_SYMBIAN + +void MenuServiceTest::MenuService_createCollection() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif + { + QSharedPointer service = CaService::instance(); + + // case 1: create collection fails + service->mCreateEntryResult.clear(); + const QString createdCollectionName("collectionName"); + int actualCollectionId = + HsMenuService::createCollection(createdCollectionName); + + QCOMPARE(actualCollectionId, 0); + + CaEntry& collectionEntry = service->mCreatedEntry; + QCOMPARE(collectionEntry.entryTypeName(), + QString(Hs::collectionTypeName)); + QCOMPARE(collectionEntry.mCaEntryRole, GroupEntryRole); + QCOMPARE(collectionEntry.text(), createdCollectionName); + CaIconDescription collectionIcon = + collectionEntry.mSetCaIconDescription; + QCOMPARE(collectionIcon.mSetFileName, + QString(Hs::defaultCollectionIconId)); + + // case 2: collection can be created + const int createdCollectionId = 9; + QSharedPointer createdEntry(new CaEntry); + createdEntry->mIdResult = createdCollectionId; + service->mCreateEntryResult = createdEntry; + + actualCollectionId = + HsMenuService::createCollection(createdCollectionName); + + QCOMPARE(actualCollectionId, createdCollectionId); + QCOMPARE(service->mCreatedEntry.mAttributes[Hs::groupNameAttributeName], + createdCollectionName); + QCOMPARE(service->mAppendGroupId, HsMenuService::allCollectionsId()); + QCOMPARE(service->mAppenEntryId, createdCollectionId); + } +#endif +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif +} + +void MenuServiceTest::MenuService_renameCollection() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + QSharedPointer service = CaService::instance(); + + service->mGetEntryResult.clear(); + + const QString newCollectionName("DEFG"); + const int collectionId = 8; + + // case 1: no entry to rename has been found + QVERIFY(!HsMenuService::renameCollection(collectionId, + newCollectionName)); + QCOMPARE(service->mGetEntryId, collectionId); + + // case 2: entry to rename has been found + QSharedPointer collectionEntry(new CaEntry); + service->mGetEntryResult = collectionEntry; + service->mUpdateEntryResult = true; + QVERIFY(HsMenuService::renameCollection(collectionId, + newCollectionName)); + + QCOMPARE(service->mUpdateEntry.text(), newCollectionName); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif +} + +void MenuServiceTest::MenuService_removeCollection() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + QSharedPointer service = CaService::instance(); + const int collectionId = 1; + + // case 1: service cannot remove collection + service->mRemoveEntryForIdResult = false; + QVERIFY(!HsMenuService::removeCollection(collectionId)); + QCOMPARE(service->mRemoveEntryId, collectionId); + + // case 2: service can remove collection + service->mRemoveEntryForIdResult = true; + QVERIFY(HsMenuService::removeCollection(collectionId)); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif +} + + +void MenuServiceTest::MenuService_addApplicationsToCollection() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + QSharedPointer service = CaService::instance(); + QList applicationIdList; + applicationIdList << 1 << 2 << 3; + const int collectionId = 11; + + service->mAppendEntriesToGroupResult = true; + QVERIFY(HsMenuService::addApplicationsToCollection( + applicationIdList, collectionId)); + + QCOMPARE(service->mAppendEntryIdList, applicationIdList); + QCOMPARE(service->mAppendListGroupId , collectionId); + + // pretend CaService to fail on append + service->mAppendEntriesToGroupResult = false; + QVERIFY(!HsMenuService::addApplicationsToCollection( + applicationIdList, collectionId)); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif +} + +void MenuServiceTest::MenuService_removeApplicationFromCollection() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + QSharedPointer service = CaService::instance(); + + const int collectionId = 4; + const int applicationId = 25; + + service->mRemoveEntryFromGroupResult = true; + QVERIFY(HsMenuService::removeApplicationFromCollection( + applicationId, collectionId)); + + QCOMPARE(service->mRemoveGroupId, collectionId); + QCOMPARE(service->mRemoveEntryFromGroupId, applicationId); + + // pretend CaService to fail on removal operation + service->mRemoveEntryFromGroupResult = true; + QVERIFY(HsMenuService::removeApplicationFromCollection( + applicationId, collectionId)); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::MenuService_organizeCollection() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + QSharedPointer service = CaService::instance(); + QList entryIdList; + entryIdList << 2 << 3 << 4; + const int groupId = 2; + + service->mCustomSortResult = true; + QVERIFY(HsMenuService::organizeCollection( + groupId, entryIdList)); + + QCOMPARE(service->mCustomSortGroupId, groupId); + QCOMPARE(service->mCustomSortEntryIdList, entryIdList); + + // pretend CaService fails on customSort + service->mCustomSortResult = false; + QVERIFY(!HsMenuService::organizeCollection( + groupId, entryIdList)); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif + +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::MenuService_touchAction() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + QSharedPointer service = CaService::instance(); + + ////touch on unused entry + const int touchedEntryId = 5; + QSharedPointer touchedEntry(new CaEntry); + touchedEntry->mIdResult = touchedEntryId; + touchedEntry->setText("GHI"); + touchedEntry->setFlags(RemovableEntryFlag | VisibleEntryFlag); + service->mGetEntryResult = touchedEntry; + service->mTouchResult = true; + + HsMenuService::touch(touchedEntryId); + QCOMPARE(service->mGetEntryId, touchedEntryId); + QCOMPARE(service->mTouchEntry.id(), touchedEntryId); + QCOMPARE(service->mTouchEntry.text(), touchedEntry->text()); + + ////touch on already used entry + const int unTouchedEntryId = 5; + QSharedPointer unTouchedEntry(new CaEntry); + unTouchedEntry->mIdResult = unTouchedEntryId; + unTouchedEntry->setText("GHI_UT"); + unTouchedEntry->setFlags(0); + service->mGetEntryResult = unTouchedEntry; + service->mTouchResult = true; + + HsMenuService::touch(touchedEntryId); + QCOMPARE(service->mGetEntryId, unTouchedEntryId); + QCOMPARE(service->mTouchEntry.id(), touchedEntryId); + QCOMPARE(service->mTouchEntry.text(), touchedEntry->text()); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif + +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::MenuService_touchListOfIdsAction() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + QSharedPointer service = CaService::instance(); + + const int touchedEntryId = 5; + QSharedPointer touchedEntry(new CaEntry); + touchedEntry->mIdResult = 9999; + touchedEntry->setText("GHI"); + touchedEntry->setFlags(RemovableEntryFlag | VisibleEntryFlag); + service->mGetEntryResult = touchedEntry; + service->mTouchResult = true; + service->mGetEntryIdsResult.append(touchedEntryId); + + const int alreadyTouchedEntryId = 6; + //alreadyTouchedEntryId is not return by mGetEntryIds + //service->mGetEntryIdsResult.append(alreadyTouchedEntryId); + + QList entryIdList; + entryIdList.append(touchedEntryId); + entryIdList.append(alreadyTouchedEntryId); + + HsMenuService::touch(entryIdList); + + QCOMPARE((bool)service->mTouchEntriesId.contains(touchedEntryId),true); + QCOMPARE((bool)service->mTouchEntriesId.contains(alreadyTouchedEntryId),false); + + QCOMPARE(service->mGetEntryIdQuery.mSetFlagsOn,RemovableEntryFlag); + QCOMPARE(service->mGetEntryIdQuery.mSetFlagsOff,UsedEntryFlag); + QCOMPARE(service->mGetEntryIdQuery.mSetEntryRoles,ItemEntryRole); + + QCOMPARE(service->mGetEntryId, touchedEntryId); + QCOMPARE(service->mTouchEntry.id(), touchedEntryId); + QCOMPARE(service->mTouchEntry.text(), touchedEntry->text()); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::MenuService_launchSoftwareUpdate() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + CaService::instance()->mExecuteCommandResult = 0; + QCOMPARE(HsMenuService::launchSoftwareUpdate(),0); + QCOMPARE(CaService::instance()->mExecuteCommand, + QString(Hs::openActionIdentifier)); + QCOMPARE(CaService::instance()->mExecuteEntry.mEntryTypeNameResult, + QString(Hs::applicationTypeName)); + QCOMPARE(CaService::instance()->mExecuteEntry.mAttributes.value( + Hs::applicationUidEntryKey), + QString::number(Hs::softwareUpdateApplicationUid)); + + CaService::instance()->mExecuteCommandResult = -333; + QCOMPARE(HsMenuService::launchSoftwareUpdate(),-333); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::MenuService_collectionIdByType() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif +#endif + { + const int ourCollectionId = 123; + QSharedPointer service = CaService::instance(); + CaService::instance()->mGetEntryIdsResult.clear(); + CaService::instance()->mGetEntryIdsResult << ourCollectionId; + + int result = HsMenuService::collectionIdByType("collection"); + + QCOMPARE(result, ourCollectionId); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif +#endif +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::initTestCase() +{ + const int allCollectionId = 8; + // ensure HsMenuService::allCollectionId will return + // non zero value, if it does not already + CaService::instance()->mGetEntryIdsResult.clear(); + CaService::instance()->mGetEntryIdsResult << allCollectionId; +} + +void MenuServiceTest::cleanup() +{ + CaService::instance()->clear(); +} +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::cleanupTestCase() +{ +#ifdef Q_OS_SYMBIAN +// stopThread(); +#endif //Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +int threadFunction(void *params) +{ + Q_UNUSED(params) +#ifdef Q_OS_SYMBIAN + while (ETrue) { + User::ResetInactivityTime();//it should help for Viewserver11 panic + User::After(5000000); + } +#endif //Q_OS_SYMBIAN + return 0; +} + +#ifdef Q_OS_SYMBIAN + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::startThread() +{ + User::LeaveIfError(iThread.Create( + _L("thread_kill_viewsrv11"), + threadFunction, + 16384, + 4000, + 4000, + NULL)); + iThread.Resume(); +} +#endif //Q_OS_SYMBIAN + + +#ifdef Q_OS_SYMBIAN + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuServiceTest::stopThread() +{ + iThread.Close(); +} +#endif //Q_OS_SYMBIAN + +QTEST_MAIN(MenuServiceTest) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/t_hsmenuserviceprovider.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/t_hsmenuserviceprovider.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,28 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +#Header files + +#remove declarations of mocked classes +HEADERS -= $$MW_LAYER_SYSTEMINCLUDE/caservice.h +HEADERS -= $$MW_LAYER_SYSTEMINCLUDE/caentry.h +HEADERS -= $$MW_LAYER_SYSTEMINCLUDE/caquery.h + +HEADERS += ./inc/*.h \ + ../../inc/*.h + +#Source files +SOURCES += ./src/*.cpp \ + ../../src/*.cpp diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/t_hsmenuserviceprovider.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/t_hsmenuserviceprovider/t_hsmenuserviceprovider.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,83 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = app + +include (../../../../common.pri) + +CONFIG += mobility +MOBILITY += publishsubscribe + +LIBS += -lhsdomainmodel +LIBS += -lhsutils +LIBS += -lcasoftwareregistry + +CONFIG += debug_and_release \ + console +CONFIG += hb +QT += testlib \ + xml \ + sql + +#DEFINES += CONTENT_ARSENAL_STORAGE_UT +DEFINES += MENUSERVICE_TEST +#DEFINES += CACLIENT_TEST +DEFINES += MENUSERVICE_UNITTEST +DEFINES += HSDOMAINMODEL_TEST +coverage:DEFINES += COVERAGE_MEASUREMENT + +DEPENDPATH += . \ + ./src \ + ./inc \ + ../src \ + ../inc + +#add new paths and put existing at the end to pick up mock files first +INCLUDEPATH = . \ + ./inc \ + ../../inc \ + ../../../../../homescreenapp/inc \ + $$INCLUDEPATH + +symbian: { + ### get rid of localization warnings + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + ### + + CONFIG += symbian_test + coverage: CONFIG -= symbian_test + TARGET.UID2 = 0x100039CE + TARGET.UID3 = 0x20022F6A + TARGET.EPOCALLOWDLLDATA=1 + TARGET.CAPABILITY = ALL -TCB + TARGET.EPOCSTACKSIZE = 0x14000 \ + // \ + 80kB + TARGET.EPOCHEAPSIZE = 0x20000 \ + 0x1000000 \ + // \ + 128kB \ + - \ + 16MB + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + + MMP_RULES += SMPSAFE +} +include(t_hsmenuserviceprovider.pri) +win32:include(installs_win32.pri) +!symbian:unix:include(installs_unix.pri) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/tsrc/tsrc.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,20 @@ +# +# 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 = t_hsmenuserviceprovider + +CONFIG += ordered diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/conf/CI_hsapplibrary.confml Binary file homescreenapp/stateplugins/hsapplibrarystateplugin/conf/CI_hsapplibrary.confml has changed diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin.pro --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -39,6 +39,8 @@ include(hsapplibrarystateplugin_exports_to_rom.pri) LIBS += -lxqsettingsmanager + + MMP_RULES += SMPSAFE } RESOURCES = $$qrcFile diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsallappsstate.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsallappsstate.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsallappsstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -52,7 +52,6 @@ private slots: void addToCollection(); - void openInstalledView(); void ascendingMenuAction(); void descendingMenuAction(); void normalModeEntered(); diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsapplibrarystate.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsapplibrarystate.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsapplibrarystate.h Mon Sep 20 10:19:07 2010 +0300 @@ -70,6 +70,8 @@ void allAppsStateEntered(); void allCollectionsStateEntered(); + + void collectionStateEntered(); protected: diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsbaseviewstate.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsbaseviewstate.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsbaseviewstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -52,10 +52,6 @@ ~HsBaseViewState(); void scrollToBeginning(); -private slots: - - virtual void openAppLibrary(); - protected slots: virtual void stateEntered(); @@ -66,25 +62,34 @@ virtual void normalModeExited(); virtual void launchItem(const QModelIndex &index); virtual void openCollection(const QModelIndex &index); - virtual void showContextMenu(HbAbstractViewItem *item, const QPointF &coords); + virtual void showContextMenu( + HbAbstractViewItem *item, const QPointF &coords); virtual int checkSoftwareUpdates(); virtual bool openTaskSwitcher(); virtual void closeContextMenu(); virtual void addToHomeScreen(const int entryId); virtual void contextMenuAction(HbAction *action); virtual void addActivated(const QModelIndex &index); - virtual void addModeShowContextMenu(HbAbstractViewItem *item, - const QPointF &coords); + virtual void addModeShowContextMenu( + HbAbstractViewItem *item, + const QPointF &coords); + virtual void openInstalledView(); protected: - void initialize(HsMenuViewBuilder &menuViewBuilder, HsStateContext stateContext); + void initialize( + HsMenuViewBuilder &menuViewBuilder, HsStateContext stateContext); void createApplicationLaunchFailMessage(int errorCode,int itemId); void defineTransitions(); +private slots: + + virtual void openAppLibrary(); + private: - virtual void setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags) = 0; + virtual void setContextMenuOptions( + HbAbstractViewItem *item, EntryFlags flags) = 0; virtual void setMenuOptions() = 0; private: diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hscollectionstate.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hscollectionstate.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hscollectionstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -63,6 +63,7 @@ void handleEmptyChange(bool empty); void lockSearchButton(bool lock); void createArrangeCollection(); + void openInstalledViewFromCollection(); private: void construct(); diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsinstalledappsstate.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsinstalledappsstate.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsinstalledappsstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -46,9 +46,13 @@ QState *parent = 0); ~HsInstalledAppsState(); + +protected: + void onEntry(QEvent *event); private slots: + void backFromInstalledView(); void openInstallationLog(); void stateEntered(); void stateExited(); @@ -65,6 +69,8 @@ Hs::HsSortAttribute mSortAttribute; HbAction *mLatestOnTopMenuAction; //not own HbAction *mOldestOnTopMenuAction; //not own + int mCollectionId; // An id of a collection to which the state machine will return. + QString mCollectionType; // A type of a collection to which the state machine will return. }; #endif // HSINSTALLEDAPPSSTATE_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hslistviewitem.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hslistviewitem.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hslistviewitem.h Mon Sep 20 10:19:07 2010 +0300 @@ -23,38 +23,45 @@ #include "hsmenustates_global.h" +HS_STATES_TEST_CLASS(MenuStatesTest) + // 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),mTargetValue(0),mTimerId(0) {} - void setTargetProgressValue(int value); +class HsProgressBar: public HbProgressBar +{ + public: + HsProgressBar(QGraphicsItem *parent = 0) : HbProgressBar(parent), + mTargetValue(0), mTimerId(0) {} + void setTargetProgressValue(int value); -protected: - void paint ( QPainter * painter, - const QStyleOptionGraphicsItem * option, - QWidget * widget = 0 ); - void timerEvent(QTimerEvent *event); -private: - int mTargetValue; - int mTimerId; + protected: + void paint(QPainter *painter, + const QStyleOptionGraphicsItem *option, + QWidget *widget = 0 ); + void timerEvent(QTimerEvent *event); + + private: + int mTargetValue; + int mTimerId; + + HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) }; -HS_STATES_TEST_CLASS(MenuStatesTest) + class HsListViewItem : public HbListViewItem { Q_OBJECT public: - - explicit HsListViewItem(QGraphicsItem* parent=0); + + explicit HsListViewItem(QGraphicsItem *parent = 0); virtual ~HsListViewItem(); - + virtual HbAbstractViewItem* createItem(); virtual void updateChildItems(); - - protected: - virtual void polish(HbStyleParameters& params); + + protected: + virtual void polish(HbStyleParameters ¶ms); private: HsProgressBar *progress; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hssearchfilterproxymodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hssearchfilterproxymodel.h Mon Sep 20 10:19: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: Proxy model for search and highlight items view. + * + */ + +#ifndef HSSEARCHFILETRPROXYMODEL_H_ +#define HSSEARCHFILETRPROXYMODEL_H_ + +#include + +#define TAG_START "" +#define TAG_END "" + +class HsSearchFilterProxyModel : public QSortFilterProxyModel +{ + Q_OBJECT + +public: + HsSearchFilterProxyModel(QObject *parent = 0); + virtual ~HsSearchFilterProxyModel(); + +public: + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole ) const; + void setFilterString(const QString &filterCriteria); + QString filterString() const; + bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const; + +private: + QString mFilterCriteria; + bool mInSettingFilterString; +}; + +#endif /* HSSEARCHFILETRPROXYMODEL_H_ */ diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hssearchview.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hssearchview.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hssearchview.h Mon Sep 20 10:19:07 2010 +0300 @@ -26,8 +26,8 @@ #include "hsmenustates_global.h" #include "hsmenuviewbuilder.h" #include "hssearchviewbuilder.h" +#include "hssearchfilterproxymodel.h" -class QSortFilterProxyModel; class HsMainWindow; class HbAbstractViewItem; class HbLineEdit; @@ -94,7 +94,7 @@ QModelIndex mSearchViewInitialIndex; QModelIndex mIndexToScrollAfterSearchDone; QModelIndex mSearchViewLongPressedIndex; - QSortFilterProxyModel *mProxyModel; // owned + HsSearchFilterProxyModel *mProxyModel; // owned HbView *mSearchView; HbListView *mSearchListView; HbSearchPanel *mSearchPanel; @@ -106,6 +106,8 @@ QScopedPointer mVkbHost; HsSearchViewBuilder mSearchViewBuilder; bool mEmptyResultText; + QString mCriteria; + }; #endif /* HSSEARCHVIEW_H_ */ diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/resource/emptylabeledview.docml --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/emptylabeledview.docml Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/emptylabeledview.docml Mon Sep 20 10:19:07 2010 +0300 @@ -3,8 +3,8 @@ + - diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallappsstate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallappsstate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallappsstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -113,22 +113,20 @@ HSMENUTEST_FUNC_ENTRY("HsAllAppsState::setMenuOptions"); mViewOptions->clearActions(); mViewOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), - static_cast(this), SLOT(openTaskSwitcher())); + static_cast(this), SLOT(openTaskSwitcher())); mViewOptions->addAction(hbTrId("txt_applib_opt_add_to_collection"), - this, SLOT(addToCollection())); - mViewOptions->addAction(hbTrId("txt_applib_opt_check_software_updates"), - static_cast(this), SLOT(checkSoftwareUpdates())); - + this, SLOT(addToCollection())); mAscendingMenuAction = mViewOptions->addAction(hbTrId("txt_applib_menu_sort_by_ascending"), this, SLOT(ascendingMenuAction())); - mDescendingMenuAction = mViewOptions->addAction(hbTrId("txt_applib_menu_sort_by_descending"), - this, SLOT(descendingMenuAction())); - - mViewOptions->addAction(hbTrId("txt_applib_opt_view_installed_applications"), - this, SLOT(openInstalledView())); + this, SLOT(descendingMenuAction())); + mViewOptions->addAction(hbTrId("txt_applib_opt_check_software_updates"), + static_cast(this), SLOT(checkSoftwareUpdates())); + mViewOptions->addAction( + hbTrId("txt_applib_opt_view_installed_applications"), + static_cast(this), SLOT(openInstalledView())); if (mSortAttribute == Hs::AscendingNameHsSortAttribute) { mAscendingMenuAction->setVisible(false); @@ -215,21 +213,6 @@ } /*! - Triggers event so that a installed applications state is entered. - \retval void - */ -#ifdef COVERAGE_MEASUREMENT -#pragma CTC SKIP -#endif //COVERAGE_MEASUREMENT -void HsAllAppsState::openInstalledView() -{ - machine()->postEvent(HsMenuEventFactory::createOpenInstalledViewEvent()); -} -#ifdef COVERAGE_MEASUREMENT -#pragma CTC ENDSKIP -#endif //COVERAGE_MEASUREMENT - -/*! Method seting context menu options. */ void HsAllAppsState::setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags) @@ -248,9 +231,6 @@ addToCollectionAction->setData( Hs::AddToCollectionFromApplicationsViewContextAction); - HbAction *uninstallAction = mContextMenu->addAction( - hbTrId("txt_common_menu_delete")); - uninstallAction->setData(Hs::UninstallContextAction); HbAction *appSettingsAction(NULL); HbAction *appDetailsAction(NULL); @@ -262,6 +242,11 @@ hbTrId("txt_common_menu_settings")); appSettingsAction->setData(Hs::AppSettingContextAction); } + + HbAction *uninstallAction = mContextMenu->addAction( + hbTrId("txt_common_menu_delete")); + uninstallAction->setData(Hs::UninstallContextAction); + if (!(entry->attribute(Hs::componentIdAttributeName).isEmpty()) && (flags & RemovableEntryFlag) ) { appDetailsAction = mContextMenu->addAction( diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallcollectionsstate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallcollectionsstate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallcollectionsstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -94,6 +94,11 @@ mViewOptions->addAction(hbTrId("txt_applib_opt_arrange"), this, SLOT(createArrangeCollection())); + mViewOptions->addAction(hbTrId("txt_applib_opt_check_software_updates"), + static_cast(this), SLOT(checkSoftwareUpdates())); + mViewOptions->addAction( + hbTrId("txt_applib_opt_view_installed_applications"), + static_cast(this), SLOT(openInstalledView())); HSMENUTEST_FUNC_EXIT("HsAllCollectionsState::setMenuOptions"); } diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsapplibrarystate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsapplibrarystate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsapplibrarystate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -114,11 +114,12 @@ { HSMENUTEST_FUNC_ENTRY("HsAppLibraryState::construct"); setObjectName("homescreen.nokia.com/state/applibrarystate"); - - mAllAppsState = new HsAllAppsState(mMenuViewBuilder, mMenuMode, mMainWindow, this); + + mAllAppsState = new HsAllAppsState( + mMenuViewBuilder, mMenuMode, mMainWindow, this); - mAllCollectionsState = new HsAllCollectionsState(mMenuViewBuilder, mMenuMode, - mMainWindow, this); + mAllCollectionsState = new HsAllCollectionsState(mMenuViewBuilder, + mMenuMode, mMainWindow, this); QState *initialState = new QState(this); setInitialState(initialState); @@ -127,13 +128,12 @@ mMenuMode, Hs::NormalHsMenuMode, mAllAppsState); initialState->addTransition(mHistoryTransaction); - initialState->addTransition(new HsMenuModeTransition( - mMenuMode, Hs::AddHsMenuMode, mAllAppsState)); + initialState->addTransition( + new HsMenuModeTransition( + mMenuMode, Hs::AddHsMenuMode, mAllAppsState)); mCollectionState = new HsCollectionState(mMenuViewBuilder, - mMenuMode, - mMainWindow, - this); + mMenuMode, mMainWindow, this); connect(mCollectionState, SIGNAL(entered()),SLOT(clearToolbarLatch())); @@ -142,7 +142,8 @@ this, mCollectionState); this->addTransition(openCollectionFromAppLibTransition); - //It is called from: HsDefaultRuntime::activityRequested(const QString &name) + // It is called from: + // HsDefaultRuntime::activityRequested(const QString &name) HsMenuEventTransition *openCollectionAfterActivityRequest = new HsMenuEventTransition(HsMenuEvent::OpenCollection, this, mCollectionState); @@ -156,21 +157,26 @@ //transition for returning from collection HsMenuEventTransition *collectionToAppLibTransition = new HsMenuEventTransition(HsMenuEvent::OpenApplicationLibrary, - mCollectionState, mAllCollectionsState); + mCollectionState, mAllCollectionsState); mCollectionState->addTransition(collectionToAppLibTransition); mInstalledAppsState = new HsInstalledAppsState( mMenuViewBuilder, mMainWindow, this); - HsMenuEventTransition *installedToAppLibTransition = - new HsMenuEventTransition(HsMenuEvent::OpenApplicationLibrary, - mInstalledAppsState, mAllAppsState); - mInstalledAppsState->addTransition(installedToAppLibTransition); - HsMenuEventTransition *allViewToInstalledTransition = new HsMenuEventTransition(HsMenuEvent::OpenInstalledView, - mAllAppsState, mInstalledAppsState); + mAllAppsState, mInstalledAppsState); mAllAppsState->addTransition(allViewToInstalledTransition); + + HsMenuEventTransition *allCollectionsToInstalledTransition = + new HsMenuEventTransition(HsMenuEvent::OpenInstalledView, + mAllCollectionsState, mInstalledAppsState); + mAllCollectionsState->addTransition(allCollectionsToInstalledTransition); + + HsMenuEventTransition *collectionToInstalledTransition = + new HsMenuEventTransition(HsMenuEvent::OpenInstalledView, + mCollectionState, mInstalledAppsState); + mCollectionState->addTransition(collectionToInstalledTransition); constructToolbar(); @@ -185,6 +191,9 @@ connect(mAllCollectionsState, SIGNAL(entered()), this, SLOT(allCollectionsStateEntered())); + connect(mCollectionState, SIGNAL(entered()), + this, SLOT(collectionStateEntered())); + HSMENUTEST_FUNC_EXIT("HsAppLibraryState::construct"); } @@ -216,7 +225,7 @@ mAllAppsState->scrollToBeginning(); mAllCollectionsState->scrollToBeginning(); } - + HSMENUTEST_FUNC_EXIT("HsAppLibraryState::onEntry"); } @@ -249,8 +258,8 @@ extensionAction->setIcon(HbIcon("qtg_mono_store")); HbAction *const operatorAction( - operatorHandler->prepareOperatorStoreAction( - mMenuViewBuilder.operatorAction())); + operatorHandler->prepareOperatorStoreAction( + mMenuViewBuilder.operatorAction())); operatorAction->setText(hbTrId(operatorHandler->text().toLatin1())); mMenuViewBuilder.oviStoreAction()->setText(hbTrId("txt_applib_grid_ovi_store")); @@ -266,12 +275,12 @@ mMenuViewBuilder.oviStoreAction()); } else if (operatorHandler->operatorStorePresent()) { mMenuViewBuilder.toolBar()->addAction( - operatorHandler->prepareOperatorStoreAction( - mMenuViewBuilder.operatorAction())); + operatorHandler->prepareOperatorStoreAction( + mMenuViewBuilder.operatorAction())); } HbAction *const allCollectionsAction( - mMenuViewBuilder.allCollectionsAction()); + mMenuViewBuilder.allCollectionsAction()); mAllAppsState->addTransition( allCollectionsAction, SIGNAL(triggered()), mAllCollectionsState); @@ -332,13 +341,21 @@ } /*! - All apps stete entered. + All apps state entered. */ void HsAppLibraryState::allAppsStateEntered() { if (mMenuMode.getHsMenuMode() == Hs::NormalHsMenuMode) { mHistoryTransaction->setTargetState(mAllAppsState); } + while (!mInstalledAppsState->transitions().isEmpty()) { + mInstalledAppsState->removeTransition( + mInstalledAppsState->transitions()[0]); + } + HsMenuEventTransition *fromInstalledAppsTransition = + new HsMenuEventTransition(HsMenuEvent::BackFromInstalledView, + mInstalledAppsState, mAllAppsState); + mInstalledAppsState->addTransition(fromInstalledAppsTransition); } /*! @@ -349,6 +366,27 @@ if (mMenuMode.getHsMenuMode() == Hs::NormalHsMenuMode) { mHistoryTransaction->setTargetState(mAllCollectionsState); } + while (!mInstalledAppsState->transitions().isEmpty()) { + mInstalledAppsState->removeTransition( + mInstalledAppsState->transitions()[0]); + } + HsMenuEventTransition *fromInstalledAppsTransition = + new HsMenuEventTransition(HsMenuEvent::BackFromInstalledView, + mInstalledAppsState, mAllCollectionsState); + mInstalledAppsState->addTransition(fromInstalledAppsTransition); } - +/*! + Collection state entered. + */ +void HsAppLibraryState::collectionStateEntered() +{ + while (!mInstalledAppsState->transitions().isEmpty()) { + mInstalledAppsState->removeTransition( + mInstalledAppsState->transitions()[0]); + } + HsMenuEventTransition *fromInstalledAppsTransition = + new HsMenuEventTransition(HsMenuEvent::BackFromInstalledView, + mInstalledAppsState, mCollectionState); + mInstalledAppsState->addTransition(fromInstalledAppsTransition); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsbaseviewstate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsbaseviewstate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsbaseviewstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -329,55 +329,58 @@ static_cast(action->data().toInt()); const int itemId = mContextModelIndex.data(CaItemModel::IdRole).toInt(); - - switch (command) { - case Hs::AddToHomeScreenContextAction: - addToHomeScreen(itemId); - break; - case Hs::AddToCollectionFromApplicationsViewContextAction: - // Addding a specific application to - // an existing collection via item specific menu. - machine()->postEvent( - HsMenuEventFactory::createAddAppsFromApplicationsViewEvent( - Hs::NoHsSortAttribute, itemId)); - break; - case Hs::AddToCollectionFromCollectionViewContextAction: - machine()->postEvent( - HsMenuEventFactory::createAddAppsFromCollectionViewEvent( - -1, itemId)); - break; - case Hs::UninstallContextAction: - machine()->postEvent( - HsMenuEventFactory::createUninstallApplicationEvent( - itemId)); - break; - case Hs::AppSettingContextAction: - machine()->postEvent( - HsMenuEventFactory::createAppSettingsViewEvent(itemId)); - break; - case Hs::AppDetailsContextAction: - machine()->postEvent( - HsMenuEventFactory::createAppDetailsViewEvent(itemId)); - break; - case Hs::OpenAppContextAction: - launchItem(mContextModelIndex); - break; - case Hs::RenameCollectionContextAction: - machine()->postEvent( - HsMenuEventFactory::createRenameCollectionEvent(itemId)); - break; - case Hs::DeleteCollectionContextAction: - machine()->postEvent( - HsMenuEventFactory::createDeleteCollectionEvent(itemId)); - break; - case Hs::OpenCollectionContextAction: - openCollection(mContextModelIndex); - break; - default: - break; + + if (itemId > 0) { + switch (command) { + case Hs::AddToHomeScreenContextAction: + addToHomeScreen(itemId); + break; + case Hs::AddToCollectionFromApplicationsViewContextAction: + // Addding a specific application to + // an existing collection via item specific menu. + machine()->postEvent( + HsMenuEventFactory::createAddAppsFromApplicationsViewEvent( + Hs::NoHsSortAttribute, itemId)); + break; + case Hs::AddToCollectionFromCollectionViewContextAction: + machine()->postEvent( + HsMenuEventFactory::createAddAppsFromCollectionViewEvent( + -1, itemId)); + break; + case Hs::UninstallContextAction: + machine()->postEvent( + HsMenuEventFactory::createUninstallApplicationEvent( + itemId)); + break; + case Hs::AppSettingContextAction: + machine()->postEvent( + HsMenuEventFactory::createAppSettingsViewEvent(itemId)); + break; + case Hs::AppDetailsContextAction: + machine()->postEvent( + HsMenuEventFactory::createAppDetailsViewEvent(itemId)); + break; + case Hs::OpenAppContextAction: + launchItem(mContextModelIndex); + break; + case Hs::RenameCollectionContextAction: + machine()->postEvent( + HsMenuEventFactory::createRenameCollectionEvent(itemId)); + break; + case Hs::DeleteCollectionContextAction: + machine()->postEvent( + HsMenuEventFactory::createDeleteCollectionEvent(itemId)); + break; + case Hs::OpenCollectionContextAction: + openCollection(mContextModelIndex); + break; + default: + break; + } + HsMenuService::touch(itemId); + } else { + closeContextMenu(); } - - HsMenuService::touch(itemId); } /*! @@ -461,3 +464,16 @@ *mMenuMode, Hs::AddHsMenuMode, addModeState)); } +/*! + Triggers event so that an installed applications state is entered. + */ +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT +void HsBaseViewState::openInstalledView() +{ + machine()->postEvent(HsMenuEventFactory::createOpenInstalledViewEvent()); +} +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hscollectionstate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hscollectionstate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hscollectionstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -212,16 +212,22 @@ hbTrId("txt_applib_menu_sort_by_oldest_on_top"), this, SLOT(oldestOnTopMenuAction())); - if(mSortAttribute == Hs::LatestOnTopHsSortAttribute) + //Default is LatestOnTopHsSortAttribute + if(mSortAttribute == Hs::OldestOnTopHsSortAttribute) { - mLatestOnTopMenuAction->setVisible(false); - } else { mOldestOnTopMenuAction->setVisible(false); + } else { + mLatestOnTopMenuAction->setVisible(false); } - } - - + if (mCollectionType == Hs::collectionDownloadedTypeName) { + mViewOptions->addAction(hbTrId("txt_applib_opt_check_software_updates"), + static_cast(this), SLOT(checkSoftwareUpdates())); + mViewOptions->addAction( + hbTrId("txt_applib_opt_view_installed_applications"), + static_cast(this), + SLOT(openInstalledViewFromCollection())); + } mMenuView->view()->setMenu(mViewOptions); HSMENUTEST_FUNC_EXIT("HsAllCollectionsState::setMenuOptions"); } @@ -299,25 +305,28 @@ */ void HsCollectionState::contextMenuAction(HbAction *action) { - Hs::HsContextAction command = static_cast (action->data().toInt()); - - if (command == Hs::RemoveFromCollectionContextAction) { - const int itemId = mContextModelIndex.data( - CaItemModel::IdRole).toInt(); - machine()->postEvent( - HsMenuEventFactory::createRemoveAppFromCollectionEvent(itemId, - mCollectionId)); - HsMenuService::touch(itemId); - } else if ( - command == Hs::AddToCollectionFromCollectionViewContextAction) { - const int itemId = mContextModelIndex.data( - CaItemModel::IdRole).toInt(); - machine()->postEvent( - HsMenuEventFactory::createAddAppsFromCollectionViewEvent( - mCollectionId, itemId)); - HsMenuService::touch(itemId); + const int itemId = mContextModelIndex.data(CaItemModel::IdRole).toInt(); + + if (itemId > 0) { + Hs::HsContextAction command = + static_cast (action->data().toInt()); + + if (command == Hs::RemoveFromCollectionContextAction) { + machine()->postEvent( + HsMenuEventFactory::createRemoveAppFromCollectionEvent(itemId, + mCollectionId)); + HsMenuService::touch(itemId); + } else if ( + command == Hs::AddToCollectionFromCollectionViewContextAction) { + machine()->postEvent( + HsMenuEventFactory::createAddAppsFromCollectionViewEvent( + mCollectionId, itemId)); + HsMenuService::touch(itemId); + } else { + HsBaseViewState::contextMenuAction(action); + } } else { - HsBaseViewState::contextMenuAction(action); + closeContextMenu(); } } @@ -436,10 +445,6 @@ removeAction->setData(Hs::RemoveFromCollectionContextAction); } - if ((flags & RemovableEntryFlag)) { - uninstallAction = mContextMenu->addAction(hbTrId("txt_common_menu_delete")); - uninstallAction->setData(Hs::UninstallContextAction); - } QSharedPointer entry = mModel->entry(item->modelIndex()); if (!(entry->attribute(Hs::appSettingsPlugin).isEmpty())) { @@ -448,6 +453,11 @@ appSettingsAction->setData(Hs::AppSettingContextAction); } + if ((flags & RemovableEntryFlag)) { + uninstallAction = mContextMenu->addAction(hbTrId("txt_common_menu_delete")); + uninstallAction->setData(Hs::UninstallContextAction); + } + if (!(entry->attribute(Hs::componentIdAttributeName).isEmpty()) && (flags & RemovableEntryFlag) ) { appDetailsAction = mContextMenu->addAction(hbTrId( @@ -507,3 +517,19 @@ topItemId, mCollectionId)); } + +/*! + Triggers event so that an installed applications state is entered. + */ +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT +void HsCollectionState::openInstalledViewFromCollection() +{ + machine()->postEvent( + HsMenuEventFactory::createOpenInstalledViewEvent( + mCollectionId, mCollectionType)); +} +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -32,6 +32,7 @@ #include "hsinstalledappsstate.h" #include "hsaddappstocollectionstate.h" #include "hsmenumodetransition.h" +#include "hsmenuevent.h" /*! \class HsInstalledAppsState @@ -71,11 +72,30 @@ parent() != 0 ? parent()->objectName() : QString(""); setObjectName(parentName + "/installedappsstate"); - connect(mBackKeyAction, SIGNAL(triggered()), SLOT(openAppLibrary())); + connect(mBackKeyAction, + SIGNAL(triggered()), + this, + SLOT(backFromInstalledView())); HSMENUTEST_FUNC_EXIT("HsInstalledAppsState::construct"); } +void HsInstalledAppsState::onEntry(QEvent *event) +{ + qDebug("HsInstalledAppsState::onEntry()"); + HSMENUTEST_FUNC_ENTRY("HsInstalledAppsState::onEntry"); + QState::onEntry(event); + + if (event->type() == HsMenuEvent::eventType()) { + HsMenuEvent *menuEvent = static_cast(event); + QVariantMap data = menuEvent->data(); + mCollectionId = data.value(Hs::itemIdKey).toInt(); + mCollectionType = data.value(Hs::entryTypeNameKey).toString(); + } + + HSMENUTEST_FUNC_EXIT("HsInstalledAppsState::onEntry"); +} + /*! Method seting menu options. */ @@ -87,8 +107,6 @@ mViewOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), this, SLOT(openTaskSwitcher())); - mViewOptions->addAction(hbTrId("txt_applib_opt_installation_log"), - this, SLOT(openInstallationLog())); if (mModel->rowCount() > 0) { mLatestOnTopMenuAction = mViewOptions->addAction( @@ -107,6 +125,8 @@ mLatestOnTopMenuAction->setVisible(false); } } + mViewOptions->addAction(hbTrId("txt_applib_opt_installation_log"), + this, SLOT(openInstallationLog())); mMenuView->view()->setMenu(mViewOptions); HSMENUTEST_FUNC_EXIT("HsInstalledAppsState::setMenuOptions"); } @@ -229,6 +249,22 @@ } /*! + Menu softkey back action slot + */ +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT +void HsInstalledAppsState::backFromInstalledView() +{ + machine()->postEvent( + HsMenuEventFactory::createBackFromInstalledViewEvent( + mCollectionId, mCollectionType)); +} +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT + +/*! Open installation log. */ void HsInstalledAppsState::openInstallationLog() diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hslistviewitem.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hslistviewitem.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hslistviewitem.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -35,36 +35,36 @@ #ifdef COVERAGE_MEASUREMENT #pragma CTC SKIP #endif //COVERAGE_MEASUREMENT -void HsProgressBar::paint(QPainter * painter, - const QStyleOptionGraphicsItem * option, +void HsProgressBar::paint(QPainter * painter, + const QStyleOptionGraphicsItem * option, QWidget * widget) { Q_UNUSED(widget) QStyleOptionGraphicsItem pixmapOption(*option); foreach (QGraphicsItem *child, childItems()) { - painter->save(); + 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(); + + foreach (QGraphicsItem *grandChild, child->childItems()) { + if (grandChild->isVisible()) { + painter->save(); + painter->translate(grandChild->pos()); + pixmapOption.exposedRect = grandChild->boundingRect(); + grandChild->paint(painter, &pixmapOption); + painter->restore(); } } painter->restore(); } -} +} #ifdef COVERAGE_MEASUREMENT #pragma CTC ENDSKIP #endif //COVERAGE_MEASUREMENT - -void HsProgressBar::setTargetProgressValue(int value) { +void HsProgressBar::setTargetProgressValue(int value) +{ mTargetValue = value; if (value > progressValue() && value <= maximum()) { if (!mTimerId) { @@ -76,22 +76,23 @@ } void HsProgressBar::timerEvent(QTimerEvent *event) - { - if (mTargetValue == progressValue()) { - killTimer(mTimerId); - mTimerId = 0; - } else { - setProgressValue(progressValue()+1); - } +{ + Q_UNUSED(event); + if (mTargetValue == progressValue()) { + killTimer(mTimerId); + mTimerId = 0; + } else { + setProgressValue(progressValue()+1); + } } -HsListViewItem::HsListViewItem(QGraphicsItem* parent) : +HsListViewItem::HsListViewItem(QGraphicsItem* parent) : HbListViewItem(parent), progress(0), isProgress(false) -{ +{ setGraphicsSize(LargeIcon); setStretchingStyle(StretchLandscape); if (this == prototype()) { - HbStyleLoader::registerFilePath(":/layout/hslistviewitem.css"); + HbStyleLoader::registerFilePath(":/layout/hslistviewitem.css"); } } @@ -116,9 +117,9 @@ isProgress = true; if (!progress) { progress = new HsProgressBar(this); - HbStyle::setItemName(progress, "progress"); + HbStyle::setItemName(progress, "progress"); progress->setRange(0, 100); - HbEffect::disable(progress); + HbEffect::disable(progress); progress->setProgressValue(progresVal); repolish(); connect(progress, SIGNAL(valueChanged(int)), SLOT(updatePixmapCache())); @@ -132,20 +133,20 @@ HbParameterLengthLimiter("txt_applib_dblist_uninstalling_1") .arg(text->text())); break; - } + } } - } else if (progress) { + } else if (progress) { disconnect(progress, SIGNAL(valueChanged())); delete progress; progress = 0; repolish(); } - // hide text-2 if we have to + // hide text-2 if we have to foreach (QGraphicsItem * item, this->childItems()) { if (HbStyle::itemName(item) == "text-2") { - item->setVisible(!isProgress); + item->setVisible(!isProgress); break; - } + } } } @@ -156,12 +157,12 @@ void HsListViewItem::polish(HbStyleParameters& params) -{ +{ if (isProgress) { HbStyleLoader::registerFilePath(":/layout/hslistviewitem.widgetml"); } HbListViewItem::setProperty("progress", isProgress); - HbListViewItem::polish(params); + HbListViewItem::polish(params); if (isProgress) { HbStyleLoader::unregisterFilePath(":/layout/hslistviewitem.widgetml"); } diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmainwindow.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmainwindow.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmainwindow.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -21,7 +21,10 @@ #include "hsmainwindow.h" #include "hsmenuview.h" #include "hsmenumodewrapper.h" - +#include "hsscene.h" +#include "hspage.h" +#include "hspagevisual.h" +#include "hswallpaper.h" /*! Constructor */ @@ -66,6 +69,24 @@ hbW->addView(view); } + // For some reason all visible items will pe rendered even they are outside of the viewport + // Hide inactive pages and wallpapers to make screen shot faster + HsScene *scene(HsScene::instance()); + QList pages(scene->pages()); + foreach (HsPage *p, pages) { + if (p != scene->activePage()) { + p->wallpaper()->hide(); + p->visual()->hide(); + } + } bool animate = !hbW->isObscured(); + // source view will be rendered to cache hbW->setCurrentView(view, animate, Hb::ViewSwitchCachedFullScreen); + // restore previous + foreach (HsPage *p, pages) { + if (p != scene->activePage()) { + p->wallpaper()->show(); + p->visual()->show(); + } + } } diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsoperatorhandler_p.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsoperatorhandler_p.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsoperatorhandler_p.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -144,13 +144,14 @@ XQSettingsManager *crManager) { QVariant variant = getVariantFromKey( - crManager, OperatorStoreApplication, XQSettingsManager::TypeString); + crManager, OperatorStoreApplication, XQSettingsManager::TypeString); if (!variant.isNull()) { CaEntry *operatorEntry = new CaEntry; operatorEntry->setEntryTypeName(Hs::applicationTypeName); + // Convert from a hexadecimal integer into a decimal one (as a string). operatorEntry->setAttribute( - Hs::applicationUidEntryKey, variant.toString()); - + Hs::applicationUidEntryKey, + QString::number(variant.toString().toInt(0, 16))); return operatorEntry; } return NULL; @@ -210,7 +211,7 @@ if (presenceVariant.isValid()) { qDebug() << "HsOperatorHandlerPrivate::storePresent" - << presenceVariant.toInt(); + << presenceVariant; return presenceVariant; } return QVariant(); diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hssearchfilterproxymodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hssearchfilterproxymodel.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,130 @@ +/* + * 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 search and highlight items view. + * + */ + +#include +#include +#include + +#include "hssearchfilterproxymodel.h" + +/*! + \class HsSearchFilterProxyModel + \ingroup group_hsmenustateplugin + \brief Proxy Model for highlight search string. + Highlight search string in model item title. + \lib ?library + \see QSortFilterProxyModel + */ + +/*! + Constructor. + \param parent parent for object. + */ +HsSearchFilterProxyModel::HsSearchFilterProxyModel(QObject *parent) : + QSortFilterProxyModel(parent), + mInSettingFilterString(false) +{ +} + +/* + Destructor. + */ +HsSearchFilterProxyModel::~HsSearchFilterProxyModel() +{ +} + +/* +The data() method is overridden to have a place where the highlighting + is added to the item data. In this implementation HTML-tags for + background color are added to the beginning and end of the match + in the data method using HbColorScheme. + \param index source parent index. + \param role item role. + */ +QVariant HsSearchFilterProxyModel::data(const QModelIndex &index, + int role) const +{ + QColor highlight = HbColorScheme::color("qtc_lineedit_marker_normal"); + QColor color = HbColorScheme::color("qtc_lineedit_selected"); + + if (role == Qt::DisplayRole && !mFilterCriteria.isEmpty()) { + QStringList textList = + QSortFilterProxyModel::data(index, role).toStringList(); + if(!textList[0].isEmpty()) + { + QString start = QString( + TAG_START).arg( highlight.name().toUpper() ).arg(color.name().toUpper()); + int pos = textList[0].indexOf(mFilterCriteria, 0,Qt::CaseInsensitive); + textList[0].insert(pos, start); + textList[0].insert(pos + start.length() + mFilterCriteria.length(), TAG_END); + } + + return QVariant(textList); + } + return QSortFilterProxyModel::data(index, role); + +} +/* +SetFilterString is the way to set the filtering criteria that is used + in highlight filtering. + QSortFilterProxyModel does not allow overriding its own filtering + criteria setting methods, so a separate method is added in the + HighlightFilterProxyModel. + This method stores the current filtering criteria and it can be + used in the data() method in highlighting the matches. + The method also calls the QSortFilterProxyModel method for setting + the filterCriteria. This triggers the base class to do the actual + filtering. + \param index source parent index. + \param role item role. + */ +void HsSearchFilterProxyModel::setFilterString(const QString &filterCriteria) +{ + mInSettingFilterString = true; + mFilterCriteria = filterCriteria; + setFilterRegExp( + QRegExp("(^|\\b)" + filterCriteria, Qt::CaseInsensitive)); + mInSettingFilterString = false; +} + +QString HsSearchFilterProxyModel::filterString() const +{ + return mFilterCriteria; +} + +/* + Reimplementated from QSortFilterProxyModel. + The filterAcceptsRow method is overridden to send a dataChanged signal + to the list view item + \param source_row row in source model. + \param source_parent source parent index. + */ +bool HsSearchFilterProxyModel::filterAcceptsRow (int source_row, + const QModelIndex &source_parent) const +{ + bool retVal = QSortFilterProxyModel::filterAcceptsRow(source_row, + source_parent); + if (mInSettingFilterString && retVal) { + QModelIndex mi = mapFromSource(sourceModel()->index(source_row, 0, + source_parent)); + emit const_cast(this)->dataChanged(mi, mi); + } + return retVal; +} + + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/src/hssearchview.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hssearchview.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hssearchview.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -16,7 +16,6 @@ */ #include -#include #include #include #include @@ -59,7 +58,7 @@ */ HsSearchView::HsSearchView(HsMenuViewBuilder &builder, HsStateContext stateContext, HsMainWindow &mainWindow) : - mProxyModel(new QSortFilterProxyModel(this)), mSearchView(NULL), + mProxyModel(new HsSearchFilterProxyModel(this)), mSearchView(NULL), mSearchListView(NULL), mSearchPanel(NULL), mStateContext(stateContext), mBuilder(builder), mMainWindow(mainWindow), mListView(NULL), mVkbHost(NULL), mSearchViewBuilder(), mEmptyResultText(true) @@ -128,8 +127,8 @@ mProxyModel->invalidate(); mProxyModel->setSourceModel(mListView->model()); - mProxyModel->setFilterRegExp( - QRegExp(QString(".*"), Qt::CaseInsensitive, QRegExp::RegExp)); + mCriteria = QString(""); + mProxyModel->setFilterString(mCriteria); mSearchView = mSearchViewBuilder.searchView(); mSearchListView = mSearchViewBuilder.searchListView(); @@ -144,7 +143,10 @@ } mSearchView->hideItems(Hb::AllItems); - mSearchListView->setModel(mProxyModel, new HsListViewItem()); + HsListViewItem *item = new HsListViewItem(); + item->setTextFormat(Qt::RichText); + + mSearchListView->setModel(mProxyModel, item); mMainWindow.setCurrentView(mSearchView); @@ -279,11 +281,14 @@ qDebug() << "HsSearchView::findItem: " + criteriaStr; HSMENUTEST_FUNC_ENTRY("HsSearchView::findItem"); - mProxyModel->setFilterRegExp( - QRegExp("(^|\\b)" + criteriaStr, Qt::CaseInsensitive)); + if (criteriaStr == mCriteria) + return; - mSearchListView->scrollTo( - mProxyModel->index(0, 0), HbAbstractItemView::PositionAtTop); + mCriteria = criteriaStr; + mProxyModel->setFilterString(criteriaStr); + if(criteriaStr.isEmpty()) + mSearchListView->scrollTo( + mProxyModel->index(0, 0), HbAbstractItemView::PositionAtTop); HSMENUTEST_FUNC_EXIT("HsSearchView::findItem"); } diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/inc/hscontentservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/inc/hscontentservice.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef HSCONTENTSERVICE_H +#define HSCONTENTSERVICE_H + +#include "t_hscontentservice.h" + +#endif diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/inc/t_hsaddtohomescreenmockstate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/inc/t_hsaddtohomescreenmockstate.h Mon Sep 20 10:19: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: +* +*/ + +#ifndef T_HS_ADD_TO_HOME_SCREEN_MOCK_STATE_H_ +#define T_HS_ADD_TO_HOME_SCREEN_MOCK_STATE_H_ + +#include +#include +#include "caentry.h" +#include "caitemmodel.h" + + +class AddToHomeScreenMockState: public QState +{ + Q_OBJECT + bool mEntered; +public: + AddToHomeScreenMockState(QState *aParent = 0); + bool enteredValue() const; + void setEnteredValue(bool entered) { + mEntered = entered; + }; + +protected: + void onEntry(QEvent *e); +}; + +#endif diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/inc/t_hscontentservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/inc/t_hscontentservice.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef T_HSCONTENTSERVICE_H +#define T_HSCONTENTSERVICE_H + +#include +#include +#include + +class HsWidgetHost; + +class HsContentService : public QObject +{ + Q_OBJECT +public: + HsContentService(QObject *parent = 0); + ~HsContentService(); + + bool widgets(const QString &uri, const QVariantHash &preferences, int &count); + static HsContentService *instance(); +signals: + bool widgetAdded(const QString &, const QVariantHash &); + bool widgetRemoved(const QString &, const QVariantHash &); +private: + Q_DISABLE_COPY(HsContentService) + +}; + +Q_DECLARE_METATYPE(HsContentService *) + +#endif // T_HSCONTENTSERVICE_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/inc/t_hsmockmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/inc/t_hsmockmodel.h Mon Sep 20 10:19: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: +* +*/ + +#ifndef T_HS_MOCK_MODEL_H_ +#define T_HS_MOCK_MODEL_H_ + +#include +#include "caentry.h" +#include "hsmenuitemmodel.h" + + +class MockModel: public HsMenuItemModel +{ + Q_OBJECT + CaEntry mEntry; +public: + MockModel(); + + QModelIndex fixedIndex() const; + + const CaEntry *entry(const QModelIndex &index) const; +}; + +#endif diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/inc/t_hsproxymodeltestmockmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/inc/t_hsproxymodeltestmockmodel.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,52 @@ +/* +* 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 T_HS_MOCK_MODEL_H_EEEEE +#define T_HS_MOCK_MODEL_H_EEEEE + +#include +#include "caentry.h" +#include "hsmenuitemmodel.h" + +class ProxyModelTestMockModel: public HsMenuItemModel +{ + Q_OBJECT +public: + ProxyModelTestMockModel(int entryId) : + HsMenuItemModel(CaQuery()), + mEntryId(entryId) {} + + virtual QModelIndex index(int, int, + const QModelIndex &parent = QModelIndex()) const { + Q_UNUSED(parent); + return QModelIndex(); + } + virtual QVariant data(const QModelIndex &, + int role = Qt::DisplayRole) const { + Q_UNUSED(role); + return QVariant(mEntryId); + } + + const CaEntry *entry(const QModelIndex &index) const; + +private: + + int mEntryId; +}; + + +#endif diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/src/t_hsaddtohomescreenmockstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/src/t_hsaddtohomescreenmockstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "t_hsaddtohomescreenmockstate.h" + + +AddToHomeScreenMockState::AddToHomeScreenMockState(QState *aParent): + QState(aParent), mEntered(false) {} +void AddToHomeScreenMockState::onEntry(QEvent *e) +{ + Q_UNUSED(e); + mEntered = true; +} +bool AddToHomeScreenMockState::enteredValue() const +{ + return mEntered; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/src/t_hscontentservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/src/t_hscontentservice.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,34 @@ +/* +* 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 "t_hscontentservice.h" + +HsContentService::HsContentService(QObject *parent): QObject(parent) {} + +HsContentService::~HsContentService() {} + +bool HsContentService::widgets(const QString &uri, const QVariantHash &preferences, int &count) +{ + Q_UNUSED(uri) + Q_UNUSED(preferences) + count = 0; + return true; +} + +HsContentService *HsContentService::instance() { + static HsContentService service; + return &service; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/src/t_hsmockmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/src/t_hsmockmodel.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "t_hsmockmodel.h" + +MockModel::MockModel(): + HsMenuItemModel(CaQuery()) +{ + mEntry.setAttribute("uri", + "homescreen.nokia.com/widget/clock"); + mEntry.setAttribute("library", + "hsresources/import/widgetregistry/20022F43/hsclockwidgetprovider.dll"); + mEntry.setEntryTypeName("widget"); +} + +QModelIndex MockModel::fixedIndex() const +{ + return QAbstractItemModel::createIndex(0, 0, 0); +} + +const CaEntry* +MockModel::entry(const QModelIndex &index) const +{ + const CaEntry *result = NULL; + if (index == fixedIndex()) { + result = &mEntry; + } + return result; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allappsstate/inc/t_allappsstate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allappsstate/inc/t_allappsstate.h Mon Sep 20 10:19: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: Tests for hsapplibrarystateplugin. +* +*/ + +#ifndef T_ALLAPPSSTATE_H +#define T_ALLAPPSSTATE_H + +#include + + +class HbMainWindow; +class HbAbstractViewItem; +class QStateMachine; + + +/** +* @test Test class for homescreen::hsutils modules. +*/ +class MenuStatesTest : public QObject +{ + Q_OBJECT + +private slots: + //void initTestCase(); + //void cleanup(); + //void init(); + /* + * Tests + */ + //HsAllAppsState + void construction(); + void addToCollection(); + void addToHomeScreen(); +#ifdef Q_OS_SYMBIAN + void openTaskSwitcher(); +#endif//Q_OS_SYMBIAN + void listItemLongPressed(); + void contextMenuAction(); + void sortOrder(); + void listItemActivated(); + void addModeAddActivated(); + void addModeShowContextMenu(); + void addModeEnteredExited(); +#ifdef Q_OS_SYMBIAN + void checkSoftwareUpdates(); +#endif//Q_OS_SYMBIAN + //HsAddModeProxyModel + void addModeProxyModel_construction(); + void addModeProxyModel_filterAcceptsRow(); + +private: + HbMainWindow* mMainWindow; + static const char TEST_PARAM_NAME[17]; + static const char TEST_PARAM_VALUE[17]; +}; + + + +#endif // T_ALLAPPSSTATE_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allappsstate/src/t_addmodeproxymodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allappsstate/src/t_addmodeproxymodel.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,157 @@ +/* +* 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 test class for hsHomeScreenStatePlugin library. +* +*/ + +#include +#include + +#include "caentry.h" +#include "caservice.h" +#include "hsmenuitemmodel.h" +#include "t_allappsstate.h" +#include "hsapp_defs.h" +#include "hsaddmodeproxymodel.h" +#include "t_hsproxymodeltestmockmodel.h" + +const char MenuStatesTest::TEST_PARAM_NAME[] = "test_param_name"; +const char MenuStatesTest::TEST_PARAM_VALUE[] = "test_param_value"; + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::addModeProxyModel_construction() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + ////clear test entries + CaQuery q; + q.setAttribute(QString(Hs::widgetParam)+TEST_PARAM_NAME, TEST_PARAM_VALUE); + QSharedPointer caServiceInstance = CaService::instance(); + QList< QSharedPointer > testEntries = caServiceInstance->getEntries(q); + caServiceInstance->removeEntries(testEntries); + ////init + CaEntry cwrtWidgetWithMiniViewEntry(ItemEntryRole); + cwrtWidgetWithMiniViewEntry.setEntryTypeName(Hs::applicationTypeName); + cwrtWidgetWithMiniViewEntry.setText("AccuWeather-W3C_TEST"); + cwrtWidgetWithMiniViewEntry.setAttribute(Hs::swTypeKey,Hs::HS_CWRT_APP_TYPE); + cwrtWidgetWithMiniViewEntry.setAttribute(Hs::widgetUriAttributeName,Hs::HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE); + cwrtWidgetWithMiniViewEntry.setAttribute(QString(Hs::widgetParam)+TEST_PARAM_NAME,TEST_PARAM_VALUE); + QSharedPointer entry = caServiceInstance->createEntry(cwrtWidgetWithMiniViewEntry); + QVERIFY(entry.data() != NULL); + + ////test + QVariantHash preferences; + preferences.insert(TEST_PARAM_NAME,TEST_PARAM_VALUE); + int widgetEntryId = HsAddModeProxyModel::findCwrtWidgetEntryId(preferences); + QCOMPARE(widgetEntryId,entry->id()); + + QScopedPointer addModeProxyModel; + addModeProxyModel.reset( new HsAddModeProxyModel()); + + QVERIFY(addModeProxyModel->mNotifier.data() != NULL ); + QCOMPARE(addModeProxyModel->mQuery.entryTypeNames().contains(Hs::applicationTypeName), QBool(true)); + QMap queryAttributes = addModeProxyModel->mQuery.attributes(); + QCOMPARE(queryAttributes.value(Hs::swTypeKey), QString(Hs::HS_CWRT_APP_TYPE)); + QCOMPARE(queryAttributes.value(Hs::widgetUriAttributeName), QString(Hs::HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE)); + + ////cwrt widget entry present in cache + QCOMPARE(addModeProxyModel->mCwrtWidgetCache.keys().contains(entry->id()), QBool(true)); + + ////notification: remove entry + addModeProxyModel->updateEntryStatus(*entry.data(), RemoveChangeType); + QCOMPARE(addModeProxyModel->mCwrtWidgetCache.keys().contains(entry->id()), QBool(false)); + ////notification: add entry + addModeProxyModel->updateEntryStatus(*entry.data(), AddChangeType); + QCOMPARE(addModeProxyModel->mCwrtWidgetCache.keys().contains(entry->id()), QBool(true)); + + ////clear + bool removeResult = caServiceInstance->removeEntry(*entry.data()); + QCOMPARE( removeResult , true ); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::addModeProxyModel_filterAcceptsRow() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + ////clear test entries + CaQuery q; + q.setAttribute(QString(Hs::widgetParam)+TEST_PARAM_NAME, TEST_PARAM_VALUE); + QSharedPointer caServiceInstance = CaService::instance(); + QList< QSharedPointer > testEntries = caServiceInstance->getEntries(q); + caServiceInstance->removeEntries(testEntries); + ////init + CaEntry cwrtWidgetWithMiniViewEntry(ItemEntryRole); + cwrtWidgetWithMiniViewEntry.setEntryTypeName(Hs::applicationTypeName); + cwrtWidgetWithMiniViewEntry.setText("AccuWeather-W3C_TEST"); + cwrtWidgetWithMiniViewEntry.setAttribute(Hs::swTypeKey,Hs::HS_CWRT_APP_TYPE); + cwrtWidgetWithMiniViewEntry.setAttribute(Hs::widgetUriAttributeName,Hs::HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE); + cwrtWidgetWithMiniViewEntry.setAttribute(QString(Hs::widgetParam)+TEST_PARAM_NAME,TEST_PARAM_VALUE); + QSharedPointer entry = caServiceInstance->createEntry(cwrtWidgetWithMiniViewEntry); + QVERIFY(entry.data() != NULL); + + ////test + QScopedPointer addModeProxyModel; + addModeProxyModel.reset( new HsAddModeProxyModel()); + QCOMPARE(addModeProxyModel->mCwrtWidgetCache.value(entry->id()), false); + + QScopedPointer proxyModelTestMockModel; + proxyModelTestMockModel.reset( new ProxyModelTestMockModel(entry->id())); + addModeProxyModel->setSourceModel(proxyModelTestMockModel.data()); + bool result = addModeProxyModel->filterAcceptsRow(0,QModelIndex()); + ///widget is not on HS so we show it + QCOMPARE(result, true); + + QVariantHash preferences; + preferences.insert(TEST_PARAM_NAME,TEST_PARAM_VALUE); + addModeProxyModel->updateCacheOnAddWidget(Hs::HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE, preferences); + QCOMPARE(addModeProxyModel->mCwrtWidgetCache.value(entry->id()), true); + result = addModeProxyModel->filterAcceptsRow(0,QModelIndex()); + ///widget is on HS so we do not show it + QCOMPARE(result, false); + + addModeProxyModel->updateCacheOnRemoveWidget(Hs::HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE, preferences); + QCOMPARE(addModeProxyModel->mCwrtWidgetCache.value(entry->id()), false); + result = addModeProxyModel->filterAcceptsRow(0,QModelIndex()); + ///widget is not on HS so we show it + QCOMPARE(result, true); + + ////clear + bool removeResult = caServiceInstance->removeEntry(*entry.data()); + QCOMPARE( removeResult , true ); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allappsstate/src/t_allappsstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allappsstate/src/t_allappsstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,679 @@ +/* +* 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 test class for hsHomeScreenStatePlugin library. +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "caentry.h" +#include "caitemmodel.h" +#include "hsmenuview.h" +#include "hsmenuevent.h" +#include "hsallappsstate.h" +#include "hsmenueventtransition.h" +#include "hsmainwindow.h" + +#include "t_hsaddtohomescreenmockstate.h" +#include "t_hsmockmodel.h" +#include "t_allappsstate.h" + +QTM_USE_NAMESPACE + + + +class HsMainWindowMock : public HsMainWindow +{ + virtual void setCurrentView(HbView *view); + +}; + +void HsMainWindowMock::setCurrentView(HbView *view) +{ + Q_UNUSED(view) + // do nothing +} + +//void MenuStatesTest::initTestCase() +//{ +// mMainWindow = new HbMainWindow(); +//} + + +//void MenuStatesTest::init() +//{ +// if (mMainWindow==NULL) +// { +// mMainWindow = new HbMainWindow(); +// } +//} + +//void MenuStatesTest::cleanup() +//{ +// qApp->processEvents(); +// delete mMainWindow; +// mMainWindow = NULL; +//} + +//void MenuStatesTest::cleanupTestCase() +//{ +// // delete mMainWindow; +//} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::construction() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + ////clear test entries + CaQuery q; + q.setAttribute(QString(Hs::widgetParam)+TEST_PARAM_NAME, + TEST_PARAM_VALUE); + QSharedPointer caServiceInstance = CaService::instance(); + QList< QSharedPointer > testEntries = caServiceInstance->getEntries(q); + caServiceInstance->removeEntries(testEntries); + + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QScopedPointer allAppsState(new HsAllAppsState( + builder, menuMode, mainWindow, 0)); + + QCOMPARE(allAppsState->mSortAttribute, + Hs::AscendingNameHsSortAttribute); + + QVERIFY(allAppsState->mModel != static_cast(0)); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// + +void MenuStatesTest::addModeEnteredExited() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QScopedPointer allAppsState(new HsAllAppsState( + builder, menuMode, mainWindow, 0)); + allAppsState->mViewOptions = new HbMenu(); + + allAppsState->mMenuMode->setHsMenuMode(Hs::AddHsMenuMode); + allAppsState->addModeEntered(); + QCOMPARE(allAppsState->mMenuMode->getHsMenuMode(),Hs::AddHsMenuMode); + allAppsState->mMenuView->view()->setMenu( 0 ); + allAppsState->addModeExited(); + QCOMPARE(allAppsState->mMenuView->view()->menu(),allAppsState->mViewOptions); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::sortOrder() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QScopedPointer allAppsState(new HsAllAppsState( + builder, menuMode, mainWindow, 0)); + allAppsState->scrollToBeginning(); + + allAppsState->stateEntered(); + + QVERIFY(allAppsState->mModel->columnCount() > 0); + QVERIFY(allAppsState->mModel->rowCount() > 0); + QVERIFY(allAppsState->mMenuView->view()->menu() != NULL); + + allAppsState->stateExited(); + + QVERIFY(allAppsState->mModel->columnCount() > 0); + QVERIFY(allAppsState->mModel->rowCount() > 0); + QVERIFY(allAppsState->mMenuView->view()->menu()->isEmpty()); + + QVERIFY(allAppsState->mModel); + QCOMPARE(allAppsState->mSortAttribute, + Hs::AscendingNameHsSortAttribute); + + allAppsState->setMenuOptions(); + QVERIFY(allAppsState->mAscendingMenuAction != 0); + QVERIFY(allAppsState->mDescendingMenuAction != 0); + allAppsState->descendingMenuAction(); + QCOMPARE(allAppsState->mSortAttribute, + Hs::DescendingNameHsSortAttribute); + + allAppsState->ascendingMenuAction(); + QCOMPARE(allAppsState->mSortAttribute, + Hs::AscendingNameHsSortAttribute); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::listItemActivated() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QScopedPointer machine(new QStateMachine(0)); + QState *parent = new QState(machine.data()); + + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QScopedPointer allAppsState(new HsAllAppsState( + builder, menuMode, mainWindow, parent)); + + allAppsState->scrollToBeginning(); + + QVERIFY(allAppsState->mModel != NULL); + QModelIndex applicationModelIndex = allAppsState->mModel->index(1, 0); + + allAppsState->launchItem(applicationModelIndex); + + QTest::qWait(1000); + QVariant launchedItem = allAppsState->mModel->data(applicationModelIndex, + CaItemModel::IdRole); + //TODO: made some utils to closing application + //HsMenuService::executeAction(launchedItem.toInt(), QString("close")); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::listItemLongPressed() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QScopedPointer machine(new QStateMachine(0)); + QState *parent = new QState(machine.data()); + + QScopedPointer window(new HbMainWindow); + + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + + QScopedPointer allAppsState(new HsAllAppsState( + builder, menuMode, mainWindow, parent)); + + allAppsState->scrollToBeginning(); + + allAppsState->stateEntered(); + QScopedPointer item(new HbListViewItem); + + QVERIFY(allAppsState->mModel != NULL); + QModelIndex itemModelIndex = allAppsState->mModel->index(0, 0); + item->setModelIndex(itemModelIndex); + + allAppsState->showContextMenu(item.data() , QPointF(50,50)); + + QSharedPointer entry = + allAppsState->mModel->entry(item->modelIndex()); + + if (!(entry->attribute(Hs::appSettingsPlugin).isEmpty())) { + QVERIFY(allAppsState->mContextMenu->actions().length() == 5); + } else { + QVERIFY(allAppsState->mContextMenu->actions().length() == 4); + } + + QVERIFY(allAppsState->mContextMenu->testAttribute(Qt::WA_DeleteOnClose)); + + + allAppsState->stateExited(); + + qApp->processEvents(); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::contextMenuAction() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QScopedPointer machine(new QStateMachine(0)); + + QScopedPointer window(new HbMainWindow); + + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindow mainWindow; + + QScopedPointer allAppsState(new HsAllAppsState( + builder, menuMode, mainWindow, machine.data())); + + + // we will start from all apps view + machine->setInitialState(allAppsState.data()); + + // create a state which is to be reached when add-to-home-screen + // event is triggered + AddToHomeScreenMockState addToHomeScreenState(machine.data()); + + // create a transition to the new child state which will be triggered by + // an event with specified operation type + HsMenuEventTransition addToHomeScreenTransition( + HsMenuEvent::AddToHomeScreen, allAppsState.data(), &addToHomeScreenState); + + // prepare the state graph + allAppsState->addTransition(&addToHomeScreenTransition); + + // MockModel object is to provide CaEntry representing widget + // the object will be deleted on destruction of allAppsState + MockModel *allAppsModel = new MockModel; + allAppsState->mModel = allAppsModel; + allAppsState->mMenuView->setModel(allAppsModel); + + machine->start(); + qApp->sendPostedEvents(); + + HbAction *action = new HbAction("test_addtohomescreen"); + action->setData(Hs::AddToHomeScreenContextAction); + allAppsState->mContextModelIndex = allAppsModel->fixedIndex(); + + allAppsState->contextMenuAction(action); + + qApp->sendPostedEvents(); + + QVERIFY(addToHomeScreenState.enteredValue()); + + machine->stop(); + qApp->removePostedEvents(0); + + allAppsState->stateExited(); + + qApp->processEvents(); + + delete action; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::addModeAddActivated() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QScopedPointer machine(new QStateMachine(0)); + + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QScopedPointer allAppsState(new HsAllAppsState( + builder, menuMode, mainWindow, machine.data())); + + { + // we will start from all apps view + machine->setInitialState(allAppsState.data()); + + // create a state which is to be reached when add-to-home-screen + // event is triggered + AddToHomeScreenMockState addToHomeScreenState(machine.data()); + + // create a transition to the new child state which will be triggered by + // an event with specified operation type + HsMenuEventTransition addToHomeScreenTransition( + HsMenuEvent::AddToHomeScreen, allAppsState.data(), + &addToHomeScreenState); + + // prepare the state graph + allAppsState->addTransition(&addToHomeScreenTransition); + + // MockModel object is to provide CaEntry representing widget + // the object will be deleted on destruction of allAppsState + MockModel *allAppsModel = new MockModel; + allAppsState->mModel = allAppsModel; + allAppsState->mMenuView->setModel(allAppsModel); + + machine->start(); + qApp->sendPostedEvents(); + + allAppsState->addActivated(allAppsModel->fixedIndex()); + qApp->sendPostedEvents(); + + QVERIFY(addToHomeScreenState.enteredValue()); + machine->stop(); + qApp->removePostedEvents(0); + } + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::addModeShowContextMenu() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QScopedPointer machine(new QStateMachine(0)); + + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QScopedPointer allAppsState(new HsAllAppsState( + builder, menuMode, mainWindow, machine.data())); + + { + MockModel *allAppsModel = new MockModel; + allAppsState->mModel = allAppsModel; + allAppsState->mMenuView->setModel(allAppsModel); + + QScopedPointer item(new HbListViewItem); + item.data()->setModelIndex(allAppsModel->fixedIndex()); + allAppsState->addModeShowContextMenu(item.data() , QPointF(50,50)); + QList actions = allAppsState->mContextMenu->actions(); + QCOMPARE(actions.size(),1); + if(actions.size() > 0 ){ + //first action is 'add to HS' + QCOMPARE(actions.at(0)->data().toInt(), + (int)Hs::AddToHomeScreenContextAction); + allAppsState->contextMenuAction( qobject_cast(actions.at(0)) ); + } + } + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::addToCollection() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + QScopedPointer machine(new QStateMachine(0)); + + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + HsAllAppsState* allAppsState(new HsAllAppsState( + builder, menuMode, mainWindow, machine.data())); + + + // we will start from all apps view + machine->setInitialState(allAppsState); + + AddToHomeScreenMockState mockState(machine.data()); + HsMenuEventTransition addToCollectionTransition( + HsMenuEvent::AddAppsToCollection, allAppsState, &mockState); + + // prepare the state graph + allAppsState->addTransition(&addToCollectionTransition); + + machine->start(); + qApp->sendPostedEvents(); + + allAppsState->addToCollection(); + + qApp->sendPostedEvents(); + + QVERIFY(mockState.enteredValue()); + machine->stop(); + qApp->removePostedEvents(0); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::addToHomeScreen() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + QScopedPointer machine(new QStateMachine(0)); + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QScopedPointer allAppsState(new HsAllAppsState( + builder, menuMode, mainWindow, machine.data())); + + { + // we will start from all apps view + machine->setInitialState(allAppsState.data()); + + // create a state which is to be reached when add-to-home-screen + // event is triggered + AddToHomeScreenMockState addToHomeScreenState(machine.data()); + + // create a transition to the new child state which will be triggered by + // an event with specified operation type + HsMenuEventTransition addToHomeScreenTransition( + HsMenuEvent::AddToHomeScreen, allAppsState.data(), &addToHomeScreenState); + + // prepare the state graph + allAppsState->addTransition(&addToHomeScreenTransition); + + // MockModel object is to provide CaEntry representing widget + // the object will be deleted on destruction of allAppsState + MockModel *allAppsModel = new MockModel; + allAppsState->mModel = allAppsModel; + allAppsState->mMenuView->setModel(allAppsModel); + + machine->start(); + qApp->sendPostedEvents(); + + allAppsState->addToHomeScreen( + allAppsModel->fixedIndex().data(CaItemModel::IdRole).toInt()); + qApp->sendPostedEvents(); + + QVERIFY(addToHomeScreenState.enteredValue()); + machine->stop(); + qApp->removePostedEvents(0); + + } + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +#ifdef Q_OS_SYMBIAN +void MenuStatesTest::openTaskSwitcher() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QScopedPointer allAppsState(new HsAllAppsState( + builder, menuMode, mainWindow, 0)); + + QVERIFY(allAppsState->openTaskSwitcher()); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} +#endif//Q_OS_SYMBIAN + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +#ifdef Q_OS_SYMBIAN +void MenuStatesTest::checkSoftwareUpdates() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QScopedPointer allAppsState(new HsAllAppsState( + builder, menuMode, mainWindow, 0)); + + QVERIFY(allAppsState->checkSoftwareUpdates()==0); + + // cleanup + QTest::qWait(5000); + + CaQuery query; + query.setEntryTypeNames(QStringList(Hs::applicationTypeName)); + query.setAttribute(Hs::applicationUidEntryKey, + QString::number(Hs::softwareUpdateApplicationUid)); + + QList< QSharedPointer > appEntries = CaService::instance()->getEntries(query); + + if (!appEntries.isEmpty()) { + QSharedPointer entry = appEntries.first(); + int entryId = entry->id(); + HsMenuService::executeAction(entryId, QString("close")); + } + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} +#endif//Q_OS_SYMBIAN + + + + + +QTEST_MAIN(MenuStatesTest) + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allappsstate/t_allappsstate.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allappsstate/t_allappsstate.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,24 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +#Header files +HEADERS += ./inc/*.h \ + ../inc/*.h \ + ../../inc/*.h + +#Source files +SOURCES += ./src/*.cpp \ + ../src/*.cpp \ + ../../src/*.cpp diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allappsstate/t_allappsstate.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allappsstate/t_allappsstate.pro Mon Sep 20 10:19: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: +# + +TEMPLATE = app +CONFIG += hb mobility +MOBILITY = serviceframework + +include(../../../../common.pri) +include(../../docml.pri) + +LIBS += -lhsdomainmodel +LIBS += -lhsutils +LIBS += -lhsmenuserviceprovider +LIBS += -lcaclient + +QT += testlib \ + xml \ + sql + +DEFINES += MENUSTATES_UNITTEST + +coverage:DEFINES += COVERAGE_MEASUREMENT + +DEPENDPATH += .\ + ./src \ + ./inc \ + ../inc \ + ../../src \ + ../../inc + +INCLUDEPATH += .\ + ./inc \ + ../inc \ + ../../inc \ + ../../../hsmenuworkerstateplugin/inc \ + ../../../../serviceproviders/hsmenuserviceprovider/inc \ + ../../../../hsutils/inc + +symbian { + for(docmlFile, docmlFiles): DOCML+=../../$$docmlFile + + ### get rid of localization warnings + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + ### + TARGET.UID3 = 0x20022F8B + TARGET.CAPABILITY = CAP_APPLICATION AllFiles + TARGET.EPOCSTACKSIZE = 0x14000 // 80kB + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB + CONFIG += symbian_test + coverage: CONFIG -= symbian_test + exists($${EPOCROOT}epoc32/include/platform/mw/XQSettingsManager) { + LIBS += -lxqsettingsmanager + + MMP_RULES += SMPSAFE + } +} + +RESOURCES += ../../$$qrcFile + +include(t_allappsstate.pri) + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allcollectionsstate/inc/t_allcollectionsstate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allcollectionsstate/inc/t_allcollectionsstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,66 @@ +/* +* 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: Tests for hsapplibrarystateplugin. +* +*/ + +#ifndef T_ALLCOLLECTIONSSTATE_H +#define T_ALLCOLLECTIONSSTATE_H + +#include + + +class HbMainWindow; +class HbAbstractViewItem; +class QStateMachine; + +/** +* @test Test class for homescreen::hsutils modules. +*/ +class MenuStatesTest : public QObject +{ + Q_OBJECT + +private slots: + /** + * initialize + */ + void initTestCase(); + void init(); + + /* + * Tests + */ + void construction(); + void listItemLongPressed(); + void contextMenuAction(); + void listItemActivated(); + void createNewCollection(); + void createArrangeCollection(); +#ifdef Q_OS_SYMBIAN + void openTaskSwitcher(); +#endif//Q_OS_SYMBIAN + void addModeSlots(); + void addModeEnteredExited(); + void normalModeEnteredExited(); + + /** + * cleanup + */ + void cleanup(); + +private: + HbMainWindow *mWindow; +}; +#endif // T_ALLCOLLECTIONSSTATE_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allcollectionsstate/src/t_allcollectionsstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allcollectionsstate/src/t_allcollectionsstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,553 @@ +/* +* 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 test class for hsHomeScreenStatePlugin library. +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "caentry.h" +#include "caitemmodel.h" +#include "hsmenuview.h" +#include "hsmenuviewbuilder.h" +#include "hsmenumodewrapper.h" +#include "hsmenuevent.h" +#include "hsallcollectionsstate.h" +#include "hsmenueventtransition.h" +#include "hsmainwindow.h" + +#include "t_hsaddtohomescreenmockstate.h" +#include "t_hsmockmodel.h" +#include "t_allcollectionsstate.h" + +class HsMainWindowMock : public HsMainWindow +{ + virtual void setCurrentView(HbView *view); + +}; + +void HsMainWindowMock::setCurrentView(HbView *view) +{ + Q_UNUSED(view); + // do nothing +} + +void MenuStatesTest::initTestCase() +{ +// mWindow = NULL; +} + +void MenuStatesTest::init() +{ +// mWindow = new HbMainWindow; +} + +void MenuStatesTest::cleanup() +{ + qApp->processEvents(); +// delete mWindow; +// mWindow = NULL; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::construction() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QState *parent = new QState; + + HsAllCollectionsState *allCollectionsState = + new HsAllCollectionsState(builder, + menuMode, + mainWindow, + parent); + + QCOMPARE(allCollectionsState->mBackKeyAction, + allCollectionsState->mMenuView->view()->navigationAction()); + + QVERIFY(allCollectionsState->mModel != + static_cast(0)); + delete parent; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// + +void MenuStatesTest::addModeEnteredExited() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + QState *parent = new QState; + HsMainWindowMock mainWindow; + HsAllCollectionsState *allCollectionsState = + new HsAllCollectionsState( + builder, menuMode, mainWindow, parent); + + allCollectionsState->mMenuMode->setHsMenuMode(Hs::AddHsMenuMode); + allCollectionsState->addModeEntered(); + + QCOMPARE(allCollectionsState->mMenuMode->getHsMenuMode(), + Hs::AddHsMenuMode); + delete parent; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// + +void MenuStatesTest::normalModeEnteredExited() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QState *parent = new QState; + HsAllCollectionsState *allCollectionsState = new HsAllCollectionsState( + builder, menuMode, mainWindow, parent); + + allCollectionsState->mMenuMode->setHsMenuMode(Hs::NormalHsMenuMode); + allCollectionsState->normalModeEntered(); + QCOMPARE(allCollectionsState->mMenuMode->getHsMenuMode(), + Hs::NormalHsMenuMode); + allCollectionsState->normalModeExited(); + QCOMPARE(allCollectionsState->mMenuMode->getHsMenuMode(), + Hs::NormalHsMenuMode); + delete parent; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::createNewCollection() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QStateMachine *machine = new QStateMachine(0); + + HsAllCollectionsState *allCollectionsState = + new HsAllCollectionsState(builder, menuMode, mainWindow, machine); + + machine->setInitialState(allCollectionsState); + + AddToHomeScreenMockState *mockState = new AddToHomeScreenMockState(machine); + + // create a transition to the new child state which will be triggered by + // an event with specified operation type + HsMenuEventTransition *newCollectionTransition = new HsMenuEventTransition( + HsMenuEvent::CreateCollection, allCollectionsState, mockState); + + allCollectionsState->addTransition(newCollectionTransition); + + allCollectionsState->scrollToBeginning(); + allCollectionsState->stateEntered(); + + machine->start(); + qApp->sendPostedEvents(); + + allCollectionsState->createNewCollection(); + qApp->sendPostedEvents(); + QVERIFY(mockState->enteredValue()); + qApp->removePostedEvents(0); + machine->stop(); + delete machine; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::createArrangeCollection() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QStateMachine *machine = new QStateMachine(0); + HsAllCollectionsState *allCollectionsState = + new HsAllCollectionsState(builder, menuMode, mainWindow, machine); + + machine->setInitialState(allCollectionsState); + + AddToHomeScreenMockState *mockState = new AddToHomeScreenMockState(machine); + + // create a transition to the new child state which will be triggered by + // an event with specified operation type + HsMenuEventTransition *transition = new HsMenuEventTransition( + HsMenuEvent::ArrangeAllCollections, allCollectionsState, mockState); + + allCollectionsState->addTransition(transition); + + allCollectionsState->scrollToBeginning(); + allCollectionsState->stateEntered(); + machine->start(); + qApp->sendPostedEvents(); + + allCollectionsState->createArrangeCollection(); + qApp->sendPostedEvents(); + + QVERIFY(mockState->enteredValue()); + qApp->removePostedEvents(0); + machine->stop(); + + delete machine; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::listItemActivated() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QStateMachine *machine = new QStateMachine(0); + QState *parent = new QState(machine); + + HsAllCollectionsState *allCollectionsState = + new HsAllCollectionsState(builder, menuMode, mainWindow, parent); + + allCollectionsState->scrollToBeginning(); + allCollectionsState->stateEntered(); + + QVERIFY(allCollectionsState->mModel != NULL); + QModelIndex applicationModelIndex = + allCollectionsState->mModel->index(0, 0); + + allCollectionsState->openCollection(applicationModelIndex); + + allCollectionsState->stateExited(); + + qApp->processEvents(); + delete machine; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- + +void MenuStatesTest::listItemLongPressed() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QScopedPointer wind(new HbMainWindow); + + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + + QStateMachine *machine = new QStateMachine(0); + QState *parent = new QState(machine); + + HsAllCollectionsState *allCollectionsState = + new HsAllCollectionsState(builder, menuMode, mainWindow, parent); + + allCollectionsState->scrollToBeginning(); + allCollectionsState->stateEntered(); + + HbAbstractViewItem *item = new HbListViewItem; + + item->setModelIndex(allCollectionsState->mModel->index(0,0)); + + allCollectionsState->showContextMenu(item , + QPointF(50,50)); + + uint flags = allCollectionsState->mModel->data(allCollectionsState->mModel->index(0, 0), + CaItemModel::FlagsRole).value (); + + if (flags & RemovableEntryFlag) { + QCOMPARE(allCollectionsState->mContextMenu->actions().length(), 4); + } else { + QCOMPARE(allCollectionsState->mContextMenu->actions().length(), 2); + } + + + QVERIFY(allCollectionsState->mContextMenu->testAttribute(Qt::WA_DeleteOnClose)); + + qApp->processEvents(); + + allCollectionsState->stateExited(); + + qApp->processEvents(); + delete machine; + delete item; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::contextMenuAction() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QScopedPointer machine(new QStateMachine(0)); + + QScopedPointer window(new HbMainWindow); + + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindow mainWindow; + + QScopedPointer allCollectionsState (new HsAllCollectionsState( + builder, menuMode, mainWindow, machine.data())); + + + // we will start from all apps view + machine->setInitialState(allCollectionsState.data()); + + // create a state which is to be reached when add-to-home-screen + // event is triggered + AddToHomeScreenMockState addToHomeScreenState(machine.data()); + + // create a transition to the new child state which will be triggered by + // an event with specified operation type + HsMenuEventTransition addToHomeScreenTransition( + HsMenuEvent::AddToHomeScreen, allCollectionsState.data(), &addToHomeScreenState); + + // prepare the state graph + allCollectionsState->addTransition(&addToHomeScreenTransition); + + // MockModel object is to provide CaEntry representing widget + // the object will be deleted on destruction of allAppsState + MockModel *allCollectionsMockModel = new MockModel; + allCollectionsState->mModel = allCollectionsMockModel; + allCollectionsState->mMenuView->setModel(allCollectionsMockModel); + + machine->start(); + qApp->sendPostedEvents(); + + HbAction *action = new HbAction("test_addtohomescreen"); + action->setData(Hs::AddToHomeScreenContextAction); + allCollectionsState->mContextModelIndex = allCollectionsMockModel->fixedIndex(); + + allCollectionsState->contextMenuAction(action); + + qApp->sendPostedEvents(); + + QVERIFY(addToHomeScreenState.enteredValue()); + + machine->stop(); + qApp->removePostedEvents(0); + + allCollectionsState->stateExited(); + + qApp->processEvents(); + + delete action; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- + +void MenuStatesTest::addModeSlots() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + QScopedPointer machine(new QStateMachine(0)); + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + menuMode.setHsMenuMode(Hs::AddHsMenuMode); + QScopedPointer allCollectionsState( + new HsAllCollectionsState(builder, menuMode, mainWindow, machine.data())); + + { + // we will start from all apps view + machine->setInitialState(allCollectionsState.data()); + + // create a state which is to be reached when add-to-home-screen + // event is triggered + AddToHomeScreenMockState addToHomeScreenState(machine.data()); + + // create a transition to the new child state which will be triggered by + // an event with specified operation type + HsMenuEventTransition addToHomeScreenTransition( + HsMenuEvent::AddToHomeScreen, allCollectionsState.data(), &addToHomeScreenState); + + // prepare the state graph + allCollectionsState->addTransition(&addToHomeScreenTransition); + + // MockModel object is to provide CaEntry representing widget + // the object will be deleted on destruction of allAppsState + allCollectionsState->scrollToBeginning(); + allCollectionsState->stateEntered(); + + + machine->start(); + qApp->sendPostedEvents(); + + allCollectionsState->addActivated(allCollectionsState->mModel->index(0,0)); + + qApp->sendPostedEvents(); + + QVERIFY(addToHomeScreenState.enteredValue()); + machine->stop(); + qApp->removePostedEvents(0); + } + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +#ifdef Q_OS_SYMBIAN +void MenuStatesTest::openTaskSwitcher() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QStateMachine *machine = new QStateMachine(0); + QState *parent = new QState(machine); + menuMode.setHsMenuMode(Hs::AddHsMenuMode); + HsAllCollectionsState *allCollectionsState = + new HsAllCollectionsState(builder, menuMode, mainWindow, parent); + + QVERIFY(allCollectionsState->openTaskSwitcher()); + delete machine; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} +#endif//Q_OS_SYMBIAN + +QTEST_MAIN(MenuStatesTest) + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allcollectionsstate/t_allcollectionsstate.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allcollectionsstate/t_allcollectionsstate.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,24 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +#Header files +HEADERS += ./inc/*.h \ + ../inc/*.h \ + ../../inc/*.h + +#Source files +SOURCES += ./src/*.cpp \ + ../src/*.cpp \ + ../../src/*.cpp diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allcollectionsstate/t_allcollectionsstate.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_allcollectionsstate/t_allcollectionsstate.pro Mon Sep 20 10:19: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: +# + +TEMPLATE = app +CONFIG += hb mobility +MOBILITY = serviceframework + +include(../../../../common.pri) +include(../../docml.pri) + +LIBS += -lhsdomainmodel +LIBS += -lhsutils +LIBS += -lhsmenuserviceprovider +LIBS += -lcaclient + +QT += testlib \ + xml \ + sql + +DEFINES += MENUSTATES_UNITTEST + +coverage:DEFINES += COVERAGE_MEASUREMENT + +DEPENDPATH += .\ + ./src \ + ./inc \ + ./../inc \ + ../../src \ + ../../inc + +INCLUDEPATH += .\ + ./inc \ + ./../inc \ + ../../inc \ + ../../../hsmenuworkerstateplugin/inc \ + ../../../../serviceproviders/hsmenuserviceprovider/inc \ + ../../../../hsutils/inc \ + ../../../../hsdomainmodel/inc/ + +symbian { + for(docmlFile, docmlFiles): DOCML+=../../$$docmlFile + ### get rid of localization warnings + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + ### + TARGET.UID3 = 0x2002DCEE + TARGET.CAPABILITY = CAP_APPLICATION AllFiles + TARGET.EPOCSTACKSIZE = 0x14000 // 80kB + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 48MB + CONFIG += symbian_test + coverage: CONFIG -= symbian_test + exists($${EPOCROOT}epoc32/include/platform/mw/XQSettingsManager) { + LIBS += -lxqsettingsmanager + + MMP_RULES += SMPSAFE + } +} + +RESOURCES += ../../$$qrcFile + +include(t_allcollectionsstate.pri) + \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_applibrarystate/inc/t_applibrarystate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_applibrarystate/inc/t_applibrarystate.h Mon Sep 20 10:19: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: Tests for hsapplibrarystateplugin. +* +*/ + +#ifndef T_ALLCOLLECTIONSSTATE_H +#define T_ALLCOLLECTIONSSTATE_H + +#include + + +class HbMainWindow; +class HbAbstractViewItem; +class QStateMachine; + +/** +* @test Test class for homescreen::hsutils modules. +*/ +class MenuStatesTest : public QObject +{ + Q_OBJECT + +private slots: + + /* + * Tests + */ + // ApplicationLibraryState + void ApplicationLibraryState_construction(); + void ApplicationLibraryState_backSteppingAction(); + void ApplicationLibraryState_clearToolbarLatch(); + void ApplicationLibraryState_historySlots(); + + //OviStore +#ifdef Q_OS_SYMBIAN +#ifdef QT_EXTENSIONS + void ApplicationLibraryState_oviStoreAction(); + void OperatorHandler_icon(); + void OperatorHandler_text(); + void OperatorHandler_action(); + void OperatorHandler_entry(); + void OperatorHandler_noCrWriteAccess(); + void OperatorHandler_storesPresent(); + void OperatorHandler_first(); + void OperatorHandler_type(); + void OperatorHandler_createAction(); +#endif//NO_QT_EXTENSIONS +#endif//Q_OS_SYMBIAN + + //HsBaseViewState + void HsBaseViewState_createApplicationLaunchFailMessage(); + + void cleanup(); +}; +#endif // T_ALLCOLLECTIONSSTATE_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_applibrarystate/src/t_applibrarystate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_applibrarystate/src/t_applibrarystate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,441 @@ +/* +* 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 test class for hsHomeScreenStatePlugin library. +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "hsapplibrarystate.h" +#include "hscollectionstate.h" +#include "caentry.h" +#include "caitemmodel.h" +#include "hsmenuview.h" +#include "hsmenuevent.h" +#include "hsallcollectionsstate.h" +#include "hsmenueventtransition.h" +#include "hsallappsstate.h" +#include "hsinstalledappsstate.h" +#include "hsoperatorhandler_p.h" +#include "hsoperatorhandler.h" +#include "hsmenuservice.h" + +#include "t_hsaddtohomescreenmockstate.h" +#include "t_hsmockmodel.h" +#include "t_applibrarystate.h" + +#include "hsmenumodetransition.h" + +#ifdef QT_EXTENSIONS +#include + +const int IncludeOperatorStore = 0x00000001; +const int RemoveOviStore = 0x00000008; +//const char *operatorStoreIconPath +// = "z:/private/20022F35/customsvg/operatorstore.svg"; + +void MenuStatesTest::OperatorHandler_storesPresent() +{ + HsOperatorHandler oviHandler; + XQSettingsManager man; + + bool value = oviHandler.m_q->storeValue(&man, IncludeOperatorStore); + oviHandler.m_q->mOperatorStorePresent = value; + QCOMPARE(oviHandler.operatorStorePresent(), value); + + bool value1 = !oviHandler.m_q->storeValue(&man, RemoveOviStore); + oviHandler.m_q->mOviStorePresent = value1; + QCOMPARE(oviHandler.oviStorePresent(), value1); + +} + +void MenuStatesTest::OperatorHandler_first() +{ + HsOperatorHandler oviHandler; + XQSettingsManager man; + + bool value = oviHandler.m_q->operatorStoreFirst(&man); + oviHandler.m_q->mOperatorStoreFirst = value; + QCOMPARE(oviHandler.operatorStoreFirst(), value); +} + +void MenuStatesTest::OperatorHandler_type() +{ + HsOperatorHandler oviHandler; + XQSettingsManager man; + + HsOperatorHandlerPrivate::HsStoreType value + = oviHandler.m_q->operatorStoreType(&man); + QVERIFY(value == HsOperatorHandlerPrivate::ApplicationType + || value == HsOperatorHandlerPrivate::UrlType + || value == HsOperatorHandlerPrivate::NoneType); +} + +void MenuStatesTest::OperatorHandler_createAction() +{ + HsOperatorHandler oviHandler; + oviHandler.m_q->mIcon = HbIcon(); + HbAction *action = oviHandler.prepareOperatorStoreAction(new HbAction); + QVERIFY(action->icon().isNull()); +} + +#endif//QT_EXTENSIONS + + + + +class HsMainWindowMock : public HsMainWindow +{ + virtual void setCurrentView(HbView *view); + +}; + +void HsMainWindowMock::setCurrentView(HbView *view) +{ + Q_UNUSED(view); + // do nothing +} + +void MenuStatesTest::cleanup() +{ + qApp->processEvents(); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::ApplicationLibraryState_construction() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QString qApplications(hbTrId("txt_applib_title_applications")); + + QScopedPointer appLibraryState(new HsAppLibraryState); + + QCOMPARE(appLibraryState->mMenuViewBuilder.currentView()->title(), + qApplications); + QVERIFY(appLibraryState->mAllAppsState); + QVERIFY(appLibraryState->mAllCollectionsState); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::ApplicationLibraryState_historySlots() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsAppLibraryState appLibrary; + + appLibrary.allCollectionsStateEntered(); + QCOMPARE(qobject_cast(appLibrary.mAllCollectionsState), + appLibrary.mHistoryTransaction->targetState()); + QCOMPARE(appLibrary.mInstalledAppsState->transitions().length(), 1); + QCOMPARE(appLibrary.mInstalledAppsState->transitions()[0]->sourceState(), + qobject_cast(appLibrary.mInstalledAppsState)); + QCOMPARE(appLibrary.mInstalledAppsState->transitions()[0]->targetState(), + qobject_cast(appLibrary.mAllCollectionsState)); + + appLibrary.allAppsStateEntered(); + QCOMPARE(qobject_cast(appLibrary.mAllAppsState), + appLibrary.mHistoryTransaction->targetState()); + QCOMPARE(appLibrary.mInstalledAppsState->transitions().length(), 1); + QCOMPARE(appLibrary.mInstalledAppsState->transitions()[0]->sourceState(), + qobject_cast(appLibrary.mInstalledAppsState)); + QCOMPARE(appLibrary.mInstalledAppsState->transitions()[0]->targetState(), + qobject_cast(appLibrary.mAllAppsState)); + + appLibrary.collectionStateEntered(); + QCOMPARE(appLibrary.mInstalledAppsState->transitions().length(), 1); + QCOMPARE(appLibrary.mInstalledAppsState->transitions()[0]->sourceState(), + qobject_cast(appLibrary.mInstalledAppsState)); + QCOMPARE(appLibrary.mInstalledAppsState->transitions()[0]->targetState(), + qobject_cast(appLibrary.mCollectionState)); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::ApplicationLibraryState_backSteppingAction() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QScopedPointer wind(new HbMainWindow); + //create statemachine to perform transitions + QScopedPointer machine(new QStateMachine(0)); + + HsAppLibraryState *appLibrary = new HsAppLibraryState(machine.data()); + + machine->setInitialState(appLibrary); + + machine->start(); + + qApp->sendPostedEvents(); + //initiate transition from collection state + appLibrary->mCollectionState->openAppLibrary(); + + qApp->sendPostedEvents(); + + QVERIFY(appLibrary->mAllAppsState->mMenuView->view()->menu()); + machine->stop(); + qApp->removePostedEvents(0); + disconnect(appLibrary,SIGNAL(initialize()),this,SLOT(appLibraryEntered())); + + qApp->processEvents(); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::ApplicationLibraryState_clearToolbarLatch() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsAppLibraryState appLibrary; + appLibrary.mMenuViewBuilder.allAppsAction()->setChecked(true); + appLibrary.mMenuViewBuilder.toolBarActionGroup()->checkedAction()->setChecked(true); + appLibrary.clearToolbarLatch(); + QVERIFY(appLibrary.mMenuViewBuilder.toolBarActionGroup()->checkedAction() == NULL); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +#ifdef QT_EXTENSIONS +void MenuStatesTest::ApplicationLibraryState_oviStoreAction() +{ + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK + { + HsAppLibraryState appLibrary; + QVERIFY(appLibrary.oviStoreAction()==0); + } +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::OperatorHandler_icon() +{ + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK + { + HsOperatorHandler oviHandler; + XQSettingsManager man; + HbIcon testIcon = oviHandler.m_q->createIcon(&man); + oviHandler.m_q->mIcon = testIcon; + QCOMPARE(oviHandler.icon(), testIcon); + } +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::OperatorHandler_text() +{ + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK + { + HsOperatorHandler oviHandler; + XQSettingsManager man; + + QString testText = oviHandler.m_q->operatorStoreTitle(&man); + oviHandler.m_q->mOperatorStoreTitle = testText; + QCOMPARE(oviHandler.text(), testText); + } +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::OperatorHandler_action() +{ + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK + { + HsOperatorHandler oviHandler; + HbIcon testIcon; + oviHandler.m_q->mIcon = testIcon; + oviHandler.m_q->mOperatorEntry = new CaEntry;; + QCOMPARE(oviHandler.icon(), testIcon); + oviHandler.action(); + QCOMPARE(oviHandler.icon(), testIcon); + } +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::OperatorHandler_entry() +{ + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK + { + HsOperatorHandler oviHandler; + XQSettingsManager man; + + CaEntry *testAppEntry = oviHandler.m_q->createAppEntry(&man); + oviHandler.m_q->mOperatorEntry = testAppEntry; + //if entry is NULL then tahts because there were no key in CR + //if it is not NULL then it must be application + QVERIFY(!testAppEntry || testAppEntry->entryTypeName() == + Hs::applicationTypeName); + + CaEntry *testUrlEntry = oviHandler.m_q->createUrlEntry(&man); + oviHandler.m_q->mOperatorEntry = testUrlEntry; + //similar as for application above + QVERIFY(!testUrlEntry || testUrlEntry->entryTypeName() == + Hs::urlTypeName); + + } +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::OperatorHandler_noCrWriteAccess() +{ + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK + { +// XQSettingsManager *crManager = new XQSettingsManager; +// XQCentralRepositorySettingsKey urlKey(AppLibUid, OperatorUrl); +// QVariant urlVarian = crManager->readItemValue( +// urlKey, XQSettingsManager::TypeString); +// QString dbg = urlVarian.toString(); +// bool result = crManager->writeItemValue(urlKey, QVariant("test")); +// QCOMPARE(result, false); + } +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +} +#endif//QT_EXTENSIONS + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsBaseViewState_createApplicationLaunchFailMessage() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder menuViewBuilder; + HsMenuModeWrapper menuMode; + HsMainWindow mainWindow; + + HsAllAppsState viewState(menuViewBuilder, menuMode, mainWindow); + + int errCode = -333; + int dummyItemId = 555; + viewState.createApplicationLaunchFailMessage(errCode,dummyItemId); + QVERIFY(!viewState.mApplicationLaunchFailMessage.isNull()); + + QVERIFY(viewState.mApplicationLaunchFailMessage->close()); + QTest::qWait(2000); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +QTEST_MAIN(MenuStatesTest) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_applibrarystate/t_applibrarystate.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_applibrarystate/t_applibrarystate.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,24 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +#Header files +HEADERS += ./inc/*.h \ + ../inc/*.h \ + ../../inc/*.h + +#Source files +SOURCES += ./src/*.cpp \ + ../src/*.cpp \ + ../../src/*.cpp diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_applibrarystate/t_applibrarystate.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_applibrarystate/t_applibrarystate.pro Mon Sep 20 10:19: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: +# + +TEMPLATE = app +CONFIG += hb mobility +MOBILITY = serviceframework + +include(../../../../common.pri) +include(../../docml.pri) + +LIBS += -lhsdomainmodel +LIBS += -lhsutils +LIBS += -lhsmenuserviceprovider +LIBS += -lcaclient + +QT += testlib \ + xml \ + sql + +DEFINES += MENUSTATES_UNITTEST + +coverage:DEFINES += COVERAGE_MEASUREMENT + +DEPENDPATH += .\ + ./src \ + ./inc \ + ../inc \ + ../../src \ + ../../inc + +INCLUDEPATH += .\ + ./inc \ + ../inc \ + ../../inc \ + ../../../hsmenuworkerstateplugin/inc \ + ../../../../serviceproviders/hsmenuserviceprovider/inc \ + ../../../../hsutils/inc \ + ../../../../hsdomainmodel/inc/ + +symbian { + for(docmlFile, docmlFiles): DOCML+=../../$$docmlFile + ### get rid of localization warnings + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + ### + TARGET.UID3 = 0x2002DCF0 + TARGET.CAPABILITY = CAP_APPLICATION AllFiles + TARGET.EPOCSTACKSIZE = 0x14000 // 80kB + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB + CONFIG += symbian_test + coverage: CONFIG -= symbian_test + exists($${EPOCROOT}epoc32/include/platform/mw/XQSettingsManager) { + LIBS += -lxqsettingsmanager + + MMP_RULES += SMPSAFE + } +} + +RESOURCES += ../../$$qrcFile + +include(t_applibrarystate.pri) + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_collectionsstate/inc/t_collectionsstate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_collectionsstate/inc/t_collectionsstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,69 @@ +/* +* 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: Tests for hsapplibrarystateplugin. +* +*/ + +#ifndef T_COLLECTIONSSTATE_H +#define T_COLLECTIONSSTATE_H + +#include +#include + +class HbAbstractViewItem; +class QStateMachine; + +/** +* @test Test class for homescreen::hsutils modules. +*/ +class MenuStatesTest : public QObject +{ + Q_OBJECT + +private slots: + + /* + * Tests + */ + void construction(); + void updateLabel(); + + void contextMenuConstruct(); + void contextMenuConstructNonEmptyCollection(); + void addAppsAction(); + void renameAction(); + void deleteAppsAction(); + void addElementToHomeScreen(); + void addCollectionShortcutToHomeScreenAction(); + void latestOnTopMenuAction(); + void oldestOnTopMenuAction(); + void createArrangeCollection(); +#ifdef Q_OS_SYMBIAN + void openTaskSwitcher(); +#endif//Q_OS_SYMBIAN + void listItemActivated(); + void listItemLongPressed(); + void contextMenuAction(); + void disableSearchAction(); + + + void init(); + /** + * cleanup + */ + void cleanup(); +private: + HbMainWindow *mWindow; +}; +#endif // T_COLLECTIONSSTATE_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_collectionsstate/src/t_collectionsstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_collectionsstate/src/t_collectionsstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,1093 @@ +/* +* 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 test class for hsHomeScreenStatePlugin library. +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "caentry.h" +#include "caitemmodel.h" +#include "hsmenuviewbuilder.h" +#include "hsmenumodewrapper.h" +#include "hsmenuevent.h" +#include "hsmenueventtransition.h" +#include "hscollectionstate.h" +#include "hsmainwindow.h" + +#include "t_hsaddtohomescreenmockstate.h" +#include "t_hsmockmodel.h" +#include "t_collectionsstate.h" + +Q_DECLARE_METATYPE(Hs::HsSortAttribute) + + +class HsMainWindowMock : public HsMainWindow +{ + virtual void setCurrentView(HbView *view); + +}; + +void HsMainWindowMock::setCurrentView(HbView *view) +{ + Q_UNUSED(view); + // do nothing +} + +void MenuStatesTest::init() +{ +} + +void MenuStatesTest::cleanup() +{ + qApp->processEvents(); +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::construction() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QScopedPointer parent(new QState); + parent->setObjectName(tr("testName1")); + + HsCollectionState *collectionState = + new HsCollectionState(builder, menuMode, mainWindow, parent.data()); + + QCOMPARE(collectionState->mSortAttribute, + Hs::LatestOnTopHsSortAttribute); + QCOMPARE(collectionState->mCollectionId, -1); + QCOMPARE(collectionState->mModel, static_cast(0)); + QCOMPARE(collectionState->objectName(), + tr("testName1/collectionstate")); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::listItemActivated() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + + QScopedPointer machine(new QStateMachine(0)); + QState *parent = new QState(machine.data()); + + const QString collectionName("testCollection" + + QDateTime::currentDateTime(). + toString("ddmmyyyy_hh_mm_ss_zzz")); + const int collectionId = HsMenuService::createCollection(collectionName); + + HsCollectionState *collectionState = + new HsCollectionState(builder, menuMode, mainWindow, parent); + + collectionState->mCollectionId = collectionId; + + HsMenuItemModel *const itemModel = + HsMenuService::getAllApplicationsModel(Hs::AscendingNameHsSortAttribute); + + QModelIndex applicationModelIndex = itemModel->index(1, 0); + + QList appList; + + appList << itemModel->data(applicationModelIndex, CaItemModel::IdRole).toInt(); + + HsMenuService::addApplicationsToCollection(appList, collectionId); + + collectionState->stateEntered(); + + QVERIFY(collectionState->mModel != NULL); + + collectionState->launchItem(applicationModelIndex); + + collectionState->stateExited(); + + QTest::qWait(3000); + + //TODO: made some utils to closing application + //HsMenuService::executeAction(appList.at(0), QString("close")); + + // cleanup + HsMenuService::removeCollection(collectionId); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::listItemLongPressed() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QScopedPointer wind(new HbMainWindow); + + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindow mainWindow; + + + QScopedPointer machine(new QStateMachine(0)); + QState *parent(new QState(machine.data())); + + const QString collectionName("testCollection" + + QDateTime::currentDateTime(). + toString("ddmmyyyy_hh_mm_ss_zzz")); + const int collectionId = HsMenuService::createCollection(collectionName); + + HsMenuItemModel *appsModel = HsMenuService::getAllApplicationsModel(); + QList list; + list << appsModel->data(appsModel->index(0),CaItemModel::IdRole).toInt(); + HsMenuService::addApplicationsToCollection(list,collectionId); + delete appsModel; + + HsCollectionState *collectionState = new HsCollectionState(builder, menuMode, + mainWindow, parent); + collectionState->mCollectionId = collectionId; + collectionState->mCollectionType = "collection"; + + collectionState->stateEntered(); + + QScopedPointer item(new HbListViewItem); + QModelIndex itemModelIndex = collectionState->mModel->index(0, 0); + item->setModelIndex(itemModelIndex); + + collectionState->showContextMenu(item.data(), QPointF(50,50)); + + int numberOfActions = 3; + + EntryFlags rootFlags = + collectionState->mModel->root().data(CaItemModel::FlagsRole).value< + EntryFlags> (); + if (rootFlags & RemovableEntryFlag) { + numberOfActions++; + } + + EntryFlags flags = item->modelIndex().data(CaItemModel::FlagsRole).value< + EntryFlags> (); + if ((flags & RemovableEntryFlag)) { + numberOfActions++; + } + + QSharedPointer entry = collectionState->mModel->entry(item->modelIndex()); + if (!(entry->attribute(Hs::appSettingsPlugin).isEmpty())) { + numberOfActions++; + } + + QCOMPARE(collectionState->mContextMenu->actions().length(), numberOfActions); + QVERIFY(collectionState->mContextMenu->testAttribute(Qt::WA_DeleteOnClose)); + + collectionState->stateExited(); + + qApp->processEvents(); + + // cleanup + if (!list.isEmpty()) { + for (int i=0; iremoveView(builder.currentView()); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::contextMenuAction() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + + QScopedPointer machine(new QStateMachine(0)); + + // we will start from collection view + + const QString collectionName("testCollection" + + QDateTime::currentDateTime().toString("ddmmyyyy_hh_mm_ss_zzz")); + const int collectionId = HsMenuService::createCollection(collectionName); + + HsMenuItemModel *allAppsModel = HsMenuService::getAllApplicationsModel(); + QVERIFY(allAppsModel->rowCount() >= 1); + QModelIndex appIndex = allAppsModel->index(0, 0); + + const int appId = allAppsModel->data(appIndex, CaItemModel::IdRole).toInt(); + QList appIdList; + appIdList << appId; + + HsCollectionState *collectionState = new HsCollectionState(builder, + menuMode, mainWindow, machine.data()); + + collectionState->mCollectionId = collectionId; + HsMenuService::addApplicationsToCollection(appIdList, collectionId); + + // create a state which is to be reached when add-to-home-screen + // event is triggered + AddToHomeScreenMockState *addToHomeScreenState = + new AddToHomeScreenMockState(machine.data()); + + // create a transition to the new child state which will be triggered by + // an event with specified operation type + HsMenuEventTransition addToHomeScreenTransition( + HsMenuEvent::AddToHomeScreen, collectionState, addToHomeScreenState); + + // prepare the state graph + collectionState->addTransition(&addToHomeScreenTransition); + + machine->setInitialState(collectionState); + machine->start(); + qApp->sendPostedEvents(); + + HbAction *action = new HbAction("test_addtohomescreen"); + action->setData(Hs::AddToHomeScreenContextAction); + + collectionState->mContextModelIndex = collectionState->mModel->index(0,0); + + collectionState->contextMenuAction(action); + + qApp->sendPostedEvents(); + qApp->processEvents(); + + QVERIFY(addToHomeScreenState->enteredValue()); + + machine->stop(); + + // cleanup + delete action; + HsMenuService::removeCollection(collectionId); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::contextMenuConstruct() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder menuView; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + + QScopedPointer parent(new QState); + + const QString collectionName("testCollection" + + QDateTime::currentDateTime(). + toString("ddmmyyyy_hh_mm_ss_zzz")); + + const int collectionId = HsMenuService::createCollection(collectionName); + + HsCollectionState *collectionState = + new HsCollectionState(menuView, menuMode, mainWindow, parent.data()); + + collectionState->mCollectionId = collectionId; + + collectionState->stateEntered(); + + qApp->processEvents(); + + int actionsCount( + collectionState->mMenuView->view()->menu()->actions().count()); + QCOMPARE(actionsCount , 5); + collectionState->stateExited(); + + // cleanup + HsMenuService::removeCollection(collectionId); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::contextMenuConstructNonEmptyCollection() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder menuView; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + + QScopedPointer parent(new QState); + + const QString collectionName("testCollection" + + QDateTime::currentDateTime(). + toString("ddmmyyyy_hh_mm_ss_zzz")); + + const int collectionId = HsMenuService::createCollection(collectionName); + + HsCollectionState *collectionState = + new HsCollectionState(menuView, menuMode, mainWindow, parent.data()); + + collectionState->mCollectionId = collectionId; + QVERIFY(HsMenuService::addApplicationsToCollection(QList()<<1, collectionId)); + + collectionState->stateEntered(); + + qApp->processEvents(); + + const int actionsCount( + collectionState->mMenuView->view()->menu()->actions().count()); + // Arrange is available inside options menu. + QCOMPARE(actionsCount , 6); + collectionState->stateExited(); + + // cleanup + HsMenuService::removeCollection(collectionId); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +void MenuStatesTest::addAppsAction() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + + QScopedPointer machine(new QStateMachine(0)); + + const QString collectionName("testCollection" + + QDateTime::currentDateTime(). + toString("ddmmyyyy_hh_mm_ss_zzz")); + + const int collectionId = + HsMenuService::createCollection(collectionName); + + HsCollectionState *collectionState = + new HsCollectionState(builder, menuMode, mainWindow, machine.data()); + + collectionState->mCollectionId = collectionId; + + AddToHomeScreenMockState *mockState = + new AddToHomeScreenMockState(machine.data()); + + HsMenuEventTransition transition( + HsMenuEvent::AddAppsToCollection, collectionState, mockState); + + collectionState->addTransition(&transition); + + machine->setInitialState(collectionState); + machine->start(); + + qApp->sendPostedEvents(); + qApp->processEvents(); + + collectionState->addAppsAction(); + + qApp->sendPostedEvents(); + qApp->processEvents(); + + QVERIFY(mockState->enteredValue()); + + machine->stop(); + + // cleanup + HsMenuService::removeCollection(collectionId); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +void MenuStatesTest::renameAction() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + + QScopedPointer machine(new QStateMachine(0)); + + const QString collectionName("testCollection" + + QDateTime::currentDateTime(). + toString("ddmmyyyy_hh_mm_ss_zzz")); + + const int collectionId = HsMenuService::createCollection(collectionName); + + HsCollectionState *collectionState = + new HsCollectionState(builder, menuMode, mainWindow, machine.data()); + + + collectionState->mCollectionId = collectionId; + + AddToHomeScreenMockState *mockState = + new AddToHomeScreenMockState(machine.data()); + + HsMenuEventTransition transition( + HsMenuEvent::RenameCollection, collectionState, mockState); + + collectionState->addTransition(&transition); + + machine->setInitialState(collectionState); + + machine->start(); + + qApp->sendPostedEvents(); + + collectionState->renameAction(); + + qApp->sendPostedEvents(); + + QVERIFY(mockState->enteredValue()); + + machine->stop(); + + // cleanup + HsMenuService::removeCollection(collectionId); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +void MenuStatesTest::deleteAppsAction() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + + QScopedPointer machine(new QStateMachine(0)); + + const QString collectionName("testCollection" + + QDateTime::currentDateTime(). + toString("ddmmyyyy_hh_mm_ss_zzz")); + + const int collectionId = HsMenuService::createCollection(collectionName); + + HsCollectionState *collectionState = + new HsCollectionState(builder, menuMode, mainWindow, machine.data()); + + collectionState->mCollectionId = collectionId; + + machine->setInitialState(collectionState); + + AddToHomeScreenMockState *mockState = + new AddToHomeScreenMockState(machine.data()); + + HsMenuEventTransition transition( + HsMenuEvent::DeleteCollection, collectionState, mockState); + + collectionState->addTransition(&transition); + + machine->setInitialState(collectionState); + machine->start(); + qApp->sendPostedEvents(); + + collectionState->deleteAction(); + + qApp->sendPostedEvents(); + + QVERIFY(mockState->enteredValue()); + + machine->stop(); + + // cleanup + HsMenuService::removeCollection(collectionId); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +void MenuStatesTest::updateLabel() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + + QScopedPointer machine(new QStateMachine(0)); + QState *rootState = new QState(machine.data()); + machine->setInitialState(rootState); + + const QString collectionName("testCollection" + + QDateTime::currentDateTime(). + toString("ddmmyyyy_hh_mm_ss_zzz")); + + const int collectionId = + HsMenuService::createCollection(collectionName); + + HsCollectionState *collectionState = + new HsCollectionState(builder, menuMode, mainWindow, rootState); + + collectionState->mCollectionId = collectionId; + + collectionState->mModel = + static_cast( + HsMenuService::getCollectionModel(collectionState->mCollectionId, + collectionState->mSortAttribute)); + + const QString label1 = collectionState->mModel->root().data( + Qt::DisplayRole).toString(); + + const QString newName(label1 + + QDateTime::currentDateTime(). + toString("ddmmyyyy_hh_mm_ss_zzz")); + + const bool renamed = HsMenuService::renameCollection( + collectionState->mCollectionId, newName); + + QVERIFY(renamed); + + QTest::qWait(3000); + + collectionState->updateLabel(); + + const QString label2 = builder.currentViewLabel()->heading(); + + QCOMPARE(label2, newName); + + QVERIFY(HsMenuService::renameCollection(collectionState->mCollectionId, label1)); + + // cleanup + HsMenuService::removeCollection(collectionId); + } +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::addElementToHomeScreen() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + + QScopedPointer machine(new QStateMachine(0)); + + const QString collectionName("testCollection" + + QDateTime::currentDateTime(). + toString("ddmmyyyy_hh_mm_ss_zzz")); + + const int collectionId = HsMenuService::createCollection(collectionName); + HsMenuItemModel *allAppsModel = HsMenuService::getAllApplicationsModel(); + QVERIFY(allAppsModel->rowCount() >= 1); + QModelIndex appIndex = allAppsModel->index(0, 0); + + const int appId = allAppsModel->data(appIndex, CaItemModel::IdRole).toInt(); + QList appIdList; + appIdList << appId; + + HsCollectionState *collectionState = + new HsCollectionState(builder, menuMode, mainWindow, machine.data()); + collectionState->mCollectionId = collectionId; + + HsMenuService::addApplicationsToCollection(appIdList, collectionId); + + // create a state which is to be reached when add-to-home-screen + // event is triggered + AddToHomeScreenMockState *addToHomeScreenState = + new AddToHomeScreenMockState(machine.data()); + + // create a transition to the new child state which will be triggered by + // an event with specified operation type + HsMenuEventTransition addToHomeScreenTransition( + HsMenuEvent::AddToHomeScreen, collectionState, addToHomeScreenState); + + // prepare the state graph + collectionState->addTransition(&addToHomeScreenTransition); + + machine->setInitialState(collectionState); + machine->start(); + qApp->processEvents(); + + const QModelIndex idx = collectionState->mModel->index(0); + + collectionState->addToHomeScreen(idx.data(CaItemModel::IdRole).toInt()); + + qApp->processEvents(); + + QVERIFY(addToHomeScreenState->enteredValue()); + + machine->stop(); + + // cleanup + if (!appIdList.isEmpty()) { + for (int i=0; i machine(new QStateMachine(0)); + + // we will start from collection view + + const QString collectionName("testCollection" + + QDateTime::currentDateTime().toString("ddmmyyyy_hh_mm_ss_zzz")); + + const int collectionId = HsMenuService::createCollection(collectionName); + + HsCollectionState *collectionState = new HsCollectionState(builder, + menuMode, mainWindow, machine.data()); + collectionState->mCollectionId = collectionId; + + // create a state which is to be reached when add-to-home-screen + // event is triggered + AddToHomeScreenMockState *addToHomeScreenState = + new AddToHomeScreenMockState(machine.data()); + + // create a transition to the new child state which will be triggered by + // an event with specified operation type + HsMenuEventTransition addToHomeScreenTransition( + HsMenuEvent::AddToHomeScreen, collectionState, addToHomeScreenState); + + // prepare the state graph + collectionState->addTransition(&addToHomeScreenTransition); + + + machine->setInitialState(collectionState); + machine->start(); + qApp->sendPostedEvents(); + + collectionState->addCollectionShortcutToHomeScreenAction(); + qApp->sendPostedEvents(); + + QVERIFY(addToHomeScreenState->enteredValue()); + + // cleanup + HsMenuService::removeCollection(collectionId); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::latestOnTopMenuAction() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + + QScopedPointer parent(new QState); + parent->setObjectName(tr("testName1")); + + const QString collectionName("testCollection" + + QDateTime::currentDateTime().toString("ddmmyyyy_hh_mm_ss_zzz")); + const int collectionId = HsMenuService::createCollection(collectionName); + + HsCollectionState *collectionState = new HsCollectionState( + builder, menuMode, mainWindow, parent.data()); + collectionState->mCollectionId = collectionId; + + collectionState->mSortAttribute = + Hs::OldestOnTopHsSortAttribute; + + MockModel *collectionModel = new MockModel; + collectionState->mModel = collectionModel; + collectionState->mMenuView->setModel(collectionModel); + + qRegisterMetaType( + "Hs::HsSortAttribute"); + collectionState->mCollectionType = Hs::collectionDownloadedTypeName; + collectionState->setMenuOptions(); + QVERIFY(collectionModel->rowCount() > 1 ); + QVERIFY(collectionState->mLatestOnTopMenuAction != 0); + QVERIFY(collectionState->mOldestOnTopMenuAction != 0); + collectionState->latestOnTopMenuAction(); + + QCOMPARE(collectionState->mSortAttribute, + Hs::LatestOnTopHsSortAttribute); + + // cleanup + HsMenuService::removeCollection(collectionId); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::oldestOnTopMenuAction() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + // GUI objects set up + + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + + QScopedPointer parent(new QState); + parent->setObjectName(tr("testName1")); + + const QString collectionName("testCollection" + + QDateTime::currentDateTime().toString("ddmmyyyy_hh_mm_ss_zzz")); + const int collectionId = HsMenuService::createCollection(collectionName); + + HsCollectionState *collectionState = + new HsCollectionState(builder, menuMode, mainWindow, parent.data()); + collectionState->mCollectionId = collectionId; + + collectionState->mSortAttribute = + Hs::LatestOnTopHsSortAttribute; + + MockModel *collectionModel = new MockModel; + collectionState->mModel = collectionModel; + collectionState->mMenuView->setModel(collectionModel); + + qRegisterMetaType( + "Hs::HsSortAttribute"); + collectionState->mCollectionType = Hs::collectionDownloadedTypeName; + collectionState->setMenuOptions(); + QVERIFY(collectionModel->rowCount() > 1 ); + QVERIFY(collectionState->mLatestOnTopMenuAction != 0); + QVERIFY(collectionState->mOldestOnTopMenuAction != 0); + + collectionState->oldestOnTopMenuAction(); + + QCOMPARE(collectionState->mSortAttribute, + Hs::OldestOnTopHsSortAttribute); + + // cleanup + HsMenuService::removeCollection(collectionId); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::createArrangeCollection() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QStateMachine *machine = new QStateMachine(0); + + const QString collectionName("testCollection" + + QDateTime::currentDateTime(). + toString("ddmmyyyy_hh_mm_ss_zzz")); + const int collectionId = HsMenuService::createCollection(collectionName); + + HsCollectionState *collectionState = + new HsCollectionState(builder, menuMode, mainWindow, machine); + + collectionState->mCollectionId = collectionId; + + machine->setInitialState(collectionState); + + AddToHomeScreenMockState *mockState = new AddToHomeScreenMockState(machine); + + // create a transition to the new child state which will be triggered by + // an event with specified operation type + HsMenuEventTransition *transition = new HsMenuEventTransition( + HsMenuEvent::ArrangeCollection, collectionState, mockState); + collectionState->addTransition(transition); + + machine->start(); + qApp->sendPostedEvents(); + collectionState->createArrangeCollection(); + qApp->sendPostedEvents(); + + QVERIFY(mockState->enteredValue()); + qApp->removePostedEvents(0); + machine->stop(); + + delete machine; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +#ifdef Q_OS_SYMBIAN +void MenuStatesTest::openTaskSwitcher() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QScopedPointer machine(new QStateMachine(0)); + HsCollectionState *collectionState = + new HsCollectionState(builder, menuMode, mainWindow, machine.data()); + QVERIFY(collectionState->openTaskSwitcher()); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} +#endif//Q_OS_SYMBIAN + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::disableSearchAction() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + + QScopedPointer machine(new QStateMachine(0)); + + const QString collectionName("testCollection" + + QDateTime::currentDateTime(). + toString("ddmmyyyy_hh_mm_ss_zzz")); + + const int collectionId = HsMenuService::createCollection(collectionName); + + HsCollectionState *collectionState = + new HsCollectionState(builder, menuMode, mainWindow, machine.data()); + + + collectionState->mCollectionId = collectionId; + + machine->setInitialState(collectionState); + + machine->start(); + + qApp->sendPostedEvents(); + + collectionState->stateEntered(); + + collectionState->mMenuView->disableSearch(true); + + QVERIFY(!collectionState->mMenuView->mBuilder.searchAction()->isEnabled()); + + collectionState->mMenuView->disableSearch(false); + + QVERIFY(collectionState->mMenuView->mBuilder.searchAction()->isEnabled()); + + collectionState->lockSearchButton(true); + + QVERIFY(!collectionState->mMenuView->mBuilder.searchAction()->isEnabled()); + + collectionState->lockSearchButton(false); + + QVERIFY(collectionState->mMenuView->mBuilder.searchAction()->isEnabled()); + + collectionState->stateExited(); + + machine->stop(); + + // cleanup + HsMenuService::removeCollection(collectionId); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} +QTEST_MAIN(MenuStatesTest) + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_collectionsstate/t_collectionsstate.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_collectionsstate/t_collectionsstate.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,24 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +#Header files +HEADERS += ./inc/*.h \ + ../inc/*.h \ + ../../inc/*.h + +#Source files +SOURCES += ./src/*.cpp \ + ../src/*.cpp \ + ../../src/*.cpp diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_collectionsstate/t_collectionsstate.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_collectionsstate/t_collectionsstate.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,78 @@ +# +# 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 = app +CONFIG += hb mobility +MOBILITY = serviceframework + +include(../../../../common.pri) +include(../../docml.pri) + +LIBS += -lhsdomainmodel +LIBS += -lhsutils +LIBS += -lhsmenuserviceprovider +LIBS += -lcaclient + +QT += testlib \ + xml \ + sql + +DEFINES += MENUSTATES_UNITTEST + +coverage:DEFINES += COVERAGE_MEASUREMENT + +DEPENDPATH += .\ + ./src \ + ./inc \ + ../src \ + ../inc \ + ../../src \ + ../../inc + +INCLUDEPATH += .\ + ./inc \ + ../../inc \ + ../src \ + ../inc \ + ../../../hsmenuworkerstateplugin/inc \ + ../../../../serviceproviders/hsmenuserviceprovider/inc \ + ../../../../hsutils/inc \ + ../../../../hsdomainmodel/inc/ + +symbian { + for(docmlFile, docmlFiles): DOCML+=../../$$docmlFile + ### get rid of localization warnings + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + ### + TARGET.UID3 = 0x2002DCED + TARGET.CAPABILITY = CAP_APPLICATION AllFiles + TARGET.EPOCSTACKSIZE = 0x14000 // 80kB + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB + CONFIG += symbian_test + coverage: CONFIG -= symbian_test + exists($${EPOCROOT}epoc32/include/platform/mw/XQSettingsManager) { + LIBS += -lxqsettingsmanager + + MMP_RULES += SMPSAFE + } +} + +RESOURCES += ../../$$qrcFile + +include(t_collectionsstate.pri) + \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_installedappsstate/inc/t_installedappsstate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_installedappsstate/inc/t_installedappsstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,58 @@ +/* +* 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: Tests for hsapplibrarystateplugin. +* +*/ + +#ifndef T_ALLAPPSSTATE_H +#define T_ALLAPPSSTATE_H + +#include +#include + +class HbMainWindow; +class HbAbstractViewItem; +class QStateMachine; + +/** +* @test Test class for homescreen::hsutils modules. +*/ +class MenuStatesTest : public QObject +{ + Q_OBJECT + +private slots: + + /* + * Tests + */ + void construction(); +#ifdef Q_OS_SYMBIAN + void openTaskSwitcher(); + void openInstallationLog(); +#endif//Q_OS_SYMBIAN + void emptyLabelVisibility(); + void stateEnteredExited(); + void listItemLongPressed(); + void latestOldestOnTopMenuAction(); + /** + * cleanup + */ + + void cleanup(); + +private: + HbMainWindow mWindow; +}; +#endif // T_ALLAPPSSTATE_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_installedappsstate/src/t_installedappsstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_installedappsstate/src/t_installedappsstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,399 @@ +/* +* 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 test class for hsHomeScreenStatePlugin library. +* +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "hsmenuview.h" +#include "hsinstalledappsstate.h" +#include "hsmainwindow.h" +#include "hsmenuitemmodel.h" + +#include "hsmenueventtransition.h" + +#include "t_installedappsstate.h" + +#include "t_hsaddtohomescreenmockstate.h" + + +class HsMainWindowMock : public HsMainWindow +{ + virtual void setCurrentView(HbView *view); + +}; + +void HsMainWindowMock::setCurrentView(HbView *view) +{ + Q_UNUSED(view); + // do nothing +} + +void MenuStatesTest::cleanup() +{ + qApp->processEvents(); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::construction() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMainWindowMock mainWindow; + + QScopedPointer parent(new QState); + + QScopedPointer allAppsState( + new HsInstalledAppsState(builder, mainWindow, parent.data())); + + + QVERIFY(!allAppsState->mModel); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +#ifdef Q_OS_SYMBIAN +void MenuStatesTest::openTaskSwitcher() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMainWindowMock mainWindow; + + QScopedPointer parent(new QState); + + QScopedPointer installedAppsState ( + new HsInstalledAppsState(builder, mainWindow, parent.data())); + + QVERIFY(installedAppsState->openTaskSwitcher()); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} +#endif//Q_OS_SYMBIAN + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +#ifdef Q_OS_SYMBIAN +void MenuStatesTest::openInstallationLog() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMainWindowMock mainWindow; + QStateMachine *machine = new QStateMachine(0); + + HsInstalledAppsState *installedAppsState = + new HsInstalledAppsState(builder, mainWindow, machine); + + machine->setInitialState(installedAppsState); + + AddToHomeScreenMockState *mockState = new AddToHomeScreenMockState(machine); + + // create a transition to the new child state which will be triggered by + // an event with specified operation type + HsMenuEventTransition *newCollectionTransition = new HsMenuEventTransition( + HsMenuEvent::ShowInstallationLog, installedAppsState, mockState); + + installedAppsState->addTransition(newCollectionTransition); + + installedAppsState->stateEntered(); + + machine->start(); + qApp->sendPostedEvents(); + + installedAppsState->openInstallationLog(); + QTest::qWait(5000); + + QVERIFY(mockState->enteredValue()); + qApp->removePostedEvents(0); + machine->stop(); + delete machine; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} +#endif//Q_OS_SYMBIAN + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::stateEnteredExited() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + int fakeId = 2; + QString fakeCollectionType("fakeCollectionType"); + + HsMenuViewBuilder builder; + HsMainWindowMock mainWindow; + + QScopedPointer parent(new QState); + + HsInstalledAppsState *installedAppsState = + new HsInstalledAppsState(builder, mainWindow, parent.data()); + + QVariantMap params; + params.insert(Hs::itemIdKey, fakeId); + params.insert(Hs::entryTypeNameKey, fakeCollectionType); + QEvent *event = new HsMenuEvent( + HsMenuEvent::BackFromInstalledView, params); + installedAppsState->onEntry(event); + delete event; + event = NULL; + QCOMPARE(installedAppsState->mCollectionId, fakeId); + QCOMPARE(installedAppsState->mCollectionType, fakeCollectionType); + + installedAppsState->stateEntered(); + + QVERIFY(installedAppsState->mModel); + + installedAppsState->mContextMenu = new HbMenu(); + installedAppsState->mContextMenu->setAttribute(Qt::WA_DeleteOnClose); + + QVERIFY(!installedAppsState->mMenuView->view()->menu()->isEmpty()); + + installedAppsState->stateExited(); + + QVERIFY(!installedAppsState->mMenuView->view()->menu()->isEmpty()); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::emptyLabelVisibility() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMainWindowMock mainWindow; + QScopedPointer machine(new QStateMachine(0)); + HsInstalledAppsState *installedAppsState = + new HsInstalledAppsState(builder, mainWindow, machine.data()); + + installedAppsState->stateEntered(); + + QVERIFY(installedAppsState->mModel); + + installedAppsState->setEmptyLabelVisibility(true); + + QCOMPARE(installedAppsState->mMenuView->mBuilder.mStateContext, + HsInstalledAppsContext); + QCOMPARE(installedAppsState->mMenuView->mBuilder.mOperationalContext, + HsEmptyLabelContext); + + + installedAppsState->setEmptyLabelVisibility(false); + + QCOMPARE(installedAppsState->mMenuView->mBuilder.mStateContext, + HsInstalledAppsContext); + QCOMPARE(installedAppsState->mMenuView->mBuilder.mOperationalContext, + HsItemViewContext); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::listItemLongPressed() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QScopedPointer window(new HbMainWindow); + HsMenuViewBuilder builder; + HsMainWindow mainWindow; + + QScopedPointer parent(new QState); + + HsInstalledAppsState *installedAppsState = + new HsInstalledAppsState(builder, mainWindow, parent.data()); + + installedAppsState->stateEntered(); + QVERIFY(installedAppsState->mModel); + + QScopedPointer item(new HbListViewItem); + + QVERIFY(installedAppsState->mModel != NULL); + + // to ensure that we have at least one item in model assign + // installedAppsState with All Applications Model.. + installedAppsState->mModel = HsMenuService::getAllApplicationsModel(); + + if( installedAppsState->mModel->rowCount() > 0 ) + { + QModelIndex itemModelIndex = installedAppsState->mModel->index(0, 0); + + QSharedPointer entry + = installedAppsState->mModel->entry(itemModelIndex); + + entry->setAttribute(Hs::componentIdAttributeName, QString("0")); + entry->setFlags(entry->flags() | RemovableEntryFlag); + + item->setModelIndex(itemModelIndex); + + installedAppsState->showContextMenu(item.data() , QPointF(50,50)); + + QCOMPARE(installedAppsState->mContextMenu->actions().length(), 2); + + Hs::HsContextAction uninstallAction = static_cast( + installedAppsState->mContextMenu->actions()[0]->data().toInt()); + QCOMPARE(uninstallAction, Hs::UninstallContextAction); + + Hs::HsContextAction detailsAction = static_cast( + installedAppsState->mContextMenu->actions()[1]->data().toInt()); + QCOMPARE(detailsAction, Hs::AppDetailsContextAction); + + installedAppsState->mContextMenu->close(); + + } else { + QWARN("No item in Installed App View"); + } + + installedAppsState->stateExited(); + + window->removeView(builder.currentView()); + qApp->processEvents(); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::latestOldestOnTopMenuAction() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMainWindowMock mainWindow; + QScopedPointer machine(new QStateMachine(0)); + HsInstalledAppsState *installedAppsState = + new HsInstalledAppsState(builder, mainWindow, machine.data()); + + installedAppsState->stateEntered(); + + QVERIFY(installedAppsState->mModel); + + // model must have some items + delete installedAppsState->mModel; + installedAppsState->mModel = HsMenuService::getAllApplicationsModel(Hs::OldestOnTopHsSortAttribute); + + installedAppsState->setMenuOptions(); + + installedAppsState->latestOnTopMenuAction(); + + QCOMPARE(installedAppsState->mSortAttribute, + Hs::OldestOnTopHsSortAttribute); + + installedAppsState->oldestOnTopMenuAction(); + QCOMPARE(installedAppsState->mSortAttribute, + Hs::LatestOnTopHsSortAttribute); + + delete installedAppsState; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +QTEST_MAIN(MenuStatesTest) + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_installedappsstate/t_installedappsstate.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_installedappsstate/t_installedappsstate.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,24 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +#Header files +HEADERS += ./inc/*.h \ + ../inc/*.h \ + ../../inc/*.h + +#Source files +SOURCES += ./src/*.cpp \ + ../src/*.cpp \ + ../../src/*.cpp diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_installedappsstate/t_installedappsstate.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_installedappsstate/t_installedappsstate.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,77 @@ +# +# 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 = app +CONFIG += hb mobility +MOBILITY = serviceframework + +include(../../../../common.pri) +include(../../docml.pri) + +LIBS += -lhsdomainmodel +LIBS += -lhsutils +LIBS += -lhsmenuserviceprovider +LIBS += -lcaclient + +QT += testlib \ + xml \ + sql + +DEFINES += MENUSTATES_UNITTEST + +coverage:DEFINES += COVERAGE_MEASUREMENT + +DEPENDPATH += .\ + ./src \ + ./inc \ + ./../src \ + ./../inc \ + ../../src \ + ../../inc + +INCLUDEPATH += .\ + ./inc \ + ./../inc \ + ../../inc \ + ../../../hsmenuworkerstateplugin/inc \ + ../../../../serviceproviders/hsmenuserviceprovider/inc \ + ../../../../hsutils/inc \ + ../../../../hsdomainmodel/inc/ + +symbian { + for(docmlFile, docmlFiles): DOCML+=../../$$docmlFile + ### get rid of localization warnings + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + ### + TARGET.UID3 = 0x2002DCF4 + TARGET.CAPABILITY = CAP_APPLICATION AllFiles + TARGET.EPOCSTACKSIZE = 0x14000 // 80kB + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB + CONFIG += symbian_test + coverage: CONFIG -= symbian_test + exists($${EPOCROOT}epoc32/include/platform/mw/XQSettingsManager) { + LIBS += -lxqsettingsmanager + + MMP_RULES += SMPSAFE + } +} + +RESOURCES += ../../$$qrcFile + +include(t_installedappsstate.pri) + \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_menuviewbuilder/inc/t_menuviewbuilder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_menuviewbuilder/inc/t_menuviewbuilder.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,81 @@ +/* +* 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: Tests for hsapplibrarystateplugin. +* +*/ + +#ifndef T_MENUVIEWBUILDER_H +#define T_MENUVIEWBUILDER_H + +#include +#include + +class HbMainWindow; +class HbAbstractViewItem; +class QStateMachine; + +/** +* @test Test class for homescreen::hsutils modules. +*/ +class MenuStatesTest : public QObject +{ + Q_OBJECT + +private slots: + /* + * Tests + */ + void HsMenuViewBuilder_construction(); + void HsMenuViewBuilder_view(); + void HsMenuViewBuilder_listView(); + void HsMenuViewBuilder_label(); + void HsMenuViewBuilder_allAppsAction(); + void HsMenuViewBuilder_allCollectionsAction(); + void HsMenuViewBuilder_searchAction(); + void HsMenuViewBuilder_oviStoreAction(); + void HsMenuViewBuilder_operatorAction(); + void HsMenuViewBuilder_toolBar(); + void HsMenuViewBuilder_toolBarExtension(); + + //Menu view + void MenuView_toolBarExtension(); + void HsMenuView_scrolling(); + void MenuView_slots(); + void MenuView_reset(); + void MenuView_showHideSearchPanel(); + // HsListViewItem + void HsListViewItem_updateChildItems(); + void HsListViewItem_createItem(); + void HsListViewItem_polish(); + void HsProgressBar_timerEvent(); + void HsProgressBar_setTargetProgressValue(); + + void cleanup(); + + /** + * special slots for tests + */ + void testslot_activated(const QModelIndex &aIndex); + void testslot_longpressed(HbAbstractViewItem *item, + const QPointF &coords); +private: + + HbAbstractViewItem *mItem; + + QModelIndex mIndex; + QPointF mPoint; + + +}; +#endif // T_MENUVIEWBUILDER_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_menuviewbuilder/src/t_menuviewbuilder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_menuviewbuilder/src/t_menuviewbuilder.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,614 @@ +/* +* 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 test class for hsHomeScreenStatePlugin library. +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "caentry.h" +#include "caitemmodel.h" +#include "hsmenuview.h" +#include "hsmenuevent.h" +#include "hsmenuviewbuilder.h" +#include "hssearchviewbuilder.h" +#include "hsmenueventtransition.h" +#include "hsallcollectionsstate.h" +#include "hsapplibrarystate.h" +#include "hsallappsstate.h" +#include "hslistviewitem.h" + +#include "t_hsaddtohomescreenmockstate.h" +#include "t_hsmockmodel.h" +#include "t_menuviewbuilder.h" + + + +void MenuStatesTest::cleanup() +{ + qApp->processEvents(); +} + +class HsMainWindowMock : public HsMainWindow +{ + virtual void setCurrentView(HbView *view); + +}; + +void HsMainWindowMock::setCurrentView(HbView *view) +{ + Q_UNUSED(view); + // do nothing +} + +class HsMainWindowSpy: public HsMainWindow +{ +public: + virtual void setCurrentView(HbView *view) + { + mSwitchedToView = view; + } + + HbView *mSwitchedToView; + + HsMainWindowSpy(): mSwitchedToView(NULL) {}; +}; + +void MenuStatesTest::HsMenuViewBuilder_construction() +{ + const HsMenuViewBuilder builder; + QList expectedActionList; + expectedActionList << builder.allAppsAction(); + expectedActionList << builder.allCollectionsAction(); + expectedActionList << builder.searchAction(); + + QList actualActionList(builder.toolBar()->actions()); + + QCOMPARE(actualActionList, expectedActionList); + +} + +void MenuStatesTest::HsMenuViewBuilder_view() +{ + HsMenuViewBuilder builder; + const HbView *view = builder.currentView(); + + builder.setStateContext(HsAllAppsContext); + builder.setOperationalContext(HsItemViewContext); + + view = builder.currentView(); + + QVERIFY(view != NULL); + QCOMPARE(view->objectName(), QString("view")); + QString title = view->title(); + QCOMPARE(title, hbTrId("txt_applib_title_applications")); + + view = builder.currentView(); + + builder.setOperationalContext(HsEmptyLabelContext); + QVERIFY(view != NULL); + QCOMPARE(view->objectName(), QString("view")); + title = view->title(); + QCOMPARE(title, hbTrId("txt_applib_title_applications")); +} + +void MenuStatesTest::HsMenuViewBuilder_listView() +{ + HsMenuViewBuilder builder; + builder.setStateContext(HsAllAppsContext); + builder.setOperationalContext(HsItemViewContext); + + const HbAbstractItemView *const itemView = builder.currentListView(); + + QVERIFY(itemView); + QVERIFY(itemView->inherits("HbListView")); + QVERIFY(itemView->itemRecycling()); + const bool visible = itemView->property("visible").toBool(); + QVERIFY(visible); +} + +void MenuStatesTest::HsMenuViewBuilder_label() +{ + HsMenuViewBuilder builder; + + const HbGroupBox *const allAppsLabel = builder.currentViewLabel(); + + QVERIFY(allAppsLabel == NULL || !allAppsLabel->isVisible()); + + builder.setStateContext(HsInstalledAppsContext); + + const HbGroupBox *const collectionLabel = builder.currentViewLabel(); + + QVERIFY(collectionLabel != NULL); + QVERIFY(collectionLabel->isVisible()); + QCOMPARE(collectionLabel->fontSpec().role(), HbFontSpec::Title); + QCOMPARE(collectionLabel->marqueeHeading(), true); +} + +void MenuStatesTest::HsMenuViewBuilder_allAppsAction() +{ + const HsMenuViewBuilder builder; + const HbAction *const action = builder.allAppsAction(); + + QVERIFY(action != NULL); + QCOMPARE(action->icon().iconName(), + QString("qtg_mono_applications_all")); + +} + +void MenuStatesTest::HsMenuViewBuilder_allCollectionsAction() +{ + const HsMenuViewBuilder builder; + const HbAction *const action = builder.allCollectionsAction(); + + QVERIFY(action != NULL); + QCOMPARE(action->icon().iconName(), + QString("qtg_mono_applications_collections")); +} + +void MenuStatesTest::HsMenuViewBuilder_searchAction() +{ + const HsMenuViewBuilder builder; + const HbAction *const action = builder.searchAction(); + + QVERIFY(action != NULL); + QCOMPARE(action->icon().iconName(), + QString("qtg_mono_search")); +} + +void MenuStatesTest::HsMenuViewBuilder_oviStoreAction() +{ + const HsMenuViewBuilder builder; + const HbAction *const action = builder.oviStoreAction(); + + QVERIFY(action != NULL); + QCOMPARE(action->icon().iconName(), + QString("qtg_mono_ovistore")); +} + +void MenuStatesTest::HsMenuViewBuilder_operatorAction() +{ + const HsMenuViewBuilder builder; + const HbAction *const action = builder.operatorAction(); + + QVERIFY(action != NULL); + //we do not have operator icon name + //QCOMPARE(action->icon().iconName(), + // QString("qtg_mono_store")); +} + +void MenuStatesTest::HsMenuViewBuilder_toolBar() +{ + HsMenuViewBuilder builder; + HbToolBar *toolBar = builder.toolBar(); + + QVERIFY(toolBar != 0); + QCOMPARE(toolBar->orientation(), Qt::Horizontal); + + const QList actions = toolBar->actions(); + + QCOMPARE(actions.count(), 3); + QCOMPARE(actions.at(0), + static_cast(builder.allAppsAction())); + QCOMPARE(actions.at(1), + static_cast(builder.allCollectionsAction())); + QCOMPARE(actions.at(2), + static_cast(builder.searchAction())); + QCOMPARE(toolBar, builder.currentView()->toolBar()); +} + +void MenuStatesTest::HsMenuViewBuilder_toolBarExtension() +{ + HsMenuViewBuilder builder; + HbToolBarExtension *toolBarExtension = builder.toolBarExtension(); + + QVERIFY(toolBarExtension); +} + + + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::MenuView_slots() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMainWindowMock mainWindow; + HsMenuView menuView(builder, HsAllAppsContext, mainWindow); + + connect(&menuView, + SIGNAL(activated(QModelIndex)), + this, + SLOT(testslot_activated(QModelIndex))); + connect(&menuView, + SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), + this, + SLOT(testslot_longpressed(HbAbstractViewItem *, QPointF))); + + emit menuView.activated(QModelIndex()); + + QScopedPointer item(new HbListViewItem()); + + emit menuView.longPressed(item.data(), QPoint(50,50)); + + QCOMPARE(mIndex, QModelIndex()); + QVERIFY(item.data() == mItem); + QCOMPARE(mPoint.x(), double(50)); + QCOMPARE(mPoint.y(), double(50)); + + disconnect(&menuView, + SIGNAL(activated(QModelIndex)), + this, + SLOT(testslot_activated(QModelIndex))); + disconnect(&menuView, + SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), + this, + SLOT(testslot_longpressed(HbAbstractViewItem *, QPointF))); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsMenuView_scrolling() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QScopedPointer wind(new HbMainWindow); + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindow mainWindow; + + QScopedPointer parent(new QState); + + + HsAllAppsState *allAppsState = new HsAllAppsState(builder, + menuMode, mainWindow, parent.data()); + + wind->addView(builder.currentView()); + + + QVERIFY(allAppsState->mModel != 0); + const int rowCount = allAppsState->mModel->rowCount(); + QVERIFY(rowCount > 0); + + allAppsState->scrollToBeginning(); + allAppsState->stateEntered(); + qApp->processEvents(); + + const int expectedRow(0); + + QVERIFY(allAppsState->mMenuView->listView() != NULL); + QVERIFY(allAppsState->mMenuView->listView()->visibleItems().count() >= 1); + + int actualRow = + allAppsState->mMenuView->listView()->visibleItems().at(0)->modelIndex().row(); + + QCOMPARE(actualRow, expectedRow); + + allAppsState->mMenuView->scrollToRow(rowCount -1); + + actualRow = + allAppsState->mMenuView->listView()->visibleItems().at(0)->modelIndex().row(); + + QVERIFY(actualRow != expectedRow); + qApp->processEvents(); + + allAppsState->mMenuView->scrollToRow(expectedRow); + + actualRow = + allAppsState->mMenuView->listView()->visibleItems().at(0)->modelIndex().row(); + + QCOMPARE(actualRow, expectedRow); + qApp->processEvents(); + + allAppsState->stateExited(); + + qApp->processEvents(); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::MenuView_toolBarExtension() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder menuViewBuilder; + HbToolBarExtension *toolBarExtension = menuViewBuilder.toolBarExtension(); + QVERIFY(toolBarExtension != NULL); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::MenuView_reset() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMainWindowMock mainWindow; + HsMenuView menuView(builder, HsCollectionContext, mainWindow); + + QVERIFY(menuView.viewLabel() != 0); + + const QString headingLabel("abcd"); + + QScopedPointer backSteppingAction(new HbAction(Hb::BackNaviAction)); + backSteppingAction->setObjectName("backSteppingAction"); + + menuView.viewLabel()->setHeading(headingLabel); + menuView.view()->setNavigationAction(backSteppingAction.data()); + + menuView.reset(HsEmptyLabelContext); + + QCOMPARE(menuView.mBuilder.mStateContext, HsCollectionContext); + QCOMPARE(menuView.mBuilder.mOperationalContext, HsEmptyLabelContext); + + QCOMPARE(menuView.view()->navigationAction()->objectName(), + backSteppingAction->objectName()); + + QVERIFY(menuView.viewLabel()); + QCOMPARE(menuView.viewLabel()->heading(), headingLabel); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::testslot_activated(const QModelIndex &aIndex) +{ + mIndex = aIndex; +} +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::testslot_longpressed(HbAbstractViewItem *item, + const QPointF &coords) +{ + mPoint = coords; + mItem = item; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsListViewItem_updateChildItems() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuViewBuilder builder; + HsMenuModeWrapper menuMode; + HsMainWindowMock mainWindow; + QScopedPointer allAppsState(new HsAllAppsState( + builder, menuMode, mainWindow, 0)); + + HsMenuItemModel *model = allAppsState->mModel; + + QVERIFY(model != static_cast(0)); + QVERIFY(model->rowCount() > 0); + QModelIndex itemModelIndex = model->index(0, 0); + + QScopedPointer listViewItem(new HsListViewItem); + + listViewItem->setModelIndex(itemModelIndex); + + + QCOMPARE((int)listViewItem->progress,0); + QCOMPARE(listViewItem->isProgress,false); + listViewItem->updateChildItems(); + QCOMPARE((int)listViewItem->progress,0); + QCOMPARE(listViewItem->isProgress,false); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsListViewItem_createItem() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QScopedPointer listViewItem(new HsListViewItem); + + QCOMPARE((HbAbstractViewItem*)listViewItem.data() ,listViewItem->prototype() ); + QScopedPointer newItem( listViewItem->createItem() ); + + QCOMPARE(newItem->prototype(), (HbAbstractViewItem*)listViewItem.data() ); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsListViewItem_polish() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QScopedPointer listViewItem(new HsListViewItem); + HbStyleParameters styleParam; + + bool expectedVal = false; + listViewItem->isProgress = expectedVal; + listViewItem->polish(styleParam); + QVariant property = listViewItem->property("progress"); + bool val = property.value(); + + QCOMPARE(val, expectedVal); + + expectedVal = true; + listViewItem->isProgress = expectedVal; + listViewItem->polish(styleParam); + property = listViewItem->property("progress"); + val = property.value(); + + QCOMPARE(val, expectedVal); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsProgressBar_timerEvent() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsProgressBar bar; + QTimerEvent event(0); + bar.timerEvent(&event); + QCOMPARE(bar.mTimerId, 0); + int val = bar.progressValue(); + bar.mTargetValue = 1; + bar.timerEvent(&event); + QCOMPARE(bar.progressValue(), val + 1); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsProgressBar_setTargetProgressValue() +{ +#ifdef Q_OS_SYMBIAN + User::ResetInactivityTime();//it should help for Viewserver11 panic +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsProgressBar bar; + bar.setTargetProgressValue(0); + QCOMPARE(bar.mTargetValue, 0); + bar.setTargetProgressValue(1); + QCOMPARE(bar.mTargetValue, 1); + QVERIFY(bar.mTimerId); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +void MenuStatesTest::MenuView_showHideSearchPanel() +{ + HsMenuViewBuilder builder; + HsMainWindowSpy window; + HsMenuView menuView(builder, HsAllAppsContext, window); + + menuView.showSearchPanel(); + HbView *originatingView = menuView.view(); + QVERIFY(window.mSwitchedToView != originatingView); + menuView.hideSearchPanel(); + QVERIFY(window.mSwitchedToView == originatingView); + +} + + +QTEST_MAIN(MenuStatesTest) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_menuviewbuilder/t_menuviewbuilder.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_menuviewbuilder/t_menuviewbuilder.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,24 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +#Header files +HEADERS += ./inc/*.h \ + ../inc/*.h \ + ../../inc/*.h + +#Source files +SOURCES += ./src/*.cpp \ + ../src/*.cpp \ + ../../src/*.cpp diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_menuviewbuilder/t_menuviewbuilder.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_menuviewbuilder/t_menuviewbuilder.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,77 @@ +# +# 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 = app +CONFIG += hb mobility +MOBILITY = serviceframework + +include(../../../../common.pri) +include(../../docml.pri) + +LIBS += -lhsdomainmodel +LIBS += -lhsutils +LIBS += -lhsmenuserviceprovider +LIBS += -lcaclient + +QT += testlib \ + xml \ + sql + +DEFINES += MENUSTATES_UNITTEST + +coverage:DEFINES += COVERAGE_MEASUREMENT + +DEPENDPATH += .\ + ./src \ + ./inc \ + ./../inc \ + ../../src \ + ../../inc \ + ../../resource + +INCLUDEPATH += .\ + ./inc \ + ./../inc \ + ../../inc \ + ../../../hsmenuworkerstateplugin/inc \ + ../../../../serviceproviders/hsmenuserviceprovider/inc \ + ../../../../hsutils/inc \ + ../../../../hsdomainmodel/inc/ + +symbian { + for(docmlFile, docmlFiles): DOCML+=../../$$docmlFile + ### get rid of localization warnings + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + ### + TARGET.UID3 = 0x2002DCEF + TARGET.CAPABILITY = CAP_APPLICATION AllFiles + TARGET.EPOCSTACKSIZE = 0x14000 // 80kB + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB + CONFIG += symbian_test + coverage: CONFIG -= symbian_test + exists($${EPOCROOT}epoc32/include/platform/mw/XQSettingsManager) { + LIBS += -lxqsettingsmanager + + MMP_RULES += SMPSAFE + } +} + +RESOURCES += ../../$$qrcFile + +include(t_menuviewbuilder.pri) + \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_searchviewbuilder/inc/t_searchviewbuilder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_searchviewbuilder/inc/t_searchviewbuilder.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,60 @@ +/* +* 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: Tests for hsapplibrarystateplugin. +* +*/ + +#ifndef T_MENUVIEWBUILDER_H +#define T_MENUVIEWBUILDER_H + +#include +#include + +class HbMainWindow; +class HbAbstractViewItem; +class QStateMachine; + +/** +* @test Test class for homescreen::hsutils modules. +*/ +class MenuStatesTest : public QObject +{ + Q_OBJECT + +private slots: + /* + * Tests + */ + void HsSearchViewBuilder_construction(); + void HsSearchViewBuilder_uiObjects(); + void HsSearchViewBuilder_setSearchLabledContext(); + void HsSearchViewBuilder_loadViewEmptySection(); + void HsSearchViewBuilder_loadViewListSection(); + + void HsSearchViewBuilder_searchViewConstruction(); + void HsSearchViewBuilder_activatedProxySlot(); + void HsSearchViewBuilder_longPressedProxySlot(); + void HsSearchViewBuilder_showHide(); + void HsSearchViewBuilder_hideVkb(); + + + void cleanup(); + + void testSlot(); + +private: + bool mSlotActivated; + +}; +#endif // T_MENUVIEWBUILDER_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_searchviewbuilder/src/t_searchviewbuilder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_searchviewbuilder/src/t_searchviewbuilder.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,187 @@ +/* +* 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 test class for hsHomeScreenStatePlugin library. +* +*/ + +#include "t_searchviewbuilder.h" +#include +#include +#include +#include "hssearchviewbuilder.h" +#include "hsmenuviewbuilder.h" +#include "hsmainwindow.h" +#include "hssearchview.h" +#include "caitemmodel.h" + +class HsMainWindowMock : public HsMainWindow +{ + virtual void setCurrentView(HbView *view) { Q_UNUSED(view); } +}; + +class MockViewItem : public HbAbstractViewItem +{ + virtual HbAbstractViewItem *createItem() + { + HbAbstractViewItem *item = new MockViewItem; + return item; + } +}; + +void MenuStatesTest::testSlot() +{ + mSlotActivated = true; +} + + +void MenuStatesTest::cleanup() +{ + qApp->processEvents(); +} + +void MenuStatesTest::HsSearchViewBuilder_construction() +{ + HsSearchViewBuilder builder; + QVERIFY(builder.mLoadedObjects.count()); +} + +void MenuStatesTest::HsSearchViewBuilder_uiObjects() +{ + HsSearchViewBuilder builder; + QVERIFY(builder.searchListView()); + QVERIFY(builder.searchPanel()); + QVERIFY(builder.searchView()); + QVERIFY(builder.searchViewLabel()); +} + +void MenuStatesTest::HsSearchViewBuilder_setSearchLabledContext() +{ + HsSearchViewBuilder builder; + builder.setSearchLabledContext(); + QVERIFY(builder.mLabledContext); +} + +void MenuStatesTest::HsSearchViewBuilder_loadViewEmptySection() +{ + HsSearchViewBuilder builder; + int firstCount = builder.mLoadedObjects.count(); + builder.loadViewEmptySection(); + QCOMPARE(firstCount, builder.mLoadedObjects.count()); +} + +void MenuStatesTest::HsSearchViewBuilder_loadViewListSection() +{ + HsSearchViewBuilder builder; + int firstCount = builder.mLoadedObjects.count(); + builder.loadViewListSection(); + QCOMPARE(firstCount, builder.mLoadedObjects.count()); +} + +void MenuStatesTest::HsSearchViewBuilder_searchViewConstruction() +{ + HsMenuViewBuilder builder; + HsMainWindowMock window; + + HsSearchView search(builder, HsAllAppsContext, window); + + QCOMPARE(search.mProxyModel->filterRole(), int(CaItemModel::TextRole)); + QCOMPARE(search.mProxyModel->filterKeyColumn(), 0); + QCOMPARE(search.mProxyModel->sortRole(), int(CaItemModel::TextRole)); +} + +void MenuStatesTest::HsSearchViewBuilder_activatedProxySlot() +{ + HsMenuViewBuilder builder; + HsMainWindowMock window; + + HsSearchView search(builder, HsAllAppsContext, window); + connect(&search, SIGNAL(activated(QModelIndex)), + this, SLOT(testSlot())); + QModelIndex idx; + + mSlotActivated = false; + search.activatedProxySlot(idx); + QCOMPARE(mSlotActivated, true); +} + +void MenuStatesTest::HsSearchViewBuilder_longPressedProxySlot() +{ + HsMenuViewBuilder builder; + HsMainWindowMock window; + + HsSearchView search(builder, HsAllAppsContext, window); + connect(&search, SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), + this, SLOT(testSlot())); + + MockViewItem item; + QPointF point; + + mSlotActivated = false; + search.longPressedProxySlot(&item, point); + QCOMPARE(mSlotActivated, true); +} + +void MenuStatesTest::HsSearchViewBuilder_showHide() +{ + HsMenuViewBuilder builder; + HsMainWindowMock window; + + HsSearchView search(builder, HsAllAppsContext, window); + + search.setSearchPanelVisible(true); + QVERIFY(search.mSearchListView); + search.hideSearchPanel(); + QVERIFY(!search.mSearchListView); + +} + + +class MockInputContext: public QInputContext +{ +public: + QEvent::Type mEventType; + MockInputContext(): mEventType(QEvent::None) {} + QString identifierName() { return qApp->inputContext()->identifierName();} + bool isComposing() const { return qApp->inputContext()->isComposing();} + QString language() { return qApp->inputContext()->language();} + void reset() {;} + void setFocusWidget(QWidget* widget) {QInputContext::setFocusWidget(widget);} + bool filterEvent(const QEvent* event) + { + mEventType = event->type(); + return true; + } +}; + +void MenuStatesTest::HsSearchViewBuilder_hideVkb() +{ + HsMenuViewBuilder builder; + HsMainWindowMock window; + + HsSearchView search(builder, HsAllAppsContext, window); + + MockInputContext *const newInputContext(new MockInputContext()); + + qApp->setInputContext(newInputContext); + + search.hideVkb(); + + QEvent::Type actualEventType = newInputContext->mEventType; + qApp->setInputContext(0); + + QCOMPARE(actualEventType, QEvent::CloseSoftwareInputPanel); +} + + +QTEST_MAIN(MenuStatesTest) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_searchviewbuilder/t_searchviewbuilder.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_searchviewbuilder/t_searchviewbuilder.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,24 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +#Header files +HEADERS += ./inc/*.h \ + ../inc/*.h \ + ../../inc/*.h + +#Source files +SOURCES += ./src/*.cpp \ + ../src/*.cpp \ + ../../src/*.cpp diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_searchviewbuilder/t_searchviewbuilder.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/t_searchviewbuilder/t_searchviewbuilder.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,77 @@ +# +# 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 = app +CONFIG += hb mobility +MOBILITY = serviceframework + +include(../../../../common.pri) +include(../../docml.pri) + +LIBS += -lhsdomainmodel +LIBS += -lhsutils +LIBS += -lhsmenuserviceprovider +LIBS += -lcaclient + +QT += testlib \ + xml \ + sql + +DEFINES += MENUSTATES_UNITTEST + +coverage:DEFINES += COVERAGE_MEASUREMENT + +DEPENDPATH += .\ + ./src \ + ./inc \ + ./../inc \ + ../../src \ + ../../inc \ + ../../resource + +INCLUDEPATH += .\ + ./inc \ + ./../inc \ + ../../inc \ + ../../../hsmenuworkerstateplugin/inc \ + ../../../../serviceproviders/hsmenuserviceprovider/inc \ + ../../../../hsutils/inc \ + ../../../../hsdomainmodel/inc/ + +symbian { + for(docmlFile, docmlFiles): DOCML+=../../$$docmlFile + ### get rid of localization warnings + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + ### + TARGET.UID3 = 0x2002DCF9 + TARGET.CAPABILITY = CAP_APPLICATION AllFiles + TARGET.EPOCSTACKSIZE = 0x14000 // 80kB + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB + CONFIG += symbian_test + coverage: CONFIG -= symbian_test + exists($${EPOCROOT}epoc32/include/platform/mw/XQSettingsManager) { + LIBS += -lxqsettingsmanager + + MMP_RULES += SMPSAFE + } +} + +RESOURCES += ../../$$qrcFile + +include(t_searchviewbuilder.pri) + \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/tsrc.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,27 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs +SUBDIRS += t_allappsstate \ + t_collectionsstate \ + t_allcollectionsstate \ + t_applibrarystate \ + t_installedappsstate \ + t_menuviewbuilder \ + t_searchviewbuilder + +CONFIG += ordered + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/hshomescreenstateplugin.pro --- a/homescreenapp/stateplugins/hshomescreenstateplugin/hshomescreenstateplugin.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/hshomescreenstateplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -43,6 +43,7 @@ symbian: { TARGET.UID3 = 0x20022F41 LIBS += -lxqsettingsmanager + MMP_RULES += SMPSAFE } include(hshomescreenstateplugin.pri) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlestate.h --- a/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlestate.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlestate.h Mon Sep 20 10:19:07 2010 +0300 @@ -66,6 +66,7 @@ void event_preRemovePage(); void event_removePage(); void event_toggleConnection(); + void event_MoveWidgetDelete(); protected: bool eventFilter(QObject *watched, QEvent *event); @@ -111,7 +112,9 @@ void action_moveWidget_connectOrientationChangeEventHandler(); void action_moveWidget_setWidgetSnap(); void action_moveWidget_reparentToPage(); + void action_moveWidgetDelete_deleteWidgetOnTrashbin(); void action_moveWidget_startWidgetDropEffect(); + void action_moveWidget_disableInteractive(); void action_moveWidget_disconnectGestureHandlers(); void action_moveWidget_disconnectOrientationChangeEventHandler(); void action_moveWidget_preventZoneAnimation(); @@ -150,6 +153,7 @@ private: bool isEditor(const QPointF &point, HsWidgetHost *widget); + void stopPageChangeAnimations(); private: HbAction *mNavigationAction; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/inc/hswallpaperselectionstate.h --- a/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hswallpaperselectionstate.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hswallpaperselectionstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -27,7 +27,7 @@ class HsSpinnerDialog; #ifdef Q_OS_SYMBIAN -class HsImageFetcherClient; +class HsImageHandlingClient; #else class XQAIWGetImageClient; #endif @@ -51,7 +51,8 @@ private slots: void action_selectingImage_start(); - void action_selectingImage_cleanup(); + void action_imageHandler_cleanup(); + void action_editingImage_start(); void action_assigningImage_showWaitDialog(); void action_assigningImage_start(); void action_assigningImage_cleanup(); @@ -62,12 +63,12 @@ void onFetchFailed(int errorCode, const QString &errorMessage); void onImageSet(); void onImageSetFailed(); - + void onEditorCompleted(); private: #ifdef Q_OS_SYMBIAN - HsImageFetcherClient *mImageFetcher; + HsImageHandlingClient *mImageHandler; #else - XQAIWGetImageClient *mImageFetcher; + XQAIWGetImageClient *mImageHandler; #endif QString mImagePath; HsWallpaper *mWallpaper; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp --- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -228,7 +228,12 @@ QState *state_waitInput = new QState(this); setInitialState(state_waitInput); + QState *state_moveWidget = new QState(this); + QState *state_moveWidgetMoving = new QState(state_moveWidget); + QState *state_moveWidgetDelete = new QState(state_moveWidget); + state_moveWidget->setInitialState(state_moveWidgetMoving); + QState *state_moveScene = new QState(this); HsWallpaperSelectionState *state_wallpaperSelectionState = new HsWallpaperSelectionState(this); @@ -252,7 +257,11 @@ state_waitInput->addTransition( this, SIGNAL(event_moveWidget()), state_moveWidget); - state_moveWidget->addTransition( + state_moveWidgetMoving->addTransition( + this, SIGNAL(event_waitInput()), state_waitInput); + state_moveWidgetMoving->addTransition( + this, SIGNAL(event_MoveWidgetDelete()), state_moveWidgetDelete); + state_moveWidgetDelete->addTransition( this, SIGNAL(event_waitInput()), state_waitInput); state_moveScene->addTransition( @@ -298,14 +307,16 @@ ENTRY_ACTION(state_moveWidget, action_moveWidget_connectGestureHandlers) ENTRY_ACTION(state_moveWidget, action_moveWidget_connectOrientationChangeEventHandler) ENTRY_ACTION(state_moveWidget, action_moveWidget_setWidgetSnap) - EXIT_ACTION(state_moveWidget, action_moveWidget_reparentToPage) EXIT_ACTION(state_moveWidget, action_moveWidget_startWidgetDropEffect) + EXIT_ACTION(state_moveWidget, action_moveWidget_disableInteractive) EXIT_ACTION(state_moveWidget, action_moveWidget_disconnectGestureHandlers) EXIT_ACTION(state_moveWidget, action_moveWidget_disconnectOrientationChangeEventHandler) EXIT_ACTION(state_moveWidget, action_moveWidget_preventZoneAnimation) EXIT_ACTION(state_moveWidget, action_moveWidget_deleteWidgetSnap) + ENTRY_ACTION(state_moveWidgetDelete, action_moveWidgetDelete_deleteWidgetOnTrashbin) + ENTRY_ACTION(state_moveScene, action_moveScene_connectGestureHandlers) EXIT_ACTION(state_moveScene, action_moveScene_moveToNearestPage) EXIT_ACTION(state_moveScene, action_moveScene_disconnectGestureHandlers) @@ -335,7 +346,9 @@ */ void HsIdleState::startPageChangeAnimation(int targetPageIndex, int duration) { - hbInstance->allMainWindows().first()->setInteractive(false); + if (!HsScene::instance()->activeWidget()) { + hbInstance->allMainWindows().first()->setInteractive(false); + } HsPropertyAnimationWrapper *animation = HsGui::instance()->pageChangeAnimation(); if (animation->isRunning()) { animation->stop(); @@ -615,7 +628,6 @@ void HsIdleState::onWidgetTapStarted(QPointF point, HsWidgetHost *widget) { HsScene *scene = HsScene::instance(); - scene->setActiveWidget(widget); HsPage *page = scene->activePage(); QMetaObject::invokeMethod(page, "updateZValues", Qt::QueuedConnection); HbVkbHost::HbVkbStatus status = HbVkbHostBridge::instance()->keypadStatus(); @@ -712,7 +724,7 @@ { Q_UNUSED(scenePos) Q_UNUSED(widget) - emit event_waitInput(); + emit event_MoveWidgetDelete(); } /*! @@ -765,6 +777,7 @@ void HsIdleState::action_idle_orientationChanged() { HsScene::instance()->activePage()->resetNewWidgets(); + stopPageChangeAnimations(); action_idle_showActivePage(); } @@ -1041,7 +1054,6 @@ HsGui::instance()->pageCrawlingAnimation(); if (pageCrawlingAnimation->isRunning()&& pageCrawlingAnimation->isForward()) { - pageCrawlingAnimation->setDuration(HSCONFIGURATION_GET(pageChangeZoneReverseAnimationDuration)); pageCrawlingAnimation->setBackward(); } @@ -1049,13 +1061,8 @@ HsScene *scene = HsScene::instance(); HsPage *page = scene->activePage(); HsWidgetHost *widget = scene->activeWidget(); - - if (HsGui::instance()->idleWidget()->trashBin()->isUnderMouse()) { - HbInstantFeedback::play(HSCONFIGURATION_GET(widgetDropToTrashbinFeedbackEffect)); - widget->page()->removeWidget(widget); - widget->remove(); - scene->setActiveWidget(0); - } else { + + if (widget) { if (widget->page() != page) { widget->page()->removeWidget(widget); page->addExistingWidget(widget); @@ -1080,11 +1087,30 @@ widget->savePresentation(); page->updateZValues(); + + widget->visual()->setParentItem(HsScene::instance()->activePage()->visual()); } + HsGui::instance()->idleWidget()->showPageIndicator(); + + emit event_waitInput(); +} + - widget->visual()->setParentItem(HsScene::instance()->activePage()->visual()); +/*! + Reparents the active widget to the active page. +*/ +void HsIdleState::action_moveWidgetDelete_deleteWidgetOnTrashbin() +{ + HsScene *scene = HsScene::instance(); + HsWidgetHost *widget = scene->activeWidget(); - HsGui::instance()->idleWidget()->showPageIndicator(); + if ( widget && HsGui::instance()->idleWidget()->trashBin()->isUnderMouse() ) { + HbInstantFeedback::play(HSCONFIGURATION_GET(widgetDropToTrashbinFeedbackEffect)); + widget->page()->removeWidget(widget); + widget->remove(); + scene->setActiveWidget(0); + } + emit event_waitInput(); } /*! @@ -1099,6 +1125,21 @@ } /*! + Set interactive to false. +*/ +void HsIdleState::action_moveWidget_disableInteractive() +{ + HsWidgetHost *widget = HsScene::instance()->activeWidget(); + if (widget) { + HsPropertyAnimationWrapper *animation = HsGui::instance()->pageChangeAnimation(); + if (animation->isRunning()) { + hbInstance->allMainWindows().first()->setInteractive(false); + } + HsScene::instance()->setActiveWidget(0); + } +} + +/*! Disconnects gesture handlers */ void HsIdleState::action_moveWidget_disconnectGestureHandlers() @@ -1512,3 +1553,24 @@ } return isWidgetEditor; } + +/*! + Stops page change and page crawling animations. +*/ +void HsIdleState::stopPageChangeAnimations() +{ + HsPropertyAnimationWrapper *animation = HsGui::instance()->pageChangeAnimation(); + if (animation->isRunning()) { + animation->stop(); + hbInstance->allMainWindows().first()->setInteractive(true); + } + animation->disconnect(this); + + HsPropertyAnimationWrapper *pageCrawlingAnimation = + HsGui::instance()->pageCrawlingAnimation(); + + if (pageCrawlingAnimation->isRunning()) { + pageCrawlingAnimation->stop(); + } +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/src/hswallpaperselectionstate.cpp --- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hswallpaperselectionstate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/src/hswallpaperselectionstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -23,7 +23,7 @@ #include "hsconfiguration.h" #ifdef Q_OS_SYMBIAN -#include "hsimagefetcherclient.h" +#include "hsimagehandlingclient.h" #else #include "xqaiwgetimageclient.h" #endif @@ -45,7 +45,7 @@ */ HsWallpaperSelectionState::HsWallpaperSelectionState(QState *parent) : QState(parent), - mImageFetcher(0), + mImageHandler(0), mWallpaper(0), mWaitDialog(0) { @@ -69,6 +69,7 @@ QState *state_processing = new QState(this); QState *state_selectingImage = new QState(state_processing); + QState *state_editingImage = new QState(state_processing); QState *state_assigningImage = new QState(state_processing); QState *state_errorMessage = new QState(this); @@ -76,9 +77,13 @@ state_processing->setInitialState(state_selectingImage); // Transitions - +#if defined (Q_OS_SYMBIAN) && !defined (__WINSCW__) + state_selectingImage->addTransition( + this, SIGNAL(event_assignImage()), state_editingImage); +#else state_selectingImage->addTransition( this, SIGNAL(event_assignImage()), state_assigningImage); +#endif // Q_OS_SYMBIAN state_processing->addTransition( this, SIGNAL(event_error()), state_errorMessage); @@ -86,7 +91,10 @@ // Actions ENTRY_ACTION(state_selectingImage, action_selectingImage_start) - EXIT_ACTION(state_selectingImage, action_selectingImage_cleanup) + EXIT_ACTION(state_selectingImage, action_imageHandler_cleanup) + + ENTRY_ACTION(state_editingImage, action_editingImage_start) + EXIT_ACTION(state_editingImage, action_imageHandler_cleanup) ENTRY_ACTION(state_assigningImage, action_assigningImage_showWaitDialog) ENTRY_ACTION(state_assigningImage, action_assigningImage_start) @@ -102,27 +110,27 @@ void HsWallpaperSelectionState::action_selectingImage_start() { #ifdef Q_OS_SYMBIAN - mImageFetcher = new HsImageFetcherClient; + mImageHandler = new HsImageHandlingClient; #else - mImageFetcher = new XQAIWGetImageClient; + mImageHandler = new XQAIWGetImageClient; #endif - connect(mImageFetcher, SIGNAL(fetchCompleted(const QString&)), + connect(mImageHandler, SIGNAL(fetchCompleted(const QString&)), this, SLOT(onFetchCompleted(const QString&))); - connect(mImageFetcher, SIGNAL(fetchFailed(int, const QString&)), + connect(mImageHandler, SIGNAL(fetchFailed(int, const QString&)), this, SLOT(onFetchFailed(int, const QString&))); - mImageFetcher->fetch(); + mImageHandler->fetch(); } /*! */ -void HsWallpaperSelectionState::action_selectingImage_cleanup() +void HsWallpaperSelectionState::action_imageHandler_cleanup() { - mImageFetcher->disconnect(this); - mImageFetcher->deleteLater(); - mImageFetcher = 0; + mImageHandler->disconnect(this); + mImageHandler->deleteLater(); + mImageHandler = 0; } /*! @@ -180,6 +188,29 @@ emit event_waitInput(); } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT +/*! + +*/ +void HsWallpaperSelectionState::action_editingImage_start() +{ +#ifdef Q_OS_SYMBIAN + mImageHandler = new HsImageHandlingClient; + + connect(mImageHandler, SIGNAL(editorCompleted()), + this, SLOT(onEditorCompleted())); + connect(mImageHandler, SIGNAL(editorFailed(int, const QString&)), + this, SLOT(onFetchFailed(int, const QString&))); + + mImageHandler->edit(mImagePath); +#endif //Q_OS_SYMBIAN +} +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT + /*! */ @@ -214,3 +245,17 @@ { emit event_error(); } + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT +/*! + +*/ +void HsWallpaperSelectionState::onEditorCompleted() +{ + emit event_waitInput(); +} +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/foundicon.png Binary file homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/foundicon.png has changed diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/inc/t_hshomescreenstateplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/inc/t_hshomescreenstateplugin.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Tests for HsHomeScreenStatePlugin class. +* +*/ + +#include +#include +#include "hshomescreenstateplugin.h" +#include "hsidlestate.h" +#include "hsloadscenestate.h" +#include "hscontentservice.h" +#include "hspage.h" +#include "hswidgethost.h" + +/** +* @test Test class for homescreen::hsutils modules. +*/ +class HomeScreenStatePluginTest : public QObject +{ + Q_OBJECT + +signals: + void finishStateMachine(); + +private slots: + + /** + * initialize + */ + void initTestCase(); + void cleanup(); + void init(); + void cleanupTestCase(); + + /** + * hswallpaperselectionstate.cpp + */ + void testWallpaperSelectionStateConstruction(); + void testWallpaperSelectionStateImageSelection(); + void testWallpaperSelectionStateImageAssignment(); + void testWallpaperSelectionStateSimpleMethods(); + + /** + * hsloadscenestate.cpp + */ + void testLoadSceneStateConstructors(); + void testLoadSceneStateOnEntryExit(); +#ifdef Q_OS_SYMBIAN + void testLoadSceneStateHandleKeyChange(); +#endif + /** + * hsrootstate.cpp + */ + void testLoadRootStateConstructors(); + void testLoadRootStateOnEntryExit(); + + /** + * t_hsbackuprestorestate.cpp + */ + void testLoadBackupRestoreStateConstructors(); + void testLoadBackupRestoreStateOnEntryExit(); + + /** + * hsidlestate.cpp + */ + void testIdleStateConstruction(); + void testIdleStateEntryAndExit(); + void testIdleStatePageLayerPos(); + void testIdleStatePageChangeAnimation(); + void testIdleStatePageChangeZones(); + void testIdleStateAddPage(); + void testIdleStateRemoveActivePage(); + void testIdleStateRemovePage(); + void testIdleStateToggleConnection(); + void testIdleStateTapPage(); + void testIdleStatePanPage(); + void testIdleStateTapWidget(); + void testIdleStateDragWidget(); + void testIdleStateDeleteWidget(); + void testIdleStateMisc(); + void testIdleStateChromeBehaviour(); + void testEventFilter(); + void testIdleStateSnapToObject(); + void testIdleStateSnapToObjectSnapEffectDisabled(); + void testIdleStateSnapToObjectSnappingDisabled(); + void testOnVerticalSnapLineTimerTimeout(); + void testOnHorizontalSnapLineTimerTimeout(); + void testShowHorizontalLine(); + void testEditorAndVKB(); + + + +private: + void createSceneAndWindow(int pageCount, int defaultPageIndex = 0, int maximumPageCount = 8); + void deleteSceneAndWindow(); + +private: + HbMainWindow *mMainWindow; + int mImageProcessingDelay; +}; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/inc/testwidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/inc/testwidget.h Mon Sep 20 10:19: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 HOMESCREEN_TEST_TESTWIDGET_H +#define HOMESCREEN_TEST_TESTWIDGET_H + +#include + +class TestWidget : public HbWidget +{ + Q_OBJECT + +public: + TestWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0); + ~TestWidget(); + +signals: + void finished(); + +public slots: + void onInitialize(); + void onShow(); + void onHide(); + +public: + QRectF boundingRect() const; + QPainterPath shape() const; + void setSucceeded() { emit finished(); } + +protected: + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + +private: + friend class HomeScreenStatePluginTest; +}; + +#endif diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/installs_win32.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,32 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +testfiles.path = ../../../../../../bin/hstests/ +testfiles.files = ./debug/t_hshomescreenstateplugin.exe + +testresources.path = ../../../../../../bin/hstests/hsresources/ +testresources.files = ../../resource/controllayer.docml + +docmltestresources_local.path = ./hsresources/ +docmltestresources_local.files = ../../resource/controllayer.docml + +dtestresources_local.path = ./debug/hsresources/ +dtestresources_local.files = ../../../../hsdomainmodel/resource/controllayer.docml + +image.path = ./debug +image.files = ./foundicon.png + +INSTALLS += testfiles testresources docmltestresources_local dtestresources_local image diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/sis/t_hshomescreenstateplugin.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/sis/t_hshomescreenstateplugin.pkg Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,35 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; + +; Language +&EN + +; SIS header: name, uid, version +#{"t_hshomescreenstateplugin"},(0x20022F60),1,0,0 + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Supports S60 5th Edition +[0x1028315F], 0, 0, 0, {"S60ProductID"} + +; HS Framework Core unittest +"/epoc32/release/armv5/urel/t_hshomescreenstateplugin.exe" - "c:/sys/bin/t_hshomescreenstateplugin.exe" +"/epoc32/data/z/private/10003a3f/import/apps/t_hshomescreenstateplugin_reg.rsc" - "c:/private/10003a3f/import/apps/t_hshomescreenstateplugin_reg.rsc" +"/epoc32/data/z/resource/apps/t_hshomescreenstateplugin.rsc" - "c:/resource/apps/t_hshomescreenstateplugin.rsc" diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/sis/t_hshomescreenstateplugin_sisx.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/sis/t_hshomescreenstateplugin_sisx.bat Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,30 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem +@echo off + +if exist t_hshomescreenstateplugin.sisx del t_hshomescreenstateplugin.sisx + +makesis t_hshomescreenstateplugin.pkg +signsis t_hshomescreenstateplugin.sis t_hshomescreenstateplugin.sisx ../../../../../internal/sis/rd.cer ../../../../../internal/sis/rd-key.pem + +if exist t_hshomescreenstateplugin.sisx ( +echo t_hshomescreenstateplugin.sisx creation SUCCEEDED +del t_hshomescreenstateplugin.sis +) + +if not exist t_hshomescreenstateplugin.sisx ( +echo t_hshomescreenstateplugin.sisx creation FAILED +) \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hsbackuprestoreobserver_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hsbackuprestoreobserver_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,90 @@ +/* +* 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: Home screen Backup/Restore observer. +* +*/ + + +#include "hsdatabase.h" +#include "hsbackuprestoreobserver.h" + + +/*! + Singleton. +*/ +HsBackupRestoreObserver *HsBackupRestoreObserver::instance() +{ + if (!mInstance) { + mInstance = new HsBackupRestoreObserver(); + } + return mInstance; +} + +/*! + Constructs a new observer with the given \a parent object. +*/ +HsBackupRestoreObserver::HsBackupRestoreObserver(QObject *parent) + : QObject(parent), + mBUROngoing(false) +{ +} + +/*! + Destructor. +*/ +HsBackupRestoreObserver::~HsBackupRestoreObserver() +{ +} + +/*! + Called when backup/restore is started. +*/ +void HsBackupRestoreObserver::backupRestoreStarted() +{ + mBUROngoing = true; + emit event_backupRestoreStarted(); +} + +/*! + Called when backup/restore is completed. +*/ +void HsBackupRestoreObserver::backupRestoreCompleted() +{ + mBUROngoing = false; + emit event_backupRestoreCompleted(); +} + +/*! + Called when Home screen is ready for backup/restore. +*/ +void HsBackupRestoreObserver::readyForBUR() +{ +} + +/*! + Returns true if bacup/restore is ongoing. +*/ +bool HsBackupRestoreObserver::checkBUR() +{ + if (mBUROngoing) { + return true; + } + return false; +} +/*! + Points to the observer instance. +*/ +HsBackupRestoreObserver *HsBackupRestoreObserver::mInstance(0); + +// End of File diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hsdatabase_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hsdatabase_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,228 @@ +/* +* 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 "hsdatabase.h" +#include "hsdomainmodeldatastructures.h" + +HsDatabase::HsDatabase(QObject *parent) + : QObject(parent) +{ +} + +HsDatabase::~HsDatabase() +{ + +} + +void HsDatabase::setConnectionName(const QString &name) +{ + mConnectionName = name; +} + +QString HsDatabase::connectionName() const +{ + return mConnectionName; +} + +void HsDatabase::setDatabaseName(const QString &name) +{ + mDatabaseName = QDir::toNativeSeparators(name); +} + +QString HsDatabase::databaseName() const +{ + return mDatabaseName; +} + +bool HsDatabase::open() +{ + return true; +} + +void HsDatabase::close() +{ + +} + +bool HsDatabase::transaction() +{ + return true; +} + +bool HsDatabase::rollback() +{ + return true; +} + +bool HsDatabase::commit() +{ + return true; +} + +bool HsDatabase::scene(HsSceneData &) +{ + return true; +} + +bool HsDatabase::pages(QList &) +{ + return true; +} + +bool HsDatabase::page(HsPageData &) +{ + return true; +} + +bool HsDatabase::insertPage(HsPageData &) +{ + return true; +} + +bool HsDatabase::updatePage(const HsPageData &) +{ + return true; +} + +bool HsDatabase::deletePage(int ) +{ + return true; +} + +bool HsDatabase::widgets(int , QList &) +{ + return true; +} + +bool HsDatabase::widgets(const QString &, QList &) +{ + return true; +} + +bool HsDatabase::widgets(const QString &, const QVariantHash &, int &count) +{ + count = 0; + return true; +} +bool HsDatabase::widget(HsWidgetData &) +{ + return true; +} + +bool HsDatabase::insertWidget(HsWidgetData &) +{ + return true; +} + +bool HsDatabase::updateWidget(const HsWidgetData &) +{ + return true; +} + +bool HsDatabase::deleteWidget(int ) +{ + return true; +} + +bool HsDatabase::deleteWidgets(const QString &) +{ + return true; +} + +bool HsDatabase::widgetPresentation(HsWidgetPresentationData &) +{ + return true; +} + +bool HsDatabase::setWidgetPresentation(const HsWidgetPresentationData &) +{ + return true; +} + +bool HsDatabase::deleteWidgetPresentation(int, Qt::Orientation) +{ + return true; +} + +bool HsDatabase::widgetPreferences(int , QVariantHash &) +{ + return true; +} + +bool HsDatabase::widgetPreference(int , const QString &, QVariant &) +{ + return true; +} + +bool HsDatabase::setWidgetPreferences(int , const QVariantHash &) +{ + return true; +} + +void HsDatabase::setInstance(HsDatabase *instance) +{ + if (mInstance != instance) { + HsDatabase *oldInstance = mInstance; + mInstance = instance; + delete oldInstance; + } +} + +HsDatabase *HsDatabase::instance() +{ + return mInstance; +} + +HsDatabase *HsDatabase::takeInstance() +{ + HsDatabase *instance = mInstance; + mInstance = 0; + return instance; +} + +bool HsDatabase::checkConnection() const +{ + return true; +} + +bool HsDatabase::configuration(QVariantHash &configuration) +{ + Q_UNUSED(configuration) + return true; +} + +bool HsDatabase::updateWidgetZValues(const QHash &data, Qt::Orientation orientation) +{ + Q_UNUSED(data) + Q_UNUSED(orientation) + return true; +} + +bool HsDatabase::matchWidgetPreferences(const QVariantHash &preferences, const QMultiMap& storedPreferences) +{ + Q_UNUSED(preferences) + Q_UNUSED(storedPreferences) + return true; +} + +HsDatabase *HsDatabase::mInstance(0); diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hsgui_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hsgui_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,195 @@ +/* +* 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: +* +*/ + +#include +#include +#include +#include +#include + +#include "hsgui.h" +#include "hsidlewidget.h" +#include "hsscene.h" +#include "hspropertyanimationwrapper.h" + +namespace { + const char gApplicationLibraryIconName[] = "qtg_mono_applications_all"; +} + +/*! + \class HsGui + \ingroup group_hsdomainmodel + \brief Represents a view in the framework. + HsGui includes common UI components for Home screen. +*/ + +HsGui *HsGui::mInstance(0); + +struct HsGuiImpl +{ + 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; +} + +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); + } + mImpl->mWindow->setCurrentView(mImpl->mIdleView); +} + +void HsGui::cleanupIdleUi() +{ + 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; +} + +QRectF HsGui::layoutRect() const +{ + return mImpl->mWindow->layoutRect(); +} + +void HsGui::show() +{ + mImpl->mWindow->raise(); + mImpl->mWindow->show(); +} + +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 e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hsimagehandlingclient_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hsimagehandlingclient_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,102 @@ +/* +* 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: Mocked Photos image handling client. +* +*/ + + +#include "hsimagehandlingclient.h" +#include + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +#ifdef Q_OS_SYMBIAN +HsImageHandlingClient::HsImageHandlingClient(QObject *parent) + : QObject(parent), + mReq(0) +#else +HsImageHandlingClient::HsImageHandlingClient(QObject *parent) + : QObject(parent) +#endif +{ + setProperty("testSetToFail", QVariant(true)); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +HsImageHandlingClient::~HsImageHandlingClient() +{ +#ifdef Q_OS_SYMBIAN + delete mReq; +#endif +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void HsImageHandlingClient::fetch() +{ + if (property("testSetToFail").value() == true) + { + handleError(-1,"KErrNotFound"); + } + else + { + handleOk(""); + } +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void HsImageHandlingClient::edit(const QString &imagePath) +{ + Q_UNUSED(imagePath); + + if (property("testSetToFail").value() == true) + { + handleEditorError(-1,"KErrNotFound"); + } + else + { + handleEditorOk(""); + } +} + +// Aiw request responses +void HsImageHandlingClient::handleOk(const QVariant& result) +{ + emit fetchCompleted(result.toString()); +} + +void HsImageHandlingClient::handleError(int errorCode, const QString& errorMessage) +{ + Q_UNUSED(errorCode); + Q_UNUSED(errorMessage); + emit fetchFailed(-1, "KErrNotFound"); +} + +void HsImageHandlingClient::handleEditorOk(const QVariant& result) +{ + Q_UNUSED(result) + emit editorCompleted(); +} + +void HsImageHandlingClient::handleEditorError(int errorCode, + const QString& errorMessage) +{ + emit editorFailed(errorCode, errorMessage); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hsmenuservice_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hsmenuservice_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "hsmenuservice.h" + +bool HsMenuService::launchTaskSwitcher() +{ + return true; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hsmessageboxwrapper_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hsmessageboxwrapper_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,78 @@ +/* +* 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 "hsmessageboxwrapper.h" + +/*! + \class HsMessageBoxWrapper + \ingroup group_hsutils + \brief +*/ +struct HsMessageBoxWrapperImpl{ + +}; +/*! + +*/ +HsMessageBoxWrapper::HsMessageBoxWrapper(QObject *parent) + : QObject(parent), mImpl(new HsMessageBoxWrapperImpl) +{ +} + +/*! + +*/ +HsMessageBoxWrapper::~HsMessageBoxWrapper() +{ + delete mImpl; +} + +/*! + +*/ +void HsMessageBoxWrapper::setHeader(const QString &header) +{ + Q_UNUSED(header); +} +/*! + +*/ +void HsMessageBoxWrapper::setQueryText(const QString &queryText) +{ + Q_UNUSED(queryText); +} +/*! + +*/ +void HsMessageBoxWrapper::show() +{ + emit accepted(); +} +/*! + +*/ +void HsMessageBoxWrapper::close() +{ +} + +/*! + +*/ +void HsMessageBoxWrapper::onDialogClosed(int action) +{ + Q_UNUSED(action) +} \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hspage_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hspage_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,487 @@ +/* +* 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 "hsdomainmodeldatastructures.h" +#include "hspage.h" +#include "hspagetoucharea.h" +#include "hspagenewwidgetlayout.h" +#include "hsscene.h" +#include "hswidgethost.h" +#include "hswidgethostvisual.h" +#include "hswallpaper.h" +#include "hswidgetpositioningonwidgetadd.h" +#include "hswidgetpositioningonorientationchange.h" +#include "hsconfiguration.h" +#include "hspagevisual.h" +#include "hsgui.h" +/*! + \class HsPage + \ingroup group_hsdomainmodel + \brief Represents a page in the framework. + HsPage contains group of widgets. HsPage can have a wallpaper. +*/ + +/*! + Constructor. + + \a parent Owner. + \a aFlags Window flags. +*/ +HsPage::HsPage(QObject* parent) + : QObject(parent), + mDatabaseId(-1), + mPageVisual(new HsPageVisual), + mWallpaper(0), + mRemovable(true), + mPageMargin(0.0) +{ + //Page margin + mPageMargin = HSCONFIGURATION_GET(pageMargin); + connect(HsConfiguration::instance(), SIGNAL(propertyChanged(QString)), SLOT(onPageMarginChanged(QString))); +} + +/*! + Destructor. +*/ +HsPage::~HsPage() +{ + delete mWallpaper; + delete mPageVisual; +} + +/*! + Returns the database id. +*/ +int HsPage::databaseId() const +{ + return mDatabaseId; +} + +/*! + Sets the database id to \a id. +*/ +void HsPage::setDatabaseId(int id) +{ + mDatabaseId = id; +} + + +/*! + Loads widgets. +*/ +bool HsPage::load() +{ + if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) { + mWallpaper = new HsPageWallpaper(this); + } + + HsWidgetHost *widget = new HsWidgetHost(-1); + mWidgets.append(widget); + connectWidget(widget); + widget->setPage(this); + widget->startWidget(); + return true; +} + +/*! + Return wallpaper. +*/ +HsWallpaper *HsPage::wallpaper() const +{ + return mWallpaper; +} +/*! + Add given existing \a widgetHost to a page. Returns true if successful +*/ +bool HsPage::addExistingWidget(HsWidgetHost *widgetHost) +{ + if (!widgetHost) { + return false; + } + + if (mWidgets.contains(widgetHost)) { + return true; + } + + if (!widgetHost->setPage(this)) { + return false; + } + + connectWidget(widgetHost); + mWidgets << widgetHost; + + return true; + } + +/*! + Remove given \a widgetHost from a page. Widget is not deleted. + Returns true if successful +*/ +bool HsPage::removeWidget(HsWidgetHost *widgetHost) +{ + if (!widgetHost || !widgetHost->setPage(0)) { + return false; + } + + disconnectWidget(widgetHost); + mWidgets.removeOne(widgetHost); + + return true; +} + +/*! + Returns list of new widgets belonging to a page. Widgets which are + not yet layouted are considered as new widgets. +*/ +QList HsPage::newWidgets() +{ + return mNewWidgets; +} + +/*! + Adds new widget into a page. Returns true if successfull. +*/ +bool HsPage::addNewWidget(HsWidgetHost* widgetHost, const QPointF &touchPoint) +{ + Q_UNUSED(touchPoint) + if (!widgetHost || mWidgets.contains(widgetHost)) { + return false; + } + + if (mNewWidgets.contains(widgetHost)) { + return true; + } + + HsWidgetPresentationData presentation; + presentation.orientation = HsGui::instance()->orientation(); + if (!widgetHost->getPresentation(presentation)) { + presentation.orientation = HsGui::instance()->orientation(); + presentation.setPos(QPointF()); + presentation.zValue = 0; + widgetHost->savePresentation(presentation); + } + + connectWidget(widgetHost); + mNewWidgets << widgetHost; + + return true; +} + +/*! + Layouts all the new widgets +*/ +void HsPage::layoutNewWidgets() +{ + if (mNewWidgets.isEmpty()) { + return; + } + + updateZValues(); + HsWidgetHost *widget = 0; + for (int i = 0; i < mNewWidgets.count(); ++i) { + widget = mNewWidgets.at(i); + widget->setPage(this); + widget->showWidget(); + } + mWidgets << mNewWidgets; + mNewWidgets.clear(); +} + +/*! + Clears new widgets list and resets layout. +*/ +void HsPage::resetNewWidgets() +{ + mNewWidgets.clear(); +} + +/*! + Remove page and all it's contained widgets from database +*/ +bool HsPage::deleteFromDatabase() +{ + //Not used in mock + return true; +} + +/*! + Return list of widgets belonging to a page +*/ +QList HsPage::widgets() const +{ + return mWidgets; +} + +/*! + Returns true if the page can be removed. Otherwise, + returns false. +*/ +bool HsPage::isRemovable() const +{ + return mRemovable; +} + +/*! + Sets removable flag to \a removable. +*/ +void HsPage::setRemovable(bool removable) +{ + mRemovable = removable; +} + +/*! + Return true if page is default page. +*/ +bool HsPage::isDefaultPage() const +{ + return mDatabaseId == HSCONFIGURATION_GET(defaultPageId); +} + +/*! + Return true if page is active page. +*/ +bool HsPage::isActivePage() const +{ + return this == HsScene::instance()->activePage(); +} + +/*! + Create page into database and return instance of a new page. +*/ +HsPage *HsPage::createInstance(const HsPageData &pageData) +{ + Q_UNUSED(pageData); + HsPage *page = new HsPage; + return page; +} + +/*! + 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; + //pageRect = rect(); + + 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; +} + +/*! + Calls onShow() for contained widgets. +*/ +void HsPage::showWidgets() +{ +} + +/*! + Calls onHide() for contained widgets. +*/ +void HsPage::hideWidgets() +{ +} + +/*! + Propagate online state to widgets. +*/ +void HsPage::setOnline(bool online) +{ + foreach (HsWidgetHost *widget, mNewWidgets) { + widget->setOnline(online); + } + foreach (HsWidgetHost *widget, mWidgets) { + widget->setOnline(online); + } +} + +/*! + Update widgets z-values and persist those. Active widget has top most + z-value. +*/ +void HsPage::updateZValues() +{ + +} + +/*! + Return this page's index. +*/ +int HsPage::pageIndex() +{ + return HsScene::instance()->pages().indexOf(this); +} + +/*! + Utility to connect widget signals to page. +*/ +void HsPage::connectWidget(HsWidgetHost *widget) +{ + connect(widget, SIGNAL(finished()), SLOT(onWidgetFinished())); + connect(widget, SIGNAL(faulted()), SLOT(onWidgetFaulted())); + connect(widget->visual(), SIGNAL(resized()), SLOT(onWidgetResized())); + connect(widget, SIGNAL(available()), SLOT(onWidgetAvailable())); + connect(widget, SIGNAL(unavailable()), SLOT(onWidgetUnavailable())); +} +/*! + Disconnect widget signals from page +*/ +void HsPage::disconnectWidget(HsWidgetHost *widget) +{ + widget->disconnect(this); +} +/*! + Disconnect and remove widget +*/ +void HsPage::onWidgetFinished() +{ + HsWidgetHost *widget = qobject_cast(sender()); + + // It can be in new widget list if we haven't layouted it yet + // or layouted new widget and widget list + if (!mNewWidgets.removeOne(widget)) { + mWidgets.removeOne(widget); + } + + disconnectWidget(widget); + widget->remove(); +} +/*! + Remove widget if it faulted +*/ +void HsPage::onWidgetFaulted() +{ + onWidgetFinished(); +} + +/*! + Calculates new widget position on page when widget size changes. If page has layout then there are new widgets + and we use layout to calculate new widget positions. +*/ +void HsPage::onWidgetResized() +{ +} +/*! + Show widget if it came available +*/ +void HsPage::onWidgetAvailable() +{ + HsWidgetHost *widget = qobject_cast(sender()); + + mUnavailableWidgets.removeOne(widget); + mWidgets.append(widget); + + widget->startWidget(isActivePage()); +} +/*! + Update internal bookkeeping and hide widget +*/ +void HsPage::onWidgetUnavailable() +{ + HsWidgetHost *widget = qobject_cast(sender()); + + if (mWidgets.contains(widget)) { + mWidgets.removeOne(widget); + } else if (mNewWidgets.contains(widget)) { + mNewWidgets.removeOne(widget); + } else { + return; + } + + mUnavailableWidgets.append(widget); +} + +/*! + 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) +{ + Q_UNUSED(orientation) +} + +void HsPage::onPageMarginChanged(const QString &value) +{ + if (value == "pageMargin") { + mPageMargin = HSCONFIGURATION_GET(pageMargin); + + if (!mWidgets.isEmpty()) { + foreach (HsWidgetHost *widget, mWidgets) { + widget->savePresentation(); + } + } + + if (!mNewWidgets.isEmpty()) { + foreach (HsWidgetHost *widget, mNewWidgets) { + widget->savePresentation(); + } + } + } +} +HsPageVisual *HsPage::visual() const +{ + return mPageVisual; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hspropertyanimationwrapper_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hspropertyanimationwrapper_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include "hspropertyanimationwrapper.h" + +/*! + \class HsMessageBoxWrapper + \ingroup group_hsutils + \brief +*/ +struct HsPropertyAnimationWrapperImpl +{ +public: + bool running; + bool forward; +}; + +/*! + +*/ +HsPropertyAnimationWrapper::HsPropertyAnimationWrapper(QObject *parent) + : QObject(parent),mImpl(new HsPropertyAnimationWrapperImpl) +{ + mImpl->running = false; + mImpl->forward = true; +} + +/*! + +*/ +HsPropertyAnimationWrapper::~HsPropertyAnimationWrapper() +{ + +} + +/*! + +*/ +void HsPropertyAnimationWrapper::setTargetObject(QObject *target) +{ + Q_UNUSED(target) +} +/*! + +*/ +void HsPropertyAnimationWrapper::setPropertyName(const QByteArray &propertyName) +{ + Q_UNUSED(propertyName) +} + +bool HsPropertyAnimationWrapper::isRunning() +{ + return mImpl->running; +} +void HsPropertyAnimationWrapper::setEndValue(const QVariant &value) +{ + Q_UNUSED(value) +} +void HsPropertyAnimationWrapper::setDuration(int msecs) +{ + Q_UNUSED(msecs) +} +void HsPropertyAnimationWrapper::setForward() +{ + mImpl->forward = true; +} + +void HsPropertyAnimationWrapper::setBackward() +{ + mImpl->forward = false; +} + +bool HsPropertyAnimationWrapper::isForward() const +{ + return mImpl->forward; +} +void HsPropertyAnimationWrapper::start() +{ + mImpl->running = true; + emit finished(); +} +/*! + +*/ +void HsPropertyAnimationWrapper::stop() +{ + mImpl->running = false; +} + +/*! + +*/ +void HsPropertyAnimationWrapper::setEasingCurve(const QEasingCurve &curve) +{ + Q_UNUSED(curve) +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hsscene_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hsscene_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,234 @@ +/* +* 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 "hsdomainmodeldatastructures.h" +#include "hsscene.h" +#include "hspage.h" +#include "hswidgethost.h" +#include "hswallpaper.h" +#include "hsconfiguration.h" + +HsScene::~HsScene() +{ + delete mWallpaper; + qDeleteAll(mPages); +} + +int HsScene::databaseId() const +{ + return mDatabaseId; +} + +bool HsScene::load() +{ + int pageCount = property("pageCount").toInt(); + if ( pageCount <= 0 ){ + pageCount = 1; + } + int defaultPageIndex = property("defaultPageIndex").toInt(); + + mDatabaseId = 1; //Just one scene in the test + if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::SceneWallpaper) { + mWallpaper = new HsSceneWallpaper(this); + } + + for (int i = 0; i < pageCount; ++i) { + HsPage *page = new HsPage; + page->load(); + mPages << page; + } + + if(defaultPageIndex > -1){ + mActivePage = mPages[defaultPageIndex]; + mActivePage->setRemovable(false); + } + + return true; +} + +HsWallpaper *HsScene::wallpaper() const +{ + return mWallpaper; +} + +QList HsScene::pages() const +{ + return mPages; +} + +bool HsScene::addPage(HsPage *page) +{ + if (!page) { + return false; + } + + if (mPages.contains(page)) { + return true; + } + + mPages << page; + return true; +} + +bool HsScene::removePage(HsPage *page) +{ + if (!page) { + return false; + } + int index = activePageIndex(); + mPages.removeOne(page); + if(mPages.isEmpty()) { + mActivePage = 0; + } + if(page == mActivePage){ + if(index >= mPages.count()){ + index--; + } + setActivePageIndex(index); + } + return true; +} + +bool HsScene::setActivePage(HsPage *page) +{ + if (!page) { + return false; + } + + if (!mPages.contains(page)) { + return false; + } + + if (page == mActivePage) { + return true; + } + + mActivePage = page; + emit activePageChanged(); + + foreach (HsPage *p, mPages) { + if (p == mActivePage) { + p->showWidgets(); + } else { + p->hideWidgets(); + } + } + + return true; +} + +bool HsScene::setActivePageIndex(int index) +{ + if (index < 0 || mPages.count() <= index) { + return false; + } + return setActivePage(mPages[index]); +} + +HsPage *HsScene::activePage() const +{ + return mActivePage; +} + +int HsScene::activePageIndex() const +{ + return mPages.indexOf(mActivePage); +} + +void HsScene::setActiveWidget(HsWidgetHost *widget) +{ + mActiveWidget = widget; +} + +HsWidgetHost *HsScene::activeWidget() const +{ + return mActiveWidget; +} + +void HsScene::setOnline(bool online) +{ + mIsOnline = online; + foreach (HsPage *page, mPages) { + page->setOnline(online); + } +} + +bool HsScene::isOnline()const +{ + return mIsOnline; +} + +/*! + Singleton. +*/ +HsScene *HsScene::instance() +{ + if (!mInstance) { + mInstance = new HsScene; + } + return mInstance; +} + +HsScene *HsScene::takeInstance() +{ + HsScene *instance = mInstance; + mInstance = 0; + return instance; +} + +void HsScene::setInstance(HsScene *instance) +{ + if (mInstance != instance) { + delete mInstance; + mInstance = instance; + } +} + + +/*! + Listens for application background/foreground changes. +*/ +bool HsScene::eventFilter(QObject *watched, QEvent *event) +{ + switch (event->type()) { + case QEvent::ApplicationActivate: + mActivePage->showWidgets(); + break; + case QEvent::ApplicationDeactivate: + mActivePage->hideWidgets(); + break; + default: + break; + } + return QObject::eventFilter(watched, event); +} + +HsScene::HsScene(QObject *parent) + : QObject(parent), + mDatabaseId(-1), + mWallpaper(0), + mActivePage(0), + mActiveWidget(0), + mIsOnline(true) +{ +} + +/*! + Points to the scene instance. +*/ +HsScene *HsScene::mInstance = 0; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hswallpaper_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hswallpaper_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,302 @@ +/* +* 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: +* +*/ + +#include +#include +#include +#include + +#include +#include + +#include "hswallpaper.h" +#include "hsscene.h" +#include "hspage.h" +#include "hswallpaperloader.h" +#include "hsconfiguration.h" +#include "hsgui.h" + +/*! + +*/ + +/*! + +*/ +HsWallpaper::HsWallpaper(QGraphicsItem *parent) + : HbWidget(parent), + mIsDefaultImage(false), + mIconItem(0) +{ + setFlag(ItemHasNoContents); + setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored); + + mIconItem = new HbIconItem(); + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout; + layout->setContentsMargins(0, 0, 0, 0); + layout->addItem(mIconItem); + setLayout(layout); + + connect(HsGui::instance(), + SIGNAL(orientationChanged(Qt::Orientation)), + SLOT(updateIconItem(Qt::Orientation))); +} + +/*! + +*/ +HsWallpaper::~HsWallpaper() +{ +} + +/*! + +*/ +void HsWallpaper::setImage(const QString &path) +{ + Q_UNUSED(path); + emit imageSet(); +} + +void HsWallpaper::setImages(const QString &portraitFileName, const QString &landscapeFileName) +{ + Q_UNUSED(portraitFileName) + Q_UNUSED(landscapeFileName) + emit imageSet(); +} + +/*! + +*/ +void HsWallpaper::setDefaultImage() +{ + if (mIsDefaultImage) { + return; + } + + mIsDefaultImage = true; + mLandscapeImagePath = QString(); + mPortraitImagePath = QString(); + + updateIconItem(HsGui::instance()->orientation()); +} + +/*! + +*/ +void HsWallpaper::remove() +{ + if (mIsDefaultImage) { + mIsDefaultImage = false; + } else { + QFile::remove(mPortraitImagePath); + QFile::remove(mLandscapeImagePath); + } + mPortraitImagePath.clear(); + mLandscapeImagePath.clear(); +} + +/*! + +*/ +bool HsWallpaper::setExistingImage() +{ + QDir dir(wallpaperDirectory()); + QStringList filters; + filters << QString("%1_portrait.*").arg(mId); + filters << QString("%1_landscape.*").arg(mId); + QFileInfoList infos = dir.entryInfoList( + filters, QDir::Files, QDir::Name | QDir::IgnoreCase); + + Q_ASSERT(infos.isEmpty() || infos.count() == 2); + + if (infos.isEmpty()) { + return false; + } + + mIsDefaultImage = false; + mLandscapeImagePath = infos.first().absoluteFilePath(); + mPortraitImagePath = infos.last().absoluteFilePath(); + + updateIconItem(HsGui::instance()->orientation()); + return true; +} + +QString HsWallpaper::rootDirectory() const +{ +#ifdef Q_OS_SYMBIAN + QString directory("c:/private/20022f35/wallpapers/"); +#else + QString directory(QDir::currentPath() + "/private/20022f35/wallpapers/"); +#endif + +#ifdef HSDOMAINMODEL_TEST + directory = QDir::currentPath() + "/wallpapers/"; +#endif + return directory; +} + +/*! + +*/ +void HsWallpaper::onLoaderFinished() +{ + if (mIsDefaultImage) { + mIsDefaultImage = false; + } else { + QFile::remove(mPortraitImagePath); + QFile::remove(mLandscapeImagePath); + } + foreach (QString path, mLoader->targets().keys()) { + QString newName = path; newName.remove("temp"); + QFile::rename(path, newName); + } + setExistingImage(); + emit imageSet(); +} + +/*! + +*/ +void HsWallpaper::onLoaderFailed() +{ + foreach (QString path, mLoader->targets().keys()) { + QFile::remove(path); + } + emit imageSetFailed(); +} + +/*! + +*/ +void HsWallpaper::updateIconItem(Qt::Orientation orientation) +{ + if (orientation == Qt::Vertical) { + mIconItem->setIcon(HbIcon(QIcon(mPortraitImagePath))); + } else { + mIconItem->setIcon(HbIcon(QIcon(mLandscapeImagePath))); + } +} + +/*! + +*/ +HsSceneWallpaper::HsSceneWallpaper(HsScene *scene, QGraphicsItem *parent) + : HsWallpaper(parent), + mScene(0) +{ + setScene(scene); +} + +/*! + +*/ +HsSceneWallpaper::~HsSceneWallpaper() +{ +} + +/*! + +*/ +void HsSceneWallpaper::setScene(HsScene *scene) +{ + Q_UNUSED(scene); +} + +/*! + +*/ +QString HsSceneWallpaper::wallpaperDirectory() const +{ + return QDir::toNativeSeparators(rootDirectory() + "scene/"); +} + +/*! + +*/ +QVariantHash HsSceneWallpaper::createTargets(const QString &sourcePath) +{ + QVariantHash targets; + + QString path = wallpaperDirectory() + + QString("temp%1_").arg(mId) + + QString("%1.") + + QFileInfo(sourcePath).suffix(); + + targets.insert(path.arg("portrait"), QSize((2 * 360) + HSCONFIGURATION_GET(bounceEffect), 640)); + targets.insert(path.arg("landscape"), QSize((2 * 640) + HSCONFIGURATION_GET(bounceEffect), 360)); + return targets; +} + +/*! + PAGE +*/ +HsPageWallpaper::HsPageWallpaper(HsPage *page, QGraphicsItem *parent) + : HsWallpaper(parent), + mPage(0) +{ + setPage(page); +} + +/*! + +*/ +HsPageWallpaper::~HsPageWallpaper() +{ +} + +/*! + +*/ +void HsPageWallpaper::setPage(HsPage *page) +{ + if (!page) { + return; + } + + mPage = page; + mId = page->databaseId(); + if (!setExistingImage()) { + setDefaultImage(); + } +} + +/*! + +*/ +QString HsPageWallpaper::wallpaperDirectory() const +{ + return QDir::toNativeSeparators(rootDirectory() + "page/"); +} + +/*! + +*/ +QVariantHash HsPageWallpaper::createTargets(const QString &sourcePath) +{ + QVariantHash targets; + + QString path = wallpaperDirectory() + + QString("temp%1_").arg(mId) + + QString("%1.") + + QFileInfo(sourcePath).suffix(); + + targets.insert(path.arg("portrait"), QSize(360, 640)); + targets.insert(path.arg("landscape"), QSize(640, 360)); + return targets; +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hswidgethost_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/hswidgethost_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,408 @@ +/* +* 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 +#include + +#include +#include +#include + +#include +#include + +#include "hsdatabase.h" +#include "hsdomainmodeldatastructures.h" +#include "hsscene.h" +#include "hspage.h" +#include "hswidgethost.h" +#include "hswidgethostvisual.h" +#include "hswidgettoucharea.h" +#include "hswidgetcomponentregistry.h" +#include "hswidgetcomponent.h" +#include "hsconfiguration.h" +#include "hscontentservice.h" +#include "testwidget.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())); + +QTM_USE_NAMESPACE + +HsWidgetHost::HsWidgetHost(int databaseId, QObject *parent) + : QObject(parent), + mDatabaseId(databaseId), + mVisual(new HsWidgetHostVisual), + mStateMachine(0), + mWidget(0), + mPage(0), + mComponent(0), + mIsFinishing(false) +{ + setupStates(); +} + +HsWidgetHost::~HsWidgetHost() +{ + delete mVisual; +} + +HsWidgetHost *HsWidgetHost::createInstance(HsWidgetData &widgetData, + const QVariantHash &preferences) +{ + Q_UNUSED(widgetData); + Q_UNUSED(preferences); + HsWidgetHost *host = NULL; + host = new HsWidgetHost(-1); + return host; +} + +int HsWidgetHost::databaseId() const +{ + return mDatabaseId; +} + +bool HsWidgetHost::setPage(HsPage *page) +{ + mPage = page; + return true; +} + +HsPage *HsWidgetHost::page() const +{ + return mPage; +} + +bool HsWidgetHost::loadPresentation() +{ + return true; +} + +bool HsWidgetHost::loadPresentation(Qt::Orientation orientation) +{ + Q_UNUSED(orientation) + return true; +} + +bool HsWidgetHost::savePresentation() +{ + return true; +} + +bool HsWidgetHost::savePresentation(Qt::Orientation orientation) +{ + Q_UNUSED(orientation) + return true; +} + +bool HsWidgetHost::savePresentation(HsWidgetPresentationData &presentation) +{ + Q_UNUSED(presentation) + return true; +} + +bool HsWidgetHost::getPresentation(HsWidgetPresentationData &presentation) +{ + Q_UNUSED(presentation) + return true; +} + +bool HsWidgetHost::removePresentation(Qt::Orientation orientation) +{ + Q_UNUSED(orientation) + return true; +} + + +void HsWidgetHost::startWidget(bool show) +{ + if (show) { + emit event_startAndShow(); + } else { + emit event_startAndHide(); + } +} + +void HsWidgetHost::showWidget() +{ + emit event_show(); +} + +void HsWidgetHost::hideWidget() +{ + emit event_hide(); +} + +void HsWidgetHost::setOnline(bool online) +{ + mIsOnlineProperty.write(mWidget, online); +} + +void HsWidgetHost::remove() +{ + emit event_remove(); +} + +void HsWidgetHost::close() +{ + emit event_close(); +} + + + +void HsWidgetHost::setupStates() +{ + // State machine + + mStateMachine = new QStateMachine(this); + mStateMachine->setAnimated(false); + + // States + + QState *state_component = new QState; + QState *state_unloaded = new QState(state_component); + QState *state_running = new QState(state_component); + QState *state_show = new QState(state_running); + QState *state_hide = new QState(state_running); + QState *state_finished = new QState; + QState *state_faulted = new QState; + QState *state_remove = new QState; + QFinalState *state_final = new QFinalState; + + mStateMachine->addState(state_component); + mStateMachine->addState(state_finished); + mStateMachine->addState(state_faulted); + mStateMachine->addState(state_remove); + mStateMachine->addState(state_final); + + mStateMachine->setInitialState(state_component); + state_component->setInitialState(state_unloaded); + state_running->setInitialState(state_hide); + + // Transitions + + state_component->addTransition( + this, SIGNAL(event_close()), state_final); + state_component->addTransition( + this, SIGNAL(event_remove()), state_remove); + state_component->addTransition( + this, SIGNAL(event_finished()), state_finished); + state_component->addTransition( + this, SIGNAL(event_faulted()), state_faulted); + + state_unloaded->addTransition( + this, SIGNAL(event_startAndShow()), state_show); + state_unloaded->addTransition( + this, SIGNAL(event_startAndHide()), state_hide); + + state_running->addTransition( + this, SIGNAL(event_unload()), state_unloaded); + + state_show->addTransition( + this, SIGNAL(event_hide()), state_hide); + + state_hide->addTransition( + this, SIGNAL(event_show()), state_show); + + state_finished->addTransition( + this, SIGNAL(event_remove()), state_remove); + state_finished->addTransition( + this, SIGNAL(event_close()), state_final); + + state_faulted->addTransition( + this, SIGNAL(event_remove()), state_remove); + state_faulted->addTransition( + this, SIGNAL(event_close()), state_final); + + state_remove->addTransition(state_final); + + // Actions + + ENTRY_ACTION(state_component, action_connectComponent) + EXIT_ACTION(state_component, action_disconnectComponent) + + ENTRY_ACTION(state_running, action_load) + ENTRY_ACTION(state_running, action_initialize) + EXIT_ACTION(state_running, action_uninitialize) + EXIT_ACTION(state_running, action_unload) + + ENTRY_ACTION(state_show, action_show) + + ENTRY_ACTION(state_hide, action_hide) + + ENTRY_ACTION(state_finished, action_finished) + + ENTRY_ACTION(state_faulted, action_faulted) + + ENTRY_ACTION(state_remove, action_notifyRemove) + ENTRY_ACTION(state_remove, action_remove) + + // Delete on finish. + + connect(mStateMachine, SIGNAL(finished()), SLOT(deleteLater()), + Qt::QueuedConnection); +} + +bool HsWidgetHost::setProperty(const char *name, QMetaProperty &property) +{ + const QMetaObject *object = mWidget->metaObject(); + int index = object->indexOfProperty(name); + property = object->property(index); + return index >= 0; +} + +bool HsWidgetHost::setMethod(const char *signature, QMetaMethod &method) +{ + const QMetaObject *object = mWidget->metaObject(); + int index = object->indexOfMethod( + QMetaObject::normalizedSignature(signature)); + method = object->method(index); + return index >= 0; +} + +bool HsWidgetHost::hasSignal(const char *signature) +{ + const QMetaObject *object = mWidget->metaObject(); + int index = object->indexOfSignal( + QMetaObject::normalizedSignature(signature)); + return index >= 0; +} + + +bool HsWidgetHost::setPreferencesToWidget() +{ + return true; +} + +void HsWidgetHost::action_connectComponent() +{ +} + +void HsWidgetHost::action_disconnectComponent() +{ +} + +void HsWidgetHost::action_load() +{ + +} + +void HsWidgetHost::action_unload() +{ + delete mWidget; + mWidget = 0; + + mOnInitializeMethod = QMetaMethod(); + mOnShowMethod = QMetaMethod(); + mOnHideMethod = QMetaMethod(); + mOnUninitializeMethod = QMetaMethod(); + mIsOnlineProperty = QMetaProperty(); + mRootPathProperty = QMetaProperty(); +} + +void HsWidgetHost::action_initialize() +{ + setPreferencesToWidget(); + setOnline(HsScene::instance()->isOnline()); + mOnInitializeMethod.invoke(mWidget); +} + +void HsWidgetHost::action_uninitialize() +{ + mOnUninitializeMethod.invoke(mWidget); +} + +void HsWidgetHost::action_show() +{ + if (!mIsFinishing) { + mOnShowMethod.invoke(mWidget); + } +} + +void HsWidgetHost::action_hide() +{ + if (!mIsFinishing) { + mOnHideMethod.invoke(mWidget); + } +} + +void HsWidgetHost::action_finished() +{ + emit finished(); +} + +void HsWidgetHost::action_faulted() +{ + emit faulted(); +} + +void HsWidgetHost::action_remove() +{ + mDatabaseId = -1; +} + +void HsWidgetHost::action_notifyRemove() +{ + //Empty at mock +} + +void HsWidgetHost::onFinished() +{ + mIsFinishing = true; + emit event_finished(); +} + +void HsWidgetHost::onError() +{ + mIsFinishing = true; + emit event_faulted(); +} + +void HsWidgetHost::onSetPreferences(const QStringList &names) +{ + Q_UNUSED(names) +} +/*! + Starts the drag effect. +*/ +void HsWidgetHost::startDragEffect() +{ +} + +/*! + Starts the drop effect. +*/ +void HsWidgetHost::startDropEffect() +{ +} +HsWidgetHostVisual *HsWidgetHost::visual() const +{ + return mVisual; +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/t_hsbackuprestorestate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/t_hsbackuprestorestate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,62 @@ +/* +* 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: +* +*/ + +#include + +#include +#include + +#include "t_hshomescreenstateplugin.h" +#include "hsbackuprestorestate.h" +#include "hsscene.h" +#include "hsdatabase.h" +#include "hsgui.h" + +void HomeScreenStatePluginTest::testLoadBackupRestoreStateConstructors() +{ + HsBackupRestoreState *brs = new HsBackupRestoreState; + delete brs; +} + +void HomeScreenStatePluginTest::testLoadBackupRestoreStateOnEntryExit() +{ + HbInstance::instance(); + HbMainWindow mainWindow; + mainWindow.show(); + QCoreApplication::sendPostedEvents(); + + QStateMachine *sm = new QStateMachine; + HsBackupRestoreState *brs = new HsBackupRestoreState; + + sm->addState(brs); + sm->setInitialState(brs); + + + QFinalState *fs = new QFinalState; + sm->addState(fs); + + brs->addTransition(this, SIGNAL(finishStateMachine()), fs); + + sm->start(); + QCoreApplication::sendPostedEvents(); + emit finishStateMachine(); + + sm->stop(); + // main window deleted -> HsGui must be deleted also + delete HsGui::takeInstance(); + delete sm; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/t_hshomescreenmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/t_hshomescreenmain.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,140 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Main test class for hsHomeScreenStatePlugin library. +* +*/ + +#include +#include +#include + +#include +#include +#include + +#include "t_hshomescreenstateplugin.h" +#include "hshomescreenstateplugin.h" +#include "testwidget.h" +#include "hsdatabase.h" +#include "hsscene.h" +#include "hsgui.h" +#include "hswidgethost.h" +#include "hsdomainmodeldatastructures.h" +#include "hsconfiguration.h" + +#include "hswidgetpositioningonorientationchange.h" +#include "hswidgetpositioningonwidgetadd.h" +#include "hswidgetpositioningonwidgetmove.h" + +#ifdef Q_OS_SYMBIAN +#include +#endif + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void HomeScreenStatePluginTest::initTestCase() +{ + mMainWindow = 0; + +#ifdef Q_OS_SYMBIAN + mImageProcessingDelay = 5000; +#else + mImageProcessingDelay = 2000; +#endif + + HsWidgetPositioningOnOrientationChange::setInstance( + new HsAdvancedWidgetPositioningOnOrientationChange); + + HsWidgetPositioningOnWidgetAdd::setInstance( + new HsAnchorPointInBottomRight); + + HsWidgetPositioningOnWidgetMove::setInstance(new HsSnapToLines); + + HsDatabase::setInstance(new HsDatabase); + + HsConfiguration::setInstance(new HsConfiguration); + +} + +void HomeScreenStatePluginTest::cleanupTestCase() +{ + +} + +void HomeScreenStatePluginTest::cleanup() +{ + //Scene already deleted as child of mainwindow + HsScene *scene = HsScene::takeInstance(); + delete scene; +} + +void HomeScreenStatePluginTest::init() +{ + +} + +void HomeScreenStatePluginTest::createSceneAndWindow(int pageCount, int defaultPageIndex, int maximumPageCount) +{ + HSCONFIGURATION_SET(setMaximumPageCount, maximumPageCount); + + HbInstance::instance(); + mMainWindow = new HbMainWindow; + mMainWindow->move(0, 0); + mMainWindow->show(); + + QEventLoop waitUntilMainWindowCreated; + QTimer eventLoopTimer; + eventLoopTimer.setInterval(15000); + eventLoopTimer.setSingleShot(true); + connect(mMainWindow, SIGNAL(viewReady()), + &waitUntilMainWindowCreated, SLOT(quit())); + connect(&eventLoopTimer, SIGNAL(timeout()), + &waitUntilMainWindowCreated, SLOT(quit())); + eventLoopTimer.start(); + waitUntilMainWindowCreated.exec(); + eventLoopTimer.stop(); + + HsScene *scene = HsScene::instance(); + scene->setProperty("pageCount", pageCount); + scene->setProperty("defaultPageIndex", defaultPageIndex); + scene->setProperty("maximumPageCount", maximumPageCount); + scene->load(); +} + +void HomeScreenStatePluginTest::deleteSceneAndWindow() +{ + delete mMainWindow; + mMainWindow = 0; + delete HsGui::takeInstance(); +} + +#ifdef Q_OS_SYMBIAN +//QTEST_MAIN corrected since crashes if TRAP not in correct place. +//Will be corrected in later (estimate 4.6.0) Qt release for Symbian. +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + int error = 0; + TRAPD(err, \ + QTEST_DISABLE_KEYPAD_NAVIGATION \ + HomeScreenStatePluginTest tc; \ + error = QTest::qExec(&tc, argc, argv);); + Q_UNUSED(err); + return error; +} +#else //Q_OS_SYMBIAN +QTEST_MAIN(HomeScreenStatePluginTest) +#endif //Q_OS_SYMBIAN diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/t_hsidlestate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/t_hsidlestate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,772 @@ +/* +* 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: Tests for HsIdleState class. +* +*/ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include "t_hshomescreenstateplugin.h" +#include "hsscene.h" +#include "hsgui.h" +#include "hspage.h" +#include "hswidgethost.h" +#include "hswidgethostvisual.h" +#include "hstitleresolver.h" +#include "hsconfiguration.h" +#include "hsidlewidget.h" + +void HomeScreenStatePluginTest::testIdleStateConstruction() +{ + QState *parent = new QState; + HsIdleState *is = new HsIdleState(parent); + + QVERIFY(is->parent() == parent); + QVERIFY(!is->mNavigationAction); + + QVERIFY(!is->findChildren().isEmpty()); + + delete parent; +} + +void HomeScreenStatePluginTest::testIdleStateEntryAndExit() +{ + createSceneAndWindow(1, 0); + + HsIdleState *is = new HsIdleState; + + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + + QFinalState *fs = new QFinalState; + sm->addState(fs); + + is->addTransition(this, SIGNAL(finishStateMachine()), fs); + + sm->start(); + // QApplication::processEvents(); + QCoreApplication::sendPostedEvents(); + + emit finishStateMachine(); + + sm->stop(); + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testIdleStatePageLayerPos() +{ + createSceneAndWindow(1, 0); + + HsIdleState *is = new HsIdleState; + QVERIFY(qFuzzyCompare(is->pageLayerXPos(0), qreal(0))); + + delete is; + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testIdleStatePageChangeAnimation() +{ + createSceneAndWindow(2, 0); + + HsIdleState *is = new HsIdleState; + + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + + QFinalState *fs = new QFinalState; + sm->addState(fs); + + is->addTransition(this, SIGNAL(finishStateMachine()), fs); + + sm->start(); + QCoreApplication::sendPostedEvents(); + is->startPageChangeAnimation(1, 10); + + // Start two anims in a row + is->startPageChangeAnimation(1, 10); + is->startPageChangeAnimation(2, 10); + + emit finishStateMachine(); + + sm->stop(); + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testIdleStatePageChangeZones() +{ + createSceneAndWindow(1, 0); + HsIdleState *is = new HsIdleState; + + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + QCoreApplication::sendPostedEvents(); + + //Test left page change zone's left border + is->mWidgetHotSpot = QPointF(0, 0); + QVERIFY(is->isInLeftPageChangeZone()); + QVERIFY(!is->isInRightPageChangeZone()); + QVERIFY(is->isInPageChangeZone()); + + //Test left page change zone's right border + is->mWidgetHotSpot = QPointF(HSCONFIGURATION_GET(pageChangeZoneWidth) - 1, 0); + QVERIFY(is->isInLeftPageChangeZone()); + QVERIFY(!is->isInRightPageChangeZone()); + QVERIFY(is->isInPageChangeZone()); + + //Test not in either of the page change zones + is->mWidgetHotSpot = QPointF(HSCONFIGURATION_GET(pageChangeZoneWidth), 0); + QVERIFY(!is->isInLeftPageChangeZone()); + QVERIFY(!is->isInRightPageChangeZone()); + QVERIFY(!is->isInPageChangeZone()); + + //Test right page change zone's right border + HsScene *scene = HsScene::instance(); + + sm->stop(); + delete sm; + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testIdleStateAddPage() +{ + createSceneAndWindow(2, 0, 3); //pagecount 2, default page 0, max pages 3 + + HsIdleState *is = new HsIdleState; + + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + QCoreApplication::sendPostedEvents(); + QString menuaction; + bool found = false; + HbView *idleView = HsGui::instance()->idleView(); + for(int i=0; i < idleView->menu()->actions().count(); i++){ + menuaction = idleView->menu()->actions()[i]->text(); + if(menuaction.left(27) == "txt_homescreen_opt_add_page"){ + found = true; + } + } + if(!found){ + QFAIL("txt_homescreen_opt_add_page menu action not found!"); + } + + emit is->event_addPage(); + + HsScene *scene = HsScene::instance(); + QCOMPARE(scene->pages().count(), 3); + // Active page index 0, the new page is created to the right side of it. + QCOMPARE(scene->activePageIndex(), 1); + + found = false; + for(int i=0; i < idleView->menu()->actions().count(); i++){ + menuaction = idleView->menu()->actions()[i]->text(); + if(menuaction.left(27) == "txt_homescreen_opt_add_page"){ + found = true; + } + } + if(found){ + QFAIL("txt_homescreen_opt_add_page menu action should not be found!"); + } + + sm->stop(); + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testIdleStateRemoveActivePage() +{ + createSceneAndWindow(3, 2); + + HsIdleState *is = new HsIdleState; + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + QCoreApplication::sendPostedEvents(); + HsScene *scene = HsScene::instance(); + int numOfPages = scene->pages().count(); + + emit is->event_preRemovePage(); + QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); + QVERIFY(scene->pages().count() == numOfPages-1); + QVERIFY(scene->activePageIndex() == 1); + + sm->stop(); + + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testIdleStateRemovePage() +{ + createSceneAndWindow(2, 0); + HsScene::instance()->setActivePageIndex(1); // default page 0 cannot be removed + + HsIdleState *is = new HsIdleState; + + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + + QCoreApplication::sendPostedEvents(); + + QString menuaction; + bool found = false; + HbView *idleView = HsGui::instance()->idleView(); + for(int i=0; i < idleView->menu()->actions().count(); i++){ + menuaction = idleView->menu()->actions()[i]->text(); + if(menuaction.left(30) == "txt_homescreen_opt_remove_page"){ + found = true; + } + } + if(!found){ + QFAIL("txt_homescreen_opt_remove_page menu action not found!"); + } + + emit is->event_preRemovePage(); + + QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); + + HsScene *scene = HsScene::instance(); + QCOMPARE(scene->pages().count(), 1); + QCOMPARE(scene->activePageIndex(), 0); + + found = false; + idleView = HsGui::instance()->idleView(); + for(int i=0; i < idleView->menu()->actions().count(); i++){ + menuaction = idleView->menu()->actions()[i]->text(); + if(menuaction.left(30) == "txt_homescreen_opt_remove_page"){ + found = true; + } + } + if(found){ // Se above comment. + QFAIL("txt_homescreen_opt_remove_page menu action shound not be found!"); + } + + sm->stop(); + + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testIdleStateToggleConnection() +{ + createSceneAndWindow(1, 0); + + HsIdleState *is = new HsIdleState; + + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + QCoreApplication::sendPostedEvents(); + + HsScene *scene = HsScene::instance(); + + QVERIFY(scene->isOnline()); + emit is->event_toggleConnection(); + QVERIFY(!scene->isOnline()); + + sm->stop(); + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testIdleStateTapPage() +{ + createSceneAndWindow(HSCONFIGURATION_GET(maximumPageCount), 0); + + HsIdleState *is = new HsIdleState; + + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + QCoreApplication::sendPostedEvents(); + + HbTapAndHoldGesture *gesture = new HbTapAndHoldGesture; + gesture->setHotSpot(QPointF(10, 100)); + QList gestures; + gestures << gesture; + QGestureEvent *gestureEvent = new QGestureEvent(gestures); + + QVERIFY(!is->mSceneMenu); + is->onPageTapAndHoldFinished(gestureEvent); + QVERIFY(is->mSceneMenu); + QVERIFY(is->mSceneMenu->actions().count() == 2); //Add page action should not exist + + delete gestureEvent; + gestures.clear(); + sm->stop(); + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testIdleStatePanPage() +{ + createSceneAndWindow(2, 0); + + HsIdleState *is = new HsIdleState; + + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + QCoreApplication::sendPostedEvents(); + + HbPanGesture *gesture = new HbPanGesture; + gesture->setHotSpot(QPointF(10, 100)); + QList gestures; + gestures << gesture; + QGestureEvent *gestureEvent = new QGestureEvent(gestures); + + //Start Panning + QSignalSpy moveSceneSpy(is, SIGNAL(event_moveScene())); + is->onPagePanStarted(gestureEvent); + QCOMPARE(moveSceneSpy.count(), 1); + + //Continue Panning + gesture->setHotSpot(QPointF(50, 100)); + is->onPagePanUpdated(gestureEvent); + + //Finish Panning + gesture->setHotSpot(QPointF(150, 100)); + QSignalSpy waitInputSpy(is, SIGNAL(event_waitInput())); + is->onPagePanFinished(gestureEvent); + QCOMPARE(waitInputSpy.count(), 1); + + delete gestureEvent; + gestures.clear(); + sm->stop(); + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testIdleStateTapWidget() +{ + createSceneAndWindow(2, 0); + + HsIdleState *is = new HsIdleState; + + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + QCoreApplication::sendPostedEvents(); + + HsScene *scene = HsScene::instance(); + HsWidgetHost *widget = scene->activePage()->widgets().first(); + is->onWidgetTapStarted(QPointF(0,0), widget); + // widget is not activated on tap, only on tap and hold + QVERIFY(!scene->activeWidget()); + + sm->stop(); + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testIdleStateDragWidget() +{ + createSceneAndWindow(2, 0, 3); + QStateMachine *sm = new QStateMachine; + HsIdleState *is = new HsIdleState; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + QCoreApplication::sendPostedEvents(); + // try to move widget left from page 1, which isn't possible + HbTapAndHoldGesture *gesture = new HbTapAndHoldGesture; + gesture->setHotSpot(QPointF(10, 100)); + QList gestures; + gestures << gesture; + QGestureEvent *gestureEvent = new QGestureEvent(gestures); + QSignalSpy moveWidgetSpy(is, SIGNAL(event_moveWidget())); + HsScene *scene = HsScene::instance(); + HsWidgetHost *widget = scene->activePage()->widgets().first(); + is->onWidgetTapAndHoldFinished(gestureEvent, widget); + QCOMPARE(moveWidgetSpy.count(), 1); + moveWidgetSpy.clear(); + + is->onWidgetMoveUpdated(QPointF(10, 150), widget); + is->onWidgetMoveUpdated(QPointF(150, 150), widget); + QSignalSpy waitInputSpy(is, SIGNAL(event_MoveWidgetDelete())); + is->onWidgetMoveFinished(QPointF(150, 150), widget); + QCOMPARE(waitInputSpy.count(), 1); + waitInputSpy.clear(); + + // move widget to second page + gesture->setHotSpot(QPointF(150, 150)); + is->onWidgetTapAndHoldFinished(gestureEvent, widget); + QCOMPARE(moveWidgetSpy.count(), 1); + moveWidgetSpy.clear(); + is->onWidgetMoveUpdated(QPointF(355, 150), widget); + is->onWidgetMoveUpdated(QPointF(150, 150), widget); + + // move widget back to first page + is->onWidgetMoveUpdated(QPointF(10, 150), widget); + is->onWidgetMoveUpdated(QPointF(150, 150), widget); + + // move widget to second page + is->onWidgetMoveUpdated(QPointF(350, 150), widget); + is->onWidgetMoveUpdated(QPointF(150, 150), widget); + + // try to add page without releasing mouse button + is->onWidgetMoveUpdated(QPointF(350, 150), widget); + is->onWidgetMoveUpdated(QPointF(150, 150), widget); + is->onWidgetMoveFinished(QPointF(150, 150), widget); + QCOMPARE(waitInputSpy.count(), 1); + waitInputSpy.clear(); + + // add page 3 + gesture->setHotSpot(QPointF(150, 150)); + is->onWidgetTapAndHoldFinished(gestureEvent, widget); + QCOMPARE(moveWidgetSpy.count(), 1); + moveWidgetSpy.clear(); + is->onWidgetMoveUpdated(QPointF(350, 150), widget); + is->onWidgetMoveUpdated(QPointF(150, 150), widget); + is->onWidgetMoveFinished(QPointF(150, 150), widget); + QCOMPARE(waitInputSpy.count(), 1); + waitInputSpy.clear(); + + // try to move widget over trash bin + gesture->setHotSpot(QPointF(150, 150)); + is->onWidgetTapAndHoldFinished(gestureEvent, widget); + QCOMPARE(moveWidgetSpy.count(), 1); + moveWidgetSpy.clear(); + is->onWidgetMoveUpdated(QPointF(180, 600), widget); + is->onWidgetMoveUpdated(QPointF(180, 605), widget); + is->onWidgetMoveUpdated(QPointF(180, 610), widget); + is->onWidgetMoveUpdated(QPointF(180, 615), widget); + is->onWidgetMoveUpdated(QPointF(180, 620), widget); + is->onWidgetMoveUpdated(QPointF(180, 625), widget); + is->onWidgetMoveUpdated(QPointF(180, 630), widget); + is->onWidgetMoveUpdated(QPointF(180, 635), widget); + is->onWidgetMoveUpdated(QPointF(150, 150), widget); + is->onWidgetMoveFinished(QPointF(150, 150), widget); + QCOMPARE(waitInputSpy.count(), 1); + waitInputSpy.clear(); + + is->pageChangeAnimationFinished(); + + + sm->stop(); + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testIdleStateDeleteWidget() +{ + createSceneAndWindow(2, 0, 3); + QStateMachine *sm = new QStateMachine; + HsIdleState *is = new HsIdleState; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + //QApplication::processEvents(); + QCoreApplication::sendPostedEvents(); + // try to move widget left from page 1, which isn't possible + HbTapAndHoldGesture *gesture = new HbTapAndHoldGesture; + gesture->setHotSpot(QPointF(10, 100)); + QList gestures; + gestures << gesture; + QGestureEvent *gestureEvent = new QGestureEvent(gestures); + QSignalSpy moveWidgetSpy(is, SIGNAL(event_moveWidget())); + HsScene *scene = HsScene::instance(); + HsWidgetHost *widget = scene->activePage()->widgets().first(); + is->onWidgetTapAndHoldFinished(gestureEvent, widget); + QCOMPARE(moveWidgetSpy.count(), 1); + moveWidgetSpy.clear(); + + // test cases where active widget is not set and stop widget drag (should not be possible in real life) + QSignalSpy waitDeleteSpy(is, SIGNAL(event_MoveWidgetDelete())); + QSignalSpy waitInputSpy(is, SIGNAL(event_waitInput())); + scene->setActiveWidget(0); + is->onWidgetMoveFinished(QPointF(150, 150), widget); + QCOMPARE(waitInputSpy.count(), 2); + QCOMPARE(waitDeleteSpy.count(), 1); + + is->pageChangeAnimationFinished(); + + + sm->stop(); + delete sm; + + deleteSceneAndWindow(); + + +} + +void HomeScreenStatePluginTest::testIdleStateMisc() +{ + createSceneAndWindow(2, 0); + + HsIdleState *is = new HsIdleState; + + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + QCoreApplication::sendPostedEvents(); + + is->onAddContentFromOptionsMenuActionTriggered(); + is->onAddContentFromContextMenuActionTriggered(); + is->action_idle_orientationChanged(); + + HsScene *scene = HsScene::instance(); + scene->setActiveWidget(scene->activePage()->widgets().first()); + is->updateSnapAlgorithmParameters(); + + sm->stop(); + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testIdleStateChromeBehaviour() +{ + createSceneAndWindow(1, 0); + QScopedPointer is(new HsIdleState()); + + is->action_idle_setupView(); + + QString newTitle("title"); + + is->action_idle_setupTitle(); + + is->mTitleResolver->metaObject()->invokeMethod(is->mTitleResolver, + "titleChanged", + Q_ARG(QString, newTitle)); + HbView *idleView = HsGui::instance()->idleView(); + + QCOMPARE(idleView->title(), newTitle); + + QString t2("new title"); + + is->action_idle_cleanupTitle(); + + is->mTitleResolver->metaObject()->invokeMethod(is->mTitleResolver, + "titleChanged", + Q_ARG(QString, t2)); + + QCOMPARE(idleView->title(), newTitle); + + is->action_idle_setupTitle(); + + is->mTitleResolver->metaObject()->invokeMethod(is->mTitleResolver, + "titleChanged", + Q_ARG(QString, t2)); + + QCOMPARE(idleView->title(), t2); + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testEventFilter() +{ + // Create with no active page + createSceneAndWindow(1, -1); + HsIdleState *is = new HsIdleState(); + QEvent e(QEvent::ApplicationActivate); + is->eventFilter(0, &e); + + HsScene *s = HsScene::instance(); + HsPage *page = new HsPage(); + HsWidgetHost *wh = new HsWidgetHost(1); + page->addNewWidget(wh); + s->addPage(page); + s->setActivePage(page); + + is->eventFilter(0, &e); + + is->action_idle_setupView(); + + QEvent ee(QEvent::ApplicationDeactivate); + QSignalSpy spy(is, SIGNAL(event_waitInput())); + is->eventFilter(0, &ee); + + QCOMPARE(1, spy.count()); + + deleteSceneAndWindow(); + delete is; +} + +void HomeScreenStatePluginTest::testIdleStateSnapToObject() +{ + createSceneAndWindow(2, 0); + + HsIdleState *is = new HsIdleState; + + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + QCoreApplication::sendPostedEvents(); + + //The page has one widget, remove the widget. + HsScene *scene = HsScene::instance(); + HsWidgetHost *widget = scene->activePage()->widgets().first(); + scene->activePage()->removeWidget(widget); + + sm->stop(); + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testIdleStateSnapToObjectSnapEffectDisabled() +{ + createSceneAndWindow(2, 0); + + HSCONFIGURATION_SET(setSnapEffectsEnabled, false); + HsIdleState *is = new HsIdleState; + + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + QCoreApplication::sendPostedEvents(); + + //The page has one widget, remove the widget + HsScene *scene = HsScene::instance(); + HsWidgetHost *widget = scene->activePage()->widgets().first(); + scene->activePage()->removeWidget(widget); + + sm->stop(); + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testIdleStateSnapToObjectSnappingDisabled() +{ + createSceneAndWindow(2, 0); + + HSCONFIGURATION_SET(setSnapEnabled, false); + HsIdleState *is = new HsIdleState; + + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + QCoreApplication::sendPostedEvents(); + + //The page has one widget, remove the widget + HsScene *scene = HsScene::instance(); + HsWidgetHost *widget = scene->activePage()->widgets().first(); + scene->activePage()->removeWidget(widget); + + sm->stop(); + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testOnVerticalSnapLineTimerTimeout() +{ + createSceneAndWindow(1, 0); + + HsIdleState *is = new HsIdleState; + + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + QCoreApplication::sendPostedEvents(); + is->onVerticalSnapLineTimerTimeout(); + sm->stop(); + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testOnHorizontalSnapLineTimerTimeout() +{ + createSceneAndWindow(1, 0); + + HsIdleState *is = new HsIdleState; + + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + QCoreApplication::sendPostedEvents(); + is->onHorizontalSnapLineTimerTimeout(); + sm->stop(); + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testShowHorizontalLine() +{ + createSceneAndWindow(1, 0); + + HsIdleState *is = new HsIdleState; + + QStateMachine *sm = new QStateMachine; + sm->addState(is); + sm->setInitialState(is); + sm->start(); + QCoreApplication::sendPostedEvents(); + is->showHorizontalLine(); + sm->stop(); + delete sm; + + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testEditorAndVKB() +{ + createSceneAndWindow(1, 0); + + HsIdleState *is = new HsIdleState; + + is->closeVirtualKeyboard(); + + HsScene *scene = HsScene::instance(); + HsWidgetHost *widget = scene->activePage()->widgets().first(); + + // scene is not set for the widgets yet. + QVERIFY(!is->isEditor(QPointF(0,0), widget)); + + delete is; + + deleteSceneAndWindow(); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/t_hsloadscenestate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/t_hsloadscenestate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,75 @@ +/* +* 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 +#ifdef Q_OS_SYMBIAN +#include +#include +#endif +#include +#include + +#include "t_hshomescreenstateplugin.h" +#include "hsloadscenestate.h" +#include "hsscene.h" +#include "hsgui.h" + +void HomeScreenStatePluginTest::testLoadSceneStateConstructors() +{ + HsLoadSceneState *lss = new HsLoadSceneState; + delete lss; +} + +void HomeScreenStatePluginTest::testLoadSceneStateOnEntryExit() +{ + HbInstance::instance(); + HbMainWindow mainWindow; + mainWindow.show(); + + HsLoadSceneState *lss = new HsLoadSceneState; + + QStateMachine *sm = new QStateMachine; + sm->addState(lss); + sm->setInitialState(lss); + sm->start(); + QCoreApplication::sendPostedEvents(); + // main window deleted -> HsGui must be deleted also + delete HsGui::takeInstance(); + delete sm; +} + +#ifdef Q_OS_SYMBIAN +void HomeScreenStatePluginTest::testLoadSceneStateHandleKeyChange() +{ + HbInstance::instance(); + HbMainWindow mainWindow; + mainWindow.show(); + QCoreApplication::sendPostedEvents(); + + HsLoadSceneState *lss = new HsLoadSceneState; + XQSettingsKey testKey(XQSettingsKey::TargetPublishAndSubscribe, KPSUidStartup.iUid, KPSStartupUiPhase); + QVariant variant(QVariant::Int); + lss->handleKeyChange(testKey, variant); + int value = EStartupUiPhaseAllDone; + variant.setValue(value); + lss->handleKeyChange(testKey, variant); + + // main window deleted -> HsGui must be deleted also + delete HsGui::takeInstance(); + delete lss; +} +#endif diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/t_hsrootstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/t_hsrootstate.cpp Mon Sep 20 10:19: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: +* +*/ + +#include + +#include "t_hshomescreenstateplugin.h" +#include "hsrootstate.h" +#include "hsscene.h" + +void HomeScreenStatePluginTest::testLoadRootStateConstructors() +{ + HsRootState *rs = new HsRootState; + delete rs; +} + +void HomeScreenStatePluginTest::testLoadRootStateOnEntryExit() +{ + HsRootState *rs = new HsRootState; + + QStateMachine *sm = new QStateMachine; + sm->addState(rs); + sm->setInitialState(rs); + + QFinalState *fs = new QFinalState; + sm->addState(fs); + + rs->addTransition(this, SIGNAL(finishStateMachine()), fs); + + sm->start(); + QCoreApplication::sendPostedEvents(); + emit finishStateMachine(); + + sm->stop(); + delete sm; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/t_hswallpaperselectionstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/t_hswallpaperselectionstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,136 @@ +/* +* 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 "t_hshomescreenstateplugin.h" +#include "hswallpaperselectionstate.h" +#include "hsscene.h" +#include "hspage.h" +#include "hsspinnerdialog.h" +#include "hsconfiguration.h" +#include "hsgui.h" + +#ifdef Q_OS_SYMBIAN +#include "hsimagehandlingclient.h" +#else +#include "xqaiwgetimageclient.h" +#endif + +void HomeScreenStatePluginTest::testWallpaperSelectionStateConstruction() +{ + HsWallpaperSelectionState *s = new HsWallpaperSelectionState; + QVERIFY(!s->mImageHandler); + QVERIFY(!s->mWallpaper); + QVERIFY(!s->mWaitDialog); + QCOMPARE(s->findChildren().count(), 5); + delete s; +} + +void HomeScreenStatePluginTest::testWallpaperSelectionStateImageSelection() +{ + HsWallpaperSelectionState *s = new HsWallpaperSelectionState; + + // Generate mImageHandler. + s->action_selectingImage_start(); + + QSignalSpy assignImageSpy(s, SIGNAL(event_assignImage())); + QSignalSpy errorSpy(s, SIGNAL(event_error())); + + s->mImageHandler->setProperty("testSetToFail", false); + s->mImageHandler->fetch(); + + QCOMPARE(assignImageSpy.count(), 1); + assignImageSpy.clear(); + QCOMPARE(errorSpy.count(), 0); + + s->mImageHandler->setProperty("testSetToFail", true); + s->mImageHandler->fetch(); + + QCOMPARE(assignImageSpy.count(), 0); + QCOMPARE(errorSpy.count(), 1); + errorSpy.clear(); + + delete s; +} + +void HomeScreenStatePluginTest::testWallpaperSelectionStateImageAssignment() +{ + createSceneAndWindow(1, 0); + HsWallpaperSelectionState *s = new HsWallpaperSelectionState; + + QSignalSpy waitInputSpy(s, SIGNAL(event_waitInput())); + s->action_assigningImage_start(); + QCOMPARE(waitInputSpy.count(), 1); + QVERIFY(s->mWallpaper); + s->action_assigningImage_cleanup(); + QVERIFY(!s->mWallpaper); + + delete s; + deleteSceneAndWindow(); +} + +void HomeScreenStatePluginTest::testWallpaperSelectionStateSimpleMethods() +{ + HbInstance::instance(); + HbMainWindow *window = new HbMainWindow; + window->move(0, 0); + window->show(); + + HsWallpaperSelectionState *s = new HsWallpaperSelectionState; + + // Cleanup + s->action_selectingImage_start(); + s->action_imageHandler_cleanup(); + QVERIFY(!s->mImageHandler); + + delete s; + s = new HsWallpaperSelectionState; + + // Wait dialog + s->action_assigningImage_showWaitDialog(); + QVERIFY(s->mWaitDialog); + s->mWaitDialog->stop(); + s->action_assigningImage_hideWaitDialog(); + QVERIFY(!s->mWaitDialog); + + delete s; + s = new HsWallpaperSelectionState; + + QSignalSpy waitInputSpy(s, SIGNAL(event_waitInput())); + s->action_errorMessage_show(); + QCOMPARE(waitInputSpy.count(), 1); + waitInputSpy.clear(); + + s->onImageSet(); + QCOMPARE(waitInputSpy.count(), 1); + waitInputSpy.clear(); + + QSignalSpy errorSpy(s, SIGNAL(event_error())); + + s->onImageSetFailed(); + QCOMPARE(errorSpy.count(), 1); + + delete s; + // main window deleted -> HsGui must be deleted also + delete HsGui::takeInstance(); + delete window; +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/testwidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/testwidget.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,60 @@ +/* +* 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: +* +*/ + +#include +#include "testwidget.h" + +TestWidget::TestWidget(QGraphicsItem *parent, Qt::WindowFlags flags) + : HbWidget(parent, flags) +{ + setPreferredSize(100, 100); +} + +TestWidget::~TestWidget() +{ +} + +void TestWidget::onInitialize() +{ +} + +void TestWidget::onShow() +{ +} + +void TestWidget::onHide() +{ +} + +void TestWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + Q_UNUSED(option) + Q_UNUSED(widget) + painter->drawRect(rect()); +} + +QRectF TestWidget::boundingRect() const +{ + return rect(); +} + +QPainterPath TestWidget::shape() const +{ + QPainterPath path; + path.addRect(rect()); + return path; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/xqaiwgetimageclient_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/xqaiwgetimageclient_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,72 @@ +/* +* 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: Moc impl for image fetcher api. +* +*/ + + +#include "xqaiwgetimageclient.h" +#include "hsimagegridwidget.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +XQAIWGetImageClient::XQAIWGetImageClient(): + mImageGrid(0) +{ + setProperty("testSetToFail", QVariant(true)); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +XQAIWGetImageClient::~XQAIWGetImageClient() +{ +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void XQAIWGetImageClient::fetch() +{ + if (property("testSetToFail").value() == true) + { + imageSelectionCancelled(); + } + else + { + imageSelected(QString("")); + } +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void XQAIWGetImageClient::imageSelected(const QString& val) +{ + emit fetchCompleted(val); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void XQAIWGetImageClient::requestCompleted(const QVariant& val) +{ + Q_UNUSED(val) +} + +void XQAIWGetImageClient::imageSelectionCancelled() +{ + emit fetchFailed(-1, QString()); //KErrNotFound +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/t_hshomescreenstateplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/t_hshomescreenstateplugin.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,69 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +#Header files +HEADERS += ./inc/*.h \ + ../../inc/*.h \ + ../../../../hsdomainmodel/inc/hsdomainmodeldatastructures.h \ + ../../../../hsdomainmodel/inc/hsdatabase.h \ + ../../../../hsdomainmodel/inc/hspage.h \ + ../../../../hsdomainmodel/inc/hspagevisual.h \ + ../../../../hsdomainmodel/inc/hspagetoucharea.h \ + ../../../../hsdomainmodel/inc/hswidgethost.h \ + ../../../../hsdomainmodel/inc/hswidgethostvisual.h \ + ../../../../hsdomainmodel/inc/hswidgettoucharea.h \ + ../../../../hsdomainmodel/inc/hsscene.h \ + ../../../../hsdomainmodel/inc/hscontentservice.h \ + ../../../../hsdomainmodel/inc/hsshortcutservice.h \ + ../../../../hsdomainmodel/inc/hsshortcutservice_p.h \ + ../../../../hsdomainmodel/inc/hswallpaper.h \ + ../../../../hsdomainmodel/inc/hsbackuprestoreobserver.h \ + ../../../../hsdomainmodel/inc/hsgui.h \ + ../../../../hsdomainmodel/inc/hsidlewidget.h \ + ../../../../hsdomainmodel/inc/hsdocumentloader.h \ + ../../../../hsdomainmodel/inc/hsconfiguration.h \ + ../../../../hsutils/inc/*.h \ + ../../../../hsutils/tsrc/t_hsutils/inc/mocksysteminfo.h + + + +#Source files +SOURCES += ./src/*.cpp \ + ../../src/*.cpp \ + ../../../../hsdomainmodel/src/hscontentservice.cpp \ + ../../../../hsdomainmodel/src/hsshortcutservice.cpp \ + ../../../../hsdomainmodel/src/hsconfiguration.cpp \ + ../../../../hsdomainmodel/src/hsidlewidget.cpp \ + ../../../../hsdomainmodel/src/hsdocumentloader.cpp \ + ../../../../hsdomainmodel/src/hspagevisual.cpp \ + ../../../../hsdomainmodel/src/hspagetoucharea.cpp \ + ../../../../hsdomainmodel/src/hswidgethostvisual.cpp \ + ../../../../hsdomainmodel/src/hswidgettoucharea.cpp \ + ../../../../hsdomainmodel/src/hswidgetpositioningonwidgetadd.cpp \ + ../../../../hsutils/src/hsimagegridwidget.cpp \ + ../../../../hsutils/src/hsmenuevent.cpp \ + ../../../../hsutils/src/hsmenueventfactory.cpp \ + ../../../../hsutils/src/hsmenueventtransition.cpp \ + ../../../../hsutils/src/hspageindicator.cpp \ + ../../../../hsutils/src/hspageindicatoritem.cpp \ + ../../../../hsutils/src/hstrashbinwidget.cpp \ + ../../../../hsutils/src/hswidgetpositioningonorientationchange.cpp \ + ../../../../hsutils/src/hstitleresolver.cpp \ + ../../../../hsutils/src/hsdeviceinfolistener.cpp \ + ../../../../hsutils/tsrc/t_hsutils/src/mocksysteminfo.cpp \ + ../../../../hsutils/src/hsspinnerdialog.cpp \ + ../../../../hsutils/src/hswidgetpositioningonwidgetmove.cpp \ + ../../../../hsutils/src/hssnapline.cpp + \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/t_hshomescreenstateplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/t_hshomescreenstateplugin.pro Mon Sep 20 10:19: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: +# + +TEMPLATE = app + +CONFIG(debug, debug|release) { + DESTDIR = ./debug +} else { + DESTDIR = ./release +} + +CONFIG += debug_and_release \ + console +CONFIG += hb mobility + +MOBILITY = serviceframework + +QT += testlib \ + xml \ + sql +HB += hbfeedback + +RESOURCES += t_hshomescreenstateplugin.qrc + +CONFIG(debug, debug|release) { + DESTDIR = ./debug +} else { + DESTDIR = ./release +} + +DEFINES += HOMESCREEN_TEST \ + HSDOMAINMODEL_TEST \ + HSUTILS_TEST \ + MENUSERVICE_TEST + +coverage:DEFINES += COVERAGE_MEASUREMENT + +DEPENDPATH += .\ + ./src \ + ./inc \ + ../../src \ + ../../inc + +INCLUDEPATH += .\ + ./inc \ + ../../inc \ + ../../../../../homescreenapp/inc \ + ../../../../hsutils/inc \ + ../../../../hsdomainmodel/inc \ + ../../../../hsapplication/inc \ + ../../../../serviceproviders/hsmenuserviceprovider/inc \ + ../../../../hsutils/tsrc/t_hsutils/inc + +exists(../../../../../../homescreensrv) { +INCLUDEPATH += ../../../../../../homescreensrv/homescreensrv_plat/contentstorage_api \ + ../../../../../../homescreensrv/contentstorage/caclient/inc \ + ../../../../../../homescreensrv/contentstorage/caclient/stub/inc +} else { +INCLUDEPATH += $${EPOCROOT}sf/mw/homescreensrv/homescreensrv_plat/contentstorage_api \ + $${EPOCROOT}sf/mw/homescreensrv/contentstorage/caclient/inc \ + $${EPOCROOT}sf/mw/homescreensrv/contentstorage/caclient/stub/inc +} + +symbian: { + CONFIG += symbian_test + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + SYMBIAN_PLATFORMS = WINSCW ARMV5 + TARGET.UID3 = 0x20022F60 + TARGET.CAPABILITY = CAP_APPLICATION AllFiles + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB + + LIBS+=-lxqservice -lxqserviceutil -labclient -lxqsettingsmanager + + MMP_RULES += SMPSAFE +} + +include(t_hshomescreenstateplugin.pri) + +win32:include(installs_win32.pri) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/t_hshomescreenstateplugin.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/t_hshomescreenstateplugin.qrc Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,6 @@ + + + foundicon.png + ../../../../hsdomainmodel/resource/controllayer.docml + + \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/wallpapers/default_landscape.png Binary file homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/wallpapers/default_landscape.png has changed diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/wallpapers/default_portrait.png Binary file homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/wallpapers/default_portrait.png has changed diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/tsrc.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,25 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs +SUBDIRS = t_hshomescreenstateplugin + +CONFIG += ordered + +symbian: { + CONFIG += symbian_test +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/hsmenuworkerstateplugin.pro --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/hsmenuworkerstateplugin.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/hsmenuworkerstateplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -44,6 +44,8 @@ LIBS += -lhal } for(docmlFile, docmlFiles): DOCML+=$$docmlFile + + MMP_RULES += SMPSAFE } RESOURCES += $$qrcFile diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddtohomescreenstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddtohomescreenstate.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddtohomescreenstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -19,6 +19,7 @@ #ifndef HSADDSHORTCUTSTATE_H #define HSADDSHORTCUTSTATE_H +#include #include #include @@ -33,7 +34,7 @@ class CaEntry; class CaNotifier; class HsContentService; - +class HsDialogController; class HsAddToHomeScreenState: public QState { @@ -53,7 +54,9 @@ void cleanUp(); - void messageWidgetCorruptedFinished(HbAction* finishedAction); + void openHomeScreen(); + + void removeWidget(); signals: @@ -78,10 +81,6 @@ QString mLibraryPath; int mEntryId; - - HbMessageBox *mCorruptedMessage; - - QAction *mConfirmAction; Hs::HsMenuMode mMenuMode; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdeletecollectionitemstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdeletecollectionitemstate.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdeletecollectionitemstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -25,7 +25,6 @@ class QAction; class HbAction; -class HbMessageBox; class HsShortcutService; class HsMenuService; @@ -46,9 +45,7 @@ void onEntry(QEvent *event); private slots: - - void deleteMessageFinished(HbAction* finishedAction); - + void removeApplicationFromCollection(); void cleanUp(); signals: @@ -64,11 +61,6 @@ int mItemId; int mCollectionId; - - HbMessageBox *mDeleteMessage; // deletes itself automatically on close - - QAction *mConfirmAction; // child for mDeleteMessage - }; #endif //HSDELETECOLLECTIONITEMSTATE_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdeletecollectionstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdeletecollectionstate.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdeletecollectionstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -46,7 +46,7 @@ private slots: - void deleteMessageFinished(HbAction* finishedAction); + void deleteCollection(); void cleanUp(); @@ -60,8 +60,6 @@ private: int mItemId; - HbMessageBox *mDeleteMessage; // deletes itself automatically on close - QAction *mConfirmAction; // child for mDeleteMessage }; #endif //HSDELETECOLLECTIONSTATE_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdialogcontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdialogcontroller.h Mon Sep 20 10:19: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 HS_DIALOG_CONTROLLER_H +#define HS_DIALOG_CONTROLLER_H + +#include +#include +#include + +class QAction; +class QString; +class HbDialog; + +#include "hsmenudialogfactory.h" +#include "hsmenuentryremovedhandler.h" + +class HsDialogController: public QObject +{ + Q_OBJECT +public: + HsDialogController( + const QString &message, + HsMenuDialogFactory::Options = + HsMenuDialogFactory::OkCancel); + + HsDialogController(HbDialog *dialog, int acceptActionIndex, + int rejectActionIndex); + + ~HsDialogController(); + + void openDialog(int entryId = 0); + + +signals: + void acceptActionTriggered(QAction* action); + void rejectActionTriggered(QAction* action); + void dialogCompleted(); + +public slots: + void dismissDialog(); + +private slots: + void onDialogFinished(HbAction* action); +private: + HbDialog *mDialog; + + const int mAcceptActionIndex; + const int mRejectActionIndex; +}; + +#endif diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsinstallationlogstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsinstallationlogstate.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsinstallationlogstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -23,8 +23,6 @@ #include "hsmenustates_global.h" HS_STATES_TEST_CLASS(MenuStatesTest) -class HbDialog; - class HsInstallationLogState: public QState { Q_OBJECT @@ -40,13 +38,6 @@ protected: void onEntry(QEvent *event); - void onExit(QEvent *event); - -private slots: - - void stateExited(); - void cleanUp(); - signals: void exit(); @@ -55,11 +46,6 @@ void construct(); void createInstallationLogDialog(); - -private: - - HbDialog* mInstalationLogDialog; - }; #endif //HSINSTALLATIONLOGSTATE_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hspreviewhswidgetstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hspreviewhswidgetstate.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hspreviewhswidgetstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -50,9 +50,9 @@ private slots: - void previewDialogFinished(HbAction* finishedAction); + void addToHomeScreen(); - void messageWidgetCorruptedFinished(HbAction* finishedAction); + void removeWidget(); void onEntry(QEvent *event); @@ -62,21 +62,12 @@ void exit(); private: - void showMessageWidgetCorrupted(); - HbDialog* buildPreviewDialog(const CaEntry& entry) const; private: - - HbDialog *mPreviewDialog; - QScopedPointer mEntryObserver; + int mEntryId; - - HbMessageBox *mCorruptedMessage; - - QAction *mConfirmRemovalAction; - QAction *mAddToHomescreenAction; QVariant mToken; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsuinstallfailedstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsuinstallfailedstate.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsuinstallfailedstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -43,12 +43,6 @@ protected: void onEntry(QEvent *event); - void onExit(QEvent *event); - -private slots: - - void stateExited(); - void cleanUp(); signals: @@ -58,9 +52,7 @@ void construct(); -private: - HbMessageBox *mBox; }; #endif /* HSUINSTALLFAILEDSTATE_H_ */ diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsuninstallitemstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsuninstallitemstate.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsuninstallitemstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -19,17 +19,21 @@ #define HSUNINSTALLITEMSTATE_H #include +#include #include "hsmenustates_global.h" HS_STATES_TEST_CLASS(MenuStatesTest) class QAction; +class HbDocumentLoader; +class HsDialogController; class HbAction; class HbMessageBox; class HsShortcutService; class HsMenuService; class HbDialog; class CaNotifier; +class CaEntry; class HsUninstallItemState: public QState { @@ -38,11 +42,6 @@ HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) public: - enum UninstallDialogType { - UninstallDialogDefinition02 = 1, - UninstallDialogDefinition03, - UninstallDialogDefinition04 - }; HsUninstallItemState(QState *parent = 0); @@ -54,10 +53,10 @@ private slots: - void uninstallMessageFinished(HbAction* finishedAction); + void uninstallItem(); void cleanUp(); - + public slots: void uninstallFailed(int error); @@ -69,23 +68,25 @@ private: void construct(); - + bool getApplicationsNames(QString &componentName, QStringList &applicationsNames, QString &confirmationMessage); - + void createSimpleUninstallMessage(bool isJava=false); void createUninstallJavaMessage(); + HsDialogController *prepareDialog(HbDialog *dialog); + QString loadProperSection(QStringList &applicationsNames, + QString &detailsMessage, + HbDocumentLoader &loader); + void prepareApplicationListLabel( QStringList & applicationsNames, + HbDocumentLoader & loader); + void prepareDialogLabel( + QString &componentName, HbDocumentLoader &loader); private: - int mItemId; - - HbMessageBox *mUninstallMessage; // deletes itself automatically on close - HbDialog *mUninstallJavaMessage; - UninstallDialogType mDialogType; - - QAction *mConfirmAction; // child for mConfirmMessage + QSharedPointer mEntry; }; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsviewappdetailsstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsviewappdetailsstate.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsviewappdetailsstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -28,7 +28,6 @@ class HbListWidget; class HsMenuItemModel; -class HbDialog; class CaNotifier; class HbDocumentLoader; @@ -48,11 +47,6 @@ protected: void onEntry(QEvent *event); - void onExit(QEvent *event); - -private slots: - - void stateExited(); signals: void exit(); @@ -63,10 +57,6 @@ void setFieldPresentation(QString key, CaSoftwareRegistry::DetailMap &detailMap, HbDocumentLoader &loader); - -private: - - HbDialog *mDialog; }; #endif /* HSVIEWAPPDETAILSSTATE_H_ */ diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsviewappsettingsstate.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsviewappsettingsstate.h Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsviewappsettingsstate.h Mon Sep 20 10:19:07 2010 +0300 @@ -44,7 +44,7 @@ virtual ~HsViewAppSettingsState(); signals: - void initialize(const QString &aUid); + void initialize(const QString &aUid, const QString &aAppName); void exit(); protected: diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsappchecklist.docml --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsappchecklist.docml Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsappchecklist.docml Mon Sep 20 10:19:07 2010 +0300 @@ -13,7 +13,6 @@ - diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsarrangedialog.docml --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsarrangedialog.docml Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsarrangedialog.docml Mon Sep 20 10:19:07 2010 +0300 @@ -8,7 +8,6 @@ - diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hscollectionslistdialog.docml --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hscollectionslistdialog.docml Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hscollectionslistdialog.docml Mon Sep 20 10:19:07 2010 +0300 @@ -10,7 +10,6 @@ - diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsinstallationlogdialog.docml --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsinstallationlogdialog.docml Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsinstallationlogdialog.docml Mon Sep 20 10:19:07 2010 +0300 @@ -9,7 +9,6 @@ - diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddtohomescreenstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddtohomescreenstate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddtohomescreenstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -23,8 +23,7 @@ #include #include #include -#include "hsmenudialogfactory.h" -#include "hsmenuentryremovedhandler.h" +#include "hsdialogcontroller.h" #include "hsaddtohomescreenstate.h" #include "hsmenuevent.h" @@ -55,8 +54,7 @@ \retval void */ HsAddToHomeScreenState::HsAddToHomeScreenState(QState *parent) : - QState(parent), - mCorruptedMessage(NULL), mConfirmAction(NULL), + QState(parent), mMenuMode(Hs::NormalHsMenuMode) { setObjectName("/AddToHomeScreenState"); @@ -69,11 +67,14 @@ } /*! - Destructor. Empty one. + Destructor. */ HsAddToHomeScreenState::~HsAddToHomeScreenState() { - cleanUp(); + QT_TRY { + emit exit(); + } QT_CATCH (...) { + } } /*! @@ -124,10 +125,7 @@ /*! Adds a widget to active page of home screen \param contentService: service for adding widgets - \param library: widget library path and file name \param uri: widget uri - \param entryId: widget entry id (ignored) - \param activePage: active page of home screen \retval true if successful */ bool HsAddToHomeScreenState::addWidget(HsContentService &contentService, @@ -141,11 +139,7 @@ if (!success) { showMessageWidgetCorrupted(); } else { - emit exit(); - if (mMenuMode == Hs::AddHsMenuMode) { - machine()->postEvent( - HsMenuEventFactory::createOpenHomeScreenEvent()); - } + openHomeScreen(); } logActionResult("Adding widget", mEntryId, success); HSMENUTEST_FUNC_EXIT("HsAddToHomeScreenState::addWidget"); @@ -153,7 +147,7 @@ } /*! - Shows message about corrupted widget library. Deletes widget eventually + Shows message about corrupted widget library. Deletes widget eventually. \param itemId entryId of widget (needed to delete it) \retval void */ @@ -161,62 +155,78 @@ { HSMENUTEST_FUNC_ENTRY("HsCollectionState::showMessageWidgetCorrupted"); - mCorruptedMessage = HsMenuDialogFactory().create( - hbTrId("txt_applib_dialog_file_corrupted_unable_to_use_wi")); - mConfirmAction = mCorruptedMessage->actions().value(0); + QScopedPointer dialogController( + new HsDialogController( + hbTrId( + "txt_applib_dialog_file_corrupted_unable_to_use_wi"))); + + connect(dialogController.data(), + SIGNAL(acceptActionTriggered(QAction*)), + this, + SLOT(removeWidget())); + + connect(dialogController.data(), + SIGNAL(dialogCompleted()), + this, + SLOT(openHomeScreen())); + + // ensure dialog is dismissed on app key pressed + connect(this, SIGNAL(exited()), + dialogController.data(), + SLOT(dismissDialog())); + + dialogController.take()->openDialog( + mEntryId + ); - QScopedPointer entryObserver( - new HsMenuEntryRemovedHandler(mEntryId, - mCorruptedMessage, SLOT(close()))); - - entryObserver.take()->setParent(mCorruptedMessage); - - mCorruptedMessage->open(this, SLOT(messageWidgetCorruptedFinished(HbAction*))); - HSMENUTEST_FUNC_EXIT("HsCollectionState::showMessageWidgetCorrupted"); } /*! - Slot launched on dismissing the corrupted widget error note + Exits the state. When in Add Mode sends event requesting back step to + Home Screen. \retval void */ -void HsAddToHomeScreenState::messageWidgetCorruptedFinished - (HbAction* finishedAction) +void HsAddToHomeScreenState::openHomeScreen() { - if (static_cast(finishedAction) == mConfirmAction) { - HsMenuService::executeAction(mEntryId, Hs::removeActionIdentifier); - } emit exit(); if (mMenuMode == Hs::AddHsMenuMode) { machine()->postEvent( HsMenuEventFactory::createOpenHomeScreenEvent()); } - mConfirmAction = NULL; } /*! + Slot. Removes entry requested that was subject of + current 'add to homescreen' action. + \retval void + */ +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT +void HsAddToHomeScreenState::removeWidget() +{ + HsMenuService::executeAction(mEntryId, Hs::removeActionIdentifier); +} +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT + +/*! Slot launched after state has exited and in destructor. \retval void */ void HsAddToHomeScreenState::cleanUp() { - // Close popups if App key was pressed - if (mCorruptedMessage != NULL) { - mCorruptedMessage->close(); - mCorruptedMessage = NULL; - } - mToken = NULL; } /*! Adds a shortcut to active page of home screen - \param shortcutService: service for adding shortcuts - \param entryId: menu entry id - \param activePage: active page of home screen - \retval true if successful + \param contentService service for adding shortcuts. + \retval true if successful. */ bool HsAddToHomeScreenState::addShortcut(HsContentService &contentService) { @@ -234,10 +244,9 @@ } /*! - Adds a tapplication to active page of home screen - \param shortcutService: service for adding shortcuts - \param entryId: menu entry id - \param data: data from event + Adds a tapplication to active page of Home Screen. + \param contentService Service for adding shortcuts. + \param entry Entry being added to Home Screen. \retval true if successful */ bool HsAddToHomeScreenState::addApplication(HsContentService &contentService, @@ -270,11 +279,8 @@ } else { success = addShortcut(contentService); } - emit exit(); - if (mMenuMode == Hs::AddHsMenuMode) { - machine()->postEvent( - HsMenuEventFactory::createOpenHomeScreenEvent()); - } + openHomeScreen(); + return success; } diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamedialog.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamedialog.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamedialog.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -135,10 +135,31 @@ unsigned int numToAppend(1); - while (mOtherCollectionsNames.contains(newName)) { - newName = hbTrId("txt_applib_dialog_entry_collectionl1").arg( + bool defaultCollection = false; + if (newName == hbTrId("txt_applib_dialog_entry_collection")) { + defaultCollection = true; + } + if (defaultCollection) { + while (mOtherCollectionsNames.contains(newName)) { + newName = hbTrId("txt_applib_dialog_entry_collectionl1").arg( numToAppend); - numToAppend++; + numToAppend++; + } + } + else { + QString textMap = hbTrId( + "txt_applib_dialog_collection_name_entry_1_l1"); + // TODO: Temporary workaround. + // The "if" instruction below can be removed when + // a text map "txt_applib_dialog_collection_name_entry_1_l1" + // is available in the platform. + if (textMap == "txt_applib_dialog_collection_name_entry_1_l1") { + textMap = "%2 (%L1)"; + } + while (mOtherCollectionsNames.contains(newName)) { + newName = textMap.arg(numToAppend).arg(name); + numToAppend++; + } } HSMENUTEST_FUNC_EXIT("HsInputDialog::newName"); diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionitemstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionitemstate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionitemstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -21,7 +21,7 @@ #include #include -#include "hsmenudialogfactory.h" +#include "hsdialogcontroller.h" #include "hsdeletecollectionitemstate.h" #include "hsmenuevent.h" @@ -39,9 +39,7 @@ HsDeleteCollectionItemState::HsDeleteCollectionItemState(QState *parent) : QState(parent), mItemId(0), - mCollectionId(0), - mDeleteMessage(NULL), - mConfirmAction(NULL) + mCollectionId(0) { construct(); } @@ -51,7 +49,10 @@ */ HsDeleteCollectionItemState::~HsDeleteCollectionItemState() { - cleanUp(); // in case of throw + QT_TRY { + emit exit(); + } QT_CATCH (...) { + } } /*! @@ -83,30 +84,49 @@ QString message; message.append( - HbParameterLengthLimiter("txt_applib_dialog_remove_1_from_collection").arg( - HsMenuService::getName(mItemId))); + HbParameterLengthLimiter( + "txt_applib_dialog_remove_1_from_collection").arg( + HsMenuService::getName(mItemId))); + + QScopedPointer dialogController( + new HsDialogController(message)); + + connect(dialogController.data(), + SIGNAL(acceptActionTriggered(QAction*)), + this, + SLOT(removeApplicationFromCollection())); - // create and show message box - mDeleteMessage = HsMenuDialogFactory().create(message); - mConfirmAction = mDeleteMessage->actions().value(0); - mDeleteMessage->open(this, SLOT(deleteMessageFinished(HbAction*))); + connect(dialogController.data(), + SIGNAL(dialogCompleted()), + this, + SIGNAL(exit())); + + // ensure dialog is dismissed on app key pressed + connect(this, SIGNAL(exited()), + dialogController.data(), + SLOT(dismissDialog())); + + dialogController.take()->openDialog(); HSMENUTEST_FUNC_EXIT("HsDeleteCollectionItemState::onEntry"); } + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT /*! - Action after closed confirmation dialog. - \param finishedAction chosen action. + Slot. Removes application from collection, both specified by event + passed to the state on entry. \retval void */ -void HsDeleteCollectionItemState::deleteMessageFinished(HbAction* finishedAction) +void HsDeleteCollectionItemState::removeApplicationFromCollection() { - if (static_cast(finishedAction) == mConfirmAction) { - HsMenuService::removeApplicationFromCollection(mItemId, mCollectionId); - } - emit exit(); - mConfirmAction = NULL; + HsMenuService::removeApplicationFromCollection(mItemId, mCollectionId); } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT /*! Slot launched after state has exited and in destructor. @@ -114,14 +134,6 @@ */ void HsDeleteCollectionItemState::cleanUp() { - // Close messagebox if App key was pressed - if (mDeleteMessage) { - disconnect(mDeleteMessage, SIGNAL(finished(HbAction*)), this, SLOT(deleteMessageFinished(HbAction*))); - mDeleteMessage->close(); - mDeleteMessage = NULL; - } - - mConfirmAction = NULL; mItemId = 0; mCollectionId = 0; } diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionstate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -24,7 +24,7 @@ #include #include "hsdeletecollectionstate.h" -#include "hsmenudialogfactory.h" +#include "hsdialogcontroller.h" #include "hsmenuevent.h" /*! @@ -40,9 +40,7 @@ */ HsDeleteCollectionState::HsDeleteCollectionState(QState *parent) : QState(parent), - mItemId(0), - mDeleteMessage(NULL), - mConfirmAction(NULL) + mItemId(0) { construct(); } @@ -52,7 +50,10 @@ */ HsDeleteCollectionState::~HsDeleteCollectionState() { - cleanUp(); // in case of throw + QT_TRY { + emit exit(); + } QT_CATCH (...) { + } } /*! @@ -91,41 +92,46 @@ HsMenuService::getName(mItemId))); } - // create and show message box - mDeleteMessage = HsMenuDialogFactory().create(message); - mConfirmAction = mDeleteMessage->actions().value(0); - mDeleteMessage->open(this, SLOT(deleteMessageFinished(HbAction*))); + QScopedPointer dialogController( + new HsDialogController(message)); + + connect(dialogController.data(), + SIGNAL(acceptActionTriggered(QAction*)), + this, + SLOT(deleteCollection())); + + connect(dialogController.data(), + SIGNAL(dialogCompleted()), + this, + SIGNAL(exit())); + + // ensure dialog is dismissed on app key pressed + connect(this, SIGNAL(exited()), + dialogController.data(), + SLOT(dismissDialog())); + + dialogController.take()->openDialog(); HSMENUTEST_FUNC_EXIT("HsDeleteCollectionState::onEntry"); } - -// --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- -// -void HsDeleteCollectionState::deleteMessageFinished(HbAction* finishedAction) +/*! + Slot. Removes collection specified by event passed on entry to the state. + \retval void + */ +void HsDeleteCollectionState::deleteCollection() { - if (static_cast(finishedAction) == mConfirmAction) { - HsMenuService::removeCollection(mItemId); - machine()->postEvent( + HsMenuService::removeCollection(mItemId); + machine()->postEvent( HsMenuEventFactory::createCollectionDeletedEvent()); - } - emit exit(); - mConfirmAction = NULL; } + /*! Slot launched after state has exited and in destructor. \retval void */ void HsDeleteCollectionState::cleanUp() { - // Close messagebox if App key was pressed - if (mDeleteMessage) { - mDeleteMessage->close(); - mDeleteMessage = NULL; - } - - mConfirmAction = NULL; mItemId = 0; } diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdialogcontroller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdialogcontroller.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,150 @@ +/* + * 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: Dialog controller + * + */ + +#include +#include +#include + +#include "hsdialogcontroller.h" + +/*! + \class HsDialogController + \ingroup group_hsworkerstateplugin + \brief Dialog utility. + + Manages dialog lifetime depending on entry removal or + signal arrival, forwards dialog originating actions to user specified callbacks. + */ + +/*! + \fn void acceptActionTriggered(QAction* action) + \param action Pointer to action which triggered the signal. + Emitted when controlled dialog closed with \a accept action. +*/ + + +/*! + \fn rejectActionTriggered(QAction* action) + \param action Pointer to action which triggered the signal. + Emitted when controlled dialog is closed with \a reject action. +*/ + +/*! + \fn void dialogCompleted() + Emitted whenever controlled dialog is closed. +*/ + +/*! + \param message Dialog's message. + \param options Dialog type indicator. + \see HsMenuDialogFactory + Creates dialog controller instance with prediefinded dialog type. + */ +HsDialogController::HsDialogController( + const QString &message, + HsMenuDialogFactory::Options options): + mDialog(HsMenuDialogFactory().create(message, options)), + mAcceptActionIndex(HsMenuDialogFactory::acceptActionIndex()), + mRejectActionIndex(HsMenuDialogFactory::rejectActionIndex()) +{ +} + +/*! + \param dialog Instance of the dialog to be displayed. + Ownership of the dialog is taken by this object. + \param acceptActionIndex Index of an \a accept action in a dialog action list + Actions indices are 0 based. (\see QGraphicsWidget). + \param rejectActionIndex Index of a \a reject action in a dialog action list. + Actions indices are 0 based.(\see QGraphicsWidget). + Creates dialog controller instance with custom dialog type. + + */ +HsDialogController::HsDialogController(HbDialog *dialog, + int acceptActionIndex, + int rejectActionIndex): + mDialog(dialog), + mAcceptActionIndex(acceptActionIndex), + mRejectActionIndex(rejectActionIndex) +{ + Q_ASSERT(mDialog != NULL); + mDialog->setAttribute(Qt::WA_DeleteOnClose); +} + +/*! + Destroys controlled dialog. + */ +HsDialogController::~HsDialogController() +{ + QT_TRY { + mDialog->deleteLater(); + } QT_CATCH (...) { + } +} + + +/*! + \param entryId Id of the entry which removal will close the dialog. + Opens dialog. + */ +void HsDialogController::openDialog(int entryId) +{ + HsMenuEntryRemovedHandler *entryRemovedHandler = + new HsMenuEntryRemovedHandler(entryId, mDialog, SLOT(close())); + + QT_TRY { + // this object should be deleted when controlled dialog is deleted + setParent(mDialog); + } QT_CATCH (const std::bad_alloc &) { + delete entryRemovedHandler; + QT_RETHROW; + } + + mDialog->open(this, SLOT(onDialogFinished(HbAction*))); +} + +/*! + This slot closes dialog. + */ +void HsDialogController::dismissDialog() +{ + mDialog->close(); +} + +/*! + \param action Identifies dialog's action. + Sends signals appropriate for \a action. Irrespective of the action, + always sends \a dialogCompleted signal. + */ +void HsDialogController::onDialogFinished(HbAction* action) +{ + mDialog->disconnect(); + + const int actionIndex = mDialog->actions().indexOf(action); + + if (actionIndex == mAcceptActionIndex) + { + emit acceptActionTriggered(action); + } else if (actionIndex == mRejectActionIndex) { + emit rejectActionTriggered(action); + } + + emit dialogCompleted(); + + mDialog->disconnect(); +} + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsinstallationlogstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsinstallationlogstate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsinstallationlogstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -23,7 +23,7 @@ #include #include "hsinstallationlogstate.h" - +#include "hsdialogcontroller.h" /*! \class HsInstallationLogState \ingroup group_hsworkerstateplugin @@ -36,8 +36,7 @@ \param parent Parent state. */ HsInstallationLogState::HsInstallationLogState(QState *parent) : - QState(parent), - mInstalationLogDialog(NULL) + QState(parent) { construct(); } @@ -47,7 +46,10 @@ */ HsInstallationLogState::~HsInstallationLogState() { - cleanUp(); // in case of throw + QT_TRY { + emit exit(); + } QT_CATCH (...) { + } } /*! @@ -59,7 +61,6 @@ if (this->parent()) { setObjectName(this->parent()->objectName() + objectName()); } - connect(this, SIGNAL(exited()), SLOT(cleanUp())); } /*! @@ -77,13 +78,6 @@ HSMENUTEST_FUNC_EXIT("HsInstallationLogState::onEntry"); } -/*! - Invoked on exiting state - */ -void HsInstallationLogState::onExit(QEvent *event) -{ - QState::onExit(event); -} /*! Create installation log dialog. @@ -100,13 +94,13 @@ Q_ASSERT_X(loadStatusOk, HS_INSTALLATION_LOG_DIALOG_LAYOUT, "Error while loading docml file."); - mInstalationLogDialog = qobject_cast( - loader.findWidget(HS_INSTALLATION_LOG_DIALOG_NAME)); + QScopedPointer dialog(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); + if (!dialog.isNull()) { + dialog->actions()[0]->setParent(dialog.data()); + dialog->setTimeout(HbPopup::NoTimeout); + dialog->setAttribute(Qt::WA_DeleteOnClose, true); HbLabel* logList; QString applicationsList; @@ -143,27 +137,26 @@ applicationsList.chop(2 * newLine.size()); logList->setPlainText(applicationsList); - - mInstalationLogDialog->open(this, SLOT(stateExited())); + + + QScopedPointer dialogController( + new HsDialogController(dialog.take(), + HsMenuDialogFactory::acceptActionIndex(), + HsMenuDialogFactory::rejectActionIndex())); + + connect(dialogController.data(), + SIGNAL(dialogCompleted()), + this, + SIGNAL(exit())); + + // ensure dialog is dismissed on app key pressed + connect(this, SIGNAL(exited()), + dialogController.data(), + SLOT(dismissDialog())); + + dialogController.take()->openDialog(); } } -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 e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hspreviewhswidgetstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hspreviewhswidgetstate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hspreviewhswidgetstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -34,7 +34,7 @@ #include "hswidgethost.h" #include "hspreviewhswidgetstate.h" #include "hsmenuevent.h" -#include "hsmenudialogfactory.h" +#include "hsdialogcontroller.h" #include "hsapp_defs.h" #include "hsscene.h" #include "hspage.h" @@ -63,11 +63,7 @@ */ HsPreviewHSWidgetState::HsPreviewHSWidgetState(QState *parent) : QState(parent), - mPreviewDialog(0), mEntryId(0), - mCorruptedMessage(0), - mConfirmRemovalAction(0), - mAddToHomescreenAction(0), mToken(), mUri() { @@ -83,7 +79,10 @@ */ HsPreviewHSWidgetState::~HsPreviewHSWidgetState() { - cleanUp(); // in case of throw + QT_TRY { + emit exit(); + } QT_CATCH (...) { + } } /*! @@ -112,16 +111,33 @@ QSharedPointer entry = CaService::instance()->getEntry(mEntryId); mUri = entry->attribute(Hs::widgetUriAttributeName); - mPreviewDialog = buildPreviewDialog(*entry); - mAddToHomescreenAction = mPreviewDialog->actions().value(0); + QScopedPointer previewDialog(buildPreviewDialog(*entry)); - if (mPreviewDialog != NULL) { + if (!previewDialog.isNull()) { // Launch popup asyncronously - - mEntryObserver.reset( - new HsMenuEntryRemovedHandler(mEntryId, this, SIGNAL(exit()))); - - mPreviewDialog->open(this, SLOT(previewDialogFinished(HbAction*))); + + + QScopedPointer dialogController( + new HsDialogController(previewDialog.take(), + HsMenuDialogFactory::acceptActionIndex(), + HsMenuDialogFactory::rejectActionIndex())); + + connect(dialogController.data(), + SIGNAL(acceptActionTriggered(QAction*)), + this, + SLOT(addToHomeScreen())); + + connect(dialogController.data(), + SIGNAL(dialogCompleted()), + this, + SIGNAL(exit())); + + // ensure dialog is dismissed on app key pressed + connect(this, SIGNAL(exited()), + dialogController.data(), + SLOT(dismissDialog())); + + dialogController.take()->openDialog(mEntryId); } HSMENUTEST_FUNC_EXIT("HsPreviewHSWidgetState::onEntry"); @@ -132,52 +148,31 @@ \retval void */ void HsPreviewHSWidgetState::cleanUp() -{ - if (mPreviewDialog != NULL) { - mPreviewDialog->disconnect(); - mPreviewDialog ->close(); - mPreviewDialog = NULL; - } - - if (mCorruptedMessage != NULL) { - mCorruptedMessage->disconnect(); - mCorruptedMessage->close(); - mCorruptedMessage = NULL; - } - +{ mToken = NULL; } /*! - Slot launched on dismissing the preview dialog + Slot. Adds the entry controlled by the state to Home Screen. \retval void */ -void HsPreviewHSWidgetState::previewDialogFinished(HbAction* finishedAction) +void HsPreviewHSWidgetState::addToHomeScreen() { - mPreviewDialog = NULL; + QVariantHash widgetData; + widgetData[Hs::uri] = mUri; + widgetData[Hs::homescreenData] = mToken; - if (finishedAction == mAddToHomescreenAction) { + bool success = HsContentService::instance()->createWidget(widgetData); - QVariantHash widgetData; - widgetData[Hs::uri] = mUri; - widgetData[Hs::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 { - emit exit(); + if (success) { + HbNotificationDialog *notificationDialog = new HbNotificationDialog(); + notificationDialog->setAttribute(Qt::WA_DeleteOnClose); + notificationDialog->setTitle(hbTrId("txt_applib_dpophead_added_to_homescreen")); + notificationDialog->show(); } - mAddToHomescreenAction = 0; + else { + showMessageWidgetCorrupted(); + } } /*! @@ -188,31 +183,46 @@ { HSMENUTEST_FUNC_ENTRY("HsCollectionState::showMessageWidgetCorrupted"); - mCorruptedMessage = HsMenuDialogFactory().create( - hbTrId("txt_applib_dialog_file_corrupted_unable_to_use_wi")); + QScopedPointer dialogController( + new HsDialogController( + hbTrId( + "txt_applib_dialog_file_corrupted_unable_to_use_wi"))); + + connect(dialogController.data(), + SIGNAL(acceptActionTriggered(QAction*)), + this, + SLOT(removeWidget())); - mConfirmRemovalAction = mCorruptedMessage->actions().value(0); - mCorruptedMessage - ->open(this, SLOT(messageWidgetCorruptedFinished(HbAction*))); + connect(dialogController.data(), + SIGNAL(dialogCompleted()), + this, + SIGNAL(exit())); + + // ensure dialog is dismissed on app key pressed + connect(this, SIGNAL(exited()), + dialogController.data(), + SLOT(dismissDialog())); + + dialogController.take()->openDialog(mEntryId); HSMENUTEST_FUNC_EXIT("HsCollectionState::showMessageWidgetCorrupted"); } /*! - Slot launched on dismissing the corrupted widget error note + Slot. Removes the entry controlled by the state from App Library. \retval void */ -void HsPreviewHSWidgetState::messageWidgetCorruptedFinished(HbAction* finishedAction) +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT + +void HsPreviewHSWidgetState::removeWidget() { - mCorruptedMessage = NULL; - - if (static_cast(finishedAction) == mConfirmRemovalAction) { - HsMenuService::executeAction(mEntryId, Hs::removeActionIdentifier); - } - emit exit(); - - mConfirmRemovalAction = NULL; + HsMenuService::executeAction(mEntryId, Hs::removeActionIdentifier); } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT /*! \param entry The entry which is to be presented by the preview dialog. diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuinstallfailedstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuinstallfailedstate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuinstallfailedstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -19,6 +19,7 @@ #include "hsuinstallfailedstate.h" #include "hsmenuevent.h" #include "hsapp_defs.h" +#include "hsdialogcontroller.h" const int installerBusyError = 4; @@ -27,7 +28,7 @@ /param parent Parent state. */ HsUninstallFailedState::HsUninstallFailedState(QState *parent) : - QState(parent), mBox(0) + QState(parent) { construct(); } @@ -37,7 +38,10 @@ */ HsUninstallFailedState::~HsUninstallFailedState() { - cleanUp(); // in case of throw + QT_TRY { + emit exit(); + } QT_CATCH (...) { + } } /*! @@ -49,8 +53,6 @@ if (this->parent()) { setObjectName(this->parent()->objectName() + objectName()); } - - connect(this, SIGNAL(exited()), SLOT(cleanUp())); } @@ -59,54 +61,42 @@ \param event entry event. */ void HsUninstallFailedState::onEntry(QEvent *event) -{ - - +{ QState::onEntry(event); HsMenuEvent *menuEvent = static_cast(event); QVariantMap data = menuEvent->data(); int error = data.value(Hs::uninstallError).toInt(); + QScopedPointer dialog; if (error == installerBusyError) { // Installer is in use - mBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); - mBox->setText(hbTrId("txt_applib_info_installer_is_currently_busy")); + dialog.reset(new HbMessageBox(HbMessageBox::MessageTypeInformation)); + dialog->setText(hbTrId("txt_applib_info_installer_is_currently_busy")); } else { // other errors - mBox = new HbMessageBox(HbMessageBox::MessageTypeWarning); - mBox->setText(hbTrId("txt_applib_info_uninstallation_failed")); + dialog.reset(new HbMessageBox(HbMessageBox::MessageTypeWarning)); + dialog->setText(hbTrId("txt_applib_info_uninstallation_failed")); } - mBox->setAttribute(Qt::WA_DeleteOnClose); - mBox->setStandardButtons(HbMessageBox::Close); - mBox->open(this, SLOT(stateExited())); + + dialog->setStandardButtons(HbMessageBox::Close); + + QScopedPointer dialogController( + new HsDialogController(dialog.take(), + HsMenuDialogFactory::acceptActionIndex(), + HsMenuDialogFactory::rejectActionIndex())); + + connect(dialogController.data(), + SIGNAL(dialogCompleted()), + this, + SIGNAL(exit())); + + // ensure dialog is dismissed on app key pressed + connect(this, SIGNAL(exited()), + dialogController.data(), + SLOT(dismissDialog())); + + dialogController.take()->openDialog(); } -/*! - Invoked on exiting state - */ -void HsUninstallFailedState::onExit(QEvent *event) -{ - QState::onExit(event); -} -/*! - State exited. - */ -void HsUninstallFailedState::stateExited() -{ - mBox = NULL; - emit exit(); -} -/*! - Slot launched after state has exited and in destructor. - \retval void - */ -void HsUninstallFailedState::cleanUp() -{ - // Close popups if App key was pressed - if (mBox) { - mBox->close(); - mBox = NULL; - } -} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuninstallitemstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuninstallitemstate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuninstallitemstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -15,28 +15,35 @@ * */ -#include -#include -#include -#include + +#include +#include +#include +#include + +#include +#include #include #include #include #include -#include -#include -#include -#include +#include "hsmenuservice.h" +#include "hsshortcutservice.h" +#include "hsuninstallitemstate.h" +#include "hsmenuevent.h" +#include "hsmenudialogfactory.h" +#include "hsdialogcontroller.h" +#include "hsmenueventfactory.h" + #include #include #include -#include "hsuninstallitemstate.h" -#include "hsmenuevent.h" -#include "hsmenudialogfactory.h" -#include "hsmenuentryremovedhandler.h" -#include "hsmenueventfactory.h" +const char definition02 [] = "uninstallDialogDefinition02"; +const char definition03 [] = "uninstallDialogDefinition03"; +const char definition04 [] = "uninstallDialogDefinition04"; + /*! \class HsUninstallItemState @@ -51,10 +58,7 @@ */ HsUninstallItemState::HsUninstallItemState(QState *parent) : QState(parent), - mItemId(0), - mUninstallMessage(NULL), - mUninstallJavaMessage(NULL), - mConfirmAction(NULL) + mEntry(NULL) { construct(); } @@ -64,7 +68,11 @@ */ HsUninstallItemState::~HsUninstallItemState() { - cleanUp(); // in case of throw + QT_TRY { + emit exit(); + } QT_CATCH (...) { + qDebug("Exception thrown"); + } } /*! @@ -77,7 +85,6 @@ setObjectName(this->parent()->objectName() + objectName()); } connect(this, SIGNAL(exited()), SLOT(cleanUp())); - } /*! @@ -87,42 +94,43 @@ void HsUninstallItemState::onEntry(QEvent *event) { HSMENUTEST_FUNC_ENTRY("HsUninstallItemState::onEntry"); + qDebug("HsUninstallItemState::onEntry()"); + QState::onEntry(event); - qDebug("HsUninstallItemState::onEntry()"); + HsMenuEvent *menuEvent = static_cast(event); - QVariantMap data = menuEvent->data(); + int itemId = menuEvent->data().value(Hs::itemIdKey).toInt(); + mEntry = CaService::instance()->getEntry(itemId); - mItemId = data.value(Hs::itemIdKey).toInt(); - QSharedPointer entry = CaService::instance()->getEntry(mItemId); - QString appType = entry->attribute(Hs::swTypeKey); - if (!appType.compare(Hs::javaSwType)) { - // java - createUninstallJavaMessage(); - } else { - // other - createSimpleUninstallMessage(); + if (mEntry) { + QString appType = mEntry->attribute(Hs::swTypeKey); + + if (!appType.compare(Hs::javaSwType)) { + // java + createUninstallJavaMessage(); + } else { + // other + createSimpleUninstallMessage(); + } } - HSMENUTEST_FUNC_EXIT("HsUninstallItemState::onEntry"); } /*! - Action after closed confirmation dialog. - \param finishedAction chosen action. + Slots. Uninstalls item controlled by the state. \retval void */ -void HsUninstallItemState::uninstallMessageFinished(HbAction* finishedAction) +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT +void HsUninstallItemState::uninstallItem() { - if (static_cast(finishedAction) == mConfirmAction) { - - HsMenuService::executeAction(mItemId, Hs::removeActionIdentifier, - this, SLOT(uninstallFailed(int))); - } - mConfirmAction = NULL; - mUninstallMessage = NULL; - mUninstallJavaMessage = NULL; - emit exit(); + HsMenuService::executeAction(*mEntry.data(), Hs::removeActionIdentifier, + this, SLOT(uninstallFailed(int))); } +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT /*! Return information about a component: component name, a list of names @@ -139,31 +147,26 @@ componentName.clear(); applicationsNames.clear(); confirmationMessage.clear(); - + QSharedPointer service = CaService::instance(); - QSharedPointer entry = service->getEntry(mItemId); - const int componentId = - entry->attribute(Hs::componentIdAttributeName).toInt(); - - QSharedPointer softwareRegistry = - CaSoftwareRegistry::create(); + const int componentId = mEntry->attribute( + Hs::componentIdAttributeName).toInt(); + QStringList appUids; - bool retval = softwareRegistry->getUninstallDetails(componentId, - componentName, - appUids, - confirmationMessage); + bool retval = CaSoftwareRegistry::create()->getUninstallDetails( + componentId, componentName, appUids, confirmationMessage); if (retval) { CaQuery query; foreach (QString uid, appUids) { query.setAttribute(Hs::applicationUidEntryKey, uid); QList< QSharedPointer > entries = - service->getEntries(query); + service->getEntries(query); if (entries.length() > 0) { applicationsNames << entries[0]->text(); } } - if (applicationsNames.length()==1 - && applicationsNames[0]==componentName) { + if (applicationsNames.length() == 1 + && applicationsNames[0] == componentName) { applicationsNames.clear(); } } @@ -177,19 +180,7 @@ */ void HsUninstallItemState::cleanUp() { - // Close messagebox if App key was pressed - if (mUninstallMessage != NULL) { - mUninstallMessage->close(); - mUninstallMessage = NULL; - } - - if (mUninstallJavaMessage != NULL) { - mUninstallJavaMessage->close(); - mUninstallJavaMessage = NULL; - } - - mConfirmAction = NULL; - mItemId = 0; + mEntry.clear(); } #ifdef COVERAGE_MEASUREMENT @@ -216,35 +207,45 @@ void HsUninstallItemState::createSimpleUninstallMessage(bool isJava) { CaQuery parentsQuery; - parentsQuery.setChildId(mItemId); + parentsQuery.setChildId(mEntry->id()); parentsQuery.setEntryTypeNames(QStringList(Hs::collectionTypeName)); - QList parentsIds = CaService::instance()->getEntryIds( - parentsQuery); + QList parentsIds = CaService::instance()->getEntryIds(parentsQuery); QString message; - if (HsShortcutService::instance()->isItemShortcutWidget(mItemId) || (parentsIds.count() > 0)) { - message.append( - HbParameterLengthLimiter("txt_applib_dialog_uninstalls_1_and_deletes_all_sh").arg( - HsMenuService::getName(mItemId))); + if (HsShortcutService::instance()->isItemShortcutWidget(mEntry->id()) + || (parentsIds.count() > 0)) { + message.append(HbParameterLengthLimiter( + "txt_applib_dialog_uninstalls_1_and_deletes_all_sh").arg( + mEntry->text())); } else { - message.append( - HbParameterLengthLimiter("txt_applib_dialog_1_will_be_removed_from_phone_c").arg( - HsMenuService::getName(mItemId))); + message.append(HbParameterLengthLimiter( + "txt_applib_dialog_1_will_be_removed_from_phone_c").arg( + mEntry->text())); } // create and show message box - mUninstallMessage = HsMenuDialogFactory().create(message); - if( isJava ){ - QSharedPointer entry = CaService::instance()->getEntry(mItemId); - HbIcon icon = entry->makeIcon(); - mUninstallMessage->setIcon(icon); + + QScopedPointer dialog( + HsMenuDialogFactory().create(message)); + if (isJava){ + dialog->setIcon(mEntry->makeIcon()); } - mConfirmAction = mUninstallMessage->actions().value(0); - - QScopedPointer entryObserver( - new HsMenuEntryRemovedHandler(mItemId, this, SIGNAL(exit()))); - entryObserver.take()->setParent(mUninstallMessage); - - mUninstallMessage->open(this, SLOT(uninstallMessageFinished(HbAction*))); + + QScopedPointer dialogController( + new HsDialogController(dialog.take(), + HsMenuDialogFactory::acceptActionIndex(), + HsMenuDialogFactory::rejectActionIndex())); + + connect(dialogController.data(), SIGNAL(acceptActionTriggered(QAction*)), + this, SLOT(uninstallItem())); + + connect(dialogController.data(), SIGNAL(dialogCompleted()), + this, SIGNAL(exit())); + + // ensure dialog is dismissed on app key pressed + connect(this, SIGNAL(exited()), + dialogController.data(), SLOT(dismissDialog())); + + dialogController.take()->openDialog(mEntry->id()); } /*! @@ -253,109 +254,133 @@ */ void HsUninstallItemState::createUninstallJavaMessage() { - HbDocumentLoader loader; - bool loadStatusOk = false; - loader.load(HS_UNINSTALL_DIALOG_LAYOUT, &loadStatusOk); - - Q_ASSERT_X(loadStatusOk, - HS_UNINSTALL_DIALOG_LAYOUT, - "Error while loading docml file."); - QString componentName; QStringList applicationsNames; QString detailsMessage; getApplicationsNames(componentName, applicationsNames, detailsMessage); - - QString section; - if (applicationsNames.isEmpty() && detailsMessage.isEmpty()) { + + if (applicationsNames.isEmpty() && detailsMessage.isEmpty()) { createSimpleUninstallMessage(true); - } - 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"); - loader.load( - HS_UNINSTALL_DIALOG_LAYOUT, section, &loadStatusOk); - } - else if (applicationsNames.isEmpty() && (!detailsMessage.isEmpty())) { - mDialogType = UninstallDialogDefinition04; - section = QString("uninstallDialogDefinition04"); - loader.load( - HS_UNINSTALL_DIALOG_LAYOUT, section, &loadStatusOk); - } + } else { + HbDocumentLoader loader; + + QString section = loadProperSection(applicationsNames, + detailsMessage, loader); + if (!section.isNull()) { + HbDialog *const dialog = qobject_cast( + loader.findWidget(HS_UNINSTALL_DIALOG_NAME)); - mUninstallJavaMessage = qobject_cast( - loader.findWidget(HS_UNINSTALL_DIALOG_NAME)); + if (dialog) { + prepareDialog(dialog); - 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)); + iconLabel->setIcon(mEntry->makeIcon()); - 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); + prepareDialogLabel(componentName, loader); - CaQuery parentsQuery; - parentsQuery.setChildId(mItemId); - parentsQuery.setEntryTypeNames(QStringList(Hs::collectionTypeName)); - QList parentsIds = CaService::instance()->getEntryIds( - parentsQuery); - - HbLabel* textLabel = - qobject_cast( - loader.findWidget(HS_UNINSTALL_DIALOG_CONFIRMATION_DIALOG_LABEL)); - if (HsShortcutService::instance()->isItemShortcutWidget(mItemId) || - (parentsIds.count() > 0)) { - textLabel->setPlainText(HbParameterLengthLimiter( - "txt_applib_info_delete_1_all_its_shortcuts_and").arg( - componentName)); - } else { - textLabel->setPlainText(HbParameterLengthLimiter( - "txt_applib_info_delete_1_and_associated_data").arg( - componentName)); - } + if ((section == definition02) || (section == definition04)) { + qobject_cast( loader.findWidget( + HS_UNINSTALL_DIALOG_DELETE_LABEL))->setPlainText( + detailsMessage); + } + + if ((section == definition02) || (section == definition03)) { + prepareApplicationListLabel(applicationsNames, loader); + } - HbLabel* detailsUninstalLabel; - if ((mDialogType == UninstallDialogDefinition02) || - (mDialogType == UninstallDialogDefinition04)) { - detailsUninstalLabel= qobject_cast( - loader.findWidget(HS_UNINSTALL_DIALOG_DELETE_LABEL)); - detailsUninstalLabel->setPlainText(detailsMessage); - } + QScopedPointer dialogController( + new HsDialogController( dialog, + HsMenuDialogFactory::acceptActionIndex(), + HsMenuDialogFactory::rejectActionIndex())); + connect(dialogController.data(), SIGNAL(acceptActionTriggered(QAction*)), + this, SLOT(uninstallItem())); + connect(dialogController.data(), SIGNAL(dialogCompleted()), + this, SIGNAL(exit())); + connect(this, SIGNAL(exited()), + dialogController.data(), SLOT(dismissDialog())); - HbLabel* listView; - QString applicationsList; - QString newLine("\n"); - if ((mDialogType == UninstallDialogDefinition02) || - (mDialogType == UninstallDialogDefinition03)) { - listView = qobject_cast( - loader.findWidget(HS_UNINSTALL_DIALOG_LIST_VIEW_LABEL)); - - for (int i=0; isetPlainText(applicationsList); + dialogController.take()->openDialog(mEntry->id()); } - - 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*))); } } } + +void HsUninstallItemState::prepareDialogLabel( + QString &componentName, HbDocumentLoader &loader) +{ + CaQuery parentsQuery; + parentsQuery.setChildId(mEntry->id()); + parentsQuery.setEntryTypeNames(QStringList(Hs::collectionTypeName)); + QList parentsIds = CaService::instance()->getEntryIds(parentsQuery); + + HbLabel* textLabel = qobject_cast(loader.findWidget( + HS_UNINSTALL_DIALOG_CONFIRMATION_DIALOG_LABEL)); + + QString plainText; + if (HsShortcutService::instance()->isItemShortcutWidget(mEntry->id()) + || parentsIds.count()) { + plainText = HbParameterLengthLimiter( + "txt_applib_info_delete_1_all_its_shortcuts_and").arg( + componentName); + } else { + plainText = HbParameterLengthLimiter( + "txt_applib_info_delete_1_and_associated_data").arg( + componentName); + } + textLabel->setPlainText(plainText); +} + +void HsUninstallItemState::prepareApplicationListLabel( + QStringList & applicationsNames, HbDocumentLoader & loader) +{ + QString applicationsList; + QString newLine("\n"); + for(int i = 0;i < applicationsNames.count();i++){ + applicationsList += applicationsNames[i] + newLine; + } + + HbLabel *listView; + listView = qobject_cast(loader.findWidget( + HS_UNINSTALL_DIALOG_LIST_VIEW_LABEL)); + listView->setPlainText(applicationsList); +} + +QString HsUninstallItemState::loadProperSection( + QStringList &applicationsNames, QString &detailsMessage, + HbDocumentLoader &loader) +{ + QString section; + if (!applicationsNames.isEmpty() && !detailsMessage.isEmpty()) { + section = QString(definition02); + } else if (!applicationsNames.isEmpty() && detailsMessage.isEmpty()) { + section = QString(definition03); + }else if (applicationsNames.isEmpty() && !detailsMessage.isEmpty()) { + section = QString(definition04); + } + if(!section.isNull()){ + bool loadStatusOk = false; + loader.load(HS_UNINSTALL_DIALOG_LAYOUT, &loadStatusOk); + + Q_ASSERT_X(loadStatusOk, + HS_UNINSTALL_DIALOG_LAYOUT, + "Error while loading docml file."); + + loader.load( + HS_UNINSTALL_DIALOG_LAYOUT, section, &loadStatusOk); + Q_ASSERT_X(loadStatusOk, + HS_UNINSTALL_DIALOG_LAYOUT, + "Error while loading docml file section."); + } + return section; +} + +HsDialogController *HsUninstallItemState::prepareDialog( + HbDialog *dialog) +{ + dialog->setAttribute(Qt::WA_DeleteOnClose); + dialog->setTimeout(HbPopup::NoTimeout); + dialog->actions()[0]->setParent(dialog); + dialog->actions()[1]->setParent(dialog); + return NULL; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappdetailsstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappdetailsstate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappdetailsstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -31,7 +31,7 @@ #include "hsviewappdetailsstate.h" #include "hsmenuevent.h" #include "hsmenuitemmodel.h" -#include "hsmenuentryremovedhandler.h" +#include "hsdialogcontroller.h" static const char *const HS_VIEWAPPDETAILS_JAVA_DIALOG_SECTION_NAME= "detailsDialogForJavaApplication"; @@ -41,7 +41,7 @@ /param parent Parent state. */ HsViewAppDetailsState::HsViewAppDetailsState(QState *parent) : - QState(parent), mDialog(0) + QState(parent) { construct(); } @@ -51,7 +51,10 @@ */ HsViewAppDetailsState::~HsViewAppDetailsState() { - delete mDialog; + QT_TRY { + emit exit(); + } QT_CATCH (...) { + } } /*! @@ -82,7 +85,7 @@ QSharedPointer entry = CaService::instance()->getEntry(entryId); if (!entry) { - stateExited(); + emit exit(); return; } const int componentId = entry->attribute( @@ -96,7 +99,7 @@ //TODO: Should we display something In that case? if (detailMap.size() < 1){ - stateExited(); + emit exit(); return; } @@ -112,13 +115,12 @@ section, &loadStatusOk); } - mDialog = qobject_cast( - loader.findWidget(HS_DETAILS_DIALOG_NAME)); + QScopedPointer dialog(qobject_cast( + loader.findWidget(HS_DETAILS_DIALOG_NAME))); - if (mDialog != NULL) { - mDialog->setTimeout(HbPopup::NoTimeout); - mDialog->setAttribute(Qt::WA_DeleteOnClose, true); - mDialog->actions()[0]->setParent(mDialog); + if (!dialog.isNull()) { + dialog->setTimeout(HbPopup::NoTimeout); + dialog->actions()[0]->setParent(dialog.data()); setFieldPresentation(CaSoftwareRegistry::componentNameKey(), detailMap, loader); @@ -140,14 +142,24 @@ detailMap, loader); } - QScopedPointer entryObserver( - new HsMenuEntryRemovedHandler(entryId, this, SIGNAL(exit()))); + QScopedPointer dialogController( + new HsDialogController(dialog.take(), + HsMenuDialogFactory::acceptActionIndex(), + HsMenuDialogFactory::rejectActionIndex())); - entryObserver.take()->setParent(mDialog); + connect(dialogController.data(), + SIGNAL(dialogCompleted()), + this, + SIGNAL(exit())); - mDialog->open(this, SLOT(stateExited())); + // ensure dialog is dismissed on app key pressed + connect(this, SIGNAL(exited()), + dialogController.data(), + SLOT(dismissDialog())); + + dialogController.take()->openDialog(entryId); } else { - stateExited(); + emit exit(); } HSMENUTEST_FUNC_EXIT("HsViewAppDetailsState::onEntry"); } @@ -179,28 +191,5 @@ } } -/*! - Slot invoked when a state is exited. - */ -void HsViewAppDetailsState::stateExited() -{ - HSMENUTEST_FUNC_ENTRY("HsViewAppDetailsState::stateExited"); - emit exit(); - HSMENUTEST_FUNC_EXIT("HsViewAppDetailsState::stateExited"); - qDebug("HsViewAppDetailsState::stateExited()"); -} -/*! - Invoked on exiting state - */ -void HsViewAppDetailsState::onExit(QEvent *event) -{ - QState::onExit(event); - // Close popups if App key was pressed or - // memory card removed - if (mDialog != NULL) { - mDialog->close(); - mDialog = NULL; - } -} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappsettingsstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappsettingsstate.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappsettingsstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -52,11 +52,6 @@ */ /*! - \var HsViewAppSettingsState::mActionConfirm - Confirm action. Owned. - */ - -/*! Constructor \param parent Parent state. \retval void @@ -118,10 +113,11 @@ new HsMenuEntryRemovedHandler(entryId, this, SIGNAL(exit()))); entryObserver.take()->setParent(mView); - - QObject::connect(this, SIGNAL(initialize(QString)), mView, SLOT(initialize(QString))); + // remove it when JAVA will start to provide only version with two strings + QObject::connect(this, SIGNAL(initialize(QString, QString)), mView, SLOT(initialize(QString))); + QObject::connect(this, SIGNAL(initialize(QString, QString)), mView, SLOT(initialize(QString, QString))); mView->setParent(this); - emit initialize(entry->attribute(Hs::applicationUidEntryKey)); + emit initialize(entry->attribute(Hs::applicationUidEntryKey), entry->text()); // Add View to main window HbMainWindow *hbMainWindow = mainWindow(); // add confirm action diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/data/DS_Snow.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/data/DS_Snow.jad Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,19 @@ +MIDlet-1: DS_Snow, ds.png, DS_Snow +xMIDlet-2: DS_Snow2, , DS_Snow2 +MIDlet-Jar-Size: 11094 +MIDlet-Jar-URL: DS_Snow.jar +MIDlet-Name: DS_Snow +MIDlet-Vendor: DS_Effects +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-1.0 +xNokia-MIDlet-UID-1: 0x2eff000e +xNokia-MIDlet-UID-2: 0x2eff000f +Nokia-MIDlet-On-Screen-Keypad: no +Nokia-MIDlet-Auto-Start-1: true +Nokia-MIDlet-Auto-Start-2: once +Nokia-MIDlet-Install-Debug: times +xMIDlet-Delete-Confirm: Do you really want to uninstall DS_Snow application? +xMIDlet-Delete-Confirm-fi: Haluatko varmasti poistaa DS_Snow sovelluksen? +xMIDlet-Delete-Confirm-sv-FI: Vill du verkligen ta bort DS_Snow applikation? +Nokia-MIDlet-Download-URL: http://midlet.download.url diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/data/DS_Snow.jar Binary file homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/data/DS_Snow.jar has changed diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/data/MIDPTestIcons.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/data/MIDPTestIcons.jad Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,25 @@ +MIDlet-1: Icon PNG, /Duke.png, com.nokia.midp.test.midptest.MIDPTest +MIDlet-10: Icon WMF, /AN04369_.WMF, com.nokia.midp.test.midptest.MIDPTest +MIDlet-11: Icon WMF2, /TR00232_.WMF, com.nokia.midp.test.midptest.MIDPTest +MIDlet-12: Icon WBMP, /happy.wbmp, com.nokia.midp.test.midptest.MIDPTest +MIDlet-2: Icon GIF, /gs_98x98.gif, com.nokia.midp.test.midptest.NoUIMIDlet +MIDlet-3: Icon GIF2, /gs_16x16.gif, com.nokia.midp.test.midptest.MIDPTest +MIDlet-4: Icon BMP, /logo.bmp, com.nokia.midp.test.midptest.MIDPTest +MIDlet-5: Icon JPG, /j_131x155.jpg, com.nokia.midp.test.midptest.MIDPTest +MIDlet-6: Icon JPG2, /j_29x29.jpg, com.nokia.midp.test.midptest.MIDPTest +MIDlet-7: Icon MNG, /DUTCH1.mng, com.nokia.midp.test.midptest.MIDPTest +MIDlet-8: Icon TIF, /Sample_UPC_TIF.tif, com.nokia.midp.test.midptest.MIDPTest +MIDlet-9: Icon ICO, /favicon.ico, com.nokia.midp.test.midptest.MIDPTest +MIDlet-Data-Size: 0 +MIDlet-Delete-Confirm: This is delete confirm text.... +MIDlet-Description: Testing support for several icon formats +MIDlet-Icon: /Duke.png +MIDlet-Jar-Size: 174409 +MIDlet-Jar-URL: MIDPTestIcons.jar +MIDlet-Name: MIDP Test Icon +MIDlet-Vendor: Nokia - OMJ Testing +MIDlet-Version: 3.91.2 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-1.0 +Nokia-MIDlet-no-exit: true +UserDefined1: Foo value diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/data/MIDPTestIcons.jar Binary file homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/data/MIDPTestIcons.jar has changed diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/inc/hscontentservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/inc/hscontentservice.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef HSCONTENTSERVICE_H +#define HSCONTENTSERVICE_H + +#include "t_hscontentservice.h" + +#endif diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/inc/hsshortcutservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/inc/hsshortcutservice.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Entry point for shortcut widget +* +*/ + +#ifndef HSSHORTCUTSERVICE_H +#define HSSHORTCUTSERVICE_H + +#include "t_hsshortcutservice.h" + +#endif // HSSHORTCUTSERVICE_H + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/inc/t_hscontentservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/inc/t_hscontentservice.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef T_HSCONTENTSERVICE_H +#define T_HSCONTENTSERVICE_H + +#include +#include +#include + +class HsWidgetHost; + +class HsContentService : public QObject +{ + Q_OBJECT +public: + HsContentService(QObject *parent = 0); + ~HsContentService(); + + bool createWidget(const QVariantHash ¶ms); + HsWidgetHost *createWidgetForPreview(const QVariantHash ¶ms); + static HsContentService *instance(); +public: + QVariantHash mParams; +private: + Q_DISABLE_COPY(HsContentService) + +}; + +Q_DECLARE_METATYPE(HsContentService *) + +#endif // T_HSCONTENTSERVICE_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/inc/t_hsmenuworkerstateplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/inc/t_hsmenuworkerstateplugin.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,199 @@ +/* +* 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: Tests for HomeScreenStatePlugin class. +* +*/ + +#ifndef T_HSMCSSTATES_H +#define T_HSMCSSTATES_H + +#include +#include +#include +#include +#include +#include +#include "t_hsshortcutservice.h" + +#ifdef Q_OS_SYMBIAN +#include +#endif + +class QStateMachine; +class HbMainWindow; +class HbAction; +class HsCollectionNameDialog; + +/** +* @test Test class for hsutils modules. +*/ +class MenuStatesTest : public QObject +{ + Q_OBJECT + +private slots: + + /** + * initialize + */ + void initTestCase(); + + /* + * Tests + */ + + // WorkerState + void MenuWorkerState_construction(); + + + // HsPreviewHSWidgetState + + void HsPreviewHSWidgetState_construction(); + void HsPreviewHSWidgetState_onEntry(); + void HsPreviewHSWidgetState_showMessageWidgetCorrupted(); + void HsPreviewHSWidgetState_buildPreviewDialog(); + void HsPreviewHSWidgetState_addToHomeScreen(); + // HsAddToHomeScreenState + + void AddToHomeScreenState_construction(); + void AddToHomeScreenState_showMessageWidgetCorrupted(); + void AddToHomeScreenState_openHomeScreen(); + + void AddToHomeScreenState_onEntry(); + + void AddToHomeScreenState_onEntry_2(); + void AddToHomeScreenState_onEntry_3(); + void AddToHomeScreenState_onEntry_4(); + + + + // HsCollectionNameState + void CollectionNameState_construction1(); + void CollectionNameState_onEntry(); + void CollectionNameState_dialogFinished(); + + // HsDeleteCollectionItemState + void DeleteCollectionItemState_construction(); + void DeleteCollectionItemState_onEntry(); + + // HsUninstallItemState + void HsUninstallItemState_construction(); + void HsUninstallItemState_onEntry(); +#ifdef Q_OS_SYMBIAN + void HsUninstallItemState_getApplicationsNames(); +#endif // Q_OS_SYMBIAN + + // HsAddAppsToCollectionState + void AddAppsToCollectionState_construction(); + void AddAppsToCollectionState_save(); + void AddAppsToCollectionState_cleanData(); + void AddAppsToCollectionState_setCollectionName(); + void AddAppsToCollectionState_setCollectionId(); + void AddAppsToCollectionState_setAppList(); + void AddAppsToCollectionState_showMessageAppsAdded(); + void AddAppsToCollectionState_selectCollection(); + void AddAppsToCollectionState_listDialogFinished(); + void AddAppsToCollectionState_newCollection(); + void AddAppsToCollectionState_editorDialogFinished(); + void AddAppsToCollectionState_appsCheckListState(); + void AddAppsToCollectionState_selectApplicationsDone(); + void AddAppsToCollectionState_collectionSelected(); + + void AppsCheckList_showAppsCheckboxList(); + void AppsCheckList_getItemsList(); + void AppsCheckList_setSortOrder(); + void AppsCheckList_selectedItemsChanged(); + + void HsCollectionNameDialog_ConstructWithNoParams(); + void HsCollectionNameDialog_ConstructWithId(); + void HsCollectionNameDialog_uniqueCollectionName(); + void HsCollectionNameDialog_closeEvent(); + + + // HsDeleteCollectionState + void DeleteCollectionState_construction1(); + + void DeleteCollectionState_onEntry(); + void DeleteCollectionState_deleteCollection(); + + // HsArrangeState + void ArrangeState_FulfillEntriesList(); + void ArrangeState_Save(); + void ArrangeState_onEntry(); + void ArrangeState_arrangeDialogFinished(); + + + // HsViewAppSettingsState + void ViewAppSettings_construction(); + void ViewAppSettings_onEntry(); + void ViewAppSettings_onExit(); + + // HsInstallationLogState + void HsInstallationLogState_construction(); + void HsInstallationLogState_onEntry(); + + // HsUninstallFailedState + void HsUninstallFailedState_construction(); + void HsUninstallFailedState_onEntry(); + + // HsViewAppDetailsState + void ViewAppDetails_construction(); + void ViewAppDetails_onEntry(); + + + /** + * cleanup + */ + void cleanupTestCase(); + void cleanup(); + + /** + * test slot for popup actions + */ + void testSlot(HbAction* finished); + + /** + * test slot to check if exit() was emitted + */ + int testExitSlot(); + + /** + * test slot for AppsCheckList_showAppsCheckboxList test + */ + void testCommitSlot(const QList &appList); + + /** + * test slot for AddAppsToCollectionState_appsCheckListState test + */ + void testTransitToStateSlot(); + +private: + void checkDialogController(); + void startThread(); + void stopThread(); + +#ifdef Q_OS_SYMBIAN + RThread iThread; +#endif + +private: + QSharedPointer mShortcutService; + QStateMachine *mStateMachine; + HbMainWindow *mWindow; + bool mFinishedEmited; + bool mCommitEmited; + bool mTransitToStateEmited; +}; + +#endif diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/inc/t_hsshortcutservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/inc/t_hsshortcutservice.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,50 @@ +/* +* 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 T_HSSHORTCUTSERVICE_H +#define T_HSSHORTCUTSERVICE_H +#include +#include +#include +#include + +#include "hsdomainmodel_global.h" + +class QStateMachine; + +class HsShortcutService : public QObject +{ + Q_OBJECT + +public: + ~HsShortcutService(); + static QSharedPointer instance(QStateMachine *machine = 0); + + void executeCollectionAction(int shortcutId, QString collectionType); + bool isItemShortcutWidget(int aItemId); + +private: + HsShortcutService(QStateMachine *aStateMachine, QObject *parent = 0); + + Q_DISABLE_COPY(HsShortcutService) + + +private: +}; + +Q_DECLARE_METATYPE(HsShortcutService *) + +#endif // T_HSSHORTCUTSERVICE_H diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/inc/testwidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/inc/testwidget.h Mon Sep 20 10:19: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 HOMESCREEN_TEST_TESTWIDGET_H +#define HOMESCREEN_TEST_TESTWIDGET_H + +#include + +class TestWidget : public HbWidget +{ + Q_OBJECT + +public: + TestWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0); + ~TestWidget(); + +signals: + void finished(); + +public slots: + void onInitialize(); + void onShow(); + void onHide(); + +public: + QRectF boundingRect() const; + QPainterPath shape() const; + void setSucceeded() { emit finished(); } + +protected: + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + +private: + friend class HomeScreenStatePluginTest; +}; + +#endif diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/hsbackuprestoreobserver_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/hsbackuprestoreobserver_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,90 @@ +/* +* 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: Home screen Backup/Restore observer. +* +*/ + + +#include "hsdatabase.h" +#include "hsbackuprestoreobserver.h" + + +/*! + Singleton. +*/ +HsBackupRestoreObserver *HsBackupRestoreObserver::instance() +{ + if (!mInstance) { + mInstance = new HsBackupRestoreObserver(); + } + return mInstance; +} + +/*! + Constructs a new observer with the given \a parent object. +*/ +HsBackupRestoreObserver::HsBackupRestoreObserver(QObject *parent) + : QObject(parent), + mBUROngoing(false) +{ +} + +/*! + Destructor. +*/ +HsBackupRestoreObserver::~HsBackupRestoreObserver() +{ +} + +/*! + Called when backup/restore is started. +*/ +void HsBackupRestoreObserver::backupRestoreStarted() +{ + mBUROngoing = true; + emit event_backupRestoreStarted(); +} + +/*! + Called when backup/restore is completed. +*/ +void HsBackupRestoreObserver::backupRestoreCompleted() +{ + mBUROngoing = false; + emit event_backupRestoreCompleted(); +} + +/*! + Called when Home screen is ready for backup/restore. +*/ +void HsBackupRestoreObserver::readyForBUR() +{ +} + +/*! + Returns true if bacup/restore is ongoing. +*/ +bool HsBackupRestoreObserver::checkBUR() +{ + if (mBUROngoing) { + return true; + } + return false; +} +/*! + Points to the observer instance. +*/ +HsBackupRestoreObserver *HsBackupRestoreObserver::mInstance(0); + +// End of File diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/hsdatabase_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/hsdatabase_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,228 @@ +/* +* 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 "hsdatabase.h" +#include "hsdomainmodeldatastructures.h" + +HsDatabase::HsDatabase(QObject *parent) + : QObject(parent) +{ +} + +HsDatabase::~HsDatabase() +{ + +} + +void HsDatabase::setConnectionName(const QString &name) +{ + mConnectionName = name; +} + +QString HsDatabase::connectionName() const +{ + return mConnectionName; +} + +void HsDatabase::setDatabaseName(const QString &name) +{ + mDatabaseName = QDir::toNativeSeparators(name); +} + +QString HsDatabase::databaseName() const +{ + return mDatabaseName; +} + +bool HsDatabase::open() +{ + return true; +} + +void HsDatabase::close() +{ + +} + +bool HsDatabase::transaction() +{ + return true; +} + +bool HsDatabase::rollback() +{ + return true; +} + +bool HsDatabase::commit() +{ + return true; +} + +bool HsDatabase::scene(HsSceneData &) +{ + return true; +} + +bool HsDatabase::pages(QList &) +{ + return true; +} + +bool HsDatabase::page(HsPageData &) +{ + return true; +} + +bool HsDatabase::insertPage(HsPageData &) +{ + return true; +} + +bool HsDatabase::updatePage(const HsPageData &) +{ + return true; +} + +bool HsDatabase::deletePage(int ) +{ + return true; +} + +bool HsDatabase::widgets(int , QList &) +{ + return true; +} + +bool HsDatabase::widgets(const QString &, QList &) +{ + return true; +} + +bool HsDatabase::widgets(const QString &, const QVariantHash &, int &count) +{ + count = 0; + return true; +} +bool HsDatabase::widget(HsWidgetData &) +{ + return true; +} + +bool HsDatabase::insertWidget(HsWidgetData &) +{ + return true; +} + +bool HsDatabase::updateWidget(const HsWidgetData &) +{ + return true; +} + +bool HsDatabase::deleteWidget(int ) +{ + return true; +} + +bool HsDatabase::deleteWidgets(const QString &) +{ + return true; +} + +bool HsDatabase::widgetPresentation(HsWidgetPresentationData &) +{ + return true; +} + +bool HsDatabase::setWidgetPresentation(const HsWidgetPresentationData &) +{ + return true; +} + +bool HsDatabase::deleteWidgetPresentation(int, Qt::Orientation) +{ + return true; +} + +bool HsDatabase::widgetPreferences(int , QVariantHash &) +{ + return true; +} + +bool HsDatabase::widgetPreference(int , const QString &, QVariant &) +{ + return true; +} + +bool HsDatabase::setWidgetPreferences(int , const QVariantHash &) +{ + return true; +} + +void HsDatabase::setInstance(HsDatabase *instance) +{ + if (mInstance != instance) { + HsDatabase *oldInstance = mInstance; + mInstance = instance; + delete oldInstance; + } +} + +HsDatabase *HsDatabase::instance() +{ + return mInstance; +} + +HsDatabase *HsDatabase::takeInstance() +{ + HsDatabase *instance = mInstance; + mInstance = 0; + return instance; +} + +bool HsDatabase::checkConnection() const +{ + return true; +} + +bool HsDatabase::configuration(QVariantHash &configuration) +{ + Q_UNUSED(configuration) + return true; +} + +bool HsDatabase::updateWidgetZValues(const QHash &data, Qt::Orientation orientation) +{ + Q_UNUSED(data) + Q_UNUSED(orientation) + return true; +} + +bool HsDatabase::matchWidgetPreferences(const QVariantHash &preferences, const QMultiMap& storedPreferences) +{ + Q_UNUSED(preferences) + Q_UNUSED(storedPreferences) + return true; +} + +HsDatabase *HsDatabase::mInstance(0); diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/hsgui_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/hsgui_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,188 @@ +/* +* 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: +* +*/ + +#include +#include +#include +#include +#include + +#include "hsgui.h" +#include "hsidlewidget.h" +#include "hsscene.h" +#include "hspropertyanimationwrapper.h" + +namespace { + const char gApplicationLibraryIconName[] = "qtg_mono_applications_all"; +} + +/*! + \class HsGui + \ingroup group_hsdomainmodel + \brief Represents a view in the framework. + HsGui includes common UI components for Home screen. +*/ + +HsGui *HsGui::mInstance(0); + +struct HsGuiImpl +{ + 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; +} + +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; +} + +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); + } + mImpl->mWindow->setCurrentView(mImpl->mIdleView); +} + +void HsGui::cleanupIdleUi() +{ + 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; +} + +QRectF HsGui::layoutRect() const +{ + return mImpl->mWindow->layoutRect(); +} + +void HsGui::show() +{ + mImpl->mWindow->raise(); + mImpl->mWindow->show(); +} + +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 e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/hspage_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/hspage_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,555 @@ +/* +* 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 "hsdomainmodeldatastructures.h" +#include "hspage.h" +#include "hspagetoucharea.h" +#include "hspagenewwidgetlayout.h" +#include "hsscene.h" +#include "hswidgethost.h" +#include "hswallpaper.h" +#include "hswidgetpositioningonwidgetadd.h" +#include "hswidgetpositioningonorientationchange.h" +#include "hsconfiguration.h" +#include "hsgui.h" + +/*! + \class HsPage + \ingroup group_hsdomainmodel + \brief Represents a page in the framework. + HsPage contains group of widgets. HsPage can have a wallpaper. +*/ + +/*! + Constructor. + + \a parent Owner. + \a aFlags Window flags. +*/ +HsPage::HsPage(QObject* parent) + : QObject(parent), + mDatabaseId(-1), + mWallpaper(0), + mRemovable(true), + mPageMargin(0.0) +{ + + //Page margin + mPageMargin = HSCONFIGURATION_GET(pageMargin); + connect(HsConfiguration::instance(), SIGNAL(propertyChanged(QString)), SLOT(onPageMarginChanged(QString))); +} + +/*! + Destructor. +*/ +HsPage::~HsPage() +{ + delete mWallpaper; +} + +/*! + Returns the database id. +*/ +int HsPage::databaseId() const +{ + return mDatabaseId; +} + +/*! + Sets the database id to \a id. +*/ +void HsPage::setDatabaseId(int id) +{ + mDatabaseId = id; +} + + + +/*! + Loads widgets. +*/ +bool HsPage::load() +{ + if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) { + mWallpaper = new HsPageWallpaper(this); + } + + /* HsWidgetHost *widget = new HsWidgetHost(-1); + mWidgets.append(widget); + connectWidget(widget); + widget->setPage(this); + widget->setParentItem(this); + widget->setPos(100, 100); + widget->startWidget(); + */ + return true; +} + +/*! + Return wallpaper. +*/ +HsWallpaper *HsPage::wallpaper() const +{ + return mWallpaper; +} +/*! + Add given existing \a widgetHost to a page. Returns true if successful +*/ +bool HsPage::addExistingWidget(HsWidgetHost *widgetHost) +{ + if (!widgetHost) { + return false; + } + + if (mWidgets.contains(widgetHost)) { + return true; + } + + if (!widgetHost->setPage(this)) { + return false; + } + + connectWidget(widgetHost); + mWidgets << widgetHost; + // widgetHost->setParentItem(this); + + return true; + } + +/*! + Remove given \a widgetHost from a page. Widget is not deleted. + Returns true if successful +*/ +bool HsPage::removeWidget(HsWidgetHost *widgetHost) +{ + if (!widgetHost || !widgetHost->setPage(0)) { + return false; + } + + disconnectWidget(widgetHost); + mWidgets.removeOne(widgetHost); + // widgetHost->setParentItem(0); + + return true; +} + +/*! + Returns list of new widgets belonging to a page. Widgets which are + not yet layouted are considered as new widgets. +*/ +QList HsPage::newWidgets() +{ + return mNewWidgets; +} + +/*! + Adds new widget into a page. Returns true if successfull. +*/ +bool HsPage::addNewWidget(HsWidgetHost* widgetHost, const QPointF &touchPoint) +{ + Q_UNUSED(touchPoint) + if (!widgetHost || mWidgets.contains(widgetHost)) { + return false; + } + + if (mNewWidgets.contains(widgetHost)) { + return true; + } + + HsWidgetPresentationData presentation; + presentation.orientation = HsGui::instance()->orientation(); + if (!widgetHost->getPresentation(presentation)) { + presentation.orientation = HsGui::instance()->orientation(); + presentation.setPos(QPointF()); + presentation.zValue = 0; + widgetHost->savePresentation(presentation); + } + + // widgetHost->hide(); + // widgetHost->setPos(presentation.x, presentation.y); + // widgetHost->setZValue(presentation.zValue); + + connectWidget(widgetHost); + mNewWidgets << widgetHost; + + return true; +} + +/*! + Layouts all the new widgets +*/ +void HsPage::layoutNewWidgets() +{ + if (mNewWidgets.isEmpty()) { + return; + } + + updateZValues(); + HsWidgetHost *widget = 0; + for (int i = 0; i < mNewWidgets.count(); ++i) { + widget = mNewWidgets.at(i); +//Not used in mock newWidgetLayout->addItem(widget); + widget->setPage(this); + // widget->setParentItem(this); + widget->showWidget(); + // widget->show(); + } + mWidgets << mNewWidgets; + mNewWidgets.clear(); +} + +/*! + Clears new widgets list and resets layout. +*/ +void HsPage::resetNewWidgets() +{ + mNewWidgets.clear(); + //setLayout(0); +} + +/*! + Remove page and all it's contained widgets from database +*/ +bool HsPage::deleteFromDatabase() +{ + //Not used in mock + return true; +} + +/*! + Return list of widgets belonging to a page +*/ +QList HsPage::widgets() const +{ + return mWidgets; +} + +/*! + Returns true if the page can be removed. Otherwise, + returns false. +*/ +bool HsPage::isRemovable() const +{ + return mRemovable; +} + +/*! + Sets removable flag to \a removable. +*/ +void HsPage::setRemovable(bool removable) +{ + mRemovable = removable; +} + +/*! + Return true if page is default page. +*/ +bool HsPage::isDefaultPage() const +{ + return mDatabaseId == HSCONFIGURATION_GET(defaultPageId); +} + +/*! + Return true if page is active page. +*/ +bool HsPage::isActivePage() const +{ + return this == HsScene::instance()->activePage(); +} + +/*! + Create page into database and return instance of a new page. +*/ +HsPage *HsPage::createInstance(const HsPageData &pageData) +{ + Q_UNUSED(pageData); + HsPage *page = new HsPage; + return page; +} + +/*! + 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; + //pageRect = rect(); + + 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; +} + +/*! + Calls onShow() for contained widgets. +*/ +void HsPage::showWidgets() +{ + /* foreach (HsWidgetHost *widget, mWidgets) { + if (widget->parentItem() == this) { + widget->showWidget(); + } + } + */ +} + +/*! + Calls onHide() for contained widgets. +*/ +void HsPage::hideWidgets() +{ + /* foreach (HsWidgetHost *widget, mWidgets) { + if (widget->parentItem() == this) { + widget->hideWidget(); + } + } + */ +} + +/*! + Propagate online state to widgets. +*/ +void HsPage::setOnline(bool online) +{ + foreach (HsWidgetHost *widget, mNewWidgets) { + widget->setOnline(online); + } + foreach (HsWidgetHost *widget, mWidgets) { + widget->setOnline(online); + } +} + +/*! + Update widgets z-values and persist those. Active widget has top most + z-value. +*/ +void HsPage::updateZValues() +{ + int z = 0; + + /*if (!mWidgets.isEmpty()) { + QMultiMap map; + foreach (HsWidgetHost *widget, mWidgets) { + map.insert(widget->zValue(), widget); + } + + QList sortedWidgets = map.values(); + + HsWidgetHost *activeWidget = HsScene::instance()->activeWidget(); + if (sortedWidgets.contains(activeWidget)) { + sortedWidgets.removeOne(activeWidget); + sortedWidgets.append(activeWidget); + } + + foreach (HsWidgetHost *widget, sortedWidgets) { + widget->setZValue(z++); + widget->savePresentation(); + } + } + + if (!mNewWidgets.isEmpty()) { + foreach (HsWidgetHost *widget, mNewWidgets) { + widget->setZValue(z++); + widget->savePresentation(); + } + } + */ +} + +/*! + Return this page's index. +*/ +int HsPage::pageIndex() +{ + return HsScene::instance()->pages().indexOf(this); +} + +/*! + Utility to connect widget signals to page. +*/ +void HsPage::connectWidget(HsWidgetHost *widget) +{ + connect(widget, SIGNAL(finished()), SLOT(onWidgetFinished())); + connect(widget, SIGNAL(faulted()), SLOT(onWidgetFaulted())); + connect(widget, SIGNAL(resized()), SLOT(onWidgetResized())); + connect(widget, SIGNAL(available()), SLOT(onWidgetAvailable())); + connect(widget, SIGNAL(unavailable()), SLOT(onWidgetUnavailable())); +} +/*! + Disconnect widget signals from page +*/ +void HsPage::disconnectWidget(HsWidgetHost *widget) +{ + widget->disconnect(this); +} +/*! + Disconnect and remove widget +*/ +void HsPage::onWidgetFinished() +{ + HsWidgetHost *widget = qobject_cast(sender()); + + // It can be in new widget list if we haven't layouted it yet + // or layouted new widget and widget list + if (!mNewWidgets.removeOne(widget)) { + mWidgets.removeOne(widget); + } + + disconnectWidget(widget); + widget->remove(); +} +/*! + Remove widget if it faulted +*/ +void HsPage::onWidgetFaulted() +{ + onWidgetFinished(); +} + +/*! + Calculates new widget position on page when widget size changes. If page has layout then there are new widgets + and we use layout to calculate new widget positions. +*/ +void HsPage::onWidgetResized() +{ + /* if ( !layout() ) { + HsWidgetHost *widget = qobject_cast(sender()); + widget->setPos(adjustedWidgetPosition(widget->geometry())); + } else { + layout()->invalidate(); + } + */ +} +/*! + Show widget if it came available +*/ +void HsPage::onWidgetAvailable() +{ + HsWidgetHost *widget = qobject_cast(sender()); + + mUnavailableWidgets.removeOne(widget); + mWidgets.append(widget); + + // widget->setParentItem(this); + widget->startWidget(isActivePage()); + // widget->show(); +} +/*! + Update internal bookkeeping and hide widget +*/ +void HsPage::onWidgetUnavailable() +{ + HsWidgetHost *widget = qobject_cast(sender()); + + if (mWidgets.contains(widget)) { + mWidgets.removeOne(widget); + } else if (mNewWidgets.contains(widget)) { + mNewWidgets.removeOne(widget); + } else { + return; + } + + mUnavailableWidgets.append(widget); + + /* widget->hide(); + widget->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) +{ + Q_UNUSED(orientation) +} + +void HsPage::onPageMarginChanged(const QString &value) +{ + if (value == "pageMargin") { + mPageMargin = HSCONFIGURATION_GET(pageMargin); + + if (!mWidgets.isEmpty()) { + foreach (HsWidgetHost *widget, mWidgets) { + // widget->setPos(adjustedWidgetPosition(widget->geometry())); + widget->savePresentation(); + } + } + + if (!mNewWidgets.isEmpty()) { + foreach (HsWidgetHost *widget, mNewWidgets) { + // widget->setPos(adjustedWidgetPosition(widget->geometry())); + widget->savePresentation(); + } + } + } +} + +HsPageVisual *HsPage::visual()const +{ + return 0; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/hsscene_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/hsscene_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,205 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include "hsdomainmodeldatastructures.h" +#include "hsscene.h" +#include "hspage.h" +#include "hswidgethost.h" +#include "hswallpaper.h" +#include "hsconfiguration.h" + +HsScene::~HsScene() +{ + delete mWallpaper; + qDeleteAll(mPages); +} + +int HsScene::databaseId() const +{ + return mDatabaseId; +} + +bool HsScene::load() +{ + int pageCount = property("pageCount").toInt(); + int defaultPageIndex = property("defaultPageIndex").toInt(); + + mDatabaseId = 1; //Just one scene in the test + if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::SceneWallpaper) { + mWallpaper = new HsSceneWallpaper(this); + } + + for (int i = 0; i < pageCount; ++i) { + HsPage *page = new HsPage; + page->load(); + mPages << page; + } + + if(defaultPageIndex > -1){ + mActivePage = mPages[defaultPageIndex]; + mActivePage->setRemovable(false); + } + + return true; +} + +HsWallpaper *HsScene::wallpaper() const +{ + return mWallpaper; +} + +QList HsScene::pages() const +{ + return mPages; +} + +bool HsScene::addPage(HsPage *page) +{ + if (!page) { + return false; + } + + if (mPages.contains(page)) { + return true; + } + + mPages << page; + return true; +} + +bool HsScene::removePage(HsPage *page) +{ + if (!page) { + return false; + } + return mPages.removeOne(page); +} + +bool HsScene::setActivePage(HsPage *page) +{ + if (!page) { + return false; + } + + if (!mPages.contains(page)) { + return false; + } + + mActivePage = page; + return true; +} + +bool HsScene::setActivePageIndex(int index) +{ + if (index < 0 || mPages.count() <= index) { + return false; + } + return setActivePage(mPages[index]); +} + +HsPage *HsScene::activePage() const +{ + return mActivePage; +} + +int HsScene::activePageIndex() const +{ + return mPages.indexOf(mActivePage); +} + +void HsScene::setActiveWidget(HsWidgetHost *widget) +{ + mActiveWidget = widget; +} + +HsWidgetHost *HsScene::activeWidget() const +{ + return mActiveWidget; +} + +void HsScene::setOnline(bool online) +{ + mIsOnline = online; + foreach (HsPage *page, mPages) { + page->setOnline(online); + } +} + +bool HsScene::isOnline()const +{ + return mIsOnline; +} + +/*! + Singleton. +*/ +HsScene *HsScene::instance() +{ + if (!mInstance) { + mInstance = new HsScene; + } + return mInstance; +} + +HsScene *HsScene::takeInstance() +{ + HsScene *instance = mInstance; + mInstance = 0; + return instance; +} + +void HsScene::setInstance(HsScene *instance) +{ + if (mInstance != instance) { + delete mInstance; + mInstance = instance; + } +} + +/*! + Listens for application background/foreground changes. +*/ +bool HsScene::eventFilter(QObject *watched, QEvent *event) +{ + switch (event->type()) { + case QEvent::ApplicationActivate: + mActivePage->showWidgets(); + break; + case QEvent::ApplicationDeactivate: + mActivePage->hideWidgets(); + break; + default: + break; + } + return QObject::eventFilter(watched, event); +} + +HsScene::HsScene(QObject *parent) + : QObject(parent), + mDatabaseId(-1), + mWallpaper(0), + mActivePage(0), + mActiveWidget(0), + mIsOnline(true) +{ +} + +/*! + Points to the scene instance. +*/ +HsScene *HsScene::mInstance = 0; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/hswallpaper_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/hswallpaper_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,324 @@ +/* +* 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: +* +*/ + +#include +#include +#include +#include + +#include +#include + +#include "hswallpaper.h" +#include "hsscene.h" +#include "hspage.h" +#include "hswallpaperloader.h" +#include "hsconfiguration.h" +#include "hsgui.h" +/*! + +*/ + +/*! + +*/ +HsWallpaper::HsWallpaper(QGraphicsItem *parent) + : HbWidget(parent), + mIsDefaultImage(false), + mIconItem(0)/*, + mLoader(0)*/ +{ + setFlag(ItemHasNoContents); + setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored); + + /* + mLoader = new HsWallpaperLoader(this); + connect(mLoader, SIGNAL(finished()), SLOT(onLoaderFinished()), Qt::UniqueConnection); + connect(mLoader, SIGNAL(failed()), SLOT(onLoaderFailed()), Qt::UniqueConnection); + */ + + mIconItem = new HbIconItem(); + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout; + layout->setContentsMargins(0, 0, 0, 0); + layout->addItem(mIconItem); + setLayout(layout); + + connect(HsGui::instance(), + SIGNAL(orientationChanged(Qt::Orientation)), + SLOT(updateIconItem(Qt::Orientation))); +} + +/*! + +*/ +HsWallpaper::~HsWallpaper() +{ +} + +/*! + +*/ +void HsWallpaper::setImage(const QString &path) +{ + Q_UNUSED(path); +} + +void HsWallpaper::setImages(const QString &portraitFileName, const QString &landscapeFileName) +{ + Q_UNUSED(portraitFileName) + Q_UNUSED(landscapeFileName) + emit imageSet(); +} + +/*! + +*/ +void HsWallpaper::setDefaultImage() +{ + if (mIsDefaultImage) { + return; + } + + QDir dir(wallpaperDirectory()); + QStringList filters; + filters << "default_portrait.*"; + filters << "default_landscape.*"; + QFileInfoList infos = dir.entryInfoList( + filters, QDir::Files, QDir::Name | QDir::IgnoreCase); + + Q_ASSERT(infos.count() == 2); + + mIsDefaultImage = true; + mLandscapeImagePath = infos.first().absoluteFilePath(); + mPortraitImagePath = infos.last().absoluteFilePath(); + + updateIconItem(HsGui::instance()->orientation()); +} + +/*! + +*/ +void HsWallpaper::remove() +{ + if (mIsDefaultImage) { + mIsDefaultImage = false; + } else { + QFile::remove(mPortraitImagePath); + QFile::remove(mLandscapeImagePath); + } + mPortraitImagePath.clear(); + mLandscapeImagePath.clear(); +} + +/*! + +*/ +bool HsWallpaper::setExistingImage() +{ + QDir dir(wallpaperDirectory()); + QStringList filters; + filters << QString("%1_portrait.*").arg(mId); + filters << QString("%1_landscape.*").arg(mId); + QFileInfoList infos = dir.entryInfoList( + filters, QDir::Files, QDir::Name | QDir::IgnoreCase); + + Q_ASSERT(infos.isEmpty() || infos.count() == 2); + + if (infos.isEmpty()) { + return false; + } + + mIsDefaultImage = false; + mLandscapeImagePath = infos.first().absoluteFilePath(); + mPortraitImagePath = infos.last().absoluteFilePath(); + + updateIconItem(HsGui::instance()->orientation()); + return true; +} + +QString HsWallpaper::rootDirectory() const +{ +#ifdef Q_OS_SYMBIAN + QString directory("c:/private/20022f35/wallpapers/"); +#else + QString directory(QDir::currentPath() + "/private/20022f35/wallpapers/"); +#endif + +#ifdef HSDOMAINMODEL_TEST + directory = QDir::currentPath() + "/wallpapers/"; +#endif + return directory; +} + +/*! + +*/ +void HsWallpaper::onLoaderFinished() +{ + if (mIsDefaultImage) { + mIsDefaultImage = false; + } else { + QFile::remove(mPortraitImagePath); + QFile::remove(mLandscapeImagePath); + } + foreach (QString path, mLoader->targets().keys()) { + QString newName = path; newName.remove("temp"); + QFile::rename(path, newName); + } + setExistingImage(); + emit imageSet(); +} + +/*! + +*/ +void HsWallpaper::onLoaderFailed() +{ + foreach (QString path, mLoader->targets().keys()) { + QFile::remove(path); + } + emit imageSetFailed(); +} + +/*! + +*/ +void HsWallpaper::updateIconItem(Qt::Orientation orientation) +{ + if (orientation == Qt::Vertical) { + mIconItem->setIcon(HbIcon(QIcon(mPortraitImagePath))); + } else { + mIconItem->setIcon(HbIcon(QIcon(mLandscapeImagePath))); + } +} + +/*! + +*/ +HsSceneWallpaper::HsSceneWallpaper(HsScene *scene, QGraphicsItem *parent) + : HsWallpaper(parent), + mScene(0) +{ + setScene(scene); +} + +/*! + +*/ +HsSceneWallpaper::~HsSceneWallpaper() +{ +} + +/*! + +*/ +void HsSceneWallpaper::setScene(HsScene *scene) +{ + if (!scene) { + return; + } + + mScene = scene; + mId = scene->databaseId(); + if (!setExistingImage()) { + setDefaultImage(); + } +} + +/*! + +*/ +QString HsSceneWallpaper::wallpaperDirectory() const +{ + return QDir::toNativeSeparators(rootDirectory() + "scene/"); +} + +/*! + +*/ +QVariantHash HsSceneWallpaper::createTargets(const QString &sourcePath) +{ + QVariantHash targets; + + QString path = wallpaperDirectory() + + QString("temp%1_").arg(mId) + + QString("%1.") + + QFileInfo(sourcePath).suffix(); + + targets.insert(path.arg("portrait"), QSize((2 * 360) + HSCONFIGURATION_GET(bounceEffect), 640)); + targets.insert(path.arg("landscape"), QSize((2 * 640) + HSCONFIGURATION_GET(bounceEffect), 360)); + return targets; +} + +/*! + PAGE +*/ +HsPageWallpaper::HsPageWallpaper(HsPage *page, QGraphicsItem *parent) + : HsWallpaper(parent), + mPage(0) +{ + setPage(page); +} + +/*! + +*/ +HsPageWallpaper::~HsPageWallpaper() +{ +} + +/*! + +*/ +void HsPageWallpaper::setPage(HsPage *page) +{ + if (!page) { + return; + } + + mPage = page; + mId = page->databaseId(); + if (!setExistingImage()) { + setDefaultImage(); + } +} + +/*! + +*/ +QString HsPageWallpaper::wallpaperDirectory() const +{ + return QDir::toNativeSeparators(rootDirectory() + "page/"); +} + +/*! + +*/ +QVariantHash HsPageWallpaper::createTargets(const QString &sourcePath) +{ + QVariantHash targets; + + QString path = wallpaperDirectory() + + QString("temp%1_").arg(mId) + + QString("%1.") + + QFileInfo(sourcePath).suffix(); + + targets.insert(path.arg("portrait"), QSize(360, 640)); + targets.insert(path.arg("landscape"), QSize(640, 360)); + return targets; +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/hswidgethost_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/hswidgethost_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,495 @@ +/* +* 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 +#include + +#include +#include +#include + +#include + +#include "hsdatabase.h" +#include "hsdomainmodeldatastructures.h" +#include "hsscene.h" +#include "hspage.h" +#include "hswidgethost.h" +#include "hswidgettoucharea.h" +#include "hswidgetcomponentregistry.h" +#include "hswidgetcomponent.h" +#include "hsconfiguration.h" +#include "testwidget.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())); + +QTM_USE_NAMESPACE + +HsWidgetHost::HsWidgetHost(int databaseId, QObject *parent) + : QObject(parent), + mDatabaseId(databaseId), + mStateMachine(0), + mWidget(0), + mPage(0), + 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(); +} + +HsWidgetHost::~HsWidgetHost() +{ +} + +HsWidgetHost *HsWidgetHost::createInstance(HsWidgetData &widgetData, + const QVariantHash &preferences) +{ + Q_UNUSED(widgetData); + Q_UNUSED(preferences); + HsWidgetHost *host = NULL; + host = new HsWidgetHost(-1); + return host; +} + +int HsWidgetHost::databaseId() const +{ + return mDatabaseId; +} + +bool HsWidgetHost::setPage(HsPage *page) +{ + mPage = page; + return true; +} + +HsPage *HsWidgetHost::page() const +{ + return mPage; +} + +bool HsWidgetHost::loadPresentation() +{ + return true; +} + +bool HsWidgetHost::loadPresentation(Qt::Orientation orientation) +{ + Q_UNUSED(orientation) + return true; +} + +bool HsWidgetHost::savePresentation() +{ + return true; +} + +bool HsWidgetHost::savePresentation(Qt::Orientation orientation) +{ + Q_UNUSED(orientation) + return true; +} + +bool HsWidgetHost::savePresentation(HsWidgetPresentationData &presentation) +{ + Q_UNUSED(presentation) + return true; +} + +bool HsWidgetHost::getPresentation(HsWidgetPresentationData &presentation) +{ + Q_UNUSED(presentation) + return true; +} + +bool HsWidgetHost::removePresentation(Qt::Orientation orientation) +{ + Q_UNUSED(orientation) + return true; +} + + + +void HsWidgetHost::startWidget(bool show) +{ + if (show) { + emit event_startAndShow(); + } else { + emit event_startAndHide(); + } +} + +void HsWidgetHost::showWidget() +{ + emit event_show(); +} + +void HsWidgetHost::hideWidget() +{ + emit event_hide(); +} + +void HsWidgetHost::setOnline(bool online) +{ + mIsOnlineProperty.write(mWidget, online); +} + +void HsWidgetHost::remove() +{ + emit event_remove(); +} + +void HsWidgetHost::close() +{ + emit event_close(); +} + +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); +} + +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); +} + + + +void HsWidgetHost::setupStates() +{ + // State machine + + mStateMachine = new QStateMachine(this); + mStateMachine->setAnimated(false); + + // States + + QState *state_component = new QState; + QState *state_unloaded = new QState(state_component); + QState *state_running = new QState(state_component); + QState *state_show = new QState(state_running); + QState *state_hide = new QState(state_running); + QState *state_finished = new QState; + QState *state_faulted = new QState; + QState *state_remove = new QState; + QFinalState *state_final = new QFinalState; + + mStateMachine->addState(state_component); + mStateMachine->addState(state_finished); + mStateMachine->addState(state_faulted); + mStateMachine->addState(state_remove); + mStateMachine->addState(state_final); + + mStateMachine->setInitialState(state_component); + state_component->setInitialState(state_unloaded); + state_running->setInitialState(state_hide); + + // Transitions + + state_component->addTransition( + this, SIGNAL(event_close()), state_final); + state_component->addTransition( + this, SIGNAL(event_remove()), state_remove); + state_component->addTransition( + this, SIGNAL(event_finished()), state_finished); + state_component->addTransition( + this, SIGNAL(event_faulted()), state_faulted); + + state_unloaded->addTransition( + this, SIGNAL(event_startAndShow()), state_show); + state_unloaded->addTransition( + this, SIGNAL(event_startAndHide()), state_hide); + + state_running->addTransition( + this, SIGNAL(event_unload()), state_unloaded); + + state_show->addTransition( + this, SIGNAL(event_hide()), state_hide); + + state_hide->addTransition( + this, SIGNAL(event_show()), state_show); + + state_finished->addTransition( + this, SIGNAL(event_remove()), state_remove); + state_finished->addTransition( + this, SIGNAL(event_close()), state_final); + + state_faulted->addTransition( + this, SIGNAL(event_remove()), state_remove); + state_faulted->addTransition( + this, SIGNAL(event_close()), state_final); + + state_remove->addTransition(state_final); + + // Actions + + ENTRY_ACTION(state_component, action_connectComponent) + EXIT_ACTION(state_component, action_disconnectComponent) + + ENTRY_ACTION(state_running, action_load) + ENTRY_ACTION(state_running, action_initialize) + EXIT_ACTION(state_running, action_uninitialize) + EXIT_ACTION(state_running, action_unload) + + ENTRY_ACTION(state_show, action_show) + + ENTRY_ACTION(state_hide, action_hide) + + ENTRY_ACTION(state_finished, action_finished) + + ENTRY_ACTION(state_faulted, action_faulted) + + ENTRY_ACTION(state_remove, action_remove) + + // Connect and start + + connect(mStateMachine, SIGNAL(finished()), SLOT(deleteLater()), + Qt::QueuedConnection); + + mStateMachine->start(); + + // Starts the state machine. QStateMachine start uses + // queued connection. + + QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); +} + +bool HsWidgetHost::setProperty(const char *name, QMetaProperty &property) +{ + const QMetaObject *object = mWidget->metaObject(); + int index = object->indexOfProperty(name); + property = object->property(index); + return index >= 0; +} + +bool HsWidgetHost::setMethod(const char *signature, QMetaMethod &method) +{ + const QMetaObject *object = mWidget->metaObject(); + int index = object->indexOfMethod( + QMetaObject::normalizedSignature(signature)); + method = object->method(index); + return index >= 0; +} + +bool HsWidgetHost::hasSignal(const char *signature) +{ + const QMetaObject *object = mWidget->metaObject(); + int index = object->indexOfSignal( + QMetaObject::normalizedSignature(signature)); + return index >= 0; +} + +bool HsWidgetHost::setPreferencesToWidget() +{ + return true; +} + +void HsWidgetHost::action_connectComponent() +{ +} + +void HsWidgetHost::action_disconnectComponent() +{ +} + +void HsWidgetHost::action_load() +{ + mWidget = new TestWidget; + + if (!mWidget || + !setMethod("onShow()", mOnShowMethod) || + !setMethod("onHide()", mOnHideMethod)) { + mWidget = 0; + emit event_faulted(); + return; + } + + setMethod("onInitialize()", mOnInitializeMethod); + setMethod("onUninitialize()", mOnUninitializeMethod); + + setProperty("isOnline", mIsOnlineProperty); + setProperty("rootPath", mRootPathProperty); + + if (hasSignal("setPreferences(const QStringList&)")) { + connect(mWidget, SIGNAL(setPreferences(QStringList)), + SLOT(onSetPreferences(QStringList))); + } + if (hasSignal("finished()")) { + connect(mWidget, SIGNAL(finished()), + SLOT(onFinished())); + } + if (hasSignal("error()")) { + connect(mWidget, SIGNAL(error()), + SLOT(onError())); + } + + mWidget->installEventFilter(this); + + //HsScene *scene = HsScene::instance(); + //setMaximumSize(scene->maximumWidgetSizeInPixels()); + //setMinimumSize(scene->minimumWidgetSizeInPixels()); + + loadPresentation(); + + /* mWidget->setParentItem(this); + + setNewSize(mWidget->size()); + */ +} + +void HsWidgetHost::action_unload() +{ + delete mWidget; + mWidget = 0; + + mOnInitializeMethod = QMetaMethod(); + mOnShowMethod = QMetaMethod(); + mOnHideMethod = QMetaMethod(); + mOnUninitializeMethod = QMetaMethod(); + mIsOnlineProperty = QMetaProperty(); + mRootPathProperty = QMetaProperty(); +} + +void HsWidgetHost::action_initialize() +{ + //mRootPathProperty.write(mWidget, mComponent->rootPath()); + setPreferencesToWidget(); + setOnline(HsScene::instance()->isOnline()); + mOnInitializeMethod.invoke(mWidget); +} + +void HsWidgetHost::action_uninitialize() +{ + mOnUninitializeMethod.invoke(mWidget); +} + +void HsWidgetHost::action_show() +{ + if (!mIsFinishing) { + mOnShowMethod.invoke(mWidget); + } +} + +void HsWidgetHost::action_hide() +{ + if (!mIsFinishing) { + mOnHideMethod.invoke(mWidget); + } +} + +void HsWidgetHost::action_finished() +{ + emit finished(); +} + +void HsWidgetHost::action_faulted() +{ + emit faulted(); +} + +void HsWidgetHost::action_remove() +{ + mDatabaseId = -1; +} + +void HsWidgetHost::action_notifyRemove() +{ +} + +void HsWidgetHost::onFinished() +{ + mIsFinishing = true; + emit event_finished(); +} + +void HsWidgetHost::onError() +{ + mIsFinishing = true; + emit event_faulted(); +} + +void HsWidgetHost::onSetPreferences(const QStringList &names) +{ + Q_UNUSED(names) +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsaddappstocollectionstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsaddappstocollectionstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,613 @@ +/* +* 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: Main test class for hsHomeScreenStatePlugin library. +* +*/ + +#include +#include +#include +#include +#include + +#include "t_hsmenuworkerstateplugin.h" +#include "hsaddappstocollectionstate.h" +#include "hsmenuworkerstate.h" +#include "hsaddtohomescreenstate.h" +#include "hsappschecklist.h" + +#include "hscollectionnamedialog.h" +#include "hsapp_defs.h" + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddAppsToCollectionState_construction() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState1; + + HsAddAppsToCollectionState aatcs1(&parentState1); + QString s1 = aatcs1.objectName(); + QVERIFY(s1 == tr("homescreen.nokia.com/state/addappstocollectionstate")); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddAppsToCollectionState_save() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState1; + + HsAddAppsToCollectionState aatcs1(&parentState1); + + aatcs1.mCollectionId = 10; + aatcs1.save(); + QCOMPARE(aatcs1.mCollectionId, 10); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddAppsToCollectionState_cleanData() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState1; + + HsAddAppsToCollectionState aatcs1(&parentState1); + + aatcs1.mCollectionId = 10; + aatcs1.cleanData(); + QVERIFY(aatcs1.mCollectionId == 0); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddAppsToCollectionState_setCollectionName() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState1; + + HsAddAppsToCollectionState aatcs1(&parentState1); + + aatcs1.setCollectionName("test"); + QVERIFY(aatcs1.mCollectionName == "test"); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddAppsToCollectionState_setCollectionId() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState1; + + HsAddAppsToCollectionState aatcs1(&parentState1); + + aatcs1.setCollectionId(1); + QVERIFY(aatcs1.mCollectionId == 1); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddAppsToCollectionState_setAppList() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState1; + + HsAddAppsToCollectionState aatcs1(&parentState1); + + QList appList; + appList.append(1); + aatcs1.setAppList(appList); + QVERIFY(aatcs1.mAppList.count() == 1); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddAppsToCollectionState_showMessageAppsAdded() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState; + HsAddAppsToCollectionState aatcs(&parentState); + + //aatcs.mMenuService = new MenuService(); + + aatcs.onEntry(new HsMenuEvent(HsMenuEvent::OpenCollectionFromAppLibrary, QVariantMap())); + aatcs.showMessageAppsAdded(10); + aatcs.stateExited(); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddAppsToCollectionState_selectCollection() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState; + HsAddAppsToCollectionState aatcs(&parentState); + QVERIFY(aatcs.mListDialog == NULL); + + aatcs.selectCollection(); + + QVERIFY(aatcs.mListDialog); + QVERIFY(aatcs.mListDialog->testAttribute(Qt::WA_DeleteOnClose)); + QCOMPARE(aatcs.mListDialog->dismissPolicy(), HbPopup::NoDismiss); + // disconnect to check if connection was done + bool result = disconnect(aatcs.mListDialog, SIGNAL(finished(HbAction*)), + &aatcs, SLOT(listDialogFinished(HbAction*))); + QVERIFY (result); + + aatcs.mListDialog->close(); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddAppsToCollectionState_listDialogFinished() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState; + HsAddAppsToCollectionState aatcs(&parentState); + QVERIFY(aatcs.mListDialog == NULL); + + aatcs.selectCollection(); + + QVERIFY(aatcs.mListDialog); + + aatcs.listDialogFinished(qobject_cast(aatcs.mListDialog->actions().value(1))); //Cancel + + QVERIFY(aatcs.mListDialog == NULL); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddAppsToCollectionState_newCollection() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState; + HsAddAppsToCollectionState aatcs(&parentState); + QVERIFY(aatcs.mEditorDialog == NULL); + + aatcs.newCollection(); + + QVERIFY(aatcs.mEditorDialog); + QVERIFY(aatcs.mEditorDialog->testAttribute(Qt::WA_DeleteOnClose)); + + // disconnect to check if connection was done + bool result = disconnect(aatcs.mEditorDialog, SIGNAL(finished(HbAction*)), + &aatcs, SLOT(editorDialogFinished(HbAction*))); + QVERIFY (result); + + aatcs.mEditorDialog->close(); + + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddAppsToCollectionState_editorDialogFinished() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState; + HsAddAppsToCollectionState aatcs(&parentState); + aatcs.mEditorDialog = new HsCollectionNameDialog(); + + aatcs.editorDialogFinished(qobject_cast(aatcs.mEditorDialog->actions().value(0))); + + QVERIFY(aatcs.mEditorDialog == NULL); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddAppsToCollectionState_collectionSelected() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState; + HsAddAppsToCollectionState aatcs(&parentState); + QVERIFY(aatcs.mListDialog == NULL); + + aatcs.selectCollection(); + + QVERIFY(aatcs.mListDialog); + + QStandardItemModel *standardItemModel = aatcs.standardItemModel(0); + QModelIndex index(standardItemModel->indexFromItem(standardItemModel->item(3,0))); + QVERIFY(index.isValid()); + aatcs.collectionSelected(index); + + QVERIFY(aatcs.mListDialog == NULL); + delete standardItemModel; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddAppsToCollectionState_appsCheckListState() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsAddAppsToCollectionState addAppsState; + connect(&addAppsState,SIGNAL(transitToFinalState()), + this,SLOT(testTransitToStateSlot())); + QCOMPARE((int)addAppsState.mAppsCheckList,NULL); + addAppsState.appsCheckListState(); + QVERIFY(addAppsState.mAppsCheckList != NULL); + QCOMPARE(addAppsState.mAppsCheckList->mSortAttribute, + addAppsState.mApplicationsSortAttribute); + mTransitToStateEmited = false; + addAppsState.mAppsCheckList->mAppsSelectDialog->close(); + QTest::qWait(150); + QCOMPARE(mTransitToStateEmited,true); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddAppsToCollectionState_selectApplicationsDone() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsAddAppsToCollectionState addAppsState; + connect(&addAppsState,SIGNAL(transitToSaveState(const QList&)), + this,SLOT(testTransitToStateSlot())); + QList appList; + appList.append(1222); + QCOMPARE(addAppsState.mActionType, + HsAddAppsToCollectionState::NoActionType); + mTransitToStateEmited = false; + addAppsState.selectApplicationsDone(appList); + QTest::qWait(100); + QCOMPARE(mTransitToStateEmited,true); + + addAppsState.mActionType = + HsAddAppsToCollectionState::ViaAllViewOptionMenuType; + disconnect(&addAppsState,SIGNAL(transitToFinalState()), + this,SLOT(testTransitToStateSlot())); + connect(&addAppsState,SIGNAL(transitToSelectCollectionState()), + this,SLOT(testTransitToStateSlot())); + mTransitToStateEmited = false; + addAppsState.selectApplicationsDone(appList); + QTest::qWait(100); + QCOMPARE(mTransitToStateEmited,true); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AppsCheckList_showAppsCheckboxList() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsAppsCheckList checkList; + Hs::HsSortAttribute sortOrder = Hs::NoHsSortAttribute; + mCommitEmited = false; + connect(&checkList,SIGNAL(commit(const QList&)), + this,SLOT(testCommitSlot(const QList&))); + checkList.showAppsCheckboxList(sortOrder); + QVERIFY(checkList.mModel != NULL); + QVERIFY(checkList.mActionConfirm != NULL); + QVERIFY(checkList.mListView != NULL); + QVERIFY(checkList.mAppsSelectDialog != NULL); + QCOMPARE(mCommitEmited,false); + checkList.mAppsSelectDialog->close(); + QTest::qWait(100); + QCOMPARE((int)checkList.mAppsSelectDialog,NULL); + QCOMPARE(mCommitEmited,true); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::testCommitSlot(const QList &appList) +{ + if(appList.isEmpty()){ + mCommitEmited = true; + } else { + mCommitEmited = false; + } +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AppsCheckList_getItemsList() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QStandardItemModel *standardModel = new QStandardItemModel(2,1); + QStandardItem *standardItem = new QStandardItem(); + standardItem->setData(2, CaItemModel::IdRole); + standardItem->setData(QString("bbb"), Qt::DisplayRole); + QList items; + items << standardItem; + standardModel->insertRow(0, items); + { + QStandardItem *standardItem = new QStandardItem(); + standardItem->setData(3, CaItemModel::IdRole); + //standardItem->setData(QString("aaa"), Qt::DisplayRole); + QList text; + text << QString("aaa"); + text << QString("ccc"); + standardItem->setData(text, Qt::DisplayRole); + + QList items; + items << standardItem; + standardModel->insertRow(0, items); + } + + QModelIndexList modelIndexList; + modelIndexList.append(standardModel->index(0,0)); + modelIndexList.append(standardModel->index(1,0)); + + HsMenuWorkerState parentState; + + HsAppsCheckList checkList; + QList list = checkList.getSortedItemsList(modelIndexList); + QCOMPARE(list.count(), 2); + QCOMPARE(list[0], 3); + QCOMPARE(list[1], 2); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AppsCheckList_setSortOrder() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsAppsCheckList checkList; + QCOMPARE(checkList.mSortAttribute, Hs::AscendingNameHsSortAttribute); + checkList.setSortOrder(Hs::DescendingNameHsSortAttribute); + QCOMPARE(checkList.mSortAttribute, Hs::DescendingNameHsSortAttribute); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AppsCheckList_selectedItemsChanged() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsAppsCheckList checkList; + checkList.mModel = + HsMenuService::getAllApplicationsModel(Hs::NoHsSortAttribute); + checkList.constructControls(); + QVERIFY(checkList.mActionConfirm != NULL); + QVERIFY(checkList.mListView != NULL); + QVERIFY(checkList.mAppsSelectDialog != NULL); + checkList.selectedItemsChanged(); + QCOMPARE(checkList.mActionConfirm->isEnabled(),false); + QItemSelectionModel *model = checkList.mListView->selectionModel(); + model->select(model->model()->index(0,0),QItemSelectionModel::Select); + QTest::qWait(100); + checkList.selectedItemsChanged(); + QCOMPARE(checkList.mActionConfirm->isEnabled(),true); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::testTransitToStateSlot() +{ + mTransitToStateEmited = true; +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsaddtohomescreenstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsaddtohomescreenstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,374 @@ +/* +* 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: Main test class for hsHomeScreenStatePlugin library. +* +*/ + + +#include "t_hsmenuworkerstateplugin.h" + +#include +#include +#include + +#include +#include + +#include "hsmenuitemmodel.h" +#include "hsmenuservice.h" +#include "hscontentservice.h" +#include "hsshortcutservice.h" +#include "hsmenuworkerstate.h" +#include "hsaddtohomescreenstate.h" +#include "hsdialogcontroller.h" +#include "hsapp_defs.h" +#include "hspage.h" + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddToHomeScreenState_construction() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState *parent = new QState(); + + HsAddToHomeScreenState *as1 = new HsAddToHomeScreenState(parent); + + HsAddToHomeScreenState *as2 = new HsAddToHomeScreenState(parent); + + QString on1 = as1->objectName(); + QString on2 = as2->objectName(); + QVERIFY(on1 == on2); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddToHomeScreenState_onEntry() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + const QString SHORTCUT_WIDGET_URI("hsshortcutwidgetplugin"); + + HsAddToHomeScreenState addToHomeScreenState; + + QScopedPointer + model(HsMenuService::getAllApplicationsModel( + Hs::DescendingNameHsSortAttribute)); + + const QString clockWidgetName("Clock"); + + int clockId = 0; + int appId = 0; + for (int i = 0; i< model->rowCount(); ++i) { + const QString textRole = model->data((model->index(i)), + CaItemModel::TextRole).toString(); + const QString entryTypeName = model->data((model->index(i)), + CaItemModel::TypeRole).toString(); + + if (entryTypeName == Hs::applicationTypeName) { + appId = model->data((model->index(i)), CaItemModel::IdRole).toInt(); + } + + if((entryTypeName == Hs::widgetTypeName) && (textRole == clockWidgetName)) { + clockId = model->data((model->index(i)), + CaItemModel::IdRole).toInt(); + } + } + QVERIFY(clockId != 0); + const QString clockWidgetUri("hsclockwidgetplugin"); + + QVariantMap eventAttributes; + + eventAttributes.insert(Hs::widgetUriAttributeName, + clockWidgetUri); + + eventAttributes.insert(Hs::entryTypeNameKey, Hs::widgetTypeName); + + eventAttributes.insert(Hs::itemIdKey, clockId); + + HsMenuEvent *addWidgetEvent = + new HsMenuEvent(HsMenuEvent::AddToHomeScreen, eventAttributes); + + addToHomeScreenState.onEntry(addWidgetEvent); + + { + QCOMPARE(HsContentService::instance()->mParams["uri"].toString(), + clockWidgetUri); + } + + eventAttributes.remove(Hs::itemIdKey); + eventAttributes.insert(Hs::itemIdKey, appId); + + HsMenuEvent *addShortcutEvent = + new HsMenuEvent(HsMenuEvent::AddToHomeScreen, eventAttributes); + + addToHomeScreenState.onEntry(addShortcutEvent); + + { + QCOMPARE(HsContentService::instance()->mParams["uri"].toString(), + SHORTCUT_WIDGET_URI); + } + + delete addWidgetEvent; + delete addShortcutEvent; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddToHomeScreenState_onEntry_2() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + const QString SHORTCUT_WIDGET_URI("hsshortcutwidgetplugin"); + + HsAddToHomeScreenState addToHomeScreenState; + + QScopedPointer + model(HsMenuService::getAllApplicationsModel( + Hs::DescendingNameHsSortAttribute)); + + const QString clockWidgetUri("homescreen.nokia.com/widget/clock"); + + CaEntry item( ItemEntryRole ); + item.setText( "TestTemplateAppWithUri" ); + item.setEntryTypeName(Hs::templatedApplicationTypeName); + item.setAttribute(Hs::widgetUriAttributeName, clockWidgetUri); + QSharedPointer newItem = CaService::instance()->createEntry( item ); + QVERIFY(!newItem.isNull()); + QVERIFY(newItem->id()); + + QVariantMap eventAttributes; + eventAttributes.insert(Hs::entryTypeNameKey, Hs::templatedApplicationTypeName); + eventAttributes.insert(Hs::itemIdKey, newItem->id()); + eventAttributes.insert(Hs::widgetUriAttributeName, clockWidgetUri); + + HsMenuEvent *addWidgetEvent = + new HsMenuEvent(HsMenuEvent::AddToHomeScreen, eventAttributes); + + addToHomeScreenState.onEntry(addWidgetEvent); + + { + QCOMPARE(HsContentService::instance()->mParams["uri"].toString(), clockWidgetUri); + } + + QVERIFY(CaService::instance()->removeEntry(newItem->id())); + + delete addWidgetEvent; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddToHomeScreenState_onEntry_3() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + const QString SHORTCUT_WIDGET_URI("hsshortcutwidgetplugin"); + + HsAddToHomeScreenState addToHomeScreenState; + + QScopedPointer + model(HsMenuService::getAllApplicationsModel( + Hs::DescendingNameHsSortAttribute)); + + const QString clockWidgetName("Clock"); + + int clockId = 0; + + for (int i = 0; i< model->rowCount(); ++i) { + const QString textRole = model->data((model->index(i)), + CaItemModel::TextRole).toString(); + + if(textRole == clockWidgetName) { + clockId = model->data((model->index(i)), + CaItemModel::IdRole).toInt(); + } + } + + CaEntry item( ItemEntryRole ); + item.setText( "TestTemplateAppWithoutUri" ); + item.setEntryTypeName(Hs::templatedApplicationTypeName); + QSharedPointer newItem = CaService::instance()->createEntry( item ); + QVERIFY(newItem->id()); + + + QVariantMap eventAttributes; + eventAttributes.insert(Hs::entryTypeNameKey, Hs::templatedApplicationTypeName); + eventAttributes.insert(Hs::itemIdKey, newItem->id()); + + HsMenuEvent *addWidgetEvent = + new HsMenuEvent(HsMenuEvent::AddToHomeScreen, eventAttributes); + + addToHomeScreenState.onEntry(addWidgetEvent); + + QVERIFY(CaService::instance()->removeEntry(newItem->id())); + + delete addWidgetEvent; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::AddToHomeScreenState_onEntry_4() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + const QString SHORTCUT_WIDGET_URI("hsshortcutwidgetplugin"); + + HsAddToHomeScreenState addToHomeScreenState; + + QScopedPointer + model(HsMenuService::getAllApplicationsModel( + Hs::DescendingNameHsSortAttribute)); + + const QString clockWidgetUri("homescreen.nokia.com/widget/clock"); + + CaEntry item( ItemEntryRole ); + item.setText( "TestParametrizedTemplateAppWithUri" ); + item.setEntryTypeName(Hs::templatedApplicationTypeName); + item.setAttribute(Hs::widgetUriAttributeName, clockWidgetUri); + // add widget param atrib to entry + item.setAttribute(QString(Hs::widgetParam+QString("caEntryId")), QString("12")); + QSharedPointer newItem = CaService::instance()->createEntry( item ); + QVERIFY(!newItem.isNull()); + QVERIFY(newItem->id()); + + QVariantMap eventAttributes; + eventAttributes.insert(Hs::entryTypeNameKey, Hs::templatedApplicationTypeName); + eventAttributes.insert(Hs::itemIdKey, newItem->id()); + eventAttributes.insert(Hs::widgetUriAttributeName, clockWidgetUri); + + QVariantMap widgetParams; + widgetParams.insert(QString(Hs::widgetParam+QString("mcsId")), QString("12")); + eventAttributes.insert(Hs::widgetParam,widgetParams); + + HsMenuEvent *addWidgetEvent = + new HsMenuEvent(HsMenuEvent::AddToHomeScreen, eventAttributes); + + addToHomeScreenState.onEntry(addWidgetEvent); + + { + QCOMPARE(HsContentService::instance()->mParams["uri"].toString(), + clockWidgetUri); + } + + QVERIFY(CaService::instance()->removeEntry(newItem->id())); + + delete addWidgetEvent; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// + +void MenuStatesTest::AddToHomeScreenState_showMessageWidgetCorrupted() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QScopedPointer as(new HsAddToHomeScreenState()); + + as->showMessageWidgetCorrupted(); + checkDialogController(); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +void MenuStatesTest::AddToHomeScreenState_openHomeScreen() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QScopedPointer as(new HsAddToHomeScreenState()); + QSignalSpy spy(as.data(), SIGNAL(exit())); + as->openHomeScreen(); + QCOMPARE(spy.count(), 1); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + + + + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsarrangestate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsarrangestate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,211 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Main test class for hsHomeScreenStatePlugin library. +* +*/ + +#include +#include +#include +#include +#include +#include + +#include "t_hsmenuworkerstateplugin.h" +#include "hsmenuworkerstate.h" +#include "hsarrangestate.h" +#include "hsmenuitemmodel.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::ArrangeState_FulfillEntriesList() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState; + + HsArrangeState arrangeState(&parentState); + QString s1 = arrangeState.objectName(); + QVERIFY(s1 == tr("homescreen.nokia.com/state/arrangestate")); + + arrangeState.mEntriesList = new HbListWidget(); + arrangeState.mItemModel = HsMenuService::getAllCollectionsModel(); + + arrangeState.mTopItemId = arrangeState.mItemModel->index( + arrangeState.mItemModel->rowCount() / 2).data( + CaItemModel::IdRole).toInt(); + arrangeState.fulfillEntriesList(*arrangeState.mEntriesList); + + QVERIFY(arrangeState.mEntriesList->count() > 0); + QVERIFY(arrangeState.mItemModel->rowCount() > 0); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::ArrangeState_Save() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState; + + HsArrangeState arrangeState(&parentState); + QString s1 = arrangeState.objectName(); + QVERIFY(s1 == tr("homescreen.nokia.com/state/arrangestate")); + + arrangeState.mEntriesList = new HbListWidget(); + arrangeState.mItemModel = HsMenuService::getAllCollectionsModel(); + + arrangeState.mTopItemId = arrangeState.mItemModel->index( + arrangeState.mItemModel->rowCount() / 2).data( + CaItemModel::IdRole).toInt(); + arrangeState.fulfillEntriesList(*arrangeState.mEntriesList); + + QVERIFY(arrangeState.mEntriesList->count() > 0); + QVERIFY(arrangeState.mTopModelIndex != QModelIndex()); + QVERIFY(arrangeState.mItemModel->rowCount() > 0); + + // arrange items + HbListWidgetItem *itemFirst = arrangeState.mEntriesList->takeItem(0); + HbListWidgetItem *itemLast = arrangeState.mEntriesList->takeItem( + arrangeState.mEntriesList->count()-1); + + arrangeState.mEntriesList->insertItem(0, itemLast); + arrangeState.mEntriesList->addItem(itemFirst); + HbLabel *label = new HbLabel(QString("arrange")); + arrangeState.mDialog = new HbDialog(); + arrangeState.mDialog->setHeadingWidget(label); + arrangeState.mDialog->setContentWidget(arrangeState.mEntriesList); + arrangeState.save(*arrangeState.mEntriesList); + + QVERIFY(arrangeState.mCollItemIdList != arrangeState.mArrangedCollItemIdList); + QCOMPARE(arrangeState.mCollItemIdList.at(0), + arrangeState.mArrangedCollItemIdList.at(arrangeState.mArrangedCollItemIdList.count()-1)); + QCOMPARE(arrangeState.mCollItemIdList.at(arrangeState.mCollItemIdList.count()-1), + arrangeState.mArrangedCollItemIdList.at(0)); + + arrangeState.stateExited(); + + QVERIFY(!arrangeState.mCollItemIdList.count()); + QVERIFY(!arrangeState.mArrangedCollItemIdList.count()); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::ArrangeState_onEntry() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState; + HsArrangeState arrangeState (&parentState); + + QVariantMap params; + params.insert(Hs::itemIdKey, 1); + QScopedPointer event (new HsMenuEvent(HsMenuEvent::ArrangeCollection, params)); + + arrangeState.onEntry(event.data()); + + QVERIFY(arrangeState.mEntriesList); + QVERIFY(arrangeState.mDialog); + QVERIFY(arrangeState.mEntriesList->arrangeMode()); + + QVERIFY(arrangeState.mDialog); + QVERIFY(arrangeState.mDialog->testAttribute(Qt::WA_DeleteOnClose)); + + // disconnect to check if connection was done + bool result = disconnect(arrangeState.mDialog, SIGNAL(finished(HbAction*)), + &arrangeState, SLOT(arrangeDialogFinished(HbAction*))); + QVERIFY(result); + + arrangeState.mDialog->close(); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::ArrangeState_arrangeDialogFinished() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState; + + HsArrangeState arrangeState(&parentState); + QString s1 = arrangeState.objectName(); + QVERIFY(s1 == tr("homescreen.nokia.com/state/arrangestate")); + + + arrangeState.mEntriesList = new HbListWidget(); + arrangeState.mItemModel = HsMenuService::getAllCollectionsModel(); + arrangeState.mTopItemId = arrangeState.mItemModel->index( + arrangeState.mItemModel->rowCount() / 2).data( + CaItemModel::IdRole).toInt(); + arrangeState.fulfillEntriesList(*arrangeState.mEntriesList); + + arrangeState.mDialog = new HbDialog(); + arrangeState.mDialog->clearActions(); + HbAction *action = new HbAction("Primary", arrangeState.mDialog); + arrangeState.mDialog->addAction(action); + + arrangeState.arrangeDialogFinished(action); + + QVERIFY(arrangeState.mEntriesList->arrangeMode() == false); + + arrangeState.stateExited(); + QVERIFY(arrangeState.mDialog == NULL); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hscollectionnamedialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hscollectionnamedialog.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,166 @@ +/* +* 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: Main test class for hsHomeScreenStatePlugin library. +* +*/ + + +#include +#include + +#include "hscollectionnamedialog.h" +#include "t_hsmenuworkerstateplugin.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsCollectionNameDialog_ConstructWithNoParams() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + int collCount = 0; + + { + HsCollectionNameDialog dialog; + QCOMPARE(dialog.inputMode(), HbInputDialog::TextInput); + QCOMPARE(dialog.promptText(), hbTrId("txt_applib_title_collection_name")); + QCOMPARE(dialog.lineEdit()->maxLength(), 248); + QCOMPARE(dialog.value().toString(), hbTrId("txt_applib_dialog_entry_collection")); + collCount = dialog.mOtherCollectionsNames.count(); + } + + { + + const int id = HsMenuService::createCollection(QString("TestConstruct")); + + QTest::qWait(3000); + + HsCollectionNameDialog dialog; + + QCOMPARE(dialog.mOtherCollectionsNames.count(), collCount + 1); + + HsMenuService::removeCollection(id); + + QTest::qWait(3000); + + } + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +void MenuStatesTest::HsCollectionNameDialog_ConstructWithId() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + int id = HsMenuService::createCollection(QString("TestConstruct")); + + QTest::qWait(3000); + + HsCollectionNameDialog dialogItem(id); + QCOMPARE(dialogItem.value().toString(), HsMenuService::getName(id)); + QCOMPARE(dialogItem.uniqueCollectionName(), dialogItem.value().toString()); + HsMenuService::removeCollection(id); + + QTest::qWait(3000); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsCollectionNameDialog_uniqueCollectionName() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QString testNewName(QString("TestNewName") + + QDateTime::currentDateTime().toString("ddmmyyyy_hh_mm_ss_zzz")); + + int id = HsMenuService::createCollection(testNewName); + + QString otherTestName(QString("OtherTestName") + + QDateTime::currentDateTime().toString("ddmmyyyy_hh_mm_ss_zzz")); + + int otherId = HsMenuService::createCollection(otherTestName); + + QTest::qWait(3000); + + HsCollectionNameDialog dialog(id); + + QCOMPARE(dialog.uniqueCollectionName(), testNewName); + + dialog.setValue(otherTestName); + + QCOMPARE(dialog.uniqueCollectionName().contains("1"), QBool(true) ); + + HsMenuService::removeCollection(id); + HsMenuService::removeCollection(otherId); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsCollectionNameDialog_closeEvent() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + mFinishedEmited = false; + HsCollectionNameDialog *dlg = new HsCollectionNameDialog(); + dlg->open(this, SLOT(testSlot(HbAction*))); + + QVERIFY(dlg->testAttribute(Qt::WA_DeleteOnClose)); + + dlg->close(); + + QVERIFY(mFinishedEmited); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hscollectionnamestate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hscollectionnamestate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,124 @@ +/* +* 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: Main test class for hsHomeScreenStatePlugin library. +* +*/ + +#include +#include "hscollectionnamedialog.h" +#include "hscollectionnamestate.h" + +#include "hsmenuevent.h" +#include "t_hsmenuworkerstateplugin.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::CollectionNameState_construction1() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState parentState1; + parentState1.setObjectName(tr("testName1")); + + HsCollectionNameState rename1(&parentState1); + QString s1 = rename1.objectName(); + QVERIFY(s1 == tr("testName1/collectionnamestate")); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::CollectionNameState_onEntry() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState parentState1; + HsCollectionNameState rename1(&parentState1); + + // prepare input event + QVariantMap params; + params.insert(Hs::itemIdKey, 1000); + QScopedPointer event (new HsMenuEvent( + HsMenuEvent::RenameCollection, params)); + + rename1.onEntry(event.data()); + + QVERIFY(rename1.mCollectionNameDialog); + QVERIFY(rename1.mCollectionNameDialog->testAttribute(Qt::WA_DeleteOnClose)); + + // disconnect to check if connection was done + bool result = disconnect(rename1.mCollectionNameDialog, SIGNAL(finished(HbAction*)), + &rename1, SLOT(dialogFinished(HbAction*))); + QVERIFY (result); + + rename1.mCollectionNameDialog->close(); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::CollectionNameState_dialogFinished() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState parentState1; + parentState1.setObjectName(tr("testName1")); + + HsCollectionNameState rename1(&parentState1); + QString s1 = rename1.objectName(); + QVERIFY(s1 == tr("testName1/collectionnamestate")); + + + rename1.mCollectionNameDialog = new HsCollectionNameDialog(); + rename1.dialogFinished(qobject_cast(rename1.mCollectionNameDialog->actions().value(1))); + + QVERIFY(rename1.mCollectionNameDialog == NULL); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hscontentservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hscontentservice.cpp Mon Sep 20 10:19: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: +* +*/ +#include "t_hscontentservice.h" + +HsContentService::HsContentService(QObject *parent): QObject(parent) {} + +HsContentService::~HsContentService() {} + +HsContentService *HsContentService::instance() { + static HsContentService service; + return &service; +} +bool HsContentService::createWidget(const QVariantHash ¶ms) +{ + mParams = params; + return true; +} + +HsWidgetHost *HsContentService::createWidgetForPreview(const QVariantHash ¶ms) +{ + Q_UNUSED(params); + return 0; +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsdeletecollectionitemstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsdeletecollectionitemstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,98 @@ +/* +* 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: Main test class for hsHomeScreenStatePlugin library. +* +*/ + +#include +#include +#include +#include + +#include "hsdeletecollectionitemstate.h" +#include "t_hsmenuworkerstateplugin.h" +#include "hscontentservice.h" +#include "hsshortcutservice.h" +#include "hsmenuevent.h" +#include "hsmenuitemmodel.h" +#include "hsdialogcontroller.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::DeleteCollectionItemState_construction() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState parentState1; + parentState1.setObjectName(tr("testName1")); + + HsDeleteCollectionItemState del1(&parentState1); + QString s1 = del1.objectName(); + QVERIFY(s1 == tr("testName1/DeleteCollectionItemState")); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + + +void MenuStatesTest::DeleteCollectionItemState_onEntry() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState parentState3; + parentState3.setObjectName(tr("testName3")); + HsDeleteCollectionItemState del3(&parentState3); + + int SomeAppId = 14; ////app to delete //esheel + int dummyCollectionID = 123456789; + QVariantMap params; + params.insert(Hs::itemIdKey, SomeAppId); + params.insert(Hs::collectionIdKey, dummyCollectionID); + + QEvent *e = new HsMenuEvent(HsMenuEvent::RemoveAppFromCollection, params); + + QString s3 = del3.objectName(); + QCOMPARE(s3, tr("testName3/DeleteCollectionItemState")); + + del3.onEntry( e ); + + QCOMPARE(del3.mItemId, SomeAppId); + QCOMPARE(del3.mCollectionId , dummyCollectionID); + + checkDialogController(); + + del3.cleanUp(); + + QCOMPARE(del3.mItemId, 0); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsdeletecollectionstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsdeletecollectionstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,122 @@ +/* +* 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: Main test class for hsHomeScreenStatePlugin library. +* +*/ + +#include +#include +#include +#include + +#include "hsdeletecollectionstate.h" +#include "t_hsmenuworkerstateplugin.h" +#include "hscontentservice.h" +#include "hsshortcutservice.h" +#include "hsmenuevent.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::DeleteCollectionState_construction1() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState parentState1; + parentState1.setObjectName(tr("testName1")); + + HsDeleteCollectionState del1(&parentState1); + QString s1 = del1.objectName(); + QVERIFY(s1 == tr("testName1/DeleteCollectionState")); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +void MenuStatesTest::DeleteCollectionState_onEntry() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState parentState; + HsDeleteCollectionState del(&parentState); + + //test event + QVariantMap params; + const int testId = 1000; + params.insert(Hs::itemIdKey, testId); + QScopedPointer event(new HsMenuEvent(HsMenuEvent::DeleteCollection, params)); + + del.onEntry(event.data()); + checkDialogController(); + + QCOMPARE(del.mItemId, testId); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +void MenuStatesTest::DeleteCollectionState_deleteCollection() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QScopedPointer machine(new QStateMachine(0)); + + QState parentState; + parentState.setObjectName(tr("testName")); + HsDeleteCollectionState del(&parentState); + + machine->addState(&del); + machine->setInitialState(&del); + + machine->start(); + + const int newCollId = HsMenuService::createCollection("DeleteColl_test"); + + del.mItemId = newCollId; + + del.deleteCollection(); + + const QString nonExistingCollName = HsMenuService::getName(newCollId); + + QCOMPARE(nonExistingCollName, QString()); + machine->stop(); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsinstallationlogstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsinstallationlogstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Main test class for hsHomeScreenStatePlugin library. +* +*/ + +#include +#include +#include +#include +#include + +#include "hsinstallationlogstate.h" +#include "t_hsmenuworkerstateplugin.h" +#include "hscontentservice.h" +#include "hsshortcutservice.h" +#include "hsmenuevent.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsInstallationLogState_construction() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState parentState1; + parentState1.setObjectName(tr("testName1")); + + HsInstallationLogState logState(&parentState1); + QString s1 = logState.objectName(); + QVERIFY(s1 == tr("testName1/InstallationLogState")); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +void MenuStatesTest::HsInstallationLogState_onEntry() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState parentState; + HsInstallationLogState logState(&parentState); + + //test event + QScopedPointer event(new HsMenuEvent(HsMenuEvent::ShowInstallationLog)); + + logState.onEntry(event.data()); + + checkDialogController(); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsmenustates.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsmenustates.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,153 @@ +/* +* 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: Main test class for hsHomeScreenStatePlugin library. +* +*/ + +#include + +#include +#include +#include + +#include "t_hsmenuworkerstateplugin.h" + +#include "hsaddtohomescreenstate.h" +#include "hsshortcutservice.h" +#include "hsdialogcontroller.h" + +void MenuStatesTest::initTestCase() +{ +#ifdef Q_OS_SYMBIAN + startThread(); + QDir::setCurrent("C:/"); +#endif //Q_OS_SYMBIAN + mStateMachine = new QStateMachine; + mShortcutService = QSharedPointer + (HsShortcutService::instance(mStateMachine/*,0*/)); + mWindow = new HbMainWindow(); +} +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::cleanupTestCase() +{ +#ifdef Q_OS_SYMBIAN + stopThread(); +#endif //Q_OS_SYMBIAN + delete mStateMachine; + delete mWindow; + mWindow = NULL; +} + +void MenuStatesTest::cleanup() +{ + qApp->processEvents(); +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +int threadFunction(void *params) +{ + Q_UNUSED(params); +#ifdef Q_OS_SYMBIAN + while (ETrue) { + User::ResetInactivityTime();//it should help for Viewserver11 panic + User::After(5000000); + } +#endif //Q_OS_SYMBIAN + return 0; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::startThread() +{ +#ifdef Q_OS_SYMBIAN + User::LeaveIfError(iThread.Create( + _L("thread_kill_viewsrv11"), + threadFunction, + 16384, + 4000, + 4000, + NULL)); + iThread.Resume(); +#endif //Q_OS_SYMBIAN +} +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::stopThread() +{ +#ifdef Q_OS_SYMBIAN + iThread.Close(); + QTest::qWait(3000); +#endif //Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::testSlot(HbAction* finished) +{ + Q_UNUSED(finished) + mFinishedEmited = true; +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +int MenuStatesTest::testExitSlot() +{ + mFinishedEmited = true; + return 0; +} + +void MenuStatesTest::checkDialogController() +{ + + QGraphicsScene *scene = mWindow->scene(); + QGraphicsItem *focusItem = scene->focusItem(); + QPointer dialog = + qobject_cast(focusItem->toGraphicsObject()); + + QVERIFY(!dialog.isNull()); + + QPointer controller(NULL); + + foreach (QObject* obj, dialog->children()) + { + controller = qobject_cast(obj); + + if (!controller.isNull()) + { + break; + } + } + + QVERIFY(!controller.isNull()); + + QSignalSpy spy(controller.data(), SIGNAL(dialogCompleted())); + controller->dismissDialog(); + + QTest::qWait(1000); + + QVERIFY(dialog.isNull()); + QVERIFY(controller.isNull()); + QCOMPARE(spy.count(), 1); +} + +QTEST_MAIN(MenuStatesTest) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsmenuworkerstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsmenuworkerstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,60 @@ +/* +* 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: Main test class for hsHomeScreenStateProvider library. +* +*/ + +#include "t_hsmenuworkerstateplugin.h" + +#include "hsaddtohomescreenstate.h" + +#include "hsmenuworkerstate.h" +#include "hsmenuevent.h" +#include "hsmenueventfactory.h" +#include "hsmenueventtransition.h" + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::MenuWorkerState_construction() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState workerStateS; + QVERIFY(workerStateS.parent() == 0); + QVERIFY(workerStateS.objectName() == "homescreen.nokia.com/state/MenuWorkerState"); + + HsMenuWorkerState *workerStateH0 = new HsMenuWorkerState(); + QVERIFY(workerStateH0->parent() == 0); + QVERIFY(workerStateH0->objectName() == "homescreen.nokia.com/state/MenuWorkerState"); + + HsMenuWorkerState *workerStateH1 = new HsMenuWorkerState(workerStateH0); + QVERIFY(workerStateH1->parent() == workerStateH0); + + + delete workerStateH1; + delete workerStateH0; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hspreviewhswidgetstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hspreviewhswidgetstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,209 @@ +/* +* 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: Main test class for hsHomeScreenStatePlugin library. +* +*/ + + +#include "t_hsmenuworkerstateplugin.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "hscontentservice.h" +#include "hsshortcutservice.h" +#include "hsmenuworkerstate.h" +#include "hspreviewhswidgetstate.h" +#include "hsapp_defs.h" +#include "hspage.h" +#include "hsscene.h" +#include "HsWidgetHost.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsPreviewHSWidgetState_construction() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState *parent = new QState(); + + HsPreviewHSWidgetState *as1 = new HsPreviewHSWidgetState(parent); + + HsPreviewHSWidgetState *as2 = new HsPreviewHSWidgetState(parent); + + QString on1 = as1->objectName(); + QString on2 = as2->objectName(); + QVERIFY(on1 == on2); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsPreviewHSWidgetState_showMessageWidgetCorrupted() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState *parent = new QState(); + HsPreviewHSWidgetState *as1 = new HsPreviewHSWidgetState(parent); + as1->showMessageWidgetCorrupted(); + checkDialogController(); + + delete parent; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsPreviewHSWidgetState_onEntry() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState *parent = new QState(); + HsPreviewHSWidgetState *as1 = new HsPreviewHSWidgetState(parent); + + QVariantMap params; + params.insert(Hs::itemIdKey, 2); + params.insert( + Hs::widgetUriAttributeName, + QString("test_uri")); + params.insert( + Hs::widgetLibraryAttributeName, + QString("test_library")); + params.insert(Hs::entryTypeNameKey, Hs::widgetTypeName); + + QScopedPointer event (new HsMenuEvent( + HsMenuEvent::PreviewHSWidget, params)); + + mFinishedEmited = false; //test slot + + as1->onEntry(event.data()); + + QCOMPARE(params.value(Hs::itemIdKey).toInt(), as1->mEntryId); + + checkDialogController(); + + delete as1; + delete parent; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsPreviewHSWidgetState_buildPreviewDialog() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsPreviewHSWidgetState previewWidgetState; + + CaEntry entry; + entry.setText("entry text"); + + QScopedPointer previewDialog( + previewWidgetState.buildPreviewDialog(entry)); + + QVERIFY(previewDialog != NULL); + QVERIFY(previewDialog->actions()[0]->parent() == previewDialog.data()); + QVERIFY(previewDialog->actions()[1]->parent() == previewDialog.data()); + + QVERIFY(previewDialog->testAttribute(Qt::WA_DeleteOnClose)); + HbLabel *const headingLabel(qobject_cast( + previewDialog->headingWidget())); + QCOMPARE(headingLabel->plainText(), entry.text()); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsPreviewHSWidgetState_addToHomeScreen() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState *parent = new QState(); + HsConfiguration::setInstance(new HsConfiguration); + HsPreviewHSWidgetState *as1 = new HsPreviewHSWidgetState(parent); + + QScopedPointer page(new HsPage); + HsScene::instance()->addPage(page.data()); + page.take(); + HsScene::instance()->load(); + + as1->addToHomeScreen(); + + QCOMPARE(HsContentService::instance()->mParams.size(), 2); + QCOMPARE(HsContentService::instance()->mParams[Hs::uri], QVariant(QString())); + QVERIFY(HsContentService::instance()->mParams[Hs::homescreenData].isNull()); + delete as1; + delete parent; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsshortcutservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsshortcutservice.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "t_hsshortcutservice.h" + +HsShortcutService::~HsShortcutService() +{ +} + +QSharedPointer +HsShortcutService::instance(QStateMachine *machine) +{ + return QSharedPointer(new HsShortcutService(machine)); +} + +void HsShortcutService::executeCollectionAction(int, QString) +{ +} + +bool HsShortcutService::isItemShortcutWidget(int) +{ + return false; +} + +HsShortcutService::HsShortcutService(QStateMachine *, QObject *) +{ +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsuinstallfailedstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsuinstallfailedstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Main test class for hsHomeScreenStatePlugin library. +* +*/ + +#include +#include + +#include "hsuinstallfailedstate.h" +#include "t_hsmenuworkerstateplugin.h" +#include "hscontentservice.h" +#include "hsmenueventfactory.h" +#include "hsmenuevent.h" +#include "hsmenuitemmodel.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsUninstallFailedState_construction() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState parentState1; + parentState1.setObjectName(tr("testName1")); + + HsUninstallFailedState uni1(&parentState1); + QString s1 = uni1.objectName(); + QVERIFY(s1 == tr("testName1/HsUninstallFailedState")); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsUninstallFailedState_onEntry() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState parentState; + HsUninstallFailedState failedState(&parentState); + + int fakeError = 3; + QVariantMap params; + params.insert(Hs::uninstallError, fakeError); + + //test event + QScopedPointer event(new HsMenuEvent(HsMenuEvent::UninstallationFailed, params)); + + failedState.onEntry(event.data()); + + checkDialogController(); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsuninstallitemstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsuninstallitemstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,170 @@ +/* +* 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: Main test class for hsHomeScreenStatePlugin library. +* +*/ + +#include +#include + +#ifdef Q_OS_SYMBIAN +#include +#include +#endif//Q_OS_SYMBIAN + +#include "hsuninstallitemstate.h" +#include "t_hsmenuworkerstateplugin.h" +#include "hscontentservice.h" +#include "hsshortcutservice.h" +#include "hsmenueventfactory.h" +#include "hsmenuevent.h" +#include "hsmenuitemmodel.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::HsUninstallItemState_construction() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState parentState1; + parentState1.setObjectName(tr("testName1")); + + HsUninstallItemState uni1(&parentState1); + QString s1 = uni1.objectName(); + QVERIFY(s1 == tr("testName1/UninstallItemState")); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +void MenuStatesTest::HsUninstallItemState_onEntry() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState parentState3; + parentState3.setObjectName(tr("testName3")); + HsUninstallItemState uni3(&parentState3); + + int SomeAppId = 14; ////app to uninst + + QVariantMap params; + params.insert(Hs::itemIdKey, SomeAppId); + + QEvent *e = new HsMenuEvent(HsMenuEvent::UninstallApplication, params); + + QString s3 = uni3.objectName(); + QCOMPARE(s3, tr("testName3/UninstallItemState")); + + uni3.onEntry( e ); + checkDialogController(); + + QCOMPARE(uni3.mEntry->id(), SomeAppId); + + uni3.cleanUp(); + + QVERIFY(uni3.mEntry.isNull()); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +#ifdef Q_OS_SYMBIAN +void MenuStatesTest::HsUninstallItemState_getApplicationsNames() +{ +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK + { + + static const char javaUid[] = "270437153"; //in DS_Snow + + Usif::RSoftwareInstall sif; + CleanupClosePushL( sif ); + User::LeaveIfError( sif.Connect() ); + + // Install the component + _LIT16( KDsSnowJadPath, "c:\\testing\\data\\t_hsmenuworkerstateplugin\\installs\\DS_Snow.jad" ); + Usif::COpaqueNamedParams* arguments = NULL; + Usif::COpaqueNamedParams* results = NULL; + arguments = Usif::COpaqueNamedParams::NewLC(); + results = Usif::COpaqueNamedParams::NewLC(); + arguments->AddIntL( Usif::KSifInParam_InstallSilently, 1 ); + TRequestStatus status; + sif.Install( KDsSnowJadPath, *arguments, *results, status, EFalse ); + User::WaitForRequest( status ); + User::LeaveIfError( status.Int() ); + + CleanupStack::PopAndDestroy( results ); + CleanupStack::PopAndDestroy( arguments ); + + // Disconnect from the SIF server + CleanupStack::PopAndDestroy( &sif ); + + + QSharedPointer service = CaService::instance(); + CaQuery query; + query.setAttribute(Hs::applicationUidEntryKey, javaUid); + QList< QSharedPointer > entries = service->getEntries(query); + QCOMPARE(entries.length(), 1); + QSharedPointer entry = entries[0]; + + HsUninstallItemState state; + + QVariantMap params; + params.insert(Hs::itemIdKey, entry->id()); + + QEvent *e = new HsMenuEvent(HsMenuEvent::UninstallApplication, params); + state.onEntry( e ); + + QCOMPARE(state.mEntry->id(), entry->id()); + + + QString componentName; + QStringList appNames; + QString confirmationMessage; + + bool result = state.getApplicationsNames(componentName, + appNames, confirmationMessage); + QVERIFY(result); + QCOMPARE(componentName, QString("DS_Snow")); + QCOMPARE(appNames.length(), 0); //in DS_Snow + + const QString remove("remove"); + service->executeCommand(entry->id(), remove); + + state.cleanUp(); + QVERIFY(state.mEntry.isNull()); + } +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +} +#endif // Q_OS_SYMBIAN diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsviewappdetailsstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsviewappdetailsstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,103 @@ +/* +* 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 test class for hsHomeScreenStatePlugin library. +* +*/ + +#include +#include +#include +#include +#include +#include "hsmenuworkerstate.h" +#include "hsviewappdetailsstate.h" +#include +#include "t_hsmenuworkerstateplugin.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::ViewAppDetails_construction() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState1; + + HsViewAppDetailsState vas1(&parentState1); + QString s1 = vas1.objectName(); + QVERIFY(s1 == tr("homescreen.nokia.com/state/MenuWorkerState/ViewAppDetailsState")); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::ViewAppDetails_onEntry() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState1; + HsViewAppDetailsState viewAppDetailsState(&parentState1); + + QString testNewName(QString("TestNewName") + + QDateTime::currentDateTime().toString("ddmmyyyy_hh_mm_ss_zzz")); + + CaQuery query; + query.setFlagsOn(RemovableEntryFlag); + QStringList typeNames; + typeNames.append(Hs::applicationTypeName); + query.setEntryTypeNames(typeNames); + QList< QSharedPointer > entries = CaService::instance()->getEntries(query); + + int entryId = entries.size() < 1 ? 555 : entries[0]->id(); + + QVariantMap eventAttributes; + eventAttributes.insert(Hs::itemIdKey, entryId); + QScopedPointer viewAppDetailsEvent; + viewAppDetailsEvent.reset(new HsMenuEvent( + HsMenuEvent::ShowAppDetails, eventAttributes)); + + + viewAppDetailsState.onEntry(viewAppDetailsEvent.data()); + + if (entries.size() < 1) { + QWARN("No removable application or widget present."); + return; + } + + checkDialogController(); + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsviewappsettingsstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/t_hsviewappsettingsstate.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,122 @@ +/* +* 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 test class for hsHomeScreenStatePlugin library. +* +*/ + +#include + +#include "hsmenuworkerstate.h" +#include "hsviewappsettingsstate.h" + +#include "t_hsmenuworkerstateplugin.h" + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::ViewAppSettings_construction() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState1; + + HsViewAppSettingsState vas1(&parentState1); + QString s1 = vas1.objectName(); + QVERIFY(s1 == tr("homescreen.nokia.com/state/MenuWorkerState/ViewAppSettingsState")); + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::ViewAppSettings_onEntry() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + HsMenuWorkerState parentState1; + HsViewAppSettingsState viewAppSettingsState(&parentState1); + + const QString javaSettingsPlugin("dumy/resource/qt/plugins/appsettings/javaapplicationsettingsview.qtplugin"); + const QString javaAppUid("269636027"); + CaEntry item( ItemEntryRole ); + item.setText( "TestJavaApp" ); + item.setEntryTypeName(Hs::applicationTypeName); + //item.setAttribute(Hs::applicationUidEntryKey, javaAppUid); + item.setAttribute(Hs::appSettingsPlugin, javaSettingsPlugin); + QSharedPointer newItem = CaService::instance()->createEntry( item ); + QVERIFY(!newItem.isNull()); + QVERIFY(newItem->id()); + + QVariantMap eventAttributes; + eventAttributes.insert(Hs::itemIdKey, newItem->id()); + + HsMenuEvent *viewAppSettingsEvent = + new HsMenuEvent(HsMenuEvent::ShowAppSettings, eventAttributes); + + viewAppSettingsState.onEntry(viewAppSettingsEvent); + + QVERIFY(CaService::instance()->removeEntry(newItem->id())); + + delete viewAppSettingsEvent; + + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void MenuStatesTest::ViewAppSettings_onExit() +{ +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARK; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN + { + QState *parent = new QState(); + HsViewAppSettingsState *viewAppSettingsState = new HsViewAppSettingsState(parent); + + QEvent *event = new QEvent(QEvent::StateMachineSignal); + viewAppSettingsState->onExit(event); + delete event; + delete viewAppSettingsState; + delete parent; + } +#ifdef Q_OS_SYMBIAN +#ifdef UT_MEMORY_CHECK + __UHEAP_MARKEND; +#endif//UT_MEMORY_CHECK +#endif//Q_OS_SYMBIAN +} + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/testwidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/src/testwidget.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,60 @@ +/* +* 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: +* +*/ + +#include +#include "testwidget.h" + +TestWidget::TestWidget(QGraphicsItem *parent, Qt::WindowFlags flags) + : HbWidget(parent, flags) +{ + setPreferredSize(100, 100); +} + +TestWidget::~TestWidget() +{ +} + +void TestWidget::onInitialize() +{ +} + +void TestWidget::onShow() +{ +} + +void TestWidget::onHide() +{ +} + +void TestWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + Q_UNUSED(option) + Q_UNUSED(widget) + painter->drawRect(rect()); +} + +QRectF TestWidget::boundingRect() const +{ + return rect(); +} + +QPainterPath TestWidget::shape() const +{ + QPainterPath path; + path.addRect(rect()); + return path; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/t_hsmenuworkerstateplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/t_hsmenuworkerstateplugin.pri Mon Sep 20 10:19: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: +# Header files +HEADERS += ./inc/*.h \ + ../../inc/*.h \ + ../../../../hsdomainmodel/inc/hsdomainmodeldatastructures.h \ + ../../../../hsdomainmodel/inc/hsdatabase.h \ + ../../../../hsdomainmodel/inc/hspage.h \ + ../../../../hsdomainmodel/inc/hspagetoucharea.h \ + ../../../../hsdomainmodel/inc/hswidgethost.h \ + ../../../../hsdomainmodel/inc/hswidgethostvisual.h \ + ../../../../hsdomainmodel/inc/hswidgettoucharea.h \ + ../../../../hsdomainmodel/inc/hsscene.h \ + ../../../../hsdomainmodel/inc/hswallpaper.h \ + ../../../../hsdomainmodel/inc/hsbackuprestoreobserver.h \ + ../../../../hsdomainmodel/inc/hsgui.h \ + ../../../../hsdomainmodel/inc/hsidlewidget.h \ + ../../../../hsdomainmodel/inc/hsdocumentloader.h \ + ../../../../hsdomainmodel/inc/hsconfiguration.h + + + +HEADERS -= ../../../hsdomainmodel/inc/hscontentservice.h +HEADERS -= ../../../hsdomainmodel/inc/hsshortcutservice.h + +# Source files +SOURCES += ./src/*.cpp \ + ../../src/*.cpp \ + ../../../../hsdomainmodel/src/hsconfiguration.cpp \ + ../../../../hsdomainmodel/src/hspagetoucharea.cpp \ + ../../../../hsdomainmodel/src/hswidgettoucharea.cpp \ + ../../../../hsdomainmodel/src/hswidgethostvisual.cpp \ + ../../../../hsdomainmodel/src/hsidlewidget.cpp \ + ../../../../hsdomainmodel/src/hsdocumentloader.cpp \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/t_hsmenuworkerstateplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/t_hsmenuworkerstateplugin/t_hsmenuworkerstateplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,107 @@ +# +# 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 = app + +include(../../../../common.pri) +include(../../docml.pri) + +LIBS += -lhsutils +LIBS += -lhsmenuserviceprovider +LIBS += -lcaclient +LIBS += -lcasoftwareregistry + + +CONFIG += hb console plugin mobility +MOBILITY = serviceframework + +QT += testlib \ + xml \ + sql +HB += hbfeedback +DEFINES += MENUSTATES_UNITTEST HSDOMAINMODEL_TEST HSWIDGETMODEL_LIB + +coverage:DEFINES += COVERAGE_MEASUREMENT + +DEPENDPATH += .\ + ./src \ + ./inc \ + ../../src \ + ../../inc + +INCLUDEPATH += .\ + ./inc \ + ../../inc \ + ../../../../../../homescreen/homescreenapp/inc \ + ../../../../../../homescreen/homescreenapp/hsdomainmodel/inc \ + ../../../../../../homescreen/homescreenapp/serviceproviders/hsmenuserviceprovider/inc \ + ../../../../../../homescreen/homescreenapp/hsutils/inc + + +win32: { +DEFINES += HSDOMAINMODEL_TEST +} + +symbian { + for(docmlFile, docmlFiles): DOCML+=../../$$docmlFile + + ### get rid of localization warnings + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + ### + TARGET.UID3 = 0x20022F6B + LIBS += -lPlatformEnv + TARGET.CAPABILITY = All -TCB + TARGET.EPOCSTACKSIZE = 0x14000 // 131kB + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 48MB + + LIBS += -lsif + LIBS += -lscrclient + + BLD_INF_RULES.prj_testexports += "./data/MIDPTestIcons.jad c:/testing/data/t_hsmenuworkerstateplugin/installs/" \ + "./data/MIDPTestIcons.jar c:/testing/data/t_hsmenuworkerstateplugin/installs/" + + BLD_INF_RULES.prj_exports += "./data/MIDPTestIcons.jad c:/testing/data/t_hsmenuworkerstateplugin/installs/" \ + "./data/MIDPTestIcons.jar c:/testing/data/t_hsmenuworkerstateplugin/installs/" + + BLD_INF_RULES.prj_testexports += "./data/DS_Snow.jad c:/testing/data/t_hsmenuworkerstateplugin/installs/" \ + "./data/DS_Snow.jar c:/testing/data/t_hsmenuworkerstateplugin/installs/" + + BLD_INF_RULES.prj_exports += "./data/DS_Snow.jad c:/testing/data/t_hsmenuworkerstateplugin/installs/" \ + "./data/DS_Snow.jar c:/testing/data/t_hsmenuworkerstateplugin/installs/" + + exportArmSis.sources += ./data/MIDPTestIcons.jad \ + ./data/MIDPTestIcons.jar + exportArmSis.sources += ./data/DS_Snow.jad \ + ./data/DS_Snow.jar + exportArmSis.path = c:/testing/data/t_hsmenuworkerstateplugin/installs + DEPLOYMENT += exportArmSis + + CONFIG += symbian_test + coverage: CONFIG -= symbian_test + + MMP_RULES += SMPSAFE + } + + +RESOURCES += ../../$$qrcFile + + +include(t_hsmenuworkerstateplugin.pri) + + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/tsrc/tsrc.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,21 @@ +# +# 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 = t_hsmenuworkerstateplugin + +CONFIG += ordered + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/hsclockwidgetplugin.pro --- a/homescreenapp/widgetplugins/hsclockwidgetplugin/hsclockwidgetplugin.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/hsclockwidgetplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -36,7 +36,7 @@ symbian: { TARGET.UID3 = 0x20022F6C LIBS += -lbafl -lapgrfx -lcone - + MMP_RULES += SMPSAFE } @@ -46,5 +46,3 @@ RESOURCES = hsclockwidgetplugin.qrc exportResources(./resource/*.manifest, $$WIDGET_SUBDIR) -exportResources(./resource/*.png, $$WIDGET_SUBDIR) -exportResources(./resource/*.svg, $$WIDGET_SUBDIR) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/resource/hsclockwidgetplugin.manifest --- a/homescreenapp/widgetplugins/hsclockwidgetplugin/resource/hsclockwidgetplugin.manifest Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/resource/hsclockwidgetplugin.manifest Mon Sep 20 10:19:07 2010 +0300 @@ -3,8 +3,8 @@ hsclockwidgetplugin Clock Themable clock widget. - tclock.png - qtg_graf_hswidget_preview_clock.svg + qtg_large_clock + qtg_large_clock false hsclockwidgetplugin.xml diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/resource/qtg_graf_hswidget_preview_clock.svg --- a/homescreenapp/widgetplugins/hsclockwidgetplugin/resource/qtg_graf_hswidget_preview_clock.svg Mon Sep 13 13:03:23 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,160 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/resource/tclock.png Binary file homescreenapp/widgetplugins/hsclockwidgetplugin/resource/tclock.png has changed diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/inc/t_hsclockwidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/inc/t_hsclockwidget.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2008, 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: test code +* +*/ + + + +#include + +#ifdef Q_OS_SYMBIAN +#include +#endif + +// forward declaration +class HsClockWidget; + +/** +* @test Implementation for the clock plugin test code +*/ +class TestClockWidget : public QObject +{ + Q_OBJECT + + private slots: + + void initTestCase(); + void cleanupTestCase(); + void init(); + void cleanup(); + + // hsclockwidget.cpp tests + void createClockWidget(); + void toggleAnalogDigital(); + + void testClockOnInitalize(); + void testClockOnShow(); + void testClockOnHide(); + void testOnUninitialize(); + void testOnSettingsChanged(); + void testClockShape(); + + // hsanalogclockwidget.cpp tests + void createAnalogClockWidget(); + void analogClockWidgetTick(); + void analogClockWidgetPolish(); + void analogClockWidgetShape(); + + // hsdigitalclocklabel.cpp tests + void createDigitalClockWidget(); + void digitalClockWidgetTick(); + void digitalClockWidgetPolish(); + void digitalClockWidgetShape(); + + // hsclockwidgettimer.cpp + void testHsClockWidgetTimer(); + +#ifdef Q_OS_SYMBIAN + // hsclocksettingsnotifier_symbian.cpp tests + void testSettingOfClockAndTimeFormat(); +#endif + +private: + + HsClockWidget *mClockWidget; + +#ifdef Q_OS_SYMBIAN + TClockFormat mClockFormat; + TTimeFormat mTimeFormat; +#endif + + }; + + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/installs_win32.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,20 @@ +# +# 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: +# + +testfiles.path = ../../../../../../bin/hstests/ +testfiles.files = ./debug/t_hsclockwidgetplugin.exe + +INSTALLS += testfiles diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/sis/t_hsclockwidgetplugin.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/sis/t_hsclockwidgetplugin.pkg Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,36 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; + +; Language +&EN + +; SIS header: name, uid, version +#{"t_t_hsclockwidgetplugin"},(0x20022F6D),1,0,0 + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Supports S60 5th Edition +[0x1028315F], 0, 0, 0, {"S60ProductID"} + +; Clock widget unittest +"/epoc32/release/armv5/urel/t_hsclockwidgetplugin.exe" - "c:/sys/bin/t_hsclockwidgetplugin.exe" +"/epoc32/data/z/private/10003a3f/import/apps/t_hsclockwidgetplugin_reg.rsc" - "c:/private/10003a3f/import/apps/t_hsclockwidgetplugin_reg.rsc" +"/epoc32/data/z/resource/apps/t_hsclockwidgetplugin.rsc" - "c:/resource/apps/t_hsclockwidgetplugin.rsc" + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/sis/t_hsclockwidgetplugin_sisx.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/sis/t_hsclockwidgetplugin_sisx.bat Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,30 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem +@echo off + +if exist t_hsclockwidgetplugin.sisx del t_hsclockwidgetplugin.sisx + +makesis t_hsclockwidgetplugin.pkg +signsis t_hsclockwidgetplugin.sis t_hsclockwidgetplugin.sisx ../../../../../internal/sis/rd.cer ../../../../../internal/sis/rd-key.pem + +if exist t_hsclockwidgetplugin.sisx ( +echo t_hsclockwidgetplugin.sisx creation SUCCEEDED +del t_hsclockwidgetplugin.sis +) + +if not exist t_hsclockwidgetplugin.sisx ( +echo t_hsclockwidgetplugin.sisx creation FAILED +) \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/src/hsdatabase_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/src/hsdatabase_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,228 @@ +/* +* 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 "hsdatabase.h" +#include "hsdomainmodeldatastructures.h" + +HsDatabase::HsDatabase(QObject *parent) + : QObject(parent) +{ +} + +HsDatabase::~HsDatabase() +{ + +} + +void HsDatabase::setConnectionName(const QString &name) +{ + mConnectionName = name; +} + +QString HsDatabase::connectionName() const +{ + return mConnectionName; +} + +void HsDatabase::setDatabaseName(const QString &name) +{ + mDatabaseName = QDir::toNativeSeparators(name); +} + +QString HsDatabase::databaseName() const +{ + return mDatabaseName; +} + +bool HsDatabase::open() +{ + return true; +} + +void HsDatabase::close() +{ + +} + +bool HsDatabase::transaction() +{ + return true; +} + +bool HsDatabase::rollback() +{ + return true; +} + +bool HsDatabase::commit() +{ + return true; +} + +bool HsDatabase::scene(HsSceneData &) +{ + return true; +} + +bool HsDatabase::pages(QList &) +{ + return true; +} + +bool HsDatabase::page(HsPageData &) +{ + return true; +} + +bool HsDatabase::insertPage(HsPageData &) +{ + return true; +} + +bool HsDatabase::updatePage(const HsPageData &) +{ + return true; +} + +bool HsDatabase::deletePage(int ) +{ + return true; +} + +bool HsDatabase::widgets(int , QList &) +{ + return true; +} + +bool HsDatabase::widgets(const QString &, QList &) +{ + return true; +} + +bool HsDatabase::widgets(const QString &, const QVariantHash &, int &count) +{ + count = 0; + return true; +} +bool HsDatabase::widget(HsWidgetData &) +{ + return true; +} + +bool HsDatabase::insertWidget(HsWidgetData &) +{ + return true; +} + +bool HsDatabase::updateWidget(const HsWidgetData &) +{ + return true; +} + +bool HsDatabase::deleteWidget(int ) +{ + return true; +} + +bool HsDatabase::deleteWidgets(const QString &) +{ + return true; +} + +bool HsDatabase::widgetPresentation(HsWidgetPresentationData &) +{ + return true; +} + +bool HsDatabase::setWidgetPresentation(const HsWidgetPresentationData &) +{ + return true; +} + +bool HsDatabase::deleteWidgetPresentation(int ,Qt::Orientation) +{ + return true; +} + +bool HsDatabase::widgetPreferences(int , QVariantHash &) +{ + return true; +} + +bool HsDatabase::widgetPreference(int , const QString &, QVariant &) +{ + return true; +} + +bool HsDatabase::setWidgetPreferences(int , const QVariantHash &) +{ + return true; +} + +void HsDatabase::setInstance(HsDatabase *instance) +{ + if (mInstance != instance) { + HsDatabase *oldInstance = mInstance; + mInstance = instance; + delete oldInstance; + } +} + +HsDatabase *HsDatabase::instance() +{ + return mInstance; +} + +HsDatabase *HsDatabase::takeInstance() +{ + HsDatabase *instance = mInstance; + mInstance = 0; + return instance; +} + +bool HsDatabase::checkConnection() const +{ + return true; +} + +bool HsDatabase::configuration(QVariantHash &configuration) +{ + Q_UNUSED(configuration) + return true; +} + +bool HsDatabase::updateWidgetZValues(const QHash &data, Qt::Orientation orientation) +{ + Q_UNUSED(data) + Q_UNUSED(orientation) + return true; +} + +bool HsDatabase::matchWidgetPreferences(const QVariantHash &preferences, const QMultiMap& storedPreferences) +{ + Q_UNUSED(preferences) + Q_UNUSED(storedPreferences) + return true; +} + +HsDatabase *HsDatabase::mInstance(0); diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/src/t_hsanalogclockwidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/src/t_hsanalogclockwidget.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2008, 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: test code +* +*/ + + + +#include + +#include +#include +#include + +#include "t_hsclockwidget.h" +#include "hsanalogclockwidget.h" + + +void TestClockWidget::createAnalogClockWidget() +{ + HsAnalogClockWidget *clock = new HsAnalogClockWidget(); + QVERIFY(clock); + + QVERIFY(clock->mBackground); + QVERIFY(clock->mHourHand); + QVERIFY(clock->mMinuteHand); + QVERIFY(clock->mSecondHand); + + QGraphicsSceneResizeEvent event; + clock->resizeEvent(&event); + + delete clock; +} + +void TestClockWidget::analogClockWidgetTick() +{ + HsAnalogClockWidget *clock = new HsAnalogClockWidget(); + clock->tick(); + delete clock; +} + +void TestClockWidget::analogClockWidgetPolish() +{ + HsAnalogClockWidget *clock = new HsAnalogClockWidget(); + HbStyleParameters params; + clock->polish(params); + HbIconItem *iconItem=static_cast(clock->mHourHand); + QVERIFY(iconItem); + delete clock; +} + +void TestClockWidget::analogClockWidgetShape() +{ + HsAnalogClockWidget *clock = new HsAnalogClockWidget(); + QPainterPath path = clock->shape(); + delete clock; +} + +// end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/src/t_hsclocksettingsnotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/src/t_hsclocksettingsnotifier.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2008, 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: test code +* +*/ + + + +#include + +#ifdef Q_OS_SYMBIAN +#include "t_hsclockwidget.h" +#include "hsclocksettingsnotifier_symbian.h" + +#include // CEnvironmentChangeNotifier + + +namespace +{ + const char ANALOG[] = "analog"; + const char DIGITAL[] = "digital"; + const char TIME12[] = "TIME12"; + const char TIME24[] = "TIME24"; +} + + +void TestClockWidget::testSettingOfClockAndTimeFormat() + { + HsClockSettingsNotifier clockSettingsNotifier; + + QVERIFY(clockSettingsNotifier.mDateTimeNotifier); + QVERIFY(clockSettingsNotifier.mDateTimeNotifier->IsActive()); + + TLocale locale; + + // ANALOG, TIME12 + locale.SetClockFormat(EClockAnalog); + locale.SetTimeFormat(ETime12); + locale.Set(); + qApp->processEvents(); + + TClockFormat clockFormat = locale.ClockFormat(); + TTimeFormat timeFormat = locale.TimeFormat(); + + QCOMPARE( clockSettingsNotifier.clockFormat(), QString(ANALOG)); + QCOMPARE( clockSettingsNotifier.timeFormat(), QString(TIME12)); + + // ANALOG, TIME24 + locale.SetClockFormat(EClockAnalog); + locale.SetTimeFormat(ETime24); + locale.Set(); + qApp->processEvents(); + + clockFormat = locale.ClockFormat(); + timeFormat = locale.TimeFormat(); + + QCOMPARE( clockSettingsNotifier.clockFormat(), QString(ANALOG)); + QCOMPARE( clockSettingsNotifier.timeFormat(), QString(TIME24)); + + // DIGITAL, TIME24 + locale.SetClockFormat(EClockDigital); + locale.SetTimeFormat(ETime24); + locale.Set(); + qApp->processEvents(); + + clockFormat = locale.ClockFormat(); + timeFormat = locale.TimeFormat(); + + QCOMPARE( clockSettingsNotifier.clockFormat(), QString(DIGITAL)); + QCOMPARE( clockSettingsNotifier.timeFormat(), QString(TIME24)); + + // DIGITAL, TIME12 + locale.SetClockFormat(EClockDigital); + locale.SetTimeFormat(ETime12); + locale.Set(); + qApp->processEvents(); + + clockFormat = locale.ClockFormat(); + timeFormat = locale.TimeFormat(); + + QCOMPARE( clockSettingsNotifier.clockFormat(), QString(DIGITAL)); + QCOMPARE( clockSettingsNotifier.timeFormat(), QString(TIME12)); + + clockSettingsNotifier.createObserver(); + QVERIFY(clockSettingsNotifier.mDateTimeNotifier); + QVERIFY(clockSettingsNotifier.mDateTimeNotifier->IsActive()); + } + + + +#endif + +// end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/src/t_hsclockwidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/src/t_hsclockwidget.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,198 @@ +/* +* Copyright (c) 2008, 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: test code +* +*/ + + + +#include +#include +#include +#include +#include +#include + +#include "t_hsclockwidget.h" +#include "hsclockwidget.h" +#include "hsanalogclockwidget.h" +#include "hsdigitalclockwidget.h" +#include "hsclockwidgettimer.h" + +#ifdef Q_OS_SYMBIAN +#include // TLocale +#include +#include +#endif //Q_OS_SYMBIAN + +namespace +{ + const char ANALOG[] = "analog"; + const char DIGITAL[] = "digital"; + const char TIME12[] = "TIME12"; + const char TIME24[] = "TIME24"; +} + + +#ifdef Q_OS_SYMBIAN +#define KClockApUid TUid::Uid(0x10005903) +#endif //Q_OS_SYMBIAN + +void TestClockWidget::initTestCase() + { +#ifdef Q_OS_SYMBIAN + TLocale locale; + mClockFormat = locale.ClockFormat(); + mTimeFormat = locale.TimeFormat(); +#endif + } + +void TestClockWidget::cleanupTestCase() + { +#ifdef Q_OS_SYMBIAN + TLocale locale; + locale.SetClockFormat(mClockFormat); + locale.SetTimeFormat(mTimeFormat); + locale.Set(); +#endif + } + +void TestClockWidget::init() + { + QGraphicsWidget *hostWidget = new QGraphicsWidget(); + mClockWidget = new HsClockWidget(hostWidget); + mClockWidget->resize(100,100); + QVERIFY( mClockWidget ); + } + +void TestClockWidget::cleanup() + { + //delete mClockWidget->parentItem(); + delete mClockWidget; + mClockWidget = 0; + + } + +void TestClockWidget::createClockWidget() + { + } + + +void TestClockWidget::toggleAnalogDigital() + { + mClockWidget->onInitialize(); + QString clockType = mClockWidget->mClockType; + + mClockWidget->onClockTapped(); + +#ifndef Q_OS_SYMBIAN + // toggles analog/digital on windows + if (clockType == DIGITAL) { + QCOMPARE( mClockWidget->mClockType, QString(ANALOG)); + } else { + QCOMPARE( mClockWidget->mClockType, QString(DIGITAL)); + } + + clockType = mClockWidget->mClockType; + + mClockWidget->onClockTapped(); + + if (clockType == DIGITAL) { + QCOMPARE( mClockWidget->mClockType, QString(ANALOG)); + } else { + QCOMPARE( mClockWidget->mClockType, QString(DIGITAL)); + } +#else + QCOMPARE( mClockWidget->mClockType, clockType); + QTest::qWait(6000); + TApaTaskList taskList(CEikonEnv::Static()->WsSession()); + TApaTask task = taskList.FindApp(KClockApUid); + if (task.Exists()){ + task.SendToBackground(); + } + else { + QWARN("Clock application start failed"); + } +#endif + } + + +void TestClockWidget::testClockOnInitalize() +{ + mClockWidget->onInitialize(); + QVERIFY(mClockWidget->mWidget); +} + +void TestClockWidget::testClockOnShow() +{ + mClockWidget->onInitialize(); + QVERIFY(mClockWidget->mWidget); + QVERIFY(!HsClockWidgetTimer::instance()->mTimer->isActive()); + mClockWidget->onShow(); + QVERIFY(HsClockWidgetTimer::instance()->mTimer->isActive()); + + QSignalSpy updateSpy(HsClockWidgetTimer::instance()->mTimer,SIGNAL(timeout())); + QEventLoop waitUntilTimeoutSignaled; + QTimer eventLoopTimer; + eventLoopTimer.setInterval(1500); + eventLoopTimer.setSingleShot(true); + connect(HsClockWidgetTimer::instance()->mTimer, SIGNAL(timeout()), + &waitUntilTimeoutSignaled, SLOT(quit())); + connect(&eventLoopTimer, SIGNAL(timeout()), &waitUntilTimeoutSignaled, SLOT(quit())); + eventLoopTimer.start(); + waitUntilTimeoutSignaled.exec(); + + //Verify timeout was received instead of eventLoopTimer has elapsed. + QCOMPARE(updateSpy.count(), 1); + QVERIFY(eventLoopTimer.isActive()); + eventLoopTimer.stop(); + +} + +void TestClockWidget::testClockOnHide() +{ + mClockWidget->onInitialize(); + mClockWidget->onShow(); + mClockWidget->onHide(); +} + +void TestClockWidget::testOnUninitialize() +{ + mClockWidget->onInitialize(); + mClockWidget->onUninitialize(); +} + + +void TestClockWidget::testOnSettingsChanged() +{ + mClockWidget->mClockType = QString(ANALOG); + mClockWidget->mTimeType = QString(TIME12); + + mClockWidget->onInitialize(); + mClockWidget->onShow(); + mClockWidget->onSettingsChanged(QString(DIGITAL), QString(TIME24)); + mClockWidget->onSettingsChanged(QString(DIGITAL), QString(TIME12)); + mClockWidget->onSettingsChanged(QString(ANALOG), QString(TIME24)); + mClockWidget->onSettingsChanged(QString(ANALOG), QString(TIME12)); +} + +void TestClockWidget::testClockShape() +{ + mClockWidget->onInitialize(); + mClockWidget->shape(); +} + +QTEST_MAIN(TestClockWidget) + +// end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/src/t_hsdigitalclockwidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/src/t_hsdigitalclockwidget.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2008, 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: test code +* +*/ + + + +#include + +#include +#include "t_hsclockwidget.h" +#include "hsdigitalclockwidget.h" +#include "hsclockwidgettimer.h" + + + +void TestClockWidget::createDigitalClockWidget() +{ + HsDigitalClockWidget *clock = new HsDigitalClockWidget(); + QVERIFY(clock); + + QVERIFY(clock->mBackground); + QVERIFY(clock->mDigit1); + QVERIFY(clock->mDigit2); + QVERIFY(clock->mDigit3); + QVERIFY(clock->mDigit4); + QVERIFY(clock->mDigit5); + QVERIFY(clock->mDigit6); + + QGraphicsSceneResizeEvent event; + clock->resizeEvent(&event); + + delete clock; +} + +void TestClockWidget::digitalClockWidgetTick() +{ + HsDigitalClockWidget *clock = new HsDigitalClockWidget(false); + clock->tick(); + clock->setAmPm(true); + clock->setAmPm(false); + clock->setAmPm(false); + delete clock; +} + +void TestClockWidget::digitalClockWidgetPolish() +{ + HsDigitalClockWidget *clock = new HsDigitalClockWidget(); + HbStyleParameters params; + clock->polish(params); + HbIconItem *iconItem=static_cast(clock->mDigit2); + QVERIFY(iconItem); + delete clock; +} + +void TestClockWidget::digitalClockWidgetShape() +{ + HsDigitalClockWidget *clock = new HsDigitalClockWidget(); + QPainterPath path = clock->shape(); + delete clock; +} + +void TestClockWidget::testHsClockWidgetTimer() +{ + HsClockWidgetTimer timer; +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/t_hsclockwidgetplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/t_hsclockwidgetplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,71 @@ +# +# 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 = app + +CONFIG += debug_and_release + +QT += testlib +QT += sql + +CONFIG(debug, debug|release) { + DESTDIR = ./debug + } else { + DESTDIR = ./release + } + +CONFIG += hb + +HB += hbfeedback + +DEFINES += HOMESCREEN_TEST \ + HSDOMAINMODEL_TEST + + +coverage: { + DEFINES += COVERAGE_MEASUREMENT +} + +INCLUDEPATH += ./inc \ + ../../inc \ + ../../../../inc \ + ../../../../hsdomainmodel/inc + +DEPENDPATH += ./inc \ + ./src \ + ../../inc \ + ../../src + +win32:include(t_hsclockwidgetplugin_win.pri) +symbian:include(t_hsclockwidgetplugin_symbian.pri) + +symbian: { + CONFIG += symbian_test + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + TARGET.UID3 = 0x20022F6D + TARGET.CAPABILITY = CAP_APPLICATION AllFiles WriteDeviceData ReadDeviceData + LIBS += -lbafl -lapgrfx -lcone + + MMP_RULES += SMPSAFE + +} + +RESOURCES = ../../hsclockwidgetplugin.qrc + +win32:include(installs_win32.pri) + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/t_hsclockwidgetplugin_symbian.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/t_hsclockwidgetplugin_symbian.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,33 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +HEADERS += ./inc/*.h \ + ../../inc/hsanalogclockwidget.h \ + ../../inc/hsclockwidget.h \ + ../../inc/hsclockwidgettimer.h \ + ../../inc/hsdigitalclockwidget.h \ + ../../inc/hsclocksettingsnotifier_symbian.h \ + ../../../../hsdomainmodel/inc/hsconfiguration.h \ + ../../../../hsdomainmodel/inc/hsdatabase.h + +SOURCES += ./src/*.cpp \ + ../../src/hsanalogclockwidget.cpp \ + ../../src/hsclockwidget.cpp \ + ../../src/hsclockwidgettimer.cpp \ + ../../src/hsdigitalclockwidget.cpp \ + ../../src/hsclocksettingsnotifier_symbian.cpp \ + ../../../../hsdomainmodel/src/hsconfiguration.cpp + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/t_hsclockwidgetplugin_win.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/t_hsclockwidgetplugin/t_hsclockwidgetplugin_win.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,31 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +HEADERS += ./inc/*.h \ + ../../inc/hsanalogclockwidget.h \ + ../../inc/hsclockwidget.h \ + ../../inc/hsclockwidgettimer.h \ + ../../inc/hsdigitalclockwidget.h \ + ../../../../hsdomainmodel/inc/hsconfiguration.h \ + ../../../../hsdomainmodel/inc/hsdatabase.h + + +SOURCES += ./src/*.cpp \ + ../../src/hsanalogclockwidget.cpp \ + ../../src/hsclockwidget.cpp \ + ../../src/hsclockwidgettimer.cpp \ + ../../src/hsdigitalclockwidget.cpp \ + ../../../../hsdomainmodel/src/hsconfiguration.cpp diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/tsrc/tsrc.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,21 @@ +# +# 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 = t_hsclockwidgetplugin + +CONFIG += ordered + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsshortcutwidgetplugin/hsshortcutwidgetplugin.pro --- a/homescreenapp/widgetplugins/hsshortcutwidgetplugin/hsshortcutwidgetplugin.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/hsshortcutwidgetplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -41,6 +41,7 @@ symbian: { TARGET.UID3 = 0x20022F46 + MMP_RULES += SMPSAFE } exportResources(./resource/*.manifest, $$WIDGET_SUBDIR) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/inc/t_hsshortcutwidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/inc/t_hsshortcutwidget.h Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2008, 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 "hsshortcutservice.h" + +class QStateMachine; + +class TestShortcutWidget : public QObject +{ + Q_OBJECT + +private slots: + void initTestCase(); + void cleanupTestCase(); + + void testConstruction(); + void testProperties(); + void testSignals(); + void testShowHide(); + void testCaNotifier(); + void testUserInteraction(); + +private: + HsShortcutService *mShortcutService; + QStateMachine *mMachine; +}; diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/sis/t_hsshortcutwidget.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/sis/t_hsshortcutwidget.pkg Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,35 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; + +; Language +&EN + +; SIS header: name, uid, version +#{"t_hsshortcutwidget"},(0x20022F64),1,0,0 + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Supports S60 5th Edition +[0x1028315F], 0, 0, 0, {"S60ProductID"} + +; Shortcut widget unittest +"/epoc32/release/armv5/urel/t_hsshortcutwidget.exe" - "c:/sys/bin/t_hsshortcutwidget.exe" +"/epoc32/data/z/private/10003a3f/import/apps/t_hsshortcutwidget_reg.rsc" - "c:/private/10003a3f/import/apps/t_hsshortcutwidget_reg.rsc" +"/epoc32/data/z/resource/apps/t_hsshortcutwidget.rsc" - "c:/resource/apps/t_hsshortcutwidget.rsc" diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/sis/t_hsshortcutwidget_sisx.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/sis/t_hsshortcutwidget_sisx.bat Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,30 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem +@echo off + +if exist t_hsshortcutwidget.sisx del t_hsshortcutwidget.sisx + +makesis t_hsshortcutwidget.pkg +signsis t_hsshortcutwidget.sis t_hsshortcutwidget.sisx ../../../../../internal/sis/rd.cer ../../../../../internal/sis/rd-key.pem + +if exist t_hsshortcutwidget.sisx ( +echo t_hsshortcutwidget.sisx creation SUCCEEDED +del t_hsshortcutwidget.sis +) + +if not exist t_hsshortcutwidget.sisx ( +echo t_hsshortcutwidget.sisx creation FAILED +) \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/src/hsdatabase_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/src/hsdatabase_mock.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,228 @@ +/* +* 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 "hsdatabase.h" +#include "hsdomainmodeldatastructures.h" + +HsDatabase::HsDatabase(QObject *parent) + : QObject(parent) +{ +} + +HsDatabase::~HsDatabase() +{ + +} + +void HsDatabase::setConnectionName(const QString &name) +{ + mConnectionName = name; +} + +QString HsDatabase::connectionName() const +{ + return mConnectionName; +} + +void HsDatabase::setDatabaseName(const QString &name) +{ + mDatabaseName = QDir::toNativeSeparators(name); +} + +QString HsDatabase::databaseName() const +{ + return mDatabaseName; +} + +bool HsDatabase::open() +{ + return true; +} + +void HsDatabase::close() +{ + +} + +bool HsDatabase::transaction() +{ + return true; +} + +bool HsDatabase::rollback() +{ + return true; +} + +bool HsDatabase::commit() +{ + return true; +} + +bool HsDatabase::scene(HsSceneData &) +{ + return true; +} + +bool HsDatabase::pages(QList &) +{ + return true; +} + +bool HsDatabase::page(HsPageData &) +{ + return true; +} + +bool HsDatabase::insertPage(HsPageData &) +{ + return true; +} + +bool HsDatabase::updatePage(const HsPageData &) +{ + return true; +} + +bool HsDatabase::deletePage(int ) +{ + return true; +} + +bool HsDatabase::widgets(int , QList &) +{ + return true; +} + +bool HsDatabase::widgets(const QString &, QList &) +{ + return true; +} + +bool HsDatabase::widgets(const QString &, const QVariantHash &, int &count) +{ + count = 0; + return true; +} +bool HsDatabase::widget(HsWidgetData &) +{ + return true; +} + +bool HsDatabase::insertWidget(HsWidgetData &) +{ + return true; +} + +bool HsDatabase::updateWidget(const HsWidgetData &) +{ + return true; +} + +bool HsDatabase::deleteWidget(int ) +{ + return true; +} + +bool HsDatabase::deleteWidgets(const QString &) +{ + return true; +} + +bool HsDatabase::widgetPresentation(HsWidgetPresentationData &) +{ + return true; +} + +bool HsDatabase::setWidgetPresentation(const HsWidgetPresentationData &) +{ + return true; +} + +bool HsDatabase::deleteWidgetPresentation(int, Qt::Orientation) +{ + return true; +} + +bool HsDatabase::widgetPreferences(int , QVariantHash &) +{ + return true; +} + +bool HsDatabase::widgetPreference(int , const QString &, QVariant &) +{ + return true; +} + +bool HsDatabase::setWidgetPreferences(int , const QVariantHash &) +{ + return true; +} + +void HsDatabase::setInstance(HsDatabase *instance) +{ + if (mInstance != instance) { + HsDatabase *oldInstance = mInstance; + mInstance = instance; + delete oldInstance; + } +} + +HsDatabase *HsDatabase::instance() +{ + return mInstance; +} + +HsDatabase *HsDatabase::takeInstance() +{ + HsDatabase *instance = mInstance; + mInstance = 0; + return instance; +} + +bool HsDatabase::checkConnection() const +{ + return true; +} + +bool HsDatabase::configuration(QVariantHash &configuration) +{ + Q_UNUSED(configuration) + return true; +} + +bool HsDatabase::updateWidgetZValues(const QHash &data, Qt::Orientation orientation) +{ + Q_UNUSED(data) + Q_UNUSED(orientation) + return true; +} + +bool HsDatabase::matchWidgetPreferences(const QVariantHash &preferences, const QMultiMap& storedPreferences) +{ + Q_UNUSED(preferences) + Q_UNUSED(storedPreferences) + return true; +} + +HsDatabase *HsDatabase::mInstance(0); diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/src/mockshortcutservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/src/mockshortcutservice.cpp Mon Sep 20 10:19: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: Entry point for shortcut widget +* +*/ + +#include + +#include "hsshortcutservice.h" +#include "hsshortcutservice_p.h" +#include "hscontentservice.h" +#include "hsmenueventfactory.h" +#include "hspage.h" +#include "hsdomainmodeldatastructures.h" + +#include "canotifier.h" +#include "canotifierfilter.h" +#include "caservice.h" + + +HsShortcutService *HsShortcutService::mInstance(0); + +HsShortcutServicePrivate::HsShortcutServicePrivate( + QStateMachine* aStateMachine, + QObject *parent) + : QObject(parent), + mStateMachine(aStateMachine) +{ +} +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +HsShortcutServicePrivate::~HsShortcutServicePrivate() +{ + +} + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void HsShortcutServicePrivate::executeCollectionAction(int shortcutId, + const QString& collectionType) +{ + QEvent* menuEvent = HsMenuEventFactory::createOpenCollectionEvent( + shortcutId, collectionType); + mStateMachine->postEvent(menuEvent); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +bool HsShortcutServicePrivate::isItemShortcutWidget(int aItemId) +{ + Q_UNUSED(aItemId); + return false; +} + +HsShortcutService *HsShortcutService::instance(QStateMachine* machine) +{ + if(!mInstance && machine) { + mInstance = new HsShortcutService(machine); + } + return mInstance; +} + + + +/*! + Contructor + + \a aManifestFileWithPath e.g c:/foo/bar/shortcutwidget.manifest + \a aContentService Pointer to content service. + \a aContentStore Pointer to content store. + \a aMcsService Pointer to mcs service. + \a aStateMachine Pointer to state machine to post events. + \a parent Parent object. +*/ +HsShortcutService::HsShortcutService( + QStateMachine* aStateMachine, + QObject *parent) + : QObject(parent) +{ + mD.reset(new HsShortcutServicePrivate(aStateMachine)); +} + +/*! + Destructor +*/ +HsShortcutService::~HsShortcutService() +{ + +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void HsShortcutService::executeCollectionAction(int shortcutId, + const QString &collectionType) +{ + mD->executeCollectionAction(shortcutId, collectionType); +} + +bool HsShortcutService::isItemShortcutWidget(int aItemId) +{ + return mD->isItemShortcutWidget(aItemId); +} diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/src/t_hsshortcutwidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/src/t_hsshortcutwidget.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,182 @@ +/* +* Copyright (c) 2008, 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: test code +* +*/ + +#include +#include +#include + +#include +#include + +#include "t_hsshortcutwidget.h" +#include "hsshortcutwidget.h" +#include "hsshortcutservice.h" +#include "hsconfiguration.h" + +#include "caentry.h" +#include "caservice.h" + +void TestShortcutWidget::initTestCase() +{ + mMachine = new QStateMachine; + mShortcutService = HsShortcutService::instance(mMachine); + HsConfiguration::setInstance(new HsConfiguration); +} + +void TestShortcutWidget::cleanupTestCase() +{ + delete mMachine; +} + +void TestShortcutWidget::testConstruction() +{ + HSCONFIGURATION_SET(setShortcutLabelVisible, true); + HsShortcutWidget *w = new HsShortcutWidget; + QVERIFY(w->mBackground); + QVERIFY(w->mIcon); + QVERIFY(w->mText); + QCOMPARE(w->mCaEntryId, -1); + QCOMPARE(w->mCaEntryRole, ItemEntryRole); + w->createPrimitives(); + QVERIFY(w->mBackground); + QVERIFY(w->mIcon); + QVERIFY(w->mText); + QCOMPARE(w->mCaEntryId, -1); + QCOMPARE(w->mCaEntryRole, ItemEntryRole); + + w->setText("testing"); + QCOMPARE(w->text(), QString("testing")); + + delete w; + + HSCONFIGURATION_SET(setShortcutLabelVisible, false); + w = new HsShortcutWidget; + QVERIFY(!w->mText); + w->setText("testing"); + QCOMPARE(w->text(), QString("")); + delete w; +} + +void TestShortcutWidget::testProperties() +{ + HsShortcutWidget *w = new HsShortcutWidget; + + QCOMPARE(w->property("caEntryId").toInt(), -1); + w->setProperty("caEntryId", 1); + QCOMPARE(w->property("caEntryId").toInt(), 1); + + QCOMPARE(w->property("uid").toString(), QString()); + w->setProperty("uid", "0xABBAACDC"); + QCOMPARE(w->property("uid").toString(), QString("0xABBAACDC")); + + delete w; +} + +void TestShortcutWidget::testSignals() +{ + HsShortcutWidget *w = new HsShortcutWidget; + + QSignalSpy spy(w, SIGNAL(finished())); + w->onInitialize(); + QCOMPARE(spy.count(), 1); + spy.clear(); + + CaEntry e; + ChangeType c = RemoveChangeType; + + w->onEntryChanged(e, c); + QCOMPARE(spy.count(), 1); + spy.clear(); + + delete w; +} + +void TestShortcutWidget::testShowHide() +{ + HsShortcutWidget *w = new HsShortcutWidget; + + w->onShow(); + QVERIFY(w->isVisible()); + w->onHide(); + + w->mCaEntryFlags = MissingEntryFlag; + w->onShow(); + QVERIFY(!w->isVisible()); + w->onHide(); + + delete w; +} + +void TestShortcutWidget::testCaNotifier() +{ + HSCONFIGURATION_SET(setShortcutLabelVisible, true); + HsShortcutWidget *w = new HsShortcutWidget; + + w->createCaNotifier(); + + CaEntry e; + ChangeType c = UpdateChangeType; + w->onEntryChanged(e, c); + QVERIFY(w->isVisible()); + + //Media detached + QSignalSpy spy(w, SIGNAL(finished())); + c = RemoveChangeType; + e.setFlags(e.flags() | MissingEntryFlag); + w->onEntryChanged(e, c); + QVERIFY(!w->isVisible()); + QCOMPARE(spy.count(), 0); + spy.clear(); + + //Genuinely removed + c = RemoveChangeType; + //Remove MissingEntryFlag + e.setFlags(e.flags() & ~MissingEntryFlag); + w->onEntryChanged(e, c); + QVERIFY(w->isVisible()); + QCOMPARE(spy.count(), 1); + spy.clear(); + delete w; + + + HSCONFIGURATION_SET(setShortcutLabelVisible, false); + w = new HsShortcutWidget; + w->createCaNotifier(); + c = UpdateChangeType; + w->onEntryChanged(e, c); + QVERIFY(w->isVisible()); + delete w; + +} + +void TestShortcutWidget::testUserInteraction() +{ + HsShortcutWidget *w = new HsShortcutWidget; + w->resize(100, 100); + + w->setBackgroundToNormal(); + QCOMPARE(w->mBackground->frameDrawer().frameGraphicsName(), QLatin1String("qtg_fr_hsshortcut_normal")); + + w->setBackgroundToPressed(); + QCOMPARE(w->mBackground->frameDrawer().frameGraphicsName(), QLatin1String("qtg_fr_hsitems_pressed")); + + w->launch(); + + delete w; +} + +QTEST_MAIN(TestShortcutWidget) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/t_hsshortcutwidget.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/t_hsshortcutwidget.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,27 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +HEADERS += ./inc/*.h \ + ../../inc/hsshortcutwidget.h \ + ../../../../hsdomainmodel/inc/hsshortcutservice.h \ + ../../../../hsdomainmodel/inc/hsshortcutservice_p.h \ + ../../../hsdomainmodel/inc/hsconfiguration.h \ + ../../../hsdomainmodel/inc/hsdatabase.h + +SOURCES += ./src/*.cpp \ + ../../src/hsshortcutwidget.cpp \ + ../../../hsdomainmodel/src/hsconfiguration.cpp + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/t_hsshortcutwidget.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/t_hsshortcutwidget.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,75 @@ +# +# 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 = app + +QT += testlib sql + +CONFIG += debug_and_release + +CONFIG(debug, debug|release) { + DESTDIR = debug + LIBS += -L../../../../../../bin/debug -lhsutils + LIBS += -L../../../../../../bin/debug -lcaclient +} +else { + DESTDIR = release + LIBS += -L../../../../../../bin/release -lhsutils + LIBS += -L../../../../../../bin/release -lcaclient +} + +CONFIG += hb mobility +MOBILITY = serviceframework + +HB += hbfeedback + +DEFINES += HOMESCREEN_TEST \ + HSDOMAINMODEL_TEST + +coverage:DEFINES += COVERAGE_MEASUREMENT + +exists(../../../../../../homescreensrv) { +INCLUDEPATH += ../../../../../../homescreensrv/homescreensrv_plat/contentstorage_api \ +} +else { +INCLUDEPATH += $${EPOCROOT}sf/mw/homescreensrv/homescreensrv_plat/contentstorage_api \ +} + +INCLUDEPATH += ./inc \ + ../../inc \ + ../../../../inc \ + ../../../../hsdomainmodel/inc \ + ../../../../hsutils/inc + +DEPENDPATH += ./inc \ + ./src \ + ../../inc \ + ../../src + +include(t_hsshortcutwidget.pri) + +symbian: { + CONFIG += symbian_test + CONFIG -= hb + load(hb.prf) + CONFIG -= symbian_i18n + TARGET.UID3 = 0x20022F64 + TARGET.CAPABILITY = CAP_APPLICATION AllFiles + + MMP_RULES += SMPSAFE +} + +win32:include(t_hsshortcutwidget_installs_win32.pri) diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/t_hsshortcutwidget_installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/t_hsshortcutwidget/t_hsshortcutwidget_installs_win32.pri Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,35 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +testfiles.path = ../../../../../../bin/hstests/ +testfiles.files = ./debug/t_hsshortcutwidget.exe + +compos.path = ../../../../../../bin/hstests/ +compos.files = ../../../../../../bin/debug/caclient.dll \ + ../../../../../../bin/debug/hsutils.dll \ + ../../../../../../homescreensrv/contentstorage/castorage/data/castorage.db \ + +compos3.path = ./debug +compos3.files = ../../../../../../bin/debug/caclient.dll \ + ../../../../../../bin/debug/hsutils.dll \ + ../../../../../../homescreensrv/contentstorage/castorage/data/castorage.db \ + + +compos4.path = ./ +compos4.files = ../../../../../../homescreensrv/contentstorage/castorage/data/castorage.db \ + +INSTALLS += testfiles compos compos3 compos4 + diff -r e4f038c420f7 -r 3ac3aaebaee5 homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/tsrc/tsrc.pro Mon Sep 20 10:19:07 2010 +0300 @@ -0,0 +1,21 @@ +# +# 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 = t_hsshortcutwidget + +CONFIG += ordered + diff -r e4f038c420f7 -r 3ac3aaebaee5 screensaver/devicedialogplugins/snsrdevicedialogplugin/snsrdevicedialogplugin.pro --- a/screensaver/devicedialogplugins/snsrdevicedialogplugin/snsrdevicedialogplugin.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/screensaver/devicedialogplugins/snsrdevicedialogplugin/snsrdevicedialogplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -36,6 +36,7 @@ pluginstub.sources = snsrdevicedialogplugin.dll pluginstub.path = /resource/plugins/devicedialogs DEPLOYMENT += pluginstub + MMP_RULES += SMPSAFE } win32: { diff -r e4f038c420f7 -r 3ac3aaebaee5 screensaver/screensavermodel/screensavermodel.pro --- a/screensaver/screensavermodel/screensavermodel.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/screensaver/screensavermodel/screensavermodel.pro Mon Sep 20 10:19: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" @@ -20,6 +20,7 @@ symbian: { TARGET.UID3 = 0x20027051 +MMP_RULES += SMPSAFE } DEFINES += SREENSAVERMODEL_LIB diff -r e4f038c420f7 -r 3ac3aaebaee5 screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrbigclockscreensaverplugin.pro --- a/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrbigclockscreensaverplugin.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrbigclockscreensaverplugin.pro Mon Sep 20 10:19:07 2010 +0300 @@ -34,6 +34,7 @@ symbian: { TARGET.UID3 = 0x20027052 + MMP_RULES += SMPSAFE } include(snsrbigclockscreensaverplugin.pri) diff -r e4f038c420f7 -r 3ac3aaebaee5 screensaver/snsrdisplaycontrol_s60/group/snsrdisplaycontrolclient.mmp --- a/screensaver/snsrdisplaycontrol_s60/group/snsrdisplaycontrolclient.mmp Mon Sep 13 13:03:23 2010 +0300 +++ b/screensaver/snsrdisplaycontrol_s60/group/snsrdisplaycontrolclient.mmp Mon Sep 20 10:19:07 2010 +0300 @@ -32,3 +32,4 @@ SOURCE snsrdisplaycontrolclient.cpp LIBRARY euser.lib +SMPSAFE \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 screensaver/snsrdisplaycontrol_s60/group/snsrdisplaycontrolserver.mmp --- a/screensaver/snsrdisplaycontrol_s60/group/snsrdisplaycontrolserver.mmp Mon Sep 13 13:03:23 2010 +0300 +++ b/screensaver/snsrdisplaycontrol_s60/group/snsrdisplaycontrolserver.mmp Mon Sep 20 10:19:07 2010 +0300 @@ -23,7 +23,7 @@ SECUREID 0x20031E00 VENDORID VID_DEFAULT -CAPABILITY CAP_APPLICATION +CAPABILITY ReadDeviceData WriteDeviceData PowerMgmt USERINCLUDE ../inc APP_LAYER_SYSTEMINCLUDE @@ -36,3 +36,4 @@ LIBRARY power_save_display_mode.lib LIBRARY hal.lib +SMPSAFE \ No newline at end of file diff -r e4f038c420f7 -r 3ac3aaebaee5 screensaver/snsrdisplaycontrol_s60/src/snsrdisplaycontrolsession.cpp --- a/screensaver/snsrdisplaycontrol_s60/src/snsrdisplaycontrolsession.cpp Mon Sep 13 13:03:23 2010 +0300 +++ b/screensaver/snsrdisplaycontrol_s60/src/snsrdisplaycontrolsession.cpp Mon Sep 20 10:19:07 2010 +0300 @@ -18,6 +18,8 @@ #include #include +#include +#include #include "snsrdisplaycontrolsession.h" #include "snsrdisplaycontrolcommon.h" @@ -96,13 +98,19 @@ { case ESnsrDispCtrlSrvDisplayOff: { - // off - // TODO + // Disable touch + HAL::Set( HALData::EPenState, 0 ); + + // Lights off + err = RProperty::Set(KPSUidCoreApplicationUIs, KLightsSSForcedLightsOn, 0); break; } case ESnsrDispCtrlSrvDisplayLowPower: { - // low power + // Disable touch + HAL::Set( HALData::EPenState, 0 ); + + // Set display mode TInt startRow = aMessage.Int0(); TInt endRow = aMessage.Int1(); // TODO: for now, we pass a zero-filled pixel buffer to power save API. @@ -114,8 +122,14 @@ } case ESnsrDispCtrlSrvDisplayFullPower: { - // full power + // Enable touch + HAL::Set( HALData::EPenState, 1 ); + + // Set display mode err = iPowerSave->Exit(); + + // Lights on + err = RProperty::Set(KPSUidCoreApplicationUIs, KLightsSSForcedLightsOn, 30) || err; break; } default: diff -r e4f038c420f7 -r 3ac3aaebaee5 screensaver/snsrutils/snsrutils.pro --- a/screensaver/snsrutils/snsrutils.pro Mon Sep 13 13:03:23 2010 +0300 +++ b/screensaver/snsrutils/snsrutils.pro Mon Sep 20 10:19:07 2010 +0300 @@ -24,6 +24,7 @@ symbian: { TARGET.UID3 = 0x20027056 + MMP_RULES += SMPSAFE } include(snsrutils.pri)