# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1271674907 -10800 # Node ID c464cd7e275316b0c75db918afa1e0c4cebc0cb4 Revision: 201011 Kit: 201015 diff -r 000000000000 -r c464cd7e2753 ftu.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftu.pro Mon Apr 19 14:01:47 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: FTU project file +# +TEMPLATE = subdirs + +SUBDIRS = ftuapplication \ + fturuntimeservices \ + wizardproviders \ + stateproviders \ + runtimeproviders + + + +tests:SUBDIRS += ftuapplication\tsrc\t_ftuapplication +tests:SUBDIRS += runtimeproviders\ftudefaultruntimeprovider\tsrc\t_ftudefaultruntimeprovider +tests:SUBDIRS += stateproviders\ftustateprovider\tsrc\t_ftustateprovider +tests:SUBDIRS += fturuntimeservices\tsrc\t_fturuntimeservices + +CONFIG += ordered + +symbian:include(ftu_exports_to_rom.pri) \ No newline at end of file diff -r 000000000000 -r c464cd7e2753 ftu_exports_to_rom.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftu_exports_to_rom.pri Mon Apr 19 14:01:47 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: FTU list of exported files to ROM +# + +BLD_INF_RULES.prj_exports += \ + "$${LITERAL_HASH}include " \ + "rom/ftu.iby CORE_APP_LAYER_IBY_EXPORT_PATH(ftu.iby)" diff -r 000000000000 -r c464cd7e2753 ftuapplication/ftuapplication.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftuapplication/ftuapplication.pri Mon Apr 19 14:01:47 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: FTU application list of files +# + +HEADERS += ./inc/*.h +SOURCES += ./src/*.cpp + +RESOURCES += ../translations/translations.qrc diff -r 000000000000 -r c464cd7e2753 ftuapplication/ftuapplication.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftuapplication/ftuapplication.pro Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,70 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: First Time Use application project file +# + +TEMPLATE = app + +TARGET = ftuapplication + +win32 { + LIBS += -L$$PWD/../../bin/debug + + CONFIG(debug, debug|release) { + SUBDIRPART = debug + } else { + SUBDIRPART = release + } + DESTDIR = $$PWD/../../bin/$$SUBDIRPART +} + +QT += xml + +CONFIG += hb mobility +MOBILITY = serviceframework + +CONFIG += hb +CONFIG += console + +nft:DEFINES += NFT + +DEPENDPATH += . \ + ./inc \ + ./src + +INCLUDEPATH += . \ + ./inc \ + ../inc + +symbian { + TARGET.UID2 = 0x100039CE + TARGET.UID3 = 0x20026F95 + TARGET.CAPABILITY = CAP_APPLICATION AllFiles TrustedUI + TARGET.EPOCSTACKSIZE = 0x14000 // 80kB + TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // 128kB - 16MB + rom:DEFINES += ROM + ICON = resources/ftu_app_icon.svg + icon.sources = resources/ftu_app_icon.svg + icon.path = /fturesources + addFiles.sources += ../translations/ftu_en_US.qm ../translations/ftu_en_GB.qm \ + ../translations/ftuexamplewizards_en_US.qm ../translations/ftuexamplewizards_en_GB.qm + addFiles.path = translations + DEPLOYMENT += icon addFiles +} + +win32 { +include(ftuapplication_installs_win32.pri) +} + +include(ftuapplication.pri) diff -r 000000000000 -r c464cd7e2753 ftuapplication/ftuapplication_installs_symbian.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftuapplication/ftuapplication_installs_symbian.pri Mon Apr 19 14:01:47 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: +# + + +#deploy.path = z: + +#exports1.path = /private/20026F95 + +#exports1.sources += resource/ftudb + +#for(export1, exports1.sources):BLD_INF_RULES.prj_exports += "./$$export1 $$deploy.path$$exports1.path/$$basename(export1)" + + + diff -r 000000000000 -r c464cd7e2753 ftuapplication/ftuapplication_installs_unix.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftuapplication/ftuapplication_installs_unix.pri Mon Apr 19 14:01:47 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: +# +# + +# Release +# + +r01.path = ../../bin/release/ +r01.files = ./release/ftuapplication + +INSTALLS += r01 + +# +# Debug +# + +d01.path = ../../bin/debug/ +d01.files = ./debug/ftuapplication + +INSTALLS += d01 \ No newline at end of file diff -r 000000000000 -r c464cd7e2753 ftuapplication/ftuapplication_installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftuapplication/ftuapplication_installs_win32.pri Mon Apr 19 14:01:47 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: +# +# +# Release +# + +r01.path = $$PWD/../../bin/release/ +r01.files = ./release/*.* + +INSTALLS += r01 + +# +# Debug +# + +d01.path = $$PWD/../../bin/debug/ +d01.files = ./debug/*.* + +INSTALLS += d01 diff -r 000000000000 -r c464cd7e2753 ftuapplication/inc/ftufirsttimeuse.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftuapplication/inc/ftufirsttimeuse.h Mon Apr 19 14:01:47 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: First Time Use application main class. +* +*/ + + +#ifndef FTU_FIRSTTIMEUSE_H +#define FTU_FIRSTTIMEUSE_H + +#include "ftutest_global.h" + +#include + +FTU_TEST_CLASS(FtuFirstTimeUseTest) + +class QStateMachine; + + +/** + * @ingroup group_ftuapplication + * @brief First Time Use application main class. + * + * Loads a runtime from a runtime provider plugin. Manages + * the runtime execution. + * + * @lib ?library + * @since S60 ?S60_version + */ +class FtuFirstTimeUse : public QObject +{ + Q_OBJECT + +public: + + /** + * Constructor. + * @since S60 ?S60_version. + * @param aParent Parent object. + */ + FtuFirstTimeUse(QObject* aParent = 0); + + /** + * Destructor. + * @since S60 ?S60_version. + */ + virtual ~FtuFirstTimeUse(); + +private: + + /** + * Registers service plugins pre-installed on the device. + */ + void registerServicePlugins(); + /** + * Recursively registers service plugins starting from given root + * directory. All directories containing plugins are added to + * application's library paths at the same time. + * @param root The root folder. + */ + void registerServicePlugins(const QString &root); + + Q_DISABLE_COPY(FtuFirstTimeUse) + +signals: + + /** + * Emitted when the FTU application needs to exit. + * @since S60 ?S60_version. + */ + void exit(); + +public slots: + + /** + * Starts the runtime. + * @since S60 ?S60_version. + */ + void start(); + + /** + * Stops the runtime. + * @since S60 ?S60_version. + */ + void stop(); + +private slots: + + /** + * Called after the runtime has started. + * @since S60 ?S60_version. + */ + void handleRuntimeStarted(); + + /** + * Called after the runtime has stopped. + * @since S60 ?S60_version. + */ + void handleRuntimeStopped(); + + /** + * Called after the runtime has faulted. + * @since S60 ?S60_version. + */ + void handleRuntimeFaulted(); + +private: + + /** + * Runtime. + */ + QStateMachine* mRuntime; + + FTU_TEST_FRIEND_CLASS(FtuFirstTimeUseTest) + +}; + +#endif + diff -r 000000000000 -r c464cd7e2753 ftuapplication/resources/ftu_app_icon.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftuapplication/resources/ftu_app_icon.svg Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r c464cd7e2753 ftuapplication/src/ftufirsttimeuse.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftuapplication/src/ftufirsttimeuse.cpp Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,202 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: First Time Use application main class. +* +*/ + + +#include "ftufirsttimeuse.h" + +#include +#include +#include +#include +#include +#include +#include + + +QTM_USE_NAMESPACE + +const char* ftuRuntimeUri = "com.nokia.ftu.runtime.FtuRuntime"; + +// --------------------------------------------------------------------------- +// FtuFirstTimeUse::FtuFirstTimeUse +// --------------------------------------------------------------------------- +// +FtuFirstTimeUse::FtuFirstTimeUse(QObject* aParent) : + QObject(aParent), + mRuntime(NULL) +{ + FTUTEST_FUNC_ENTRY("FTU::FtuFirstTimeUse::FtuFirstTimeUse"); + + registerServicePlugins(); + + QServiceManager manager; + QServiceFilter filter(ftuRuntimeUri); + QList interfaces = manager.findInterfaces( + filter); + + qDebug() << "ftu: found " << interfaces.count() + << " instances of runtime"; + + if(interfaces.count() > 0){ + mRuntime = (QStateMachine*)(manager.loadInterface( + interfaces.first().interfaceName())); + } + + + + if(mRuntime) { + mRuntime->setParent(this); + connect(mRuntime, SIGNAL(started()), SLOT(handleRuntimeStarted())); + connect(mRuntime, SIGNAL(stopped()), SLOT(handleRuntimeStopped())); + connect(mRuntime, SIGNAL(faulted()), SLOT(handleRuntimeFaulted())); + } + + FTUTEST_FUNC_EXIT("FTU::FtuFirstTimeUse::FtuFirstTimeUse"); +} + +// --------------------------------------------------------------------------- +// FtuFirstTimeUse::~FtuFirstTimeUse() +// --------------------------------------------------------------------------- +// +FtuFirstTimeUse::~FtuFirstTimeUse() +{ + if(mRuntime) + { + disconnect(mRuntime, SIGNAL(started()), this, SLOT(handleRuntimeStarted())); + disconnect(mRuntime, SIGNAL(stopped()), this, SLOT(handleRuntimeStopped())); + disconnect(mRuntime, SIGNAL(faulted()), this, SLOT(handleRuntimeFaulted())); + + delete mRuntime; + } +} + +// --------------------------------------------------------------------------- +// FtuFirstTimeUse::start() +// --------------------------------------------------------------------------- +// +void FtuFirstTimeUse::start() +{ + FTUTEST_FUNC_ENTRY("FTU::FtuFirstTimeUse::start"); + + if(mRuntime) { + mRuntime->start(); + } else { + emit exit(); + } + + FTUTEST_FUNC_EXIT("FTU::FtuFirstTimeUse::start"); +} + +// --------------------------------------------------------------------------- +// FtuFirstTimeUse::stop() +// --------------------------------------------------------------------------- +// +void FtuFirstTimeUse::stop() +{ + FTUTEST_FUNC_ENTRY("FTU::FtuFirstTimeUse::stop"); + + mRuntime->stop(); + + FTUTEST_FUNC_EXIT("FTU::FtuFirstTimeUse::stop"); +} + +// --------------------------------------------------------------------------- +// FtuFirstTimeUse::handleRuntimeStarted() +// --------------------------------------------------------------------------- +// +void FtuFirstTimeUse::handleRuntimeStarted() +{ +} + +// --------------------------------------------------------------------------- +// FtuFirstTimeUse::handleRuntimeStopped() +// --------------------------------------------------------------------------- +// +void FtuFirstTimeUse::handleRuntimeStopped() +{ + emit exit(); +} + +// --------------------------------------------------------------------------- +// FtuFirstTimeUse::handleRuntimeFaulted() +// --------------------------------------------------------------------------- +// +void FtuFirstTimeUse::handleRuntimeFaulted() +{ + emit exit(); +} +// --------------------------------------------------------------------------- +// FtuFirstTimeUse::registerServicePlugins() +// --------------------------------------------------------------------------- +// +void FtuFirstTimeUse::registerServicePlugins() +{ + FTUTEST_FUNC_ENTRY("FTU::FtuFirstTimeUse::registerServicePlugins()"); + QStringList pluginPaths; + + pluginPaths << "fturesources/plugins"; + + QFileInfoList drives = QDir::drives(); + foreach(const QString pluginPath, pluginPaths) { +#ifdef Q_OS_SYMBIAN + //Check plugin dirs from root of different drives + foreach(QFileInfo drive, drives) { + QString driveLetter = drive.absolutePath(); + QString path = driveLetter + pluginPath; + if(QDir(path).exists()) { + registerServicePlugins(path); + } + } +#endif + //Check plugin path relative to current dir + if(QDir(pluginPath).exists()) { + registerServicePlugins(pluginPath); + } + } + FTUTEST_FUNC_EXIT("FTU::FtuFirstTimeUse::registerServicePlugins()"); +} + +// --------------------------------------------------------------------------- +// FtuFirstTimeUse::registerServicePlugins() +// --------------------------------------------------------------------------- +// +void FtuFirstTimeUse::registerServicePlugins(const QString &root) +{ + FTUTEST_FUNC_ENTRY("FTU::FtuFirstTimeUse::registerServicePlugins(const QString &)"); + qDebug() << "FTU: root: " << root; + QDir dir = QDir(root); + QFileInfoList fileInfos = dir.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot); + + foreach (QFileInfo fileInfo, fileInfos) { + registerServicePlugins(fileInfo.absoluteFilePath()); + } + + fileInfos = dir.entryInfoList(QStringList("*.xml")); + + if (!fileInfos.isEmpty()) { + //Plugin dll and xml are in the same directory + QApplication::addLibraryPath(root); + qDebug() << QString("FTU::FtuFirstTimeUse::registerServicePlugins - Directory added to application's library paths: ") + << root; + QServiceManager manager; + foreach(QFileInfo fileInfo, fileInfos) { + manager.addService(fileInfo.absoluteFilePath()); + qDebug() << QString("FTU::FtuFirstTimeUse::registerServicePlugins - Plugin registered: ") + fileInfo.fileName(); + } + } + FTUTEST_FUNC_EXIT("FTU::FtuFirstTimeUse::registerServicePlugins(const QString &)"); +} diff -r 000000000000 -r c464cd7e2753 ftuapplication/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftuapplication/src/main.cpp Mon Apr 19 14:01:47 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: First Time Use application main implementation. +* +*/ + + +#include "ftufirsttimeuse.h" +#include "ftutest_global.h" + +#include +#include +#include +#include + +// --------------------------------------------------------------------------- +// main +// --------------------------------------------------------------------------- +// +int main(int argc, char *argv[]) +{ + FTUTEST_FUNC_ENTRY("FTU::FtuFirstTimeUse::main"); + + HbApplication app(argc, argv); + + QTranslator translator; + + QString translation = "ftu_"; + if(argc > 1){ + translation.append(argv[1]); + } + else{ + // another option to load locale could be QLocale::system().language()) + translation.append(QLocale::system().name()); // this seems to be ftu_en_US in Windows and ftu_en_GB in WINSCW emulator and hardware + } + translator.load(translation, ":/translations" ); + app.installTranslator(&translator); + + QString exampleWizardsTranslation = "ftuexamplewizards_"; + if(argc > 1){ + exampleWizardsTranslation.append(argv[1]); + } + else{ + exampleWizardsTranslation.append(QLocale::system().name()); + } + QTranslator exampleWizardsTranslator; + + exampleWizardsTranslator.load(exampleWizardsTranslation, ":/translations" ); + app.installTranslator(&exampleWizardsTranslator); + + FtuFirstTimeUse ftuFirstTimeUse; +#ifdef ROM + QDir::setCurrent("Z:/"); +#else + QDir::setCurrent("C:/"); + FTUDEBUG("main() - FtuApplication's current dir set to C:/"); +#endif //ROM + QObject::connect(&app,SIGNAL(aboutToQuit()),&ftuFirstTimeUse,SLOT(stop())); + QObject::connect(&ftuFirstTimeUse, SIGNAL(exit()), &app, SLOT(quit()),Qt::QueuedConnection); + ftuFirstTimeUse.start(); + int ret = app.exec(); + FTUTEST_FUNC_EXIT("FTU::FtuFirstTimeUse::main"); + return ret; +} diff -r 000000000000 -r c464cd7e2753 fturuntimeservices/fturuntimeservices.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fturuntimeservices/fturuntimeservices.pri Mon Apr 19 14:01:47 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: FTU runtime services list of files +# + +HEADERS += ./inc/*.h +SOURCES += ./src/*.cpp diff -r 000000000000 -r c464cd7e2753 fturuntimeservices/fturuntimeservices.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fturuntimeservices/fturuntimeservices.pro Mon Apr 19 14:01:47 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: FTU runtime services project file +# + +TEMPLATE = lib + +symbian { + CONFIG(debug, debug|release) { + DESTDIR = debug + } else { + DESTDIR = release + } +} + +win32 { + CONFIG(debug, debug|release) { + SUBDIRPART = debug + } else { + SUBDIRPART = release + } + DESTDIR = $$PWD/../../bin/$$SUBDIRPART +} +CONFIG += debug_and_release + +DEFINES += FTURUNTIMESERVICES_LIB + +DEPENDPATH += . \ + inc \ + src + +INCLUDEPATH += . \ + inc + +CONFIG += hb + +symbian { +TARGET.UID3 = 0x20027037 +TARGET.EPOCALLOWDLLDATA=1 +TARGET.CAPABILITY = ALL -TCB +LIBS += -lswinstcli +BLD_INF_RULES.prj_exports += "./inc/fturuntimeservices_global.h |../inc/" \ + "./inc/ftucontentservice.h |../inc/" +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE +} + +win32 { +} +include(fturuntimeservices.pri) +system(copy /y .\inc\fturuntimeservices_global.h ..\inc) +system(copy /y .\inc\ftucontentservice.h ..\inc) + +#ONLY FOR DEVELOPMENT! REMOVE THIS BEFORE EACH HS_Domain RELEASE! +symbian: MMP_RULES += EXPORTUNFROZEN diff -r 000000000000 -r c464cd7e2753 fturuntimeservices/fturuntimeservices_installs_symbian.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fturuntimeservices/fturuntimeservices_installs_symbian.pri Mon Apr 19 14:01:47 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/ftucontentservice.h \ + ./inc/ftucontentservice_p.h \ + ./inc/fturuntimeservices_global.h + +SOURCES += ./src/ftucontentservice.cpp \ \ No newline at end of file diff -r 000000000000 -r c464cd7e2753 fturuntimeservices/fturuntimeservices_installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fturuntimeservices/fturuntimeservices_installs_win32.pri Mon Apr 19 14:01:47 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: +# +# +# Release +# + +r01.path = $$PWD/../../bin/release +r01.files = ./release/*.* + +INSTALLS += r01 + +# +# Debug +# + +d01.path = $$PWD/../../bin/debug +d01.files = ./debug/*.* + +INSTALLS += d01 diff -r 000000000000 -r c464cd7e2753 fturuntimeservices/inc/ftucontentservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fturuntimeservices/inc/ftucontentservice.h Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,133 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Content service. +* +*/ + + +#ifndef FTU_RUNTIMESERVICES_CONTENTSERVICE_H +#define FTU_RUNTIMESERVICES_CONTENTSERVICE_H + +#include "fturuntimeservices_global.h" + +#include +#include + +class FtuContentServicePrivate; +class FtuWizard; + + +/** + * @ingroup group_ftucontentmodel + * @brief Content service. + * + * States use content service through an execution + * context. Content service provides access to wizards. + * + * @lib ?library + * @since S60 ?S60_version + */ +class FTURUNTIMESERVICES_EXPORT FtuContentService : public QObject +{ + Q_OBJECT + +public: + + /** + * Constructor. + * @since S60 ?S60_version. + * @param parent Parent object. + */ + FtuContentService( QObject *parent = 0); + + /** + * Destructor. + * @since S60 ?S60_version. + */ + virtual ~FtuContentService(); + +private: + + Q_DISABLE_COPY(FtuContentService) + +public: + + /** + * Inserts wizard at the end of the list. + * @since S60 ?S60_version. + * @param wizard Wizard. + */ + void appendWizard(FtuWizard *wizard); + + /** + * Inserts wizard at the given index position in the list. + * @since S60 ?S60_version. + * @param index Index. + * @param wizard Wizard. + */ + void insertWizard(int index, FtuWizard *wizard); + + /** + * Sets the active wizard. + * @since S60 ?S60_version. + * @param index Wizard index. + */ + void setActiveWizard(int index); + + /** + * Returns the active wizard. + * @since S60 ?S60_version. + * @return Wizard index. + */ + int activeWizard() const; + + /** + * Returns the wizard at index position aIndex in the list. + * @since S60 ?S60_version. + * @param index Index. + * @return Wizard. + */ + FtuWizard *wizard(int index) const; + + /** + * Returns all wizards as list. + * @since S60 ?S60_version. + * @return Wizard. + */ + QList wizards() const; + +signals: + + /** + * Emitted when a wizard is added to the wizard list. + * @since S60 ?S60_version. + * @param index Wizard's index position in the list. + */ + void wizardAdded(int index); + +private: + + /** + * Private implementation. + */ + FtuContentServicePrivate* mFtuContentServicePrivate; + + friend class FtuContentServicePrivate; + +}; + +Q_DECLARE_METATYPE(FtuContentService*) + +#endif + diff -r 000000000000 -r c464cd7e2753 fturuntimeservices/inc/ftucontentservice_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fturuntimeservices/inc/ftucontentservice_p.h Mon Apr 19 14:01:47 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: Content service private implementation. +* +*/ + + +#ifndef FTU_RUNTIMESERVICES_CONTENTSERVICE_P_H +#define FTU_RUNTIMESERVICES_CONTENTSERVICE_P_H + +#include + +class FtuWizard; +class FtuContentService; + +/** + * @ingroup group_ftucontentservice + * @brief Content service private implementation. + * + * @lib ?library + * @since S60 ?S60_version + */ +class FtuContentServicePrivate: public QObject +{ + Q_OBJECT + +public: + + /** + * Constructor. + * @since S60 ?S60_version. + * @param contentService Content service. + */ + FtuContentServicePrivate(FtuContentService *ftuContentService); + + /** + * Destructor. + * @since S60 ?S60_version. + */ + virtual ~FtuContentServicePrivate(); + +private: + + Q_DISABLE_COPY(FtuContentServicePrivate) + +public: + + /** + * Inserts wizard at the end of the list. + * @since S60 ?S60_version. + * @param wizard Wizard. + */ + void appendWizard(FtuWizard *wizard); + + /** + * Inserts wizard at the given index position in the list. + * @since S60 ?S60_version. + * @param index Index. + * @param wizard Wizard. + */ + void insertWizard(int index, FtuWizard *wizard); + + /** + * Sets the active wizard. + * @since S60 ?S60_version. + * @param index Wizard index. + */ + void setActiveWizard(int index); + + /** + * Returns the active wizard. + * @since S60 ?S60_version. + * @return wizard index. + */ + int activeWizard() const; + + /** + * Returns the wizard at index position index in the list. + * @since S60 ?S60_version. + * @param index Index. + * @return Wizard. + */ + FtuWizard* wizard(int index) const; + + /** + * Returns all wizards as list. + * @since S60 ?S60_version. + * @return Wizards. + */ + QList wizards() const; + +public: + + /** + * Public interface. + */ + FtuContentService *mFtuContentService; + + /** + * Wizard container. + */ + QList mWizardList; + + /** + * Active wizard index. + */ + int mActiveWizardIndex; + +}; + +#endif diff -r 000000000000 -r c464cd7e2753 fturuntimeservices/inc/fturuntimeservices_global.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fturuntimeservices/inc/fturuntimeservices_global.h Mon Apr 19 14:01:47 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: Library header. +* +*/ + + +#ifndef FTURUNTIMESERVICES_GLOBAL_H +#define FTURUNTIMESERVICES_GLOBAL_H + +#include + + +// services uri; services key names used when the service is passed as property in state +const char FTU_CONTENT_SERVICE_KEY[] = "http://ftu.nokia.com/runtimeservices/contentservice"; + +// property name used to register for required services in state +// runtime assigns requested service based on value of the key in state, service keys should be used. +const char FTU_SERVICES_REGISTRATION_KEY[] = "_ftu_services_"; + +#ifdef FTURUNTIMESERVICES_LIB +#define FTURUNTIMESERVICES_EXPORT Q_DECL_EXPORT +#else +#ifdef FTURUNTIMESERVICES_TEST + #define FTURUNTIMESERVICES_EXPORT + #else + #define FTURUNTIMESERVICES_EXPORT Q_DECL_IMPORT + #endif +#endif + +#endif // FTURUNTIMESERVICES_GLOBAL_H diff -r 000000000000 -r c464cd7e2753 fturuntimeservices/src/ftucontentservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fturuntimeservices/src/ftucontentservice.cpp Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,203 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: First Time Use runtime content service. +* +*/ + + +#include "ftucontentservice.h" +#include "ftucontentservice_p.h" +#include + + +// --------------------------------------------------------------------------- +// FtuContentServicePrivate::FtuContentServicePrivate() +// --------------------------------------------------------------------------- +// +FtuContentServicePrivate::FtuContentServicePrivate(FtuContentService *ftuContentService) + : QObject(ftuContentService), + mFtuContentService(ftuContentService), + mActiveWizardIndex(-1) +{ + +} + +// --------------------------------------------------------------------------- +// FtuContentServicePrivate::~FtuContentServicePrivate() +// --------------------------------------------------------------------------- +// +FtuContentServicePrivate::~FtuContentServicePrivate() +{ + qDeleteAll(mWizardList); +} + +// --------------------------------------------------------------------------- +// FtuContentServicePrivate::appendWizard() +// --------------------------------------------------------------------------- +// +void FtuContentServicePrivate::appendWizard(FtuWizard *wizard) +{ + if (wizard && mWizardList.contains(wizard)) { + return; + } + + mWizardList.append(wizard); + + if (wizard) { + int index = mWizardList.size() - 1; + emit mFtuContentService->wizardAdded(index); + } +} + +// --------------------------------------------------------------------------- +// FtuContentServicePrivate::insertWizard() +// --------------------------------------------------------------------------- +// +void FtuContentServicePrivate::insertWizard(int index, FtuWizard *wizard) +{ + if (wizard && mWizardList.contains(wizard)) { + return; + } + + if (index < 0 || mWizardList.count() < index) { + return; + } + + mWizardList.insert(index, wizard); + + if (wizard) { + emit mFtuContentService->wizardAdded(index); + } +} + +// --------------------------------------------------------------------------- +// FtuContentServicePrivate::setActiveWizard() +// --------------------------------------------------------------------------- +// +void FtuContentServicePrivate::setActiveWizard(int index) +{ + if (index < 0 || mWizardList.count() <= index) { + index = -1; + } + + mActiveWizardIndex = index; +} + +// --------------------------------------------------------------------------- +// FtuContentServicePrivate::activeWizard() +// --------------------------------------------------------------------------- +// +int FtuContentServicePrivate::activeWizard() const +{ + return mActiveWizardIndex; +} + +// --------------------------------------------------------------------------- +// FtuContentServicePrivate::wizard() +// --------------------------------------------------------------------------- +// +FtuWizard* FtuContentServicePrivate::wizard(int index) const +{ + if (index < 0 || mWizardList.count() <= index) { + return 0; + } + + return mWizardList[index]; +} + +// --------------------------------------------------------------------------- +// FtuContentServicePrivate::wizards() +// --------------------------------------------------------------------------- +// +QList FtuContentServicePrivate::wizards() const +{ + return mWizardList; +} + +// --------------------------------------------------------------------------- +// FtuContentService::FtuContentService() +// --------------------------------------------------------------------------- +// +FtuContentService::FtuContentService(QObject *parent) + : QObject(parent), + mFtuContentServicePrivate(NULL) +{ + mFtuContentServicePrivate = new FtuContentServicePrivate(this); +} + +// --------------------------------------------------------------------------- +// FtuContentService::~FtuContentService() +// --------------------------------------------------------------------------- +// +FtuContentService::~FtuContentService() +{ + if(mFtuContentServicePrivate) + { + delete mFtuContentServicePrivate; + } +} + +// --------------------------------------------------------------------------- +// FtuContentService::appendWizard() +// --------------------------------------------------------------------------- +// +void FtuContentService::appendWizard(FtuWizard *wizard) +{ + mFtuContentServicePrivate->appendWizard(wizard); +} + +// --------------------------------------------------------------------------- +// FtuContentService::insertWizard() +// --------------------------------------------------------------------------- +// +void FtuContentService::insertWizard(int index, FtuWizard *wizard) +{ + mFtuContentServicePrivate->insertWizard(index, wizard); +} + +// --------------------------------------------------------------------------- +// FtuContentService::setActiveWizard() +// --------------------------------------------------------------------------- +// +void FtuContentService::setActiveWizard(int index) +{ + mFtuContentServicePrivate->setActiveWizard(index); +} + +// --------------------------------------------------------------------------- +// FtuContentService::activeWizard() +// --------------------------------------------------------------------------- +// +int FtuContentService::activeWizard() const +{ + return mFtuContentServicePrivate->activeWizard(); +} + +// --------------------------------------------------------------------------- +// FtuContentService::wizard() +// --------------------------------------------------------------------------- +// +FtuWizard *FtuContentService::wizard(int index) const +{ + return mFtuContentServicePrivate->wizard(index); +} + +// --------------------------------------------------------------------------- +// FtuContentService::wizards() +// --------------------------------------------------------------------------- +// +QList FtuContentService::wizards() const +{ + return mFtuContentServicePrivate->wizards(); +} diff -r 000000000000 -r c464cd7e2753 inc/ftutest_global.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/ftutest_global.h Mon Apr 19 14:01:47 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: The dll header file. +* +*/ + + +#ifndef FTUTEST_GLOBAL_H +#define FTUTEST_GLOBAL_H + +#include + +#ifdef NFT +#ifdef Q_OS_SYMBIAN +#include +#endif +#endif + +#ifndef FTU_TEST + #define FTU_TEST_CLASS(aClassName) +#else + #define FTU_TEST_CLASS(aClassName) class aClassName; +#endif //FTU_TEST + +#ifndef FTU_TEST + #define FTU_TEST_FRIEND_CLASS(aClassName) +#else + #define FTU_TEST_FRIEND_CLASS(aClassName) friend class aClassName; +#endif //FTU_TEST + +#define FTUCATCHDEBUG qDebug("Catched in: %s on line: %d",__FILE__,__LINE__); +#define FTUDEBUG(a) qDebug("%s in: %s on line: %d", (a), __FILE__,__LINE__); + +#ifdef NFT + #define FTUTEST(aText) qDebug() << QString(aText) +#ifdef Q_OS_SYMBIAN + inline void FTUTestFreeRam(const QString &aFunction) + { + TMemoryInfoV1Buf meminfo; + UserHal::MemoryInfo(meminfo); + int memSize = meminfo().iTotalRamInBytes >> 10; + int memFree = meminfo().iFreeRamInBytes >> 10; + + RHeap& ownHeap = User::Heap(); + TInt biggestBlock = 0; + int heapFree = ownHeap.Available(biggestBlock) >> 10; + int heapSize = ownHeap.Size() >> 10; + qDebug()<< aFunction << "memFree" << memFree << "kb memSize" << memSize << "kb heapFree" << heapFree << "kb heapSize" << heapSize; + } + + #define FTUTEST_FUNC_ENTRY(aFunction) FTUTestFreeRam(QString(aFunction)+" entry") + #define FTUTEST_FUNC_EXIT(aFunction) FTUTestFreeRam(QString(aFunction)+" exit") +#else + #define FTUTEST_FUNC_ENTRY(aFunction) qDebug()<< aFunction << " entry"; + #define FTUTEST_FUNC_EXIT(aFunction) qDebug()<< aFunction << " exit"; +#endif + +#else + #define FTUTEST(aText) + #define FTUTEST_FUNC_ENTRY(aFunction) + #define FTUTEST_FUNC_EXIT(aFunction) +#endif + +#endif // FTUTEST_GLOBAL_H + diff -r 000000000000 -r c464cd7e2753 layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/layers.sysdef.xml Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,16 @@ + + +]> + + + + + + + + + + + + diff -r 000000000000 -r c464cd7e2753 rom/ftu.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rom/ftu.iby Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The FTU iby file. +* +*/ + + +#ifndef __FTU_IBY__ +#define __FTU_IBY__ + + +// ---- ftuapplication -------------------------------------------------------- + +file=ABI_DIR/BUILD_DIR/ftuapplication.exe PROGRAMS_DIR/ftuapplication.exe +data=ZPRIVATE/10003a3f/import/apps/ftuapplication_reg.rsc private/10003a3f/import/apps/ftuapplication_reg.rsc + +// ---- fturuntimeservices ---------------------------------------------------- + +file=ABI_DIR/BUILD_DIR/fturuntimeservices.dll SHARED_LIB_DIR/fturuntimeservices.dll + +// ---- ftudefaultruntimeprovider --------------------------------------------- + +file=ABI_DIR/BUILD_DIR/ftudefaultruntimeprovider.dll SHARED_LIB_DIR/ftudefaultruntimeprovider.dll +data=/epoc32/data/z/fturesources/plugins/runtimeproviders/ftudefaultruntimeprovider.qtplugin fturesources/plugins/runtimeproviders/ftudefaultruntimeprovider.qtplugin +data=/epoc32/data/z/fturesources/plugins/runtimeproviders/ftudefaultruntimeprovider.xml fturesources/plugins/runtimeproviders/ftudefaultruntimeprovider.xml + +// ---- ftuwizardprovider ----------------------------------------------------- + +file=ABI_DIR/BUILD_DIR/ftuwizardprovider.dll SHARED_LIB_DIR/ftuwizardprovider.dll + +// ---- ftustateprovider ------------------------------------------------------ + +file=ABI_DIR/BUILD_DIR/ftustateprovider.dll SHARED_LIB_DIR/ftustateprovider.dll +//data=/epoc32/data/z/fturesources/plugins/stateproviders/ftustateprovider.qtplugin fturesources/plugins/stateproviders/ftustateprovider.qtplugin +//data=/epoc32/data/z/fturesources/plugins/stateproviders/ftustateprovider.manifest fturesources/plugins/stateproviders/ftustateprovider.manifest + +#endif //__FTU_IBY__ diff -r 000000000000 -r c464cd7e2753 runtimeproviders/ftudefaultruntimeprovider/ftudefaultruntimeprovider.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/runtimeproviders/ftudefaultruntimeprovider/ftudefaultruntimeprovider.pri Mon Apr 19 14:01:47 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: FTU default runtime provider list of files +# + +HEADERS += ./inc/*.h +SOURCES += ./src/*.cpp \ No newline at end of file diff -r 000000000000 -r c464cd7e2753 runtimeproviders/ftudefaultruntimeprovider/ftudefaultruntimeprovider.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/runtimeproviders/ftudefaultruntimeprovider/ftudefaultruntimeprovider.pro Mon Apr 19 14:01:47 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: FTU default runtime provider project file +# + +TEMPLATE = lib + + +symbian { + CONFIG(debug, debug|release) { + DESTDIR = debug + } else { + DESTDIR = release + } +} + +win32 { + CONFIG(debug, debug|release) { + SUBDIRPART = debug + } else { + SUBDIRPART = release + } + DESTDIR = $$PWD/../../../bin/$$SUBDIRPART/fturesources/plugins/runtimeproviders + LIBS += -L$$PWD/../../../bin/debug +} + +LIBS += -lfturuntimeservices +LIBS += -lftustateprovider + +CONFIG += plugin debug_and_release + +CONFIG += hb + +CONFIG += hb mobility +MOBILITY = serviceframework + +QT += xml sql + +DEFINES += FTUDEFAULTRUNTIMEPROVIDER_LIB + +coverage:DEFINES += COVERAGE_MEASUREMENT + +DEPENDPATH += ./inc \ + ./src + +INCLUDEPATH += ./inc \ + ../../inc \ + +symbian { + TARGET.UID3 = 0x20026F97 + TARGET.EPOCALLOWDLLDATA=1 + TARGET.CAPABILITY = ALL -TCB + appkey:DEFINES += S60APP_KEY + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + + include(ftudefaultruntimeprovider_installs_symbian.pri) +} + +win32 { +include(ftudefaultruntimeprovider_installs_win32.pri) +} + +symbian:unix:include(ftudefaultruntimeprovider_installs_unix.pri) + +include(ftudefaultruntimeprovider.pri) + +symbian: plugin{ + BLD_INF_RULES.prj_exports += "resource/$${TARGET}.s60xml z:$$qtplugins.path/$${TARGET}.xml" + + for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin z:$$qtplugins.path/$$basename(qtplugin)" + +} diff -r 000000000000 -r c464cd7e2753 runtimeproviders/ftudefaultruntimeprovider/ftudefaultruntimeprovider_installs_symbian.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/runtimeproviders/ftudefaultruntimeprovider/ftudefaultruntimeprovider_installs_symbian.pri Mon Apr 19 14:01:47 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: +# + +export.sources = resource/*.xml +export.path = /fturesources/plugins/runtimeproviders + +pluginstub.sources = ftudefaultruntimeprovider.dll +pluginstub.path = /fturesources/plugins/runtimeproviders + +DEPLOYMENT += export pluginstub diff -r 000000000000 -r c464cd7e2753 runtimeproviders/ftudefaultruntimeprovider/ftudefaultruntimeprovider_installs_unix.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/runtimeproviders/ftudefaultruntimeprovider/ftudefaultruntimeprovider_installs_unix.pri Mon Apr 19 14:01:47 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: +# +# +# Release +# + +r01.path = ../../../bin/release/fturesources/plugins/runtimeproviders +r01.files = ./release/*.so* \ + ./resource/*.manifest + +INSTALLS += r01 + +# +# Debug +# + +d01.path = ../../../bin/debug/fturesources/plugins/runtimeproviders +d01.files = ./debug/*.so* \ + ./resource/*.manifest + +INSTALLS += d01 diff -r 000000000000 -r c464cd7e2753 runtimeproviders/ftudefaultruntimeprovider/ftudefaultruntimeprovider_installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/runtimeproviders/ftudefaultruntimeprovider/ftudefaultruntimeprovider_installs_win32.pri Mon Apr 19 14:01:47 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: +# +# +# Release +# + +r01.path = $$PWD/../../../bin/release/fturesources/plugins/runtimeproviders +r01.files = ./release/*.* \ + ./resource/*.manifest + +INSTALLS += r01 + +# +# Debug +# + +d01.path = $$PWD/../../../bin/debug/fturesources/plugins/runtimeproviders +d01.files = ./debug/*.* \ + ./resource/*.manifest + +INSTALLS += d01 diff -r 000000000000 -r c464cd7e2753 runtimeproviders/ftudefaultruntimeprovider/inc/ftudefaultruntime.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/runtimeproviders/ftudefaultruntimeprovider/inc/ftudefaultruntime.h Mon Apr 19 14:01:47 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: Declaration of the FTU default runtime. +* +*/ + + +#ifndef FTU_RUNTIMES_DEFAULTRUNTIME_H +#define FTU_RUNTIMES_DEFAULTRUNTIME_H + +#include "ftutest_global.h" +#include +#include + +FTU_TEST_CLASS(FtuDefaultRuntimeProviderTest) + +// Forward declarations +class QStateMachine; +class HbMainWindow; +class FtuContentService; + + + +/** @ingroup group_ftudefaultruntimeprovider + * @brief Default implementation of the ftu runtime. + * + * Creates an execution context (EC) and populates it with + * runtime services. States are loaded from state provider + * plugins. Each state is given an access to the EC. States + * are added to a state machine. Finally, the state machine + * is started. + * + * @lib ?library + * @since S60 ?S60_version + */ +class FtuDefaultRuntime : public QStateMachine +{ + Q_OBJECT + +public: + + /** + * Constructor. + * @since S60 ?S60_version. + * @param parent - address of parent QObject instance, by default none + */ + FtuDefaultRuntime(QObject* = 0); + + /** + * Destructor. + * @since S60 ?S60_version. + */ + ~FtuDefaultRuntime(); + +private: + /** + * Copy constructor + */ + Q_DISABLE_COPY(FtuDefaultRuntime) + +public slots: + +private slots: + + /** + * Called after the state machine has started. + * @since S60 ?S60_version. + */ + void handleStateMachineStarted(); + + /** + * Called after the state machine has stopped. + * @since S60 ?S60_version. + */ + void handleStateMachineStopped(); + +signals: + + /** + * Emission of this signal initiates a transition to the final state. + */ + void stopStateMachine(); + +private: + + /** + * Creates content service parts + * @since S60 ?S60_version. + */ + void createContentServiceParts(); + + /** + * Creates gui service parts + * @since S60 ?S60_version. + */ + void createGuiServiceParts(); + + /** + * Creates states + * @since S60 ?S60_version. + */ + void createStates(); + + /** + * Assign services to states based on value of property HS_SERVICES_REGISTRATION_KEY + * @since S60 ?S60_version. + */ + void assignServices(); + + /** + * Function create and initialize services shared between states + */ + void initializeRuntimeServices(); + +private: + + + /** + * Content service delivered to runtime's states. + */ + FtuContentService *mFtuContentService; + + /** + * Window to visualize scene + */ + HbMainWindow *mWindow; + + /** + * Contains address of runtime service. + * Ownership transfered to application. Don't remove it. + */ + QHash mServices; + + FTU_TEST_FRIEND_CLASS(FtuDefaultRuntimeProviderTest) + +}; + +#endif // FTU_RUNTIMES_DEFAULTRUNTIME_H + diff -r 000000000000 -r c464cd7e2753 runtimeproviders/ftudefaultruntimeprovider/inc/ftudefaultruntimeprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/runtimeproviders/ftudefaultruntimeprovider/inc/ftudefaultruntimeprovider.h Mon Apr 19 14:01:47 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: Declaration of the FTU default runtime provider. +* +*/ + + +#ifndef FTU_RUNTIMEPROVIDERS_DEFAULTRUNTIMEPROVIDER_H +#define FTU_RUNTIMEPROVIDERS_DEFAULTRUNTIMEPROVIDER_H + +#include +#include + + +QTM_USE_NAMESPACE + +/** + * @ingroup group_ftudefaultruntimeprovider + * @brief Provides a default implementation of the ftu runtime. + * + * This provider includes a default implementation of the ftu runtime. + * The runtime is described in the ftudefaultruntimeprovider.manifest file. + * + * @since S60 ?S60_version. + */ +class FtuDefaultRuntimeProvider : public QObject, public QServicePluginInterface +{ + Q_OBJECT + Q_INTERFACES(QtMobility::QServicePluginInterface) +public: + +public: + QObject *createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session); + +}; + +#endif //FTU_RUNTIMEPROVIDERS_DEFAULTRUNTIMEPROVIDER_H + diff -r 000000000000 -r c464cd7e2753 runtimeproviders/ftudefaultruntimeprovider/resource/ftudefaultruntimeprovider.manifest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/runtimeproviders/ftudefaultruntimeprovider/resource/ftudefaultruntimeprovider.manifest Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,5 @@ + + + + diff -r 000000000000 -r c464cd7e2753 runtimeproviders/ftudefaultruntimeprovider/resource/ftudefaultruntimeprovider.s60xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/runtimeproviders/ftudefaultruntimeprovider/resource/ftudefaultruntimeprovider.s60xml Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,12 @@ + + + ftudefaultruntimeprovider + z:/fturesources/plugins/runtimeproviders/ftudefaultruntimeprovider.qtplugin + First Time Use Provider + + com.nokia.ftu.runtime.FtuRuntime + 1.0 + Default implementation for ftu runtime + + + diff -r 000000000000 -r c464cd7e2753 runtimeproviders/ftudefaultruntimeprovider/resource/ftudefaultruntimeprovider.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/runtimeproviders/ftudefaultruntimeprovider/resource/ftudefaultruntimeprovider.xml Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,12 @@ + + + ftudefaultruntimeprovider + ftudefaultruntimeprovider + First Time Use Runtime Plugin + + com.nokia.ftu.runtime.FtuRuntime + 1.0 + Default implementation for ftu runtime + + + diff -r 000000000000 -r c464cd7e2753 runtimeproviders/ftudefaultruntimeprovider/src/ftudefaultruntime.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/runtimeproviders/ftudefaultruntimeprovider/src/ftudefaultruntime.cpp Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,210 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the FTU default runtime. +* +*/ + + +#include "ftudefaultruntime.h" +#include "ftutest_global.h" +#include "ftucontentservice.h" + +#include "ftustateprovider.h" + +#include +#include +#include +#include + +#include + + + +// plugin factory const + +// states +const char wizardMenuStateUri [] = "ftu.nokia.com/state/wizardmenustate"; +const char wizardLoaderStateUri [] = "ftu.nokia.com/state/wizardloaderstate"; +const char wizardActivatedStateUri [] = "ftu.nokia.com/state/wizardactivatedstate"; + +// --------------------------------------------------------------------------- +// FtuDefaultRuntime::FtuDefaultRuntime +// --------------------------------------------------------------------------- +// +FtuDefaultRuntime::FtuDefaultRuntime( QObject* aParent) + : + QStateMachine(aParent), + mFtuContentService(0), + mWindow(0) +{ + createContentServiceParts(); + createGuiServiceParts(); + initializeRuntimeServices(); + createStates(); + assignServices(); +} + +// --------------------------------------------------------------------------- +// FtuDefaultRuntime::~FtuDefaultRuntime() +// --------------------------------------------------------------------------- +// +FtuDefaultRuntime::~FtuDefaultRuntime() +{ + delete mWindow; + delete mFtuContentService; +} + +// --------------------------------------------------------------------------- +// FtuDefaultRuntime::handleStateMachineStarted() +// --------------------------------------------------------------------------- +// +void FtuDefaultRuntime::handleStateMachineStarted() +{ + +} + +// --------------------------------------------------------------------------- +// FtuDefaultRuntime::handleStateMachineStopped() +// --------------------------------------------------------------------------- +// +void FtuDefaultRuntime::handleStateMachineStopped() +{ + emit stopped(); +} + +// --------------------------------------------------------------------------- +//createContentServiceParts() - implementation +// --------------------------------------------------------------------------- +// +void FtuDefaultRuntime::createContentServiceParts() +{ + mFtuContentService = new FtuContentService(this); +} + +// --------------------------------------------------------------------------- +// FtuDefaultRuntime::createGuiServiceParts() +// --------------------------------------------------------------------------- +// +void FtuDefaultRuntime::createGuiServiceParts() +{ + mWindow = new HbMainWindow(); + mWindow->show(); +} + +// --------------------------------------------------------------------------- +// FtuDefaultRuntime::createStates() +// --------------------------------------------------------------------------- +// +void FtuDefaultRuntime::createStates() +{ + + FtuStateProvider stateProvider; + + QFinalState* finalState = new QFinalState(); + this->addState(finalState); + + // parallel state activates all children states + QState* parallel = new QState(QState::ParallelStates); + this->addState(parallel); + parallel->addTransition(this, SIGNAL(stopStateMachine()), finalState); + + // root GUI state + QState* guiRootState = new QState(parallel); + + // root FTU state + QState* ftuRootState = new QState(guiRootState); + + // create state based on token + QState* wizardMenuState = stateProvider.createState(wizardMenuStateUri); + // set state specific data + wizardMenuState->setParent(ftuRootState); + wizardMenuState->setObjectName(wizardMenuStateUri); + wizardMenuState->setProperty(FTU_SERVICES_REGISTRATION_KEY, + QList() << FTU_CONTENT_SERVICE_KEY); + + connect(mFtuContentService, SIGNAL(wizardAdded(int)), wizardMenuState, + SLOT(addWizardToListModel(int))); + + QState *wizardLoadingState = stateProvider.createState(wizardLoaderStateUri); + wizardLoadingState->setParent(parallel); + wizardLoadingState->setObjectName(wizardLoaderStateUri); + wizardLoadingState->setProperty(FTU_SERVICES_REGISTRATION_KEY, + QList() << FTU_CONTENT_SERVICE_KEY); + + // Create activated state + + + QState* wizardActivatedState = stateProvider.createState(wizardActivatedStateUri); + wizardActivatedState->setParent(ftuRootState); + wizardActivatedState->setObjectName(wizardActivatedStateUri); + wizardActivatedState->setProperty(FTU_SERVICES_REGISTRATION_KEY, + QList() << FTU_CONTENT_SERVICE_KEY); + + + // Setup state transitions menu state <-> activated state + // From menu to activated + wizardMenuState->addTransition(wizardMenuState, SIGNAL(wizardSelected()), + wizardActivatedState); + + // From activated back to menu + wizardActivatedState->addTransition(wizardActivatedState, + SIGNAL(backEventTriggered()), + wizardMenuState); + + // set initial state for statemachine + ftuRootState->setInitialState(wizardMenuState); + guiRootState->setInitialState(ftuRootState); + this->setInitialState(parallel); + + connect(this, SIGNAL(started()), SLOT(handleStateMachineStarted())); + connect(this, SIGNAL(stopped()), SLOT(handleStateMachineStopped())); + connect(this, SIGNAL(finished()), SLOT(handleStateMachineStopped())); + +} + +// --------------------------------------------------------------------------- +// FtuDefaultRuntime::assignServices() +// --------------------------------------------------------------------------- +// +void FtuDefaultRuntime::assignServices() +{ + QList children = this->findChildren(); + foreach (QState* state, children) + { + QList services = state->property(FTU_SERVICES_REGISTRATION_KEY).toList(); + + foreach (const QVariant& service, services) + { + QString name = service.toString(); + qDebug() << "Assign service:" << name << "\n to " << state->objectName(); + if (name == FTU_CONTENT_SERVICE_KEY) + { + state->setProperty(name.toAscii().data(), qVariantFromValue(mFtuContentService)); + } + else + { + qWarning() << "WARNING: Service " << name << " is unknown"; + } + } + } +} + +// --------------------------------------------------------------------------- +//void initializeRuntimeServices() - implementation +// --------------------------------------------------------------------------- +// +void FtuDefaultRuntime::initializeRuntimeServices() +{ + mServices[ FTU_CONTENT_SERVICE_KEY ] = mFtuContentService; +} diff -r 000000000000 -r c464cd7e2753 runtimeproviders/ftudefaultruntimeprovider/src/ftudefaultruntimeprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/runtimeproviders/ftudefaultruntimeprovider/src/ftudefaultruntimeprovider.cpp Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the FTU default runtime provider. +* +*/ + + +#include "ftudefaultruntimeprovider.h" +#include "ftudefaultruntime.h" + + +#include +#include +#include + +// --------------------------------------------------------------------------- +// FtuDefaultRuntimeProvider::createInstance() +// --------------------------------------------------------------------------- +// +QObject *FtuDefaultRuntimeProvider::createInstance(const QServiceInterfaceDescriptor &descriptor, + QServiceContext *context, + QAbstractSecuritySession *session) +{ + Q_UNUSED(context); + Q_UNUSED(session); + + if (descriptor.interfaceName() == "com.nokia.ftu.runtime.FtuRuntime") { + return new FtuDefaultRuntime(this); + } else { + return 0; + } +} + +#ifndef COVERAGE_MEASUREMENT +Q_EXPORT_PLUGIN2(ftudefaultruntimeprovider, FtuDefaultRuntimeProvider) +#endif //COVERAGE_MEASUREMENT + + + + + + diff -r 000000000000 -r c464cd7e2753 runtimeproviders/runtimeproviders.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/runtimeproviders/runtimeproviders.pro Mon Apr 19 14:01:47 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: FTU runtime providers project file +# + +TEMPLATE = subdirs +SUBDIRS = ftudefaultruntimeprovider diff -r 000000000000 -r c464cd7e2753 sis/ftu.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sis/ftu.pkg Mon Apr 19 14:01:47 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: FTU package file +; + +; Language +&EN +; 01 + +; SIS header: name, uid, version +#{"ftu"}, (0x20027007), 1, 0, 0 + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Supports S60 5th Edition +[0x1028315F], 0, 0, 0, {"S60ProductID"} + +; ---- ftuapplication -------------------------------------------------------- + +"/epoc32/release/armv5/urel/ftuapplication.exe" - "c:/sys/bin/ftuapplication.exe" +"/epoc32/data/z/private/10003a3f/import/apps/ftuapplication_reg.rsc" - "c:/private/10003a3f/import/apps/ftuapplication_reg.rsc" +"/epoc32/data/z/fturesources/ftu_app_icon.svg" - "c:/fturesources/ftu_app_icon.svg" + +; ---- fturuntimeservices ---------------------------------------------------- + +"/epoc32/release/armv5/urel/fturuntimeservices.dll" - "c:/sys/bin/fturuntimeservices.dll" + +; ---- ftudefaultruntimeprovider --------------------------------------------- + +"/epoc32/release/armv5/urel/ftudefaultruntimeprovider.dll" - "c:/sys/bin/ftudefaultruntimeprovider.dll" +"/epoc32/data/z/fturesources/plugins/runtimeproviders/ftudefaultruntimeprovider.qtplugin" - "c:/fturesources/plugins/runtimeproviders/ftudefaultruntimeprovider.qtplugin" +"/epoc32/data/z/fturesources/plugins/runtimeproviders/ftudefaultruntimeprovider.manifest" - "c:/fturesources/plugins/runtimeproviders/ftudefaultruntimeprovider.manifest" + + +; ---- ftuwizardprovider ----------------------------------------------------- + +"/epoc32/release/armv5/urel/ftuwizardprovider.dll" - "c:/sys/bin/ftuwizardprovider.dll" + +; ---- ftustateprovider ------------------------------------------------------ + +"/epoc32/release/armv5/urel/ftustateprovider.dll" - "c:/sys/bin/ftustateprovider.dll" +"/epoc32/data/z/fturesources/plugins/stateproviders/ftustateprovider.qtplugin" - "c:/fturesources/plugins/stateproviders/ftustateprovider.qtplugin" +"/epoc32/data/z/fturesources/plugins/stateproviders/ftustateprovider.manifest" - "c:/fturesources/plugins/stateproviders/ftustateprovider.manifest" + + + diff -r 000000000000 -r c464cd7e2753 sis/ftu_sisx.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sis/ftu_sisx.bat Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,29 @@ +@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 + +if exist ftu.sisx del ftu.sisx + +makesis ftu.pkg +signsis ftu.sis ftu.sisx rd.cer rd-key.pem + +if exist ftu.sisx ( +echo ftu.sisx creation SUCCEEDED +del ftu.sis +) + +if not exist ftu.sisx ( +echo ftu.sisx creation FAILED +) \ No newline at end of file diff -r 000000000000 -r c464cd7e2753 sis/ftu_unittest.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sis/ftu_unittest.pkg Mon Apr 19 14:01:47 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: FTU unit test package file +; + +; Language +&EN +; 01 + +; SIS header: name, uid, version +#{"ftu_unittest"}, (0x20027008), 1, 0, 0 + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Supports S60 5th Edition +[0x1028315F], 0, 0, 0, {"S60ProductID"} + +; FTU application unit test +"/epoc32/release/armv5/urel/t_ftuapplication.exe" - "c:/sys/bin/t_ftuapplication.exe" +"/epoc32/data/z/private/10003a3f/import/apps/t_ftuapplication_reg.rsc" - "c:/private/10003a3f/import/apps/t_ftuapplication_reg.rsc" +"/epoc32/data/z/resource/apps/t_ftuapplication.rsc" - "c:/resource/apps/t_ftuapplication.rsc" + +; FTU runtimeservices unit test +"/epoc32/release/armv5/urel/t_fturuntimeservices.exe" - "c:/sys/bin/t_fturuntimeservices.exe" +"/epoc32/data/z/private/10003a3f/import/apps/t_fturuntimeservices_reg.rsc" - "c:/private/10003a3f/import/apps/t_fturuntimeservices_reg.rsc" +"/epoc32/data/z/resource/apps/t_fturuntimeservices.rsc" - "c:/resource/apps/t_fturuntimeservices.rsc" + +; FTU defaultruntimeprovider unit test +"/epoc32/release/armv5/urel/t_ftudefaultruntimeprovider.exe" - "c:/sys/bin/t_ftudefaultruntimeprovider.exe" +"/epoc32/data/z/private/10003a3f/import/apps/t_ftudefaultruntimeprovider_reg.rsc" - "c:/private/10003a3f/import/apps/t_ftudefaultruntimeprovider_reg.rsc" +"/epoc32/data/z/resource/apps/t_ftudefaultruntimeprovider.rsc" - "c:/resource/apps/t_ftudefaultruntimeprovider.rsc" + +; FTU stateprovider unit test +"/epoc32/release/armv5/urel/t_ftustateprovider.exe" - "c:/sys/bin/t_ftustateprovider.exe" +"/epoc32/data/z/private/10003a3f/import/apps/t_ftustateprovider_reg.rsc" - "c:/private/10003a3f/import/apps/t_ftustateprovider_reg.rsc" +"/epoc32/data/z/resource/apps/t_ftustateprovider.rsc" - "c:/resource/apps/t_ftustateprovider.rsc" diff -r 000000000000 -r c464cd7e2753 sis/ftu_unittest_sisx.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sis/ftu_unittest_sisx.bat Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,31 @@ +@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 + +set MAIN_SIS_DIR=%CD% + +if exist ftu_unittest.sisx del ftu_unittest.sisx + +makesis ftu_unittest.pkg +signsis ftu_unittest.sis ftu_unittest.sisx rd.cer rd-key.pem + +if exist ftu_unittest.sisx ( +echo ftu_unittest.sisx creation SUCCEEDED +del ftu_unittest.sis +) + +if not exist ftu_unittest.sisx ( +echo ftu_unittest.sisx creation FAILED +) diff -r 000000000000 -r c464cd7e2753 sis/rd-key.pem --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sis/rd-key.pem Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQDLRF+r1FGGkCwTrb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW4 +6Y+LWaA8HMlDdoHRB0FgASisYcFagwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh +7W7Dt9F5FZij8F7/9Pi6+FhhxZFIf1DD+yry9D7+Sp+BgdNALe4XOpf25QIBAwKB +gQCHgupyjYuvCsgNHn7PNtnvVxInrB5MQNoPli+O+uNJWUK/Q+57Rl+yO8AoEzDX +pFaLWiuVVhsdloDnAgabT/FXzYncs6uOHyEUV+dSXb78vtLPJqAX+Fg2i3hOXreB +yskcZ13/OsKVOu5wgrJkx2baZufkqMwOSytf5y9nwjEIKwJBAP+inobagVNrN62j +KQva3cC+UN/6XnKdTc0CA6bHyLOaJoH1xiMwG/VS2PGjHI0tiSMNtLn/QPpHJ003 +iabGhdUCQQDLjp/9UjFT6K6CF66Chqf30pZXhx+GTSQZmv/gvZiMly7X9fX9BGX3 +2MbJohBC4yI21XKTbisWywkF73Hwh+TRAkEAqmxprzxWN5zPyRdwspHpKymLP/w+ +9xOJM1atGdqFzRFvAU6EF3Vn+OHl9my9s3OwwgkjJqorUYTE3iUGby8D4wJBAIe0 +aqjhdjfwdFa6dFcEb/qMZDpaFQQzbWZnVUB+ZbMPdI/5TqitmU/l2dvBYCyXbCSO +TGJJcg8yBgP09qBamIsCQFL7j1tM0XPVQJQ89WpKCld7O9ORxRGVj1eG0tWijrH8 +mGbYh8SGCVoWV3vrKSS8GBrFVgQnqUaHuEdtM7tpCAQ= +-----END RSA PRIVATE KEY----- diff -r 000000000000 -r c464cd7e2753 sis/rd.cer --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sis/rd.cer Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICzDCCAjWgAwIBAgIBADANBgkqhkiG9w0BAQUFADArMRAwDgYDVQQKEwdSRCBD +ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZTAeFw0wNDExMTUxMjQyMDZaFw0z +NzA5MjMxMjQyMDZaMCsxEDAOBgNVBAoTB1JEIENlcnQxFzAVBgNVBAMTDlJEIENl +cnRpZmljYXRlMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDLRF+r1FGGkCwT +rb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW46Y+LWaA8HMlDdoHRB0FgASisYcFa +gwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh7W7Dt9F5FZij8F7/9Pi6+FhhxZFI +f1DD+yry9D7+Sp+BgdNALe4XOpf25QIBA6OCAQAwgf0wDAYDVR0TBAUwAwEB/zAL +BgNVHQ8EBAMCAoQwHQYDVR0OBBYEFFi/kuGzxhVpjGxe9ZwlxC3fH9jFMFMGA1Ud +IwRMMEqAFFi/kuGzxhVpjGxe9ZwlxC3fH9jFoS+kLTArMRAwDgYDVQQKEwdSRCBD +ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZYIBADBsBgNVHSAEZTBjMGEGBFUd +IAAwWTATBggrBgEFBQcCARYHaHR0cDovLzBCBggrBgEFBQcCAjA2GjRGb3IgUiZE +IHVzYWdlIG9ubHkuIFRoaXMgY2VydGlmaWNhdGUgaXMgbm90IHRydXN0ZWQuMA0G +CSqGSIb3DQEBBQUAA4GBAHGB4RQMAgBdeT2hxfOr6f2nA/dZm+M5yX5daUtZnET9 +Ed0A9sazLawfN2G1KFQT9kxEParAyoAkpbMAsRrnRz/9cM3OHgFm/NiKRnf50DpT +7oCx0I/65mVD2kt+xXE62/Ii5KPnTufIkPi2uLvURCia1tTS8JmJ8dtxDGyQt8BR +-----END CERTIFICATE----- diff -r 000000000000 -r c464cd7e2753 stateproviders/ftustateprovider/ftustateprovider.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/ftustateprovider/ftustateprovider.pri Mon Apr 19 14:01:47 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: FTU state provider list of files +# + +HEADERS += ./inc/*.h +SOURCES += ./src/*.cpp + +RESOURCES += resources/resources.qrc diff -r 000000000000 -r c464cd7e2753 stateproviders/ftustateprovider/ftustateprovider.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/ftustateprovider/ftustateprovider.pro Mon Apr 19 14:01:47 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: FTU state provider project file +# + +TEMPLATE = lib + +DEFINES += FTUSTATEPROVIDER_LIB + + +symbian { + CONFIG(debug, debug|release) { + DESTDIR = debug + } else { + DESTDIR = release + } +} + +win32 { + CONFIG(debug, debug|release) { + SUBDIRPART = debug + } else { + SUBDIRPART = release + } + DESTDIR = $$PWD/../../../bin/$$SUBDIRPART/fturesources/plugins/stateproviders + LIBS += -L$$PWD/../../../bin/debug +} + +LIBS += -lftuwizardmodel +LIBS += -lftuwizardprovider +LIBS += -lfturuntimeservices + +CONFIG += debug_and_release + +coverage:DEFINES += COVERAGE_MEASUREMENT + +CONFIG += hb + +QT += xml + +nft:DEFINES += NFT + +DEPENDPATH += ./inc \ + ./src + +INCLUDEPATH += ./inc \ + ../../inc \ + ../../wizardproviders/ftuwizardprovider/inc + +#TRANSLATIONS=ftustateprovider.ts + +symbian { + TARGET.UID2 = 0x20004C45 + TARGET.UID3 = 0x20026F99 + TARGET.EPOCALLOWDLLDATA=1 + TARGET.CAPABILITY = ALL -TCB + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + + #include(ftustateprovider_installs_symbian.pri) + + BLD_INF_RULES.prj_exports += "./inc/ftustateprovider_global.h |../../inc/" \ + "./inc/ftustateprovider.h |../../inc/" +} + +win32:include(ftustateprovider_installs_win32.pri) + +symbian:unix:include(ftustateprovider_installs_unix.pri) + +include(ftustateprovider.pri) + +#ONLY FOR DEVELOPMENT! REMOVE THIS BEFORE EACH HS_Domain RELEASE! +symbian: MMP_RULES += EXPORTUNFROZEN diff -r 000000000000 -r c464cd7e2753 stateproviders/ftustateprovider/ftustateprovider_installs_symbian.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/ftustateprovider/ftustateprovider_installs_symbian.pri Mon Apr 19 14:01:47 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: +# + +export.sources = resource/*.manifest +export.path = /fturesources/plugins/stateproviders + +pluginstub.sources = ftustateprovider.dll +pluginstub.path = /fturesources/plugins/stateproviders + +DEPLOYMENT += export pluginstub + +#deploy.path = z: +#qtplugins.path = /fturesources/plugins/stateproviders +#qtplugins.sources += qmakepluginstubs/ftustateprovider.qtplugin +#qtplugins.sources += resource/ftustateprovider.manifest + +#for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" + \ No newline at end of file diff -r 000000000000 -r c464cd7e2753 stateproviders/ftustateprovider/ftustateprovider_installs_unix.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/ftustateprovider/ftustateprovider_installs_unix.pri Mon Apr 19 14:01:47 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: +# +# +# Release +# + +r01.path = ../../../bin/release/fturesources/plugins/stateproviders +r01.files = ./release/*.so* \ + ./resource/*.manifest + +INSTALLS += r01 + +# +# Debug +# + +d01.path = ../../../bin/debug/fturesources/plugins/stateproviders +d01.files = ./debug/*.so* \ + ./resource/*.manifest + +INSTALLS += d01 diff -r 000000000000 -r c464cd7e2753 stateproviders/ftustateprovider/ftustateprovider_installs_win32.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/ftustateprovider/ftustateprovider_installs_win32.pri Mon Apr 19 14:01:47 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: +# +# +# Release +# + +r01.path = $$PWD/../../../bin/release/fturesources/plugins/stateproviders +r01.files = $$PWD/../../../bin/release/ftustateprovider.* \ + ./resource/*.manifest + +INSTALLS += r01 + +# +# Debug +# + +d01.path = $$PWD/../../../bin/debug/fturesources/plugins/stateproviders +d01.files = $$PWD/../../../bin/debug/ftustateprovider.* \ + ./resource/*.manifest + +INSTALLS += d01 diff -r 000000000000 -r c464cd7e2753 stateproviders/ftustateprovider/inc/ftustateprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/ftustateprovider/inc/ftustateprovider.h Mon Apr 19 14:01:47 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: Declaration of the FTU state provider +* +*/ + + +#ifndef FTU_STATEPROVIDERS_STATEPROVIDER_H +#define FTU_STATEPROVIDERS_STATEPROVIDER_H + +#include "ftutest_global.h" +#include "ftustateprovider_global.h" + +FTU_TEST_CLASS(FtuStateProviderTest) + +class QState; +class FtuStateProviderPrivate; + + + +/** + * @ingroup group_ftustateprovider + * @brief Provides a default implementation for each FTU state. + * + * This provider includes a default implementation for each FTU state + * States are described in the ftustateprovider.manifest file. + * + * @lib ftustateprovider + * @since S60 ?S60_version. + */ +class FTUSTATEPROVIDER_EXPORT FtuStateProvider : public QObject +{ + + Q_OBJECT +public: + + FtuStateProvider(QObject *parent=NULL); + +public: + + /** + * Creates a state based on the given uri. + * + * @param uri Identifies the state to be created. + * @since S60 ?S60_version. + * @return Constructed QState, ownership transferred. + */ + QState* createState(const QString& uri); + +private: + + FtuStateProviderPrivate* mPrivate; + friend class FtuStateProviderPrivate; + + + + FTU_TEST_FRIEND_CLASS(FtuStateProviderTest) +}; + + +#endif //FTU_STATEPROVIDERS_STATEPROVIDER_H diff -r 000000000000 -r c464cd7e2753 stateproviders/ftustateprovider/inc/ftustateprovider_global.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/ftustateprovider/inc/ftustateprovider_global.h Mon Apr 19 14:01:47 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: Library header. +* +*/ + + +#ifndef FTUSTATEPROVIDER_GLOBAL_H +#define FTUSTATEPROVIDER_GLOBAL_H + +#include + + +#ifdef FTUSTATEPROVIDER_LIB +#define FTUSTATEPROVIDER_EXPORT Q_DECL_EXPORT +#else +#ifdef FTUSTATEPROVIDER_TEST + #define FTUSTATEPROVIDER_EXPORT + #else + #define FTUSTATEPROVIDER_EXPORT Q_DECL_IMPORT + #endif +#endif + +#endif // FTUSTATEPROVIDER_GLOBAL_H diff -r 000000000000 -r c464cd7e2753 stateproviders/ftustateprovider/inc/ftustateprovider_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/ftustateprovider/inc/ftustateprovider_p.h Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: State provider private impl. +* +*/ + + +#ifndef FTU_STATEPROVIDERS_STATEPROVIDER_P_H +#define FTU_STATEPROVIDERS_STATEPROVIDER_P_H + +#include "ftutest_global.h" + +FTU_TEST_CLASS(FtuStateProviderTest) + +class QState; +class FtuStateProviderPrivate; + + + +/** + * @ingroup group_ftustateprovider + * @brief PState provider private impl. + * + * @lib ftustateprovider + * @since S60 ?S60_version. + */ +class FtuStateProviderPrivate : public QObject +{ + + Q_OBJECT +public: + FtuStateProviderPrivate(QObject *parent=NULL); + +public: + + /** + * Creates a state based on the given uri. + * + * @param uri Identifies the state to be created. + * @since S60 ?S60_version. + * @return Constructed QState, ownership transferred. + */ + QState* createState(const QString& uri); + +private: + + FTU_TEST_FRIEND_CLASS(FtuStateProviderTest) +}; + + +#endif //FTU_STATEPROVIDERS_STATEPROVIDER_P_H diff -r 000000000000 -r c464cd7e2753 stateproviders/ftustateprovider/inc/ftuwizardactivatedstate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/ftustateprovider/inc/ftuwizardactivatedstate.h Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,225 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 FTU_STATES_WIZARDACTIVATEDSTATE_H +#define FTU_STATES_WIZARDACTIVATEDSTATE_H + +#include +#include +#include "ftutest_global.h" + +FTU_TEST_CLASS(FtuStateProviderTest) + +class QGraphicsWidget; +class HbMainWindow; +class HbLabel; +class HbStackedWidget; +class HbView; +class HbDocumentLoader; +class HbAction; +class HbGridView; +class QGraphicsLinearLayout; +class FtuContentService; +class FtuWizard; + + +/** @ingroup group_ftustateprovider + * @brief The state handles wizard activation and interaction. + * + * @see StateMachine + * + * @lib ?library + * @since S60 ?S60_version + */ +class FtuWizardActivatedState : public QState +{ + Q_OBJECT +public: + /* + * The plugin's display mode enumeration. + * FullScreen means menustrip is not shown. + * PartialScreen means menustrip is shown. + */ + enum PluginDisplayMode{FullScreen, PartialScreen}; + +public: + + /** + * Constructor. + * @since S60 ?S60_version. + * @param aParent Owner. + */ + FtuWizardActivatedState(QState *aParent = 0); + + /** + * Destructor. + * @since S60 ?S60_version. + */ + virtual ~FtuWizardActivatedState(); + +protected: + + /** + * @copydoc QState::onEntry() + */ + void onEntry(QEvent *event); + + /** + * @copydoc QState::onExit() + */ + void onExit(QEvent *event); + +private: + + /** + * Returns content service object. + * @return The content service pointer. + * @since S60 ?S60_version. + */ + FtuContentService *content() const; + + /** + * Returns the main window handle. + * @since S60 ?S60_version. + * @return The pointer to the main window. + */ + HbMainWindow* mainWindow(); + + /** + * Creates the menustrip. + * @since S60 ?S60_version. + */ + void constructGrid(); + + /** + * Connects signals and slots for active wizard. + * @since S60 ?S60_version. + */ + void setActiveWizardConnections(); + + /** + * Calculates the wizard's geometry. + * @since S60 ?S60_version. + * @return The calculated rect. + */ + QRectF calculateWizardGeometry(); + +public slots: + + /** + * Signalled when back action is triggerd from toolbaar. + * @since S60 ?S60_version. + */ + void handleBackEvent(); + + /** + * @copydoc FtuWizard::onViewChanged + */ + void changeWizardView(FtuWizard *caller, QGraphicsWidget* viewWidget); + + /** + * @copydoc FtuWizard::fullScreenModeRequested + */ + void enableFullScreenMode(FtuWizard *caller); + + /** + * @copydoc FtuWizard::partialScreenModeRequested + */ + void enablePartialScreenMode(FtuWizard *caller); + + /** + * @copydoc FtuWizard::onInfoTextUpdated + */ + void updateInfoText(FtuWizard *caller, QString text); + + /** + * Handles the item selection from grid. + * @param index The activated item. + * @sice S60 ?S60_version. + */ + void activateWizard(const QModelIndex index); + +signals: + + /** + * Emitted when the menu state is to be activated. + * @since S60 ?S60_version. + */ + void backEventTriggered(); + +private: + + /** + * HbMainWindow instance. + */ + HbMainWindow* mMainWindow; + + /** + * HbDocumentLoader instance. + */ + HbDocumentLoader* mDocumentLoader; + + /** + * Plugin view instance. + */ + HbView* mPluginView; + + /** + * Pointer to the activated wizard. Not owned. + */ + FtuWizard* mActiveWizard; + + /** + * Info text label. + */ + HbLabel* mPluginTitleLabel; + + /** + * Wizard widget area. + */ + HbStackedWidget* mWizardStackedWidget; + + /** + * Back action overriding the app exit functionality. + */ + HbAction* mBackAction; + + /** + * The menustrip component. + */ + HbGridView* mMenustrip; + + /** + * Plugin's previously activated view. + */ + QGraphicsWidget* mPreviousView; + + /** + * Plugin's currently activated view. + */ + QGraphicsWidget* mCurrentView; + + /** + * The Plugin's display mode. + */ + PluginDisplayMode mPluginDisplayMode; + + FTU_TEST_FRIEND_CLASS(FtuStateProviderTest) +}; + +#endif //FTU_STATES_WizardActivatedState_H diff -r 000000000000 -r c464cd7e2753 stateproviders/ftustateprovider/inc/ftuwizardloaderstate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/ftustateprovider/inc/ftuwizardloaderstate.h Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 FTU_STATES_WIZARDLOADERSTATE_H +#define FTU_STATES_WIZARDLOADERSTATE_H + +#include "ftutest_global.h" +#include + +FTU_TEST_CLASS(FtuStateProviderTest) + +class FtuWizardProvider; +class FtuContentService; +class FtuWizard; + + +/** @ingroup group_ftustateprovider + * @brief Initial state after first boot + * + * @see StateMachine + * + * @lib ?library + * @since S60 ?S60_version + */ +class FtuWizardLoaderState : public QState +{ + Q_OBJECT + +public: + + /** + * Constructor. + * @since S60 ?S60_version. + * @param aParent Owner. + */ + FtuWizardLoaderState(QState *aParent = 0); + + /** + * Destructor. + * @since S60 ?S60_version. + */ + virtual ~FtuWizardLoaderState(); + +public slots: + + /** + * Received when wizard is initialized. + * @param wizard The caller object. + * @param success True if succesful, false otherwise. + */ + void addWizard(FtuWizard* wizard, bool success); + +signals: + +protected: + + /** + * @copydoc QState::onEntry() + */ + void onEntry(QEvent *event); + + /** + * @copydoc QState::onExit() + */ + void onExit(QEvent *event); + +private: + /** + * Convenience method that returns the content service from dynamically + * added meta object property. + * @since S60 ?S60_version. + * @return Content service. + */ + FtuContentService *content() const; +private: + /* + * Wizard provider handle. Owned. + */ + FtuWizardProvider* mWizardProvider; + + FTU_TEST_FRIEND_CLASS(FtuStateProviderTest) +}; + +#endif //FTU_STATES_WIZARDLOADERSTATE_H diff -r 000000000000 -r c464cd7e2753 stateproviders/ftustateprovider/inc/ftuwizardmenustate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/ftustateprovider/inc/ftuwizardmenustate.h Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,151 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declaration of the wizard menu state. +* +*/ + + +#ifndef FTU_STATES_WIZARDMENUSTATE_H +#define FTU_STATES_WIZARDMENUSTATE_H + +#include +#include +#include "ftutest_global.h" + +FTU_TEST_CLASS(FtuStateProviderTest) + +class HbMainWindow; +class HbView; +class HbListView; +class HbLabel; +class HbDocumentLoader; +class QStandardItemModel; +class FtuContentService; +class QDate; +class FtuWizard; +class HbAction; + +/** @ingroup group_ftustateprovider + * @brief The state where wizard menu is shown + * + * @see StateMachine + * + * @lib ?library + * @since S60 ?S60_version + */ +class FtuWizardMenuState : public QState +{ + Q_OBJECT + +public: + + /** + * Constructor. + * @since S60 ?S60_version. + * @param aParent Owner. + */ + FtuWizardMenuState(QState *aParent = 0); + + /** + * Destructor. + * @since S60 ?S60_version. + */ + virtual ~FtuWizardMenuState(); + + +protected: + + /** + * @copydoc QState::onEntry() + */ + void onEntry(QEvent *event); + + /** + * @copydoc QState::onExit() + */ + void onExit(QEvent *event); + +private: + /** + * Creates table of contents widget. + * @since S60 ?S60_version. + */ + void createTocList(); + + /** + * Creates title text on a label. + * @since S60 ?S60_version. + */ + void createInfoText(); + + /** + * Returns content service object. + * @since S60 ?S60_version. + */ + FtuContentService *content() const; + /** + * Gets the date as string. + * @param date The date to convert as string. + * @since S60 ?S60_version. + */ + QString updatedAsString(const QDate& date) const; + +public slots: + + /** + * Called when new wizards arrives. + * @since S60 ?S60_version. + * @param index Wizard index in content service. + */ + void addWizardToListModel(int aIndex); + + /** + * Signalled when user selects an item from the list. + * @param index The index of the selected item. + */ + void activateWizard(const QModelIndex index); + + /** + * @copydoc FtuWizard::progressUpdated() + */ + void updateProgress(FtuWizard *caller, bool show, int progress); + + /** + * Called when application has to exit + */ + void exitApp(); + +signals: + + /** + * Signalled when user selects an item from the list and the + * plugin is activated. + */ + void wizardSelected(); + +private: + + HbMainWindow* mMainWindow; + HbView* mTocView; + HbLabel* mInfoText; + HbListView* mListView; + HbDocumentLoader* mDocumentLoader; + + QStandardItemModel* mModel; + HbAction* mExitAction; + + FTU_TEST_FRIEND_CLASS(FtuStateProviderTest) +}; + +#endif //FTU_STATES_WIZARDMENUSTATE_H diff -r 000000000000 -r c464cd7e2753 stateproviders/ftustateprovider/resources/resources.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/ftustateprovider/resources/resources.qrc Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,5 @@ + + + ftustateprovider.docml + + diff -r 000000000000 -r c464cd7e2753 stateproviders/ftustateprovider/src/ftustateprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/ftustateprovider/src/ftustateprovider.cpp Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the FTU state provider +* +*/ + + +#include "ftustateprovider.h" +#include "ftustateprovider_p.h" +#include "ftuwizardmenustate.h" +#include "ftuwizardloaderstate.h" +#include "ftuwizardactivatedstate.h" + +#include +#include + + + +// constants +const char wizardMenuStateUri [] = "ftu.nokia.com/state/wizardmenustate"; +const char wizardLoaderStateUri [] = "ftu.nokia.com/state/wizardloaderstate"; +const char wizardActivatedStateUri [] = "ftu.nokia.com/state/wizardactivatedstate"; + +// --------------------------------------------------------------------------- +// FtuStateProviderPrivate::FtuStateProviderPrivate +// --------------------------------------------------------------------------- +// +FtuStateProviderPrivate::FtuStateProviderPrivate(QObject *parent) +:QObject(parent) +{ +} + +// --------------------------------------------------------------------------- +// FtuStateProviderPrivate::createState +// --------------------------------------------------------------------------- +// +QState* FtuStateProviderPrivate::createState(const QString& uri) +{ + if(uri == wizardMenuStateUri) { + return new FtuWizardMenuState(); + } + else if(uri == wizardLoaderStateUri){ + return new FtuWizardLoaderState(); + } + else if(uri == wizardActivatedStateUri){ + return new FtuWizardActivatedState(); + } + else { + qDebug() << "FTU: No state found for uri: " << uri; + return NULL; + } +} +// --------------------------------------------------------------------------- +// FtuStateProvider::FtuStateProvider +// --------------------------------------------------------------------------- +// +FtuStateProvider::FtuStateProvider(QObject *parent) +:QObject(parent), mPrivate(new FtuStateProviderPrivate()) +{ +} + +// --------------------------------------------------------------------------- +// FtuStateProviderPrivate::createState +// --------------------------------------------------------------------------- +// +QState* FtuStateProvider::createState(const QString& uri) +{ + return mPrivate->createState(uri); +} diff -r 000000000000 -r c464cd7e2753 stateproviders/ftustateprovider/src/ftuwizardactivatedstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/ftustateprovider/src/ftuwizardactivatedstate.cpp Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,416 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implements the wizard activation and interactions. +* +*/ + + +#include "ftuwizardactivatedstate.h" +#include "fturuntimeservices_global.h" +#include "ftucontentservice.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +const int gridRowCount = 1; + +const char *FTUSTATEPROVIDER_DOCML2 = ":/xml/ftustateprovider.docml"; +const char *WIZARD_VIEW = "wizardView"; +const char *WIZARD_INFOTEXT_LABEL = "wizardInfoTextLabel"; +const char *WIZARD_STACKEDWIDGET = "wizardStackedWidget"; +const char *WIZARD_GRID_VIEW = "wizardGridView"; + +/* +#define LOG_GEOM(txt, r) logGeometry(txt, r) + +static void logGeometry(const char *txt, const QRectF& r) +{ + qDebug() << "ftu:" << txt << " x: " << r.topLeft().x() << " y: " << r.topLeft().y() + << " w: " << r.width() << " h: " << r.height(); +} +*/ + +// --------------------------------------------------------------------------- +// FtuWizardActivatedState::FtuWizardActivatedState +// --------------------------------------------------------------------------- +// +FtuWizardActivatedState::FtuWizardActivatedState(QState *parent) : + QState(parent), + mMainWindow(NULL), + mDocumentLoader(NULL), + mPluginView(NULL), + mActiveWizard(NULL), + mPluginTitleLabel(NULL), + mWizardStackedWidget(NULL), + mBackAction(NULL), + mMenustrip(NULL), + mPreviousView(NULL), + mCurrentView(NULL), + mPluginDisplayMode(PartialScreen) +{ + mMainWindow = hbInstance->allMainWindows().at(0); + mDocumentLoader = new HbDocumentLoader(); + mPluginView = new HbView(); + + bool ok = false; + mDocumentLoader->load(FTUSTATEPROVIDER_DOCML2, &ok); + QGraphicsWidget *widget = mDocumentLoader->findWidget(WIZARD_VIEW); + Q_ASSERT_X(ok && (widget != 0), "ftustateprovider", "invalid DocML file"); + + mPluginView->setWidget(widget); + mMainWindow->addView(mPluginView); + + mPluginView->setTitle(qtTrId("txt_ftu_title_setup")); + + mPluginTitleLabel = qobject_cast(mDocumentLoader->findWidget(WIZARD_INFOTEXT_LABEL)); + + mWizardStackedWidget = qobject_cast(mDocumentLoader->findWidget(WIZARD_STACKEDWIDGET)); + + QString path = QDir::currentPath(); + + mBackAction = new HbAction(Hb::BackAction, this); + +} + +// --------------------------------------------------------------------------- +// FtuWizardActivatedState::~FtuWizardActivatedState +// --------------------------------------------------------------------------- +// +FtuWizardActivatedState::~FtuWizardActivatedState() +{ + delete mDocumentLoader; + + if(mBackAction) + { + delete mBackAction; + } +} + +// --------------------------------------------------------------------------- +// FtuWizardActivatedState::onEntry +// --------------------------------------------------------------------------- +// +void FtuWizardActivatedState::onEntry(QEvent *event) +{ + qDebug() << "ftu:FtuWizardActivatedState::onEntry"; + QState::onEntry(event); + + int activeIndex = content()->activeWizard(); + mActiveWizard = content()->wizard(activeIndex); + + mPluginView->setNavigationAction(mBackAction); + // Make menustrip for testing purposes. + if(!mMenustrip) + { + constructGrid(); + } + mMenustrip->setVisible(true); + + connect(mBackAction, SIGNAL(triggered()), + this, SLOT(handleBackEvent())); + + setActiveWizardConnections(); + + mActiveWizard->activateWizard(); +} + +// --------------------------------------------------------------------------- +// FtuWizardActivatedState::onExit +// --------------------------------------------------------------------------- +// +void FtuWizardActivatedState::onExit(QEvent *event) +{ + QState::onExit(event); + + disconnect(mBackAction, SIGNAL(triggered()), + this, SLOT(handleBackEvent())); + + disconnect(mActiveWizard, SIGNAL(viewChanged(FtuWizard *, + QGraphicsWidget* )), + this, SLOT(changeWizardView(FtuWizard*, QGraphicsWidget*))); + + disconnect(mActiveWizard, SIGNAL(fullScreenModeRequested(FtuWizard *)), + this, SLOT(enableFullScreenMode(FtuWizard*))); + + disconnect(mActiveWizard, SIGNAL(partialScreenModeRequested(FtuWizard * )), + this, SLOT(enablePartialScreenMode(FtuWizard*))); + + disconnect(mActiveWizard, SIGNAL(infoTextUpdated(FtuWizard *, QString )), + this, SLOT(updateInfoText(FtuWizard *, QString))); +} + +// --------------------------------------------------------------------------- +// FtuWizardActivatedState::setActiveWizardConnections +// --------------------------------------------------------------------------- +// +void FtuWizardActivatedState::setActiveWizardConnections() +{ + // first disconnect possible old connections with active wizard + disconnect(mActiveWizard, SIGNAL(viewChanged(FtuWizard *, + QGraphicsWidget* )), + this, SLOT(changeWizardView(FtuWizard*, QGraphicsWidget*))); + + disconnect(mActiveWizard, SIGNAL(fullScreenModeRequested(FtuWizard *)), + this, SLOT(enableFullScreenMode(FtuWizard*))); + + disconnect(mActiveWizard, SIGNAL(partialScreenModeRequested(FtuWizard * )), + this, SLOT(enablePartialScreenMode(FtuWizard*))); + + disconnect(mActiveWizard, SIGNAL(infoTextUpdated(FtuWizard *, QString )), + this, SLOT(updateInfoText(FtuWizard *, QString))); + + // then connect new ones to active wizard + connect(mActiveWizard, SIGNAL(viewChanged(FtuWizard *, QGraphicsWidget* )), + this, SLOT(changeWizardView(FtuWizard*, QGraphicsWidget*))); + + connect(mActiveWizard, SIGNAL(fullScreenModeRequested(FtuWizard *)), + this, SLOT(enableFullScreenMode(FtuWizard*))); + + connect(mActiveWizard, SIGNAL(partialScreenModeRequested(FtuWizard * )), + this, SLOT(enablePartialScreenMode(FtuWizard*))); + + connect(mActiveWizard, SIGNAL(infoTextUpdated(FtuWizard *, QString )), + this, SLOT(updateInfoText(FtuWizard *, QString))); +} + +// --------------------------------------------------------------------------- +// FtuWizardActivatedState::content +// --------------------------------------------------------------------------- +// +FtuContentService *FtuWizardActivatedState::content() const +{ + return property(FTU_CONTENT_SERVICE_KEY).value(); +} + +// --------------------------------------------------------------------------- +// FtuWizardActivatedState::handleBackEvent +// --------------------------------------------------------------------------- +// + +void FtuWizardActivatedState::handleBackEvent() +{ + if(!mActiveWizard->handleBackEvent()) + { + emit backEventTriggered(); + } +} + +// --------------------------------------------------------------------------- +// FtuWizardActivatedState::changeWizardView +// --------------------------------------------------------------------------- +// +void FtuWizardActivatedState::changeWizardView(FtuWizard *caller, + QGraphicsWidget* viewWidget) +{ + if(caller == mActiveWizard) + { + if(viewWidget) + { + if (mWizardStackedWidget->indexOf(viewWidget) == -1) + { + // add wizard's widget to stacked widget if not yet there + mWizardStackedWidget->addWidget(viewWidget); + } + // set wizard's widget as current widget + mWizardStackedWidget->setCurrentWidget(viewWidget); + + qDebug() << "Ftu: switching view due plugin view change"; + mainWindow()->setCurrentView(mPluginView, true); + + QList wizards = content()->wizards(); + // get index of active wizard + int index = wizards.indexOf(mActiveWizard); + + // temp solution to skip edge indexes - start + if (index == 0) { index++; } + if (index == wizards.count()-1) { index--; } + // temp solution to skip edge indexes - end + + // create model index for active wizard + QModelIndex modelIndex = mMenustrip->model()->index(index, 0); + // scroll to correct position in menustrip + HbAbstractItemView::ScrollHint hint = HbAbstractItemView::PositionAtCenter; + mMenustrip->scrollTo(modelIndex, hint); + } + } +} + +// --------------------------------------------------------------------------- +// FtuWizardActivatedState::enableFullScreenMode +// --------------------------------------------------------------------------- +// +void FtuWizardActivatedState::enableFullScreenMode(FtuWizard *caller) +{ + if(caller == mActiveWizard) + { + mPluginDisplayMode = FullScreen; + // Remove menustrip + mMenustrip->setVisible(false); + caller->resizeWizard(calculateWizardGeometry()); + } +} + +// --------------------------------------------------------------------------- +// FtuWizardActivatedState::enablePartialScreenMode +// --------------------------------------------------------------------------- +// +void FtuWizardActivatedState::enablePartialScreenMode(FtuWizard *caller) +{ + if(caller == mActiveWizard) + { + mPluginDisplayMode = PartialScreen; + mMenustrip->setVisible(true); + caller->resizeWizard(calculateWizardGeometry()); + } +} + +// --------------------------------------------------------------------------- +// FtuWizardActivatedState::updateInfoText +// --------------------------------------------------------------------------- +// +void FtuWizardActivatedState::updateInfoText(FtuWizard *caller, + QString text) +{ + if(caller == mActiveWizard) + { + mPluginTitleLabel->setPlainText(text); + } +} + +// --------------------------------------------------------------------------- +// FtuWizardActivatedState::mainWindow +// --------------------------------------------------------------------------- +// +HbMainWindow* FtuWizardActivatedState::mainWindow() +{ + return hbInstance->allMainWindows().at(0); +} + +// --------------------------------------------------------------------------- +// FtuWizardActivatedState::constructGrid +// --------------------------------------------------------------------------- +// +void FtuWizardActivatedState::constructGrid() +{ + // fetch grid view from docml + mMenustrip = qobject_cast(mDocumentLoader->findWidget(WIZARD_GRID_VIEW)); + // set row amount for grid + mMenustrip->setRowCount(gridRowCount); + + mMenustrip->setScrollDirections(Qt::Horizontal); + + FtuContentService* ftuContentService = content(); + // get wizards + QList wizards = ftuContentService->wizards(); + + QStandardItemModel* model = new QStandardItemModel(this); + + for(int i = 0 ; i < wizards.size() ; ++i) + { + // get wizard settings + const FtuWizardSetting& settings = wizards.at(i)->wizardSettings(); + QStandardItem* item = new QStandardItem(); + HbIcon icon(settings.mMenustripDefaultIcon.absoluteFilePath()); + + item->setBackground(QBrush(Qt::lightGray)); + item->setData(icon, Qt::DecorationRole); + + QStringList data; + data << settings.mMenustripLabel; + + item->setData(QVariant(data), Qt::DisplayRole); + + model->appendRow(item); + } + // set above defined model for menustrip + mMenustrip->setModel(model); + + connect(mMenustrip, SIGNAL(activated(const QModelIndex)), + this, SLOT(activateWizard(const QModelIndex))); +} + +// --------------------------------------------------------------------------- +// FtuWizardActivatedState::activateWizard +// --------------------------------------------------------------------------- +// +void FtuWizardActivatedState::activateWizard(const QModelIndex index) +{ + // get index for selected wizard + int wizardIndex = index.row(); + if (wizardIndex != -1) + { + // check if other wizard than current is activated + if (mActiveWizard != content()->wizard(wizardIndex)) + { + // first deactivate current active wizard + if(mActiveWizard) + { + mActiveWizard->deactivateWizard(); + } + // set selected wizard active (precaution, as state does not change) + content()->setActiveWizard(wizardIndex); + // save active wizard + mActiveWizard = content()->wizard(wizardIndex); + // reset connections for new active wizard + setActiveWizardConnections(); + // set new active wizard visible + mActiveWizard->activateWizard(); + } + + // temp solution to skip edge indexes - start + if (wizardIndex == 0) { wizardIndex++; } + if (wizardIndex == content()->wizards().count()-1) { wizardIndex--; } + QModelIndex modelIndex = mMenustrip->model()->index(wizardIndex, 0); + // temp solution to skip edge indexes - end + + HbAbstractItemView::ScrollHint hint = HbAbstractItemView::PositionAtCenter; + // scroll to correct position in menustrip + mMenustrip->scrollTo(modelIndex, hint); + } +} + +// --------------------------------------------------------------------------- +// FtuWizardActivatedState::calculateWizardGeometry +// --------------------------------------------------------------------------- +// +QRectF FtuWizardActivatedState::calculateWizardGeometry() +{ + QRectF widgetRect = mWizardStackedWidget->geometry(); + QRectF pluginRect = mPluginView->geometry(); + if(mPluginDisplayMode == FullScreen) + { + pluginRect.setSize(QSizeF(widgetRect.width(), + (widgetRect.height() + + mMenustrip->geometry().height()))); + } + else + { + pluginRect.setSize(QSizeF(widgetRect.width(), + widgetRect.height())); + } + + return pluginRect; +} diff -r 000000000000 -r c464cd7e2753 stateproviders/ftustateprovider/src/ftuwizardloaderstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/ftustateprovider/src/ftuwizardloaderstate.cpp Mon Apr 19 14:01:47 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 "ftuwizardloaderstate.h" +#include "ftuwizardprovider.h" +#include "ftucontentservice.h" +#include +#include +#include "ftutest_global.h" + +#include + +// --------------------------------------------------------------------------- +// FtuWizardLoaderState::FtuWizardLoaderState +// --------------------------------------------------------------------------- +// +FtuWizardLoaderState::FtuWizardLoaderState(QState *parent) : + QState(parent), + mWizardProvider(NULL) +{ + mWizardProvider = new FtuWizardProvider(); +} + +// --------------------------------------------------------------------------- +// FtuWizardLoaderState::~FtuWizardLoaderState +// --------------------------------------------------------------------------- +// +FtuWizardLoaderState::~FtuWizardLoaderState() +{ + delete mWizardProvider; +} +// --------------------------------------------------------------------------- +// FtuWizardLoaderState::addWizard +// --------------------------------------------------------------------------- +// +void FtuWizardLoaderState::addWizard(FtuWizard* wizard, bool success) +{ + if(NULL!=wizard) { + qDebug() << "Wizard " << wizard->objectName() << " initialized with " << success; + } + else { + qFatal("void FtuWizardLoaderState::addWizard(FtuWizard* wizard, bool success): Null pointer argument wizard"); + } + + if(wizard && success) + { + content()->appendWizard(wizard); + + // Disconnect the signal, for it is no longer needed. + disconnect(wizard, SIGNAL(wizardInitialized(FtuWizard*, bool)), + this, SLOT(addWizard(FtuWizard*, bool))); + } +} + +// --------------------------------------------------------------------------- +// FtuWizardLoaderState::onEntry +// --------------------------------------------------------------------------- +// +void FtuWizardLoaderState::onEntry(QEvent *event) +{ + QState::onEntry(event); + + QList pluginList; + mWizardProvider->loadFTUPlugins(pluginList); + int size = pluginList.size(); + + if(size > 0) + { + for(int i = 0; i < size; i++) + { + FtuWizard* wizard = pluginList[i]->createWizard(); + if(wizard) + { + + connect(wizard, SIGNAL(wizardInitialized(FtuWizard*, bool)), + this, SLOT(addWizard(FtuWizard*, bool))); + wizard->initializeWizard(); + } + } + } +} + +// --------------------------------------------------------------------------- +// FtuWizardLoaderState::onExit +// --------------------------------------------------------------------------- +// +void FtuWizardLoaderState::onExit(QEvent *event) +{ + QState::onExit(event); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +FtuContentService *FtuWizardLoaderState::content() const +{ + return property(FTU_CONTENT_SERVICE_KEY).value(); +} + diff -r 000000000000 -r c464cd7e2753 stateproviders/ftustateprovider/src/ftuwizardmenustate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/ftustateprovider/src/ftuwizardmenustate.cpp Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,283 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the wizard menu state. +* +*/ + + +#include "ftuwizardmenustate.h" +#include "ftucontentservice.h" +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +const int progressCompelete = 100; +const char* emptyLine = " "; + +#define WMS_LOG qDebug() << "ftu:FtuWizardMenuState" + +const char *FTUSTATEPROVIDER_DOCML = ":/xml/ftustateprovider.docml"; +const char *TOC_VIEW = "tocView"; +const char *TOC_INFOTEXT_LABEL = "tocInfoTextLabel"; +const char *TOC_LIST_VIEW = "tocListView"; + + + +// --------------------------------------------------------------------------- +// FtuWizardMenuState::FtuWizardMenuState +// --------------------------------------------------------------------------- +// +FtuWizardMenuState::FtuWizardMenuState(QState *parent) : + QState(parent), + mMainWindow(NULL), + mTocView(NULL), + mInfoText(NULL), + mListView(NULL), + mDocumentLoader(NULL), + mModel(NULL) +{ + mMainWindow = hbInstance->allMainWindows().at(0); + mModel = new QStandardItemModel(this); + + mDocumentLoader = new HbDocumentLoader(); + bool ok = false; + mDocumentLoader->load(FTUSTATEPROVIDER_DOCML, &ok); + QGraphicsWidget *widget = mDocumentLoader->findWidget(TOC_VIEW); + Q_ASSERT_X(ok && (widget != 0), "ftustateprovider", "invalid DocML file"); + mTocView = qobject_cast(widget); + + mTocView->setTitle(qtTrId("txt_ftu_title_setup")); + + mMainWindow->addView(mTocView); + // Set as initial view. + mMainWindow->setCurrentView(mTocView); + mExitAction = new HbAction(Hb::QuitNaviAction, this); + mTocView->setNavigationAction(mExitAction); + QObject::connect( mExitAction, SIGNAL(triggered()), this, SLOT(exitApp())); +} + +// --------------------------------------------------------------------------- +// FtuWizardMenuState::~FtuWizardMenuState +// --------------------------------------------------------------------------- +// +FtuWizardMenuState::~FtuWizardMenuState() +{ + if(mModel) + { + delete mModel; + } + delete mDocumentLoader; +} + +// --------------------------------------------------------------------------- +// FtuWizardMenuState::onEntry +// --------------------------------------------------------------------------- +// +void FtuWizardMenuState::onEntry(QEvent *event) +{ + WMS_LOG << "::onEntry"; + QState::onEntry(event); + + if(!mInfoText) + { + createInfoText(); + } + if(!mListView) + { + createTocList(); + } + + // If this is not the current view, we're getting back from plugin view + if(mMainWindow->currentView() != mTocView) + { + mMainWindow->setCurrentView(mTocView, true); + } + + mMainWindow->show(); +} + +// --------------------------------------------------------------------------- +// FtuWizardMenuState::onExit +// --------------------------------------------------------------------------- +// +void FtuWizardMenuState::onExit(QEvent *event) +{ + QState::onExit(event); +} + +// --------------------------------------------------------------------------- +// FtuWizardMenuState::content +// --------------------------------------------------------------------------- +// +FtuContentService *FtuWizardMenuState::content() const +{ + return property(FTU_CONTENT_SERVICE_KEY).value(); +} + +// --------------------------------------------------------------------------- +// FtuWizardMenuState::updatedAsString +// --------------------------------------------------------------------------- +// +QString FtuWizardMenuState::updatedAsString(const QDate& date) const +{ + QString status; + + if(date == QDate().currentDate() ) + { + status.append(qtTrId("txt_ftu_list_update_today")); + } + else + { + status.append(qtTrId("txt_ftu_list_update_date").arg(date.toString())); + } + return status; +} + +// --------------------------------------------------------------------------- +// FtuWizardMenuState::addWizardToListModel +// --------------------------------------------------------------------------- +// +void FtuWizardMenuState::addWizardToListModel(int aIndex) +{ + WMS_LOG << "::addWizardToListModel idx : " << aIndex; + FtuContentService* ftuContentService = content(); + + FtuWizard* addedWizard = ftuContentService->wizard(aIndex); + if(addedWizard) + { + // Connect for progress updates. + connect(addedWizard, SIGNAL(progressUpdated(FtuWizard *, bool, int)), + this, SLOT(updateProgress(FtuWizard *, bool, int))); + + const FtuWizardSetting& settings = addedWizard->wizardSettings(); + QStandardItem* newItem = new QStandardItem(); + HbIcon icon (settings.mTocDefaultIcon.absoluteFilePath()); + QStringList data; + data << settings.mTocLabel; + QDate date = addedWizard->wizardCompletedDate(); + if(date.isNull()) + { + data << emptyLine; + } + else + { + data << updatedAsString(date); + } + + newItem->setBackground(QBrush(Qt::lightGray)); + newItem->setData(icon, Qt::DecorationRole); + newItem->setData(QVariant(data), Qt::DisplayRole); + + mModel->appendRow(newItem); + } +} + +// --------------------------------------------------------------------------- +// FtuWizardMenuState::createTocList +// --------------------------------------------------------------------------- +// +void FtuWizardMenuState::createTocList() +{ + if (!mListView) + { + mListView = qobject_cast(mDocumentLoader->findWidget( + TOC_LIST_VIEW)); + connect(mListView, + SIGNAL(activated(const QModelIndex)), + this, + SLOT(activateWizard(const QModelIndex))); + + mListView->setModel(mModel); + } +} + +// --------------------------------------------------------------------------- +// FtWizardMenuState::createInfoText +// --------------------------------------------------------------------------- +// +void FtuWizardMenuState::createInfoText() +{ + mInfoText = qobject_cast(mDocumentLoader->findWidget(TOC_INFOTEXT_LABEL)); + mInfoText->setPlainText(qtTrId("txt_ftu_subtitle_toc")); +} + +// --------------------------------------------------------------------------- +// FtuWizardMenuState::activateWizard +// --------------------------------------------------------------------------- +// +void FtuWizardMenuState::activateWizard(const QModelIndex index) +{ + // Set the active wizard index + content()->setActiveWizard(index.row()); + // signal to activated state + emit wizardSelected(); +} + +// --------------------------------------------------------------------------- +// FtuWizardMenuState::updateProgress +// --------------------------------------------------------------------------- +// +void FtuWizardMenuState::updateProgress(FtuWizard *caller, bool show, + int progress) +{ + Q_UNUSED(show) + QList wizards = content()->wizards(); + int index = -1; + + // Get the index of the wizard + for(int i = 0 ; i < wizards.size() ; ++i) + { + if(caller == wizards[i]) + { + WMS_LOG << "::updateProgress wizard found at: " << i; + index = i; + } + } + if(index != -1) + { + QStringList data; + data << wizards[index]->wizardSettings().mTocLabel; + + if(progress < progressCompelete) + { + QString progressStr; + QString progressNumber; + progressNumber.setNum(progress); + progressStr = qtTrId("txt_ftu_list_progress_status").arg(progressNumber); + data << progressStr; + } + else + { + QDate date = wizards[index]->wizardCompletedDate(); + data << updatedAsString(date); + } + mModel->item(index)->setData(QVariant(data), Qt::DisplayRole); + } +} + +void FtuWizardMenuState::exitApp() + { + qApp->exit(); + } diff -r 000000000000 -r c464cd7e2753 stateproviders/stateproviders.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateproviders/stateproviders.pro Mon Apr 19 14:01:47 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: FTU state providers project file +# + +TEMPLATE = subdirs +SUBDIRS = ftustateprovider +CONFIG += ordered diff -r 000000000000 -r c464cd7e2753 sysdef_1_5_1.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sysdef_1_5_1.dtd Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r c464cd7e2753 translations/FTU_textmap_10_1_v4_edit.xls Binary file translations/FTU_textmap_10_1_v4_edit.xls has changed diff -r 000000000000 -r c464cd7e2753 translations/ftu_en.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/translations/ftu_en.ts Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,316 @@ + + + + + + markable setting item: marked or unmarked , shown only in some marketing areas + Sign up for tips & tricks + Sign up for tips & tricks + + ftu_07 + setlabel + ft + False + + + TOC item, data sync + Import data + Import data + + ftu_09 + list item + ft + False + + + related to terms of use below + Accept + Accept + + ftu_07 + button + ft + False + + + menustrip item + Email accounts + Email accounts + + ftu_10 + grid + ft + False + + + TOC item, setting in sync with control panel´s settings + Time, date and location + Time, date and location + + ftu_09 + dblist + ft + False + + + menustrip item + Import data + Import data + + ftu_10 + grid + ft + False + + + TOC item, email account creation + Email accounts + Email accounts + + ftu_09 + dblist + ft + False + + + TOC item, IM account creation + Instant messaging + Instant messaging + + ftu_09 + dblist + ft + False + + + + no + no + + ftu_08 + button + ft + False + + + menustrip item + time, date& location + time, date& location + + ftu_10 + grid + ft + False + + + info text that user can find settings later, dialog view + You can find later link to setup from your home screen. + You can find later link to setup from your home screen. + + ftu_08 + info + ft + False + + + subtitle hints to the view + Please read terms of use and accept to continue + Please read terms of use and accept to continue + + ftu_07 + subhead + ft + False + + + TOC item, second row, tells last time user has edited plugin/module, shown only if the update has been today + updated today + updated today + + ftu_09 + dblist_val + ft + False + + + info text for user choices, related to buttons below, dialog view + Do you want to do start up settings now (recommended)? + Do you want to do start up settings now (recommended)? + + ftu_08 + info + ft + False + + + TOC item, sync with the Phonebook mycard + My contact card + My contact card + + ftu_09 + list item + ft + False + + + + yes + yes + + ftu_08 + button + ft + False + + + menustrip item + Importing… + Importing… + + ftu_10 + grid + ft + False + + + menustrip item + Instant messaging + Instant messaging + + ftu_10 + grid + ft + False + + + TOC item, data sync list item, where U is the source where the data is imported in to the phone (e.g. name of the PC or phone) + Import data from %1 + Import data from %1 + + ftu_09 + list item + ft + False + + + placeholder, correct text from services later + <terms of use> + <terms of use> + + ftu_07 + info + ft + False + + + menustrip item + Style of phone + Style of phone + + ftu_10 + grid + ft + False + + + menustrip item + Social media + Social media + + ftu_10 + grid + ft + False + + + menustrip item, these items open same stuff as TOC items + My contact card + My contact card + + ftu_10 + grid + ft + False + + + Title shown in all FTU views, excluding videos& pin code query + Setup + Setup + + ftu + title + ft + False + + + TOC item, second row, tells the status of the user initiated progress (data sync from source x) + %1% done… + %1% done… + + ftu_09 + dblist_val + ft + False + + + TOC item, second row, tells last time user has edited plugin/module, where U is the date + updated %1 + updated %1 + + ftu_09 + dblist_val + ft + False + + + info text for language selection, uses main view + Set your phone language: + Set your phone language: + + ftu_06 + setlabel + ft + False + + + TOC item, main phone style settings (ringing tone, wallpaper, theme) + Style of phone + Style of phone + + ftu_09 + dblist + ft + False + + + text hints what user can do with the the Table Of Concents (TOC) items + Select setting you want to edit + Select setting you want to edit + + ftu_09 + subhead + ft + False + + + info text to user´s choices, uses main view + Select language you want to use + Select language you want to use + + ftu_06 + subhead + ft + False + + + TOC item, SM account creation (facebook etc) + Social media + Social media + + ftu_09 + dblist + ft + False + + + diff -r 000000000000 -r c464cd7e2753 translations/ftu_en_GB.qm Binary file translations/ftu_en_GB.qm has changed diff -r 000000000000 -r c464cd7e2753 translations/ftu_en_US.qm Binary file translations/ftu_en_US.qm has changed diff -r 000000000000 -r c464cd7e2753 translations/ftu_fi.qm Binary file translations/ftu_fi.qm has changed diff -r 000000000000 -r c464cd7e2753 translations/ftu_fi.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/translations/ftu_fi.ts Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,315 @@ + + + + + + + Sign up for tips & tricks + markable setting item: marked or unmarked , shown only in some marketing areas + Tillaan kikat ja vinkit + Comment + setlabel + Co + + False + + + Import data + TOC item, data sync + Sisääntuo tietoa + + list item + + + False + + + Accept + related to terms of use below + Hyväksy + Text ID + button + Te + + False + + + Import data + menustrip item + Sisääntuo tietoa + + grid + + + False + + + Email accounts + menustrip item + Postilootat + + grid + + + False + + + Time, date and location + TOC item, setting in sync with control panel´s settings + Tapa, paikka ja aika + + dblist + + + False + + + Email accounts + TOC item, email account creation + Postilootat + + dblist + + + False + + + Instant messaging + TOC item, IM account creation + Välitön viestintä + + dblist + + + False + + + no + ei + + button + + + False + + + time, date& location + menustrip item + Tapa, aika ja paikka + + grid + + + False + + + You can find later link to setup from your home screen. + info text that user can find settings later, dialog view + Löyvät linkin käyttöönottoon myöhemmin kotinäytöltä + + info + + + False + + + Please read terms of use and accept to continue + subtitle hints to the view + Hyväksyhhän lakihöpinät ja paina nappulaa + File name + subhead + Fi + + False + + + updated today + TOC item, second row, tells last time user has edited plugin/module, shown only if the update has been today + Päivitetty tänään + + dblist_val + + + False + + + Do you want to do start up settings now (recommended)? + info text for user choices, related to buttons below, dialog view + Halluukko tehä käyttöönottoasetukset nytten? + + info + + + False + + + My contact card + TOC item, sync with the Phonebook mycard + Mun kontaktikortti + + list item + + + False + + + yes + joo + + button + + + False + + + Importing… + menustrip item + Sisääntuonti + + grid + + + False + + + Instant messaging + menustrip item + Välitön viestintä + + grid + + + False + + + Import data from %1 + TOC item, data sync list item, where U is the source where the data is imported in to the phone (e.g. name of the PC or phone) + Sisääntuodaan tietoa lähteestä %1 + + list item + + + False + + + <terms of use> + placeholder, correct text from services later + Käyttöehedot + + info + + + False + + + Style of phone + menustrip item + Puhelimen tyyli + + grid + + + False + + + Social media + menustrip item + Sosiaaliverkot + + grid + + + False + + + My contact card + menustrip item, these items open same stuff as TOC items + Mun kontaktikortti + + grid + + + False + + + Setup + Title shown in all FTU views, excluding videos& pin code query + Käyttöönotto + View ID (draft) + title + Vi + + False + + + %1'%' done… + TOC item, second row, tells the status of the user initiated progress (data sync from source x) + %1% duunattu + + dblist_val + + + False + + + updated %1 + TOC item, second row, tells last time user has edited plugin/module, where U is the date + Päivitetty %1 + + dblist_val + + + False + + + Set your phone language: + info text for language selection, uses main view + Asetappa luurin kieli: + Layout ID + setlabel + La + + False + + + Style of phone + TOC item, main phone style settings (ringing tone, wallpaper, theme) + Puhelimen tyyli + + dblist + + + False + + + Select setting you want to edit + text hints what user can do with the the Table Of Concents (TOC) items + Valitse asetus jota haluat säätää + + subhead + + + False + + + Select language you want to use + info text to user´s choices, uses main view + Valitteppa kieli jolla haluat pamlata + Position ID + subhead + Po + + False + + + Social media + TOC item, SM account creation (facebook etc) + Sosiaaliverkot + + dblist + + + False + + + diff -r 000000000000 -r c464cd7e2753 translations/ftuexamplewizards.xls Binary file translations/ftuexamplewizards.xls has changed diff -r 000000000000 -r c464cd7e2753 translations/ftuexamplewizards_en.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/translations/ftuexamplewizards_en.ts Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,126 @@ + + + + + + + Other + Other + + ftuemailwizard + + ft + False + + + + Please choose again! + Please choose again! + + ftuemailwizard + + ft + False + + + + Get socialized + Get socialized + + ftusocialmediawizard + + ft + False + + + + You are now a social person + You are now a social person + + ftusocialmediawizard + + ft + False + + + Info text shown when user enters the wizard + Set up data transfer + Set up data transfer + + ftuexamplewizard + + ft + False + + + Text in button + Start data transfer + Start data transfer + + ftuexamplewizard + + ft + False + + + + Select your email account type + Select your email account type + + ftuemailwizard + + ft + False + + + + Time is set now + Time is set now + + ftudatetimelocationwizard + + ft + False + + + + Great choice! + Great choice! + + ftuemailwizard + + ft + False + + + + Set social media accounts + Set social media accounts + + ftusocialmediawizard + + ft + False + + + + Set time + Set time + + ftudatetimelocationwizard + + ft + False + + + + Date, time and location + Date, time and location + + ftudatetimelocationwizard + + ft + False + + + diff -r 000000000000 -r c464cd7e2753 translations/ftuexamplewizards_en_GB.qm Binary file translations/ftuexamplewizards_en_GB.qm has changed diff -r 000000000000 -r c464cd7e2753 translations/ftuexamplewizards_en_US.qm Binary file translations/ftuexamplewizards_en_US.qm has changed diff -r 000000000000 -r c464cd7e2753 translations/ftuexamplewizards_fi.qm Binary file translations/ftuexamplewizards_fi.qm has changed diff -r 000000000000 -r c464cd7e2753 translations/ftuexamplewizards_fi.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/translations/ftuexamplewizards_fi.ts Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,116 @@ + + + + + + Other + Muu + ftuemailwizard + + ft + + False + + + Please choose again! + Valittehan uudelleen! + ftuemailwizard + + ft + + False + + + Get socialized + Sosialisoidu + ftusocialmediawizard + + ft + + False + + + You are now a social person + Sä olet nyt tosi sosiaalinen tyyppi + ftusocialmediawizard + + ft + + False + + + Set up data transfer + Info text shown when user enters the wizard + Aseta tiedonsiirto + ftuexamplewizard + + ft + + False + + + Start data transfer + Text in button + Aloita tiedonsiirto + ftuexamplewizard + + ft + + False + + + Select your email account type + Valitse sähköpostisi tyyppi + ftuemailwizard + + ft + + False + + + Time is set now + Kello on nyt asetettu + ftudatetimelocationwizard + + ft + + False + + + Great choice! + Oikea valinta! + ftuemailwizard + + ft + + False + + + Set social media accounts + Aseta sosiaalimediapalvelut + ftusocialmediawizard + + ft + + False + + + Set time + Aseta aika + ftudatetimelocationwizard + + ft + + False + + + Date, time and location + Päivämäärä, aika ja sijainti + ftudatetimelocationwizard + + ft + + False + + + diff -r 000000000000 -r c464cd7e2753 translations/translations.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/translations/translations.qrc Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,8 @@ + + + ftu_en_US.qm + + + ftu_en_GB.qm + + diff -r 000000000000 -r c464cd7e2753 wizardproviders/ftuwizardprovider/conf/ftuwizardprovider.confml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wizardproviders/ftuwizardprovider/conf/ftuwizardprovider.confml Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,74 @@ + + + + Defines which FTU Wizards are displayed when application is run. + + Configures how many ftu plug-ins will be loaded. List plug-ins below. The value of a single key is the interface identifier in literal format. + + + Value is the interface identifier in literal format. + + + Value is the interface identifier in literal format. + + + Value is the interface identifier in literal format. + + + Value is the interface identifier in literal format. + + + Value is the interface identifier in literal format. + + + Value is the interface identifier in literal format. + + + Value is the interface identifier in literal format. + + + Value is the interface identifier in literal format. + + + Value is the interface identifier in literal format. + + + Value is the interface identifier in literal format. + + + Value is the interface identifier in literal format. + + + Value is the interface identifier in literal format. + + + Value is the interface identifier in literal format. + + + Value is the interface identifier in literal format. + + + Value is the interface identifier in literal format. + + + + + 5 + ftudatetimelocationwizard.manifest + ftuemailwizard.manifest + ftusocialmediawizard.manifest + ftudatetimewizard.manifest + dataimportftuwizard.manifest + + + + + + + + + + + + + diff -r 000000000000 -r c464cd7e2753 wizardproviders/ftuwizardprovider/conf/ftuwizardprovider_20026F9B.crml Binary file wizardproviders/ftuwizardprovider/conf/ftuwizardprovider_20026F9B.crml has changed diff -r 000000000000 -r c464cd7e2753 wizardproviders/ftuwizardprovider/ftuwizardprovider.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wizardproviders/ftuwizardprovider/ftuwizardprovider.pri Mon Apr 19 14:01:47 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: FTU wizard provider list of files +# + +HEADERS += ./inc/*.h +SOURCES += ./src/*.cpp \ No newline at end of file diff -r 000000000000 -r c464cd7e2753 wizardproviders/ftuwizardprovider/ftuwizardprovider.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wizardproviders/ftuwizardprovider/ftuwizardprovider.pro Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,62 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: FTU wizard provider project file +# + + +TEMPLATE = lib +CONFIG += hb + +INCLUDEPATH += ./inc + + +DEFINES += FTUWIZARDPROVIDER_LIB + +win32 { + CONFIG(debug, debug|release) { + SUBDIRPART = debug + } else { + SUBDIRPART = release + } + DESTDIR = $$PWD/../../../bin/$$SUBDIRPART + LIBS += -L$$PWD/../../../bin/debug +} + +DEPENDPATH += ./inc \ + ./src + +INCLUDEPATH += ./inc \ + ../../inc + +LIBS += -lftuwizardmodel + +QT -= webkit +QT += xml + +symbian { + TARGET.UID3 = 0x20026F9B + TARGET.CAPABILITY = ALL -TCB + TARGET.EPOCALLOWDLLDATA=1 + TARGET.EPOCHEAPSIZE = 0x020000 0x1F00000 + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + LIBS += -lxqsettingsmanager + BLD_INF_RULES.prj_exports += \ + "conf/ftuwizardprovider.confml APP_LAYER_CONFML(ftuwizardprovider.confml)" \ + "conf/ftuwizardprovider_20026F9B.crml APP_LAYER_CRML(ftuwizardprovider_20026F9B.crml)" +} + +include(ftuwizardprovider.pri) + +#ONLY FOR DEVELOPMENT! REMOVE THIS BEFORE EACH HS_Domain RELEASE! +symbian: MMP_RULES += EXPORTUNFROZEN diff -r 000000000000 -r c464cd7e2753 wizardproviders/ftuwizardprovider/inc/ftumanifestparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wizardproviders/ftuwizardprovider/inc/ftumanifestparser.h Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Wizard provider manifest parser. +* +*/ + + +#ifndef FTU_WIZARPROVIDER_MANIFESTPARSER_H +#define FTU_WIZARPROVIDER_MANIFESTPARSER_H + +#include + +class QDomElement; +/** + * @ingroup wizardprovider + * @brief Loads ftu plugins from an XML manifest file. + * + * @lib ?library + * @since S60 ?S60_version + */ +class FtuManifestParser : public QObject +{ + Q_OBJECT + +public: + + /** + * Constructor. + * @since S60 ?S60_version. + * @param aParent Parent object. + */ + FtuManifestParser(QObject* aParent = 0); + + /** + * Destructor. + * @since S60 ?S60_version. + */ + virtual ~FtuManifestParser(); + + /** + * Parses plugin list from manifest file. + * @since S60 ?S60_version. + * @param path The path where manifest file is found. + * @return Parsed plugin paths. + */ + QStringList parsePluginList(const QString& path); + +private: + + Q_DISABLE_COPY(FtuManifestParser) + + /** + * Parses the plugin paths from a manifest file. + * @since S60 ?S60_version. + * @param fileName Manifest file name. + * @return Parsed path. + */ + QString loadFromXml(const QString& fileName); + + /** + * Parses the attribute. + * @since S60 ?S60_version. + * @param element The element from which the attribute is parsed. + * @param attributeName The name of the attribute to be parsed. + * @return Parsed attribute. + */ + QString parseAttribute(QDomElement& element, const QString& attributeName) const; + + /** + * Reads the configured plugins. + * @since S60 ?S60_version. + * @return List of configured manifest files. + */ + QStringList readManifestFilesFromConfig(); + +private: + +}; + +#endif //FTU_WIZARPROVIDER_MANIFESTPARSER_H + diff -r 000000000000 -r c464cd7e2753 wizardproviders/ftuwizardprovider/inc/ftuwizardprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wizardproviders/ftuwizardprovider/inc/ftuwizardprovider.h Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: FTU wirzard provider. +* +*/ + + +#ifndef FTU_WIZARDPROVIDER_H +#define FTU_WIZARDPROVIDER_H + +#include "ftuwizardprovider_global.h" +#include "ftutest_global.h" +#include +#include +#include + +class FtuWizard; +class FtuWizardFactory; + +FTU_TEST_CLASS(FtuWizardProviderTest) + + +/** + * @ingroup group_ftuwizardprovider + * @brief Loads and connects FTU plugins + * + * This service is responsible for loading FTU plugins. + * + * @since S60 ?S60_version. + */ +class FTUWIZARDPROVIDER_EXPORT FtuWizardProvider : public QObject +{ + + Q_OBJECT + +public: + + /** + * Default constructor. + * + * @since S60 ?S60_version. + */ + FtuWizardProvider(QObject* =0); + + /** + * Destructor. + * + * @since S60 ?S60_version. + */ + virtual ~FtuWizardProvider(); + + /** + * Loads all FTU plugins. + * @param plugins The list will contain all found plugins on return. + * @since S60 ?S60_version. + */ + void loadFTUPlugins(QList& plugins); + +private: + + +private slots: + +private: + + QString mWizardManifestDir; + + FTU_TEST_FRIEND_CLASS(FtuWizardProviderTest) +}; + + + + +#endif diff -r 000000000000 -r c464cd7e2753 wizardproviders/ftuwizardprovider/inc/ftuwizardprovider_global.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wizardproviders/ftuwizardprovider/inc/ftuwizardprovider_global.h Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The dll header file. +* +*/ + + +#ifndef FTUWIZARDPROVIDER_GLOBAL +#define FTUWIZARDPROVIDER_GLOBAL + +#include + + +#ifdef FTUWIZARDPROVIDER_LIB + #define FTUWIZARDPROVIDER_EXPORT Q_DECL_EXPORT +#else + #ifdef FTUWIZARDPROVIDER_TEST + #define FTUWIZARDPROVIDER_EXPORT + #else + #define FTUWIZARDPROVIDER_EXPORT Q_DECL_IMPORT + #endif +#endif + + +#endif // FTUWIZARDPROVIDER_GLOBAL diff -r 000000000000 -r c464cd7e2753 wizardproviders/ftuwizardprovider/inc/ftuwizardproviderinternalcrkeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wizardproviders/ftuwizardprovider/inc/ftuwizardproviderinternalcrkeys.h Mon Apr 19 14:01:47 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: Wizard provider manifest parser. +* +*/ + +#ifndef FTUWIZARDPROVIDERINTERNALCRKEYS_H +#define FTUWIZARDPROVIDERINTERNALCRKEYS_H + +#include + + +/** +* Ftu Wizard plugin configuration +*/ +const qint32 KCrUidFtuWizardProvider = {0x20026F9B}; + +/** +* Describes how many ftu wizard plug-ins are listed in the configuration +* Type: int +*/ +const quint32 KFtuNumberOfWizardPlugins = {0x00000001}; + +#endif // FTUWIZARDPROVIDERINTERNALCRKEYS_H diff -r 000000000000 -r c464cd7e2753 wizardproviders/ftuwizardprovider/src/ftumanifestparser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wizardproviders/ftuwizardprovider/src/ftumanifestparser.cpp Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,227 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: FTU manifest parser. +* +*/ + + +#include "ftumanifestparser.h" +#ifdef Q_OS_SYMBIAN +#include "ftuwizardproviderinternalcrkeys.h" +#endif +#include +#include +#include +#include +#include +#include + +#ifdef Q_OS_SYMBIAN + +#include // for reading cenrep keys +#endif // Q_OS_SYMBIAN + +// --------------------------------------------------------------------------- +// FtuManifestParser::FtuManifestParser +// --------------------------------------------------------------------------- +// +FtuManifestParser::FtuManifestParser(QObject* aParent) + : QObject(aParent) +{ +} + +// --------------------------------------------------------------------------- +// FtuManifestParser::~FtuManifestParser +// --------------------------------------------------------------------------- +// +FtuManifestParser::~FtuManifestParser() +{ + +} + + +// --------------------------------------------------------------------------- +// FtuManifestParser::parsePluginList +// --------------------------------------------------------------------------- +// +QStringList FtuManifestParser::parsePluginList(const QString& manifestPath) +{ + QStringList dllNameList; + QStringList pathList; + + //Check plugin dirs from root of different drives + QFileInfoList drives = QDir::drives(); + int i; + for(i = 0; i < drives.count(); i++) + { + QFileInfo drive = drives.at(i); + QString driveLetter = drive.absolutePath(); + QString path = driveLetter + manifestPath; + if(QDir(path).exists()) + { + qDebug() << "ftu:: append to path list: " << path; + pathList << path; + } + } + // Read the configured plugin list. + QStringList filesToRead = readManifestFilesFromConfig(); + + for(i=0; i < pathList.count(); i++) + { + QString path = pathList.at(i); + QDir dir(path); + + // Use the configured list as a filter while getting the + // manifest files. + dir.setNameFilters(filesToRead); + QStringList entries = dir.entryList(filesToRead, QDir::Files); + + qDebug() << "ftu: Configured manifest file count " + << filesToRead.count() + << " found manifest files from system " << entries.count(); + + // Go through the configured list and find the manifest files. + for(int j=0; j < filesToRead.count() ; ++j) + { + int index = entries.indexOf(filesToRead[j]); + qDebug() << "ftu:reading manifest file from "<< index; + if(index > -1 && index <= entries.count()) + { + QString fileName = entries[index]; + qDebug() << "ftu:: loading from manifest file: " << fileName; + QString path = loadFromXml(dir.absoluteFilePath(fileName)); + qDebug() << "ftu:: path from manifest: " << path; + if(!path.isEmpty()) + { + dllNameList << path; + } + } + } + } + return dllNameList; +} + +// --------------------------------------------------------------------------- +// FtuManifestParser::readManifestFilesFromConfig +// --------------------------------------------------------------------------- +// + +QStringList FtuManifestParser::readManifestFilesFromConfig() +{ + QStringList filesFromConf; +#ifdef Q_OS_SYMBIAN + + XQSettingsManager* settingsManager = new XQSettingsManager(); + + XQSettingsKey numberOfPluginsKey(XQSettingsKey::TargetCentralRepository, + KCrUidFtuWizardProvider, + KFtuNumberOfWizardPlugins); + + bool ok = false; + int numberOfPlugins = settingsManager->readItemValue( + numberOfPluginsKey).toInt(&ok); + + qDebug() << "Ftu:FtuManifestParser reading the nbr of plugins resulted: " + << ok; + + if(ok) + { + qDebug() << "Ftu:reading config for " << numberOfPlugins + << " plugins"; + + + for(int i=1; i <= numberOfPlugins ; ++i) + { + XQSettingsKey fileKey(XQSettingsKey::TargetCentralRepository, + KCrUidFtuWizardProvider, + KFtuNumberOfWizardPlugins + i); + + QString file = settingsManager->readItemValue(fileKey, + XQSettingsManager::TypeString).toString(); + qDebug() << "Ftu:Reading filename from conf :" << file; + filesFromConf << file; + } + } + delete settingsManager; +#else + // Add hardcoded strings for windows environment, + // currently the settings manager is not available for windows. + filesFromConf << "ftusocialmediawizard.manifest" + << "ftudatetimelocationwizard.manifest" + << "ftuexamplewizard.manifest" + << "ftuemailwizard.manifest"; +#endif + return filesFromConf; +} + +// --------------------------------------------------------------------------- +// FtuManifestParser::loadFromXml +// --------------------------------------------------------------------------- +// +QString FtuManifestParser::loadFromXml(const QString& aFileName) +{ + + qDebug() << "ftu:: ManifestParser::loadFromXml " << aFileName; + QFile file(aFileName); + + if(!file.exists()) + { + qDebug() << "ftu: file does not exist"; + return QString(); + } + + QDomDocument document; + if(!document.setContent(&file)) + { + return QString(); + } + + QDomElement element = document.documentElement(); + if(element.tagName() != "plugin") + { + qDebug() << "ftu: Tag name plugin not found"; + return QString(); + } + + QDomNodeList plugins = element.elementsByTagName("runtime"); + + for(int i = 0; i < plugins.count(); ++i) + { + element = plugins.at(i).toElement(); + QString attr = parseAttribute(element, "library"); + qDebug() << "ftu::parsed attr " << attr; + return attr; + } + return QString(); +} + + +// --------------------------------------------------------------------------- +// FtuManifestParser::parseAttribute +// --------------------------------------------------------------------------- +// +QString FtuManifestParser::parseAttribute(QDomElement& element, + const QString& attributeName) const +{ + QDomAttr attribute = element.attributeNode(attributeName); + if(attribute.isNull() || attribute.value().isEmpty()) + { + qDebug() << "ftu: attribute not parsed [attr name]" << attributeName; + return QString(); + } + + return attribute.value(); +} + + diff -r 000000000000 -r c464cd7e2753 wizardproviders/ftuwizardprovider/src/ftuwizardprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wizardproviders/ftuwizardprovider/src/ftuwizardprovider.cpp Mon Apr 19 14:01:47 2010 +0300 @@ -0,0 +1,159 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: FTU wizard provider. +* +*/ + + +#include "ftuwizardprovider.h" +#include "ftumanifestparser.h" + +#include + +#include +#include +#ifdef Q_OS_SYMBIAN +#include +#else +#include +#endif +#include + +//#define _USE_SERVICEFW + +#ifdef _USE_SERVICEFW +#include "ftuwizardproviderinternalcrkeys.h" + +#include +#include +#include // for reading cenrep keys + +#endif + + +#ifndef FTUWIZARDPROVIDER_TEST +const char wizardManifestDir [] = "/fturesources/plugins/wizardproviders"; +#else +const char wizardManifestDir [] = "/fturesources/testresources/plugins/wizardproviders"; +#endif + +// --------------------------------------------------------------------------- +// FtuWizardProvider::FtuWizardProvider +// --------------------------------------------------------------------------- +// +FtuWizardProvider::FtuWizardProvider(QObject* parent): + QObject(parent), mWizardManifestDir(wizardManifestDir) +{ + +} + +// --------------------------------------------------------------------------- +// FtuWizardProvider::~FtuWizardProvider +// --------------------------------------------------------------------------- +// +FtuWizardProvider::~FtuWizardProvider() +{ +} + +// --------------------------------------------------------------------------- +// FtuWizardProvider::loadFTUPlugins +// --------------------------------------------------------------------------- +// +void FtuWizardProvider::loadFTUPlugins(QList& plugins) +{ +#ifdef Q_OS_SYMBIAN + QDir pluginsDir = QLibraryInfo::location(QLibraryInfo::PluginsPath) + + "/FTU"; +#else + QDir pluginsDir = QCoreApplication::applicationDirPath() + + "/resource/qt/plugins/FTU"; +#endif + + QStringList pluginList; + + FtuManifestParser parser; +#ifdef Q_OS_SYMBIAN + pluginList = parser.parsePluginList(mWizardManifestDir); +#else + QString manifestDir = QCoreApplication::applicationDirPath() + + mWizardManifestDir; + // Remove c:/ + manifestDir.remove(0,3); + pluginList = parser.parsePluginList(manifestDir); +#endif + +#ifdef _USE_SERVICEFW + + XQSettingsManager settingsManager; + + XQSettingsKey numberOfPluginsKey(XQSettingsKey::TargetCentralRepository, + KCrUidFtuWizardProvider, + KFtuNumberOfWizardPlugins); + + bool ok; + int numberOfPlugins = settingsManager.readItemValue( + numberOfPluginsKey).toInt(&ok); + + QServiceManager* serviceManager = new QServiceManager(); + + if(ok) + { + qDebug() << "Ftu:reading config for " << numberOfPlugins + << " plugins"; + + + for(int i=1; i <= numberOfPlugins ; ++i) + { + XQSettingsKey fileKey(XQSettingsKey::TargetCentralRepository, + KCrUidFtuWizardProvider, + KFtuNumberOfWizardPlugins + i); + + QString interface = settingsManager.readItemValue(fileKey, + XQSettingsManager::TypeString).toString(); + qDebug() << "Ftu:Reading interface name from conf :" << interface; + QObject* obj = serviceManager->loadInterface(interface); + if(obj) + { + FtuWizardFactory* factory = qobject_cast + (obj); + if(factory) + { + plugins.append(factory); + } + } + + } + } + delete serviceManager; + +#else + foreach (QString filename, pluginList) + { + qDebug () << "Ftu: Loading instance from : "<< filename; + QPluginLoader loader(pluginsDir.absoluteFilePath(filename)); + QObject* instance = loader.instance(); + if(instance) + { + qDebug() << "ftu: instance loaded"; + FtuWizardFactory* factory = qobject_cast + (instance); + if(factory) + { + qDebug() << "ftu: appending factory to list"; + plugins.append(factory); + } + } + } +#endif +} diff -r 000000000000 -r c464cd7e2753 wizardproviders/wizardproviders.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wizardproviders/wizardproviders.pro Mon Apr 19 14:01:47 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 = ftuwizardprovider + +CONFIG += ordered