# HG changeset patch # User Pat Downey # Date 1283340044 -3600 # Node ID 7e0eff37aedb75273ed6a82dba5667c1ac10119a # Parent 8ee96d21d9bf0951effc716491ec9c6ff6d3425b Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035 diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/conf.pri --- a/controlpanel/conf/conf.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: This file provides the information required for building -# General Settings. -# -# - -symbian { - BLD_INF_RULES.prj_exports += \ - "$${LITERAL_HASH}include"\ - "conf/s60settingsuis.confml MW_LAYER_CONFML(s60settingsuis.confml)" \ - "conf/s60settingsuis_101F877A.crml MW_LAYER_CRML(s60settingsuis_101f877a.crml)" \ - "conf/s60settingsuis_101F877B.crml MW_LAYER_CRML(s60settingsuis_101f877b.crml)" \ - "conf/s60settingsuis_101F877C.crml MW_LAYER_CRML(s60settingsuis_101f877c.crml)" \ - "conf/s60settingsuis_101F877E.crml MW_LAYER_CRML(s60settingsuis_101f877e.crml)" \ - "conf/s60settingsuis_101F877F.crml MW_LAYER_CRML(s60settingsuis_101f877f.crml)" \ - "conf/s60settingsuis_101F883B.crml MW_LAYER_CRML(s60settingsuis_101f883b.crml)" \ - "conf/s60settingsuis_101F8751.crml MW_LAYER_CRML(s60settingsuis_101f8751.crml)" \ - "conf/s60settingsuis_101F8780.crml MW_LAYER_CRML(s60settingsuis_101f8780.crml)" \ - "conf/s60settingsuis_101F8781.crml MW_LAYER_CRML(s60settingsuis_101f8781.crml)" \ - "conf/s60settingsuis_101F8782.crml MW_LAYER_CRML(s60settingsuis_101f8782.crml)" \ - "conf/s60settingsuis_101F8831.crml MW_LAYER_CRML(s60settingsuis_101f8831.crml)" \ - "conf/s60settingsuis_1000A82B.crml MW_LAYER_CRML(s60settingsuis_1000a82b.crml)" \ - "conf/s60settingsuis_1020720A.crml MW_LAYER_CRML(s60settingsuis_1020720a.crml)" \ - "conf/s60settingsuis_1028239D.crml MW_LAYER_CRML(s60settingsuis_1028239d.crml)" \ - "conf/s60settingsuis_2002120B.crml MW_LAYER_CRML(s60settingsuis_2002120b.crml)" -} - -# End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/s60settingsuis.confml Binary file controlpanel/conf/s60settingsuis.confml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/s60settingsuis_1000A82B.crml Binary file controlpanel/conf/s60settingsuis_1000A82B.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/s60settingsuis_101F8751.crml Binary file controlpanel/conf/s60settingsuis_101F8751.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/s60settingsuis_101F877A.crml Binary file controlpanel/conf/s60settingsuis_101F877A.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/s60settingsuis_101F877B.crml Binary file controlpanel/conf/s60settingsuis_101F877B.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/s60settingsuis_101F877C.crml Binary file controlpanel/conf/s60settingsuis_101F877C.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/s60settingsuis_101F877E.crml Binary file controlpanel/conf/s60settingsuis_101F877E.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/s60settingsuis_101F877F.crml Binary file controlpanel/conf/s60settingsuis_101F877F.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/s60settingsuis_101F8780.crml Binary file controlpanel/conf/s60settingsuis_101F8780.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/s60settingsuis_101F8781.crml Binary file controlpanel/conf/s60settingsuis_101F8781.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/s60settingsuis_101F8782.crml Binary file controlpanel/conf/s60settingsuis_101F8782.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/s60settingsuis_101F8831.crml Binary file controlpanel/conf/s60settingsuis_101F8831.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/s60settingsuis_101F883B.crml Binary file controlpanel/conf/s60settingsuis_101F883B.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/s60settingsuis_1020720A.crml Binary file controlpanel/conf/s60settingsuis_1020720A.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/s60settingsuis_1028239D.crml Binary file controlpanel/conf/s60settingsuis_1028239D.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/conf/s60settingsuis_2002120B.crml Binary file controlpanel/conf/s60settingsuis_2002120B.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel.pro --- a/controlpanel/controlpanel.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = subdirs -SUBDIRS = src -CONFIG += ordered - -include(rom/cp_rom.pri) -include(conf/conf.pri) \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/controlpanel_plat.pri --- a/controlpanel/controlpanel_plat/inc/controlpanel_plat.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -PLATFORM_HEADERS += $$PWD/cpglobal.h \ - $$PWD/cpbasepath.h \ - $$PWD/cpplugininterface.h \ - $$PWD/cpsettingformitemdata.h \ - $$PWD/cppluginlauncher.h \ - $$PWD/cpbasesettingview.h \ - $$PWD/cpitemdatahelper.h \ - $$PWD/cpsettingformentryitemdata.h \ - $$PWD/cpsettingformentryitemdataimpl.h \ - $$PWD/cppluginloader.h \ - $$PWD/cppluginutility.h \ - $$PWD/cplauncherinterface.h - -HEADERS += $$PLATFORM_HEADERS \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/cpbasepath.h --- a/controlpanel/controlpanel_plat/inc/cpbasepath.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Common path definitions for controlpanel -* -*/ - -#ifndef CPBASEPATH_H -#define CPBASEPATH_H - -#include - -/* - CP_PLUGIN_PATH : path to place controlpanel plugin stub files (.qtplugin files) - CP_PLUGIN_CONFIG_PATH: path to place controlpanel plugin configuration files (.cpcfg files) -*/ -#ifdef Q_OS_SYMBIAN - #define CP_PLUGIN_PATH QLatin1String("/resource/qt/plugins/controlpanel") - #define CP_PLUGIN_CONFIG_PATH QLatin1String("/resource/qt/plugins/controlpanel/config") -#else - #ifdef _DEBUG - #define CP_PLUGIN_PATH QLatin1String("/ControlPanel/debug/bin") - #define CP_PLUGIN_CONFIG_PATH QLatin1String("/ControlPanel/debug/bin/config") - #else - #define CP_PLUGIN_PATH QLatin1String("/ControlPanel/release/bin") - #define CP_PLUGIN_CONFIG_PATH QLatin1String("/ControlPanel/release/bin/config") - #endif -#endif - - -#endif //CPBASEPATH_H - -//End of File - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/cpbasesettingview.h --- a/controlpanel/controlpanel_plat/inc/cpbasesettingview.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Base class for controlpane plugin views. -* -*/ -#ifndef CPBASESETTINGVIEW_H -#define CPBASESETTINGVIEW_H - -#include "cpglobal.h" -#include - -class QVariant; -class QModelIndex; -class HbDataForm; -class CpBaseSettingViewPrivate; -class CpItemDataHelper; - -class CP_EXPORT CpBaseSettingView : public HbView -{ - Q_OBJECT -public: - explicit CpBaseSettingView(QGraphicsWidget *widget = 0, QGraphicsItem *parent = 0); - virtual ~CpBaseSettingView(); -signals: - void returnValueDelivered(const QVariant &returnValue); - void aboutToClose(); -protected: - virtual void close(); -private: - Q_DISABLE_COPY(CpBaseSettingView) - Q_DECLARE_PRIVATE_D(d_ptr, CpBaseSettingView) - Q_PRIVATE_SLOT(d_func(), void _q_softkeyClicked()) -private: - CpBaseSettingViewPrivate *d_ptr; - friend class CpBaseSettingViewPrivate; -}; - -#endif /* CPBASESETTINGVIEW_H */ diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/cpglobal.h --- a/controlpanel/controlpanel_plat/inc/cpglobal.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Common definitions for controlpanel -* -*/ - -#ifndef CPGLOBAL_H -#define CPGLOBAL_H - -#include - -#ifdef BUILD_CP_FRAMEWORK - #define CP_EXPORT Q_DECL_EXPORT -#else - #define CP_EXPORT Q_DECL_IMPORT -#endif - -#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/cpitemdatahelper.h --- a/controlpanel/controlpanel_plat/inc/cpitemdatahelper.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Helper class by which a plugin can communicate with the associated dataform. -* -*/ -#ifndef CPITEMDATAHELPER_H -#define CPITEMDATAHELPER_H - -#include -#include - -class QObject; -class HbWidget; -class QModelIndex; -class HbDataForm; -class HbAbstractViewItem; -class HbDataFormModelItem; -class CpItemDataHelperPrivate; - -class CP_EXPORT CpItemDataHelper : public QObject -{ - Q_OBJECT -public: - explicit CpItemDataHelper(HbDataForm *form = 0); - virtual ~CpItemDataHelper(); - - void bindToForm(HbDataForm *form); - - void addItemPrototype(HbAbstractViewItem *prototype); - - void addConnection(HbDataFormModelItem *item, - const char *signal, - QObject *receiver, - const char *method); - - void removeConnection(HbDataFormModelItem *item, - const char *signal, - QObject *receiver, - const char *method); - - void connectToForm(const char *signal, - QObject *receiver, - const char *method); - - void disconnectFromForm(const char *signal, - QObject *receiver, - const char *method); - - HbWidget *widgetFromModelIndex(const QModelIndex &index); - - HbDataFormModelItem *modelItemFromModelIndex(const QModelIndex &index); - -private: - CpItemDataHelperPrivate *d; -}; - -#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/cplauncherinterface.h --- a/controlpanel/controlpanel_plat/inc/cplauncherinterface.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Interface for controlpanel plugins, with this interface client application can launch a view from outside of controlpanel application. -* -*/ - - -#ifndef CPLAUNCHERINTERFACE_H -#define CPLAUNCHERINTERFACE_H - -#include -#include - -/*! - \class CpLauncherInterface - \brief The class CpLauncherInterface defines an interface for plugins, if one controlpanel plugin implements - this interface, client application can launch a setting view from outside of controlpanel application by two ways. - - (1) launch setting view in client process, using CpPluginLauncher. - - \code - CpBaseSettingView *settingView = CpPluginLauncher::launchSettingView("cpmyplugin.dll",QVariant()); - \endcode - - (2) launch setting view in embedded mode, using QtHighway client API. - - \code - if (mRequest) { - delete mRequest; - mRequest = 0; - } - - mRequest = mAppMgr.create("com.nokia.symbian.ICpPluginLauncher", "launchSettingView(QString,QVariant)", true); - - if (!mRequest) - { - return; - } - else - { - connect(mRequest, SIGNAL(requestOk(QVariant)), SLOT(handleReturnValue(QVariant))); - connect(mRequest, SIGNAL(requestError(int,QString)), SLOT(handleError(int,QString))); - } - - // Set arguments for request - QList args; - args << QVariant("cpmyplugin.dll"); - args << QVariant(); - mRequest->setArguments(args); - - mRequest->setSynchronous(false); - // Make the request - if (!mRequest->send()) - { - //report error - } - \endcode - - */ - -class QVariant; -class CpBaseSettingView; - -class CpLauncherInterface -{ -public: - /*! - Destructor of CpLauncherInterface. - */ - virtual ~CpLauncherInterface() - { - } - - /*! - Create a CpBaseSettingView by the parameter hint. - */ - virtual CpBaseSettingView *createSettingView(const QVariant &hint) const = 0; -}; - -Q_DECLARE_INTERFACE(CpLauncherInterface, "com.nokia.controlpanel.launcher.interface/1.0"); - -#endif /* CPLAUNCHERINTERFACE_H */ diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/cplogger.h --- a/controlpanel/controlpanel_plat/inc/cplogger.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Log utility for controlpanel framework. -* -*/ -#ifndef CPLOGGER_H -#define CPLOGGER_H - - -/* - config file path :/logconf/controlpanellog.conf - - Format: - - [CpFramework] - logdatetime = 1 - logloggername = 1 - datetimeformat = hh:mm:ss:zzz - output = debugoutput fileoutput - fileoutput/logfile = C:/data/logs/cpframework.log - fileoutput/truncate = 1 - - [CpPerformance] - logdatetime = 1 - datetimeformat = hh:mm:ss:zzz - output = fileoutput - fileoutput/logfile = C:/data/logs/cpperformance.log - fileoutput/truncate = 1 -*/ - -#include -#include - -/* - define ENABLE_CPFW_LOG to make CPFW_LOG work -*/ - -//#define ENABLE_CPFW_LOG - -/* - define ENABLE_CPPERF_LOG to make CPPERF_LOG work -*/ - -//#define ENABLE_CPPERF_LOG - -#define CPFW_LOGGER_NAME QLatin1String("CpFramework") -#define CPPERF_LOGGER_NAME QLatin1String("CpPerformance") - -#define CP_LOGGER_CONFIG_PATH QLatin1String(":/logconf/controlpanellog.conf") - -#ifdef ENABLE_CPFW_LOG - #define CPFW_LOG(str) Logger::instance(CPFW_LOGGER_NAME)->log(str); - #define CPSP_LOG_FUNC_ENTRY(func) LogFunctionEntryHelper ___cpfw_log_func_entry_helper(CPFW_LOGGER_NAME,func); -#else - #define CPFW_LOG(str) - #define CPSP_LOG_FUNC_ENTRY(func) -#endif - -#ifdef ENABLE_CPPERF_LOG - #define CPPERF_LOG(str) Logger::instance(CPPERF_LOGGER_NAME)->log(str); -#else - #define CPPERF_LOG(str) -#endif - -#endif /* CPLOGGER_H */ diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/cpplugininterface.h --- a/controlpanel/controlpanel_plat/inc/cpplugininterface.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Interface for controlpanel plugins. -* -*/ - -#ifndef CPPLUGININTERFACE_H -#define CPPLUGININTERFACE_H - -#include -#include - -/*! - \class CpPluginInterface - \brief The class CpPluginInterface is an interface for controlpanel plugins. - */ - -class CpSettingFormItemData; -class CpItemDataHelper; - -class CpPluginInterface -{ -public: - /*! - Destructor of CpPluginInterface. - */ - virtual ~CpPluginInterface() - { - } - - /*! - Create a set of data form mode item, by which the control panel framework can build a data form model. - */ - virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const = 0; -}; - -Q_DECLARE_INTERFACE(CpPluginInterface, "com.nokia.controlpanel.plugin.interface/1.0"); - -#endif /* CPPLUGININTERFACE_H */ diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/cppluginlauncher.h --- a/controlpanel/controlpanel_plat/inc/cppluginlauncher.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Launch controlpanel plugin setting view in client process. -* -*/ - -#ifndef CPPLUGINLAUNCHER_H -#define CPPLUGINLAUNCHER_H - -#include "cpglobal.h" -#include - -class QString; -class CpBaseSettingView; - -class CP_EXPORT CpPluginLauncher -{ -public: - static CpBaseSettingView* launchSettingView(const QString &pluginFile,const QVariant &hint = QVariant()); -}; - -#endif /* CPPLUGINLAUNCHER_H */ diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/cppluginloader.h --- a/controlpanel/controlpanel_plat/inc/cppluginloader.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Utility class to load a CpPluginInterface or CpLauncherInterface from a controlpanel plugin file. -* -*/ - -#ifndef CPPLUGINLOADER_H -#define CPPLUGINLOADER_H - -#include -#include - -class QString; -class CpPluginInterface; -class CpLauncherInterface; -class CpPluginPlatInterface; - -class CP_EXPORT CpPluginLoader -{ -public: - static CpPluginInterface *loadCpPluginInterface(const QString &pluginFile); - static CpLauncherInterface *loadCpLauncherInterface(const QString &pluginFile); -}; - -#endif /* CPPLUGINLOADER_H */ diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/cppluginutility.h --- a/controlpanel/controlpanel_plat/inc/cppluginutility.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Utility class for controlpanel plugins. -* -*/ - -#ifndef CPPLUGINUTILITY_H -#define CPPLUGINUTILITY_H - -#include - -class HbDataForm; - -class CP_EXPORT CpPluginUtility -{ -public: - static void addCpItemPrototype(HbDataForm *settingForm); -}; - -#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/cpsettingformentryitemdata.h --- a/controlpanel/controlpanel_plat/inc/cpsettingformentryitemdata.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef CPSETTINGFORMENTRYITEMDATA_H -#define CPSETTINGFORMENTRYITEMDATA_H - -#include -#include -#include -#include - -class CpItemDataHelper; -class CpBaseSettingView; -class HbDataForm; -class QModelIndex; -class CpSettingFormEntryItemDataPrivate; - -class CP_EXPORT CpSettingFormEntryItemData : public CpSettingFormItemData -{ - Q_OBJECT -public: - enum EntryItemType { - ListEntryItem = HbDataFormModelItem::CustomItemBase + 1, - ButtonEntryItem = HbDataFormModelItem::CustomItemBase + 2 - }; - - explicit CpSettingFormEntryItemData(const HbDataFormModelItem *parent = 0); - - explicit CpSettingFormEntryItemData( - CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const HbIcon &icon = HbIcon(), - const HbDataFormModelItem *parent = 0); - - explicit CpSettingFormEntryItemData( - HbDataForm *dataForm, - const QString &text = QString(), - const QString &description = QString(), - const HbIcon &icon = HbIcon(), - const HbDataFormModelItem *parent = 0); - - explicit CpSettingFormEntryItemData( - EntryItemType type, - CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const QString &iconName = QString(), - const HbDataFormModelItem *parent = 0); - - explicit CpSettingFormEntryItemData( - EntryItemType type, - HbDataForm *dataForm, - const QString &text = QString(), - const QString &description = QString(), - const QString &iconName = QString(), - const HbDataFormModelItem *parent = 0); - - virtual ~CpSettingFormEntryItemData(); - - QString text() const; - void setText(const QString &text); - - QString description() const; - void setDescription(const QString &description); - - QString iconName() const; - void setIconName(const QString &icon); - - HbIcon entryItemIcon() const; - void setEntryItemIcon(const HbIcon &icon); - -public slots: - virtual void onLaunchView(); -private: - virtual CpBaseSettingView *createSettingView() const = 0; -private: - Q_DISABLE_COPY(CpSettingFormEntryItemData) - Q_DECLARE_PRIVATE_D(d_ptr, CpSettingFormEntryItemData) - Q_PRIVATE_SLOT(d_func(), void _q_itemPressed(const QModelIndex &index)) - Q_PRIVATE_SLOT(d_func(), void _q_itemActivated(const QModelIndex &index)) -private: - CpSettingFormEntryItemDataPrivate *d_ptr; -}; - -#endif //CPSETTINGFORMENTRYITEMDATA_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/cpsettingformentryitemdataimpl.h --- a/controlpanel/controlpanel_plat/inc/cpsettingformentryitemdataimpl.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef CPSETTINGFORMENTRYITEMDATAIMPL_H -#define CPSETTINGFORMENTRYITEMDATAIMPL_H - -#include "cpsettingformentryitemdata.h" - - -/*! - \class CpSettingFormEntryItemDataImpl - \brief The template class CpSettingFormEntryItemDataImpl provide a defaut implementation of CpSettingFormEntryItemData. - By implementing pure virtual function CpSettingFormEntryItemData::createSettingView. - */ -class CpItemDataHelper; -template -class CpSettingFormEntryItemDataImpl : public CpSettingFormEntryItemData -{ -public: - - /*! - Construct a new CpSettingFormEntryItemDataImpl with the given text,description and parent. - */ - explicit CpSettingFormEntryItemDataImpl(CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const HbIcon &icon = HbIcon(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(itemDataHelper,text,description,icon,parent) - { } - - /*! - Construct a new CpSettingFormEntryItemDataImpl with the given text,description and parent. - */ - explicit CpSettingFormEntryItemDataImpl(HbDataForm *dataForm, - const QString &text = QString(), - const QString &description = QString(), - const HbIcon &icon = HbIcon(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(dataForm,text,description,icon,parent) - - { } - - /*! - Construct a new CpSettingFormEntryItemData with the given type, text, description, icon name, and parent. - */ - explicit CpSettingFormEntryItemDataImpl( - EntryItemType type, - CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const QString &icon = QString(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(type,itemDataHelper,text,description,icon,parent) - { } - - /*! - Construct a new CpSettingFormEntryItemData with the given type, text, description, icon name, and parent. - */ - explicit CpSettingFormEntryItemDataImpl( - EntryItemType type, - HbDataForm *dataForm, - const QString &text = QString(), - const QString &description = QString(), - const QString &icon = QString(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(type,dataForm,text,description,icon,parent) - { } - - /*! - Destructor. - */ - virtual ~CpSettingFormEntryItemDataImpl() - { } - - /*! - Implement CpSettingFormEntryItemData::createSettingView - */ - virtual CpBaseSettingView *createSettingView() const - { return new PLUGIN_VIEW(); } -}; - -#endif // CP_SETTINGFORM_ENTRY_ITEM_DATA_IMPL_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/cpsettingformitemdata.h --- a/controlpanel/controlpanel_plat/inc/cpsettingformitemdata.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* This class is a control panel defined HbDataFormModelItem -* -* -*/ -#ifndef CPSETTINGFORMITEMDATA_H -#define CPSETTINGFORMITEMDATA_H - -#include -#include -#include -#include - -class QString; -class CpItemDataHelper; -class CpSettingFormItemDataPrivate; - -class CP_EXPORT CpSettingFormItemData : public QObject, public HbDataFormModelItem -{ - Q_OBJECT -public: - CpSettingFormItemData(HbDataFormModelItem::DataItemType type, - const QString &label, - const HbDataFormModelItem *parent = 0); - CpSettingFormItemData(const HbDataFormModelItem *parent = 0); - virtual ~CpSettingFormItemData(); -private: - CpSettingFormItemDataPrivate *d_ptr; //reservered -}; - - -#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/logger.h --- a/controlpanel/controlpanel_plat/inc/logger.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This class provide log functionality. -* -*/ - -#ifndef LOGGER_H -#define LOGGER_H - -#include -#include -#include - -class LogOutput; -class QSettings; -class LoggerPrivate; - -/* - -configuration format: - - [myapplog] - logDateTime = 1 - logLoggerName = 1 - datetimeformat = hh:mm:ss - output = debugoutput consoleoutput fileoutput - fileoutput/logfile = C:/data/log/myapp.log - fileoutput/truncate = 1 - -code examples: - - QSettings settings("myapp.ini",QSettings::IniFormat); - Logger::instance("myapplog")->configure(settings); - Logger::instance("myapplog")->log("Hello world!"); - -*/ - -class LOGGER_EXPORT Logger : public QObject -{ - Q_OBJECT - Q_PROPERTY(bool logDateTime READ logDateTime WRITE setLogDateTime) - Q_PROPERTY(bool logLoggerName READ logLoggerName WRITE setLogLoggerName) - Q_PROPERTY(QString dateTimeFormat READ dateTimeFormat WRITE setDateTimeFormat) -public: - static Logger *instance(const QString &name); - static void close(const QString &name); - static void closeAll(); -public: - virtual ~Logger(); - - void log(const QString &log); - - void configure(const QString &configFile,QSettings::Format format = QSettings::NativeFormat); - - void configure(QSettings &settings); - - bool addLogOutput(LogOutput *output); - - void removeLogOutput(LogOutput *output); - - LogOutput *logOutput(const QString &name); - - void clearAllLogOutput(); - - QString name() const; - - bool logDateTime() const; - void setLogDateTime(bool on); - - bool logLoggerName() const; - void setLogLoggerName(bool on); - - QString dateTimeFormat() const; - void setDateTimeFormat(const QString &format); -private: - explicit Logger(const QString &name = QString(),QObject *parent = 0); - LoggerPrivate *d_ptr; -}; - -class InitLoggerHelper -{ -public: - InitLoggerHelper(const QString &loggerName,const QString &configPath) - : mLoggerName(loggerName) - { - Logger::instance(loggerName)->configure(configPath,QSettings::IniFormat); - } - ~InitLoggerHelper() { - Logger::close(mLoggerName); - } -private: - QString mLoggerName; -}; - -class LogFunctionEntryHelper -{ -public: - LogFunctionEntryHelper(const QString &loggerName,const QString &func) - : mLoggerName(loggerName), mFunc(func) - { - Logger::instance(mLoggerName)->log(QLatin1String(">>>> ") + mFunc); - } - ~LogFunctionEntryHelper() - { - Logger::instance(mLoggerName)->log(QLatin1String("<<<< ") + mFunc); - } -private: - QString mLoggerName; - QString mFunc; -}; - -#define INIT_LOGGER(loggerName,configPath) \ - InitLoggerHelper __init##loggerName(loggerName,configPath); - -#endif //LOGGER_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/logger_plat.pri --- a/controlpanel/controlpanel_plat/inc/logger_plat.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -# -# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -PLATFORM_HEADERS += $$PWD/logger.h \ - $$PWD/loggerglobal.h \ - $$PWD/logoutput.h \ - $$PWD/logoutputfactory.h \ - $$PWD/cplogger.h - -HEADERS += $$PLATFORM_HEADERS diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/loggerglobal.h --- a/controlpanel/controlpanel_plat/inc/loggerglobal.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Common definitions for log. -* -*/ -#ifndef LOGGERGLOBAL_H -#define LOGGERGLOBAL_H - -#include - -#ifdef BUILD_LOGGER_DLL - #define LOGGER_EXPORT Q_DECL_EXPORT -#else - #define LOGGER_EXPORT Q_DECL_IMPORT -#endif - -#define LINE_SEPERATOR QLatin1String("\r\n"); - -#define SETTINGS_SECTION_SEPERATOR QLatin1String("/") - -//following strings can be used in configuration file to specify logger's properties -//refer to logger.h -#define LOGGER_LOGDATETIME QLatin1String("logdatetime") -#define LOGGER_LOGLOGGERNAME QLatin1String("logloggername") -#define LOGGER_DATETIMEFORMAT QLatin1String("datetimeformat") -#define LOGGER_OUTPUT QLatin1String("output") - -#define DEBUGOUTPUT_NAME QLatin1String("debugoutput") -#define CONSOLEOUTPUT_NAME QLatin1String("consoleoutput") -#define FILEOUTPUT_NAME QLatin1String("fileoutput") - #define FILEOUTPUT_LOGFILE QLatin1String("logfile") - #define FILEOUTPUT_TRUNCATE QLatin1String("truncate") - -#endif //LOGGERGLOBAL_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/logoutput.h --- a/controlpanel/controlpanel_plat/inc/logoutput.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: An interface to output log string. -* -*/ -#ifndef LOGOUTPUT_H -#define LOGOUTPUT_H - -#include -#include - -class QString; -class QSettings; -class Logger; - -class LogOutputPrivate; -class LOGGER_EXPORT LogOutput : public QObject -{ - Q_OBJECT - Q_PROPERTY(QString name READ name WRITE setName) -public: - virtual ~LogOutput(); - virtual void output(const QString &log) = 0; - virtual bool init() = 0; - bool load(QSettings &settings); - - Logger *parentLogger(); - void setParentLogger(Logger *parentLogger); - - QString name() const; - void setName(const QString &name); -private: - virtual bool doLoad(QSettings &settings) = 0; -protected: - LogOutput(Logger *parentLogger = 0); -private: - LogOutputPrivate *d_ptr; -}; - -#endif //LOGOUTPUT_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/controlpanel_plat/inc/logoutputfactory.h --- a/controlpanel/controlpanel_plat/inc/logoutputfactory.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Factory class to create LogOutput. -* -*/ -#ifndef LOGOUTPUTFACTORY_H -#define LOGOUTPUTFACTORY_H - -class LogOutput; -class QVariant; -class QString; - -#include -#include - -class LOGGER_EXPORT LogOutputFactory -{ -public: - typedef LogOutput* (*CREATE_ENTRY)(); - static LogOutput *createLogOutput(const QString &name); - static LogOutput *createLogOutput(const QString &name,const QHash &properties); - static void addCreateLogOutputEntry(const QString &name,CREATE_ENTRY entry); -}; - -class LogOutputCreateEntryRegister -{ -public: - LogOutputCreateEntryRegister(const QString &name,LogOutputFactory::CREATE_ENTRY entry) { - LogOutputFactory::addCreateLogOutputEntry(name,entry); - } -}; - -#define REGISTER_OUTPUT_LOG(name,Class) \ - static LogOutput *create##Class() { \ - LogOutput *output = new Class(); \ - output->setName(name); \ - return output; \ - } \ - LogOutputCreateEntryRegister the##Class##EntryRegister(name,create##Class); - -#endif //LOGOUTPUTFACTORY_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/example_common.pri --- a/controlpanel/examples/example_common.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: controlpanel project - common qmake settings -# - -CONFIG += debug_and_release - -# On win32 and mac, debug and release libraries are named differently. -# We must follow the debug and release settings Qt was compiled with: -# build debug iff Qt built debug, build release iff Qt built release. - -win32|mac { - !contains(QT_CONFIG,debug)|!contains(QT_CONFIG,release) { - CONFIG -= debug_and_release debug release - contains(QT_CONFIG,debug): CONFIG+=debug - contains(QT_CONFIG,release):CONFIG+=release - } -} - -CONFIG(debug, debug|release) { - SUBDIRPART = debug -} else { - SUBDIRPART = release -} - -win32 { - DESTDIR = C:/ControlPanel/$$SUBDIRPART/bin - OBJECTS_DIR = $$PWD/../$$SUBDIRPART/tmp/$$TARGET -} - -# Add the output dirs to the link path too -LIBS += -L$$DESTDIR - -MOC_DIR = moc -OBJECT_DIR = obj -RCC_DIR = rcc - -#For some reason the default include path doesn't include MOC_DIR on symbian -symbian { - INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE - INCLUDEPATH += $$MOC_DIR - TARGET.CAPABILITY = ALL -TCB - TARGET.EPOCALLOWDLLDATA = 1 -} - -win32 { - # add platfrom API for windows - INCLUDEPATH += $$PWD/../controlpanel_plat/inc -} - -CONFIG += hb plugin -LIBS += -lcpframework - -symbian: plugin { # copy qtstub and manifest - - PLUGIN_STUB_PATH = /resource/qt/plugins/controlpanel - - deploy.path = C: - pluginstub.sources = $${TARGET}.dll - pluginstub.path = $$PLUGIN_STUB_PATH - DEPLOYMENT += pluginstub - - qtplugins.path = $$PLUGIN_STUB_PATH - qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin - - for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" -} - - - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/examples.pro --- a/controlpanel/examples/examples.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = subdirs -SUBDIRS = groupplugin/groupplugin.pro viewplugin/viewplugin.pro themeplugin/themeplugin.pro -CONFIG += ordered - -include (rom/rom.pri) \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/groupplugin/groupplugin.pri --- a/controlpanel/examples/groupplugin/groupplugin.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: controlpanel project - common qmake settings -# - -HEADERS += src/cpsamplegroup.h \ - src/cpgroupplugin.h -SOURCES += src/cpsamplegroup.cpp \ - src/cpgroupplugin.cpp \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/groupplugin/groupplugin.pro --- a/controlpanel/examples/groupplugin/groupplugin.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = lib -TARGET = cpgroupplugin - -include (../example_common.pri) -include (groupplugin.pri) - -# Input -symbian: { - TARGET.UID3 = 0x20025FE3 -} - - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/groupplugin/src/cpgroupplugin.cpp --- a/controlpanel/examples/groupplugin/src/cpgroupplugin.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ -#include "cpgroupplugin.h" -#include "cpsamplegroup.h" - -CpGroupPlugin::CpGroupPlugin() -{ -} - -CpGroupPlugin::~CpGroupPlugin() -{ -} - -QList CpGroupPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const -{ - return QList() << new CpSampleGroup(itemDataHelper); -} - -Q_EXPORT_PLUGIN2(CpGroupPlugin, CpGroupPlugin); diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/groupplugin/src/cpgroupplugin.h --- a/controlpanel/examples/groupplugin/src/cpgroupplugin.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ -#ifndef CPGROUPPLUGIN_H -#define CPGROUPPLUGIN_H - -#include -#include - -class CpGroupPlugin : public QObject, public CpPluginInterface -{ - Q_OBJECT - Q_INTERFACES(CpPluginInterface) -public: - CpGroupPlugin(); - virtual ~CpGroupPlugin(); - virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; -}; -#endif // CPGROUPPLUGIN_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/groupplugin/src/cpsamplegroup.cpp --- a/controlpanel/examples/groupplugin/src/cpsamplegroup.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ -#include "cpsamplegroup.h" -#include -#include -#include - -CpSampleGroup::CpSampleGroup(CpItemDataHelper &itemDataHelper) : - CpSettingFormItemData(HbDataFormModelItem::GroupItem,QString("Sample Group")), - mSliderItem(0), - mCheckBoxItem(0) -{ - mSliderItem = new CpSettingFormItemData(HbDataFormModelItem::SliderItem, - QString("Sample Slider")); - itemDataHelper.addConnection(mSliderItem,SIGNAL(valueChanged(int)),this,SLOT(sliderValueChanged(int))); - this->appendChild(mSliderItem); - - mCheckBoxItem = new CpSettingFormItemData(HbDataFormModelItem::CheckBoxItem, - QString("Sample Check Box")); - itemDataHelper.addConnection(mCheckBoxItem,SIGNAL(stateChanged (int)),this,SLOT(checkBoxStateChanged(int))); - this->appendChild(mCheckBoxItem); - -} -CpSampleGroup::~CpSampleGroup() -{ - //TODO: release resource when necessary -} -void CpSampleGroup::sliderValueChanged(int value) -{ - //TODO: store your changes - HbMessageBox::launchInformationMessageBox(QString("slider value changed to:%1").arg(value)); -} -void CpSampleGroup::checkBoxStateChanged(int state) -{ - //TODO: store your changes - QString str = (state ? "checked" : "un-checked"); - HbMessageBox::launchInformationMessageBox(str); -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/groupplugin/src/cpsamplegroup.h --- a/controlpanel/examples/groupplugin/src/cpsamplegroup.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ -#ifndef CPSAMPLEGROUP_H -#define CPSAMPLEGROUP_H - -#include - -class CpSettingFormItemData; -class CpItemDataHelper; - -class CpSampleGroup : public CpSettingFormItemData -{ - Q_OBJECT -public: - explicit CpSampleGroup(CpItemDataHelper &itemDataHelper); - ~CpSampleGroup(); - -private slots: - //need handling your member's value change - void sliderValueChanged(int value); - void checkBoxStateChanged(int state); - -private: - CpSettingFormItemData *mSliderItem; - CpSettingFormItemData *mCheckBoxItem; -}; - -#endif // CPSAMPLEGROUP_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/rom/controlpanel_examples.iby --- a/controlpanel/examples/rom/controlpanel_examples.iby Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ - -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -file=ABI_DIR\BUILD_DIR\cpgroupplugin.dll SHARED_LIB_DIR\cpgroupplugin.dll -file=ABI_DIR\BUILD_DIR\cpviewplugin.dll SHARED_LIB_DIR\cpviewplugin.dll - -data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpgroupplugin.qtplugin resource\qt\plugins\controlpanel\cpgroupplugin.qtplugin -data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpviewplugin.qtplugin resource\qt\plugins\controlpanel\cpviewplugin.qtplugin diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/rom/rom.pri --- a/controlpanel/examples/rom/rom.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -symbian: { - BLD_INF_RULES.prj_exports += \ - "$${LITERAL_HASH}include" \ - "rom/controlpanel_examples.iby CORE_MW_LAYER_IBY_EXPORT_PATH(controlpanel_examples.iby)" -} \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/themeplugin/src/cpthemeplugin.cpp --- a/controlpanel/examples/themeplugin/src/cpthemeplugin.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ -#include "cpthemeplugin.h" -#include "cpthemepluginentryitemdata.h" - -CpThemePlugin::CpThemePlugin() -{ -} - -CpThemePlugin::~CpThemePlugin() -{ -} - -QList CpThemePlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const -{ - CpSettingFormEntryItemData *entryItem = new CpThemePluginEntryItemData( - itemDataHelper,tr("Theme"),tr("Name of the Theme"),HbIcon(":/image/qgn_menu_note.svg")); - return QList() << entryItem; -} - -Q_EXPORT_PLUGIN2(cpthemeplugin, CpThemePlugin); diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/themeplugin/src/cpthemeplugin.h --- a/controlpanel/examples/themeplugin/src/cpthemeplugin.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ - -#ifndef CPTHEMEPLUGIN_H -#define CPTHEMEPLUGIN_H - -#include -#include - -class CpThemePlugin : public QObject, public CpPluginInterface -{ - Q_OBJECT - Q_INTERFACES(CpPluginInterface) -public: - CpThemePlugin(); - virtual ~CpThemePlugin(); - virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; -}; - -#endif //CPTHEMEPLUGIN_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/themeplugin/src/cpthemepluginentryitemdata.cpp --- a/controlpanel/examples/themeplugin/src/cpthemepluginentryitemdata.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ - -#include "cpthemepluginentryitemdata.h" -#include -#include -#include -#include - -CpThemePluginEntryItemData::CpThemePluginEntryItemData(CpItemDataHelper &itemDataHelper, - const QString &text /*= QString()*/, - const QString &description /*= QString()*/, - const HbIcon &icon /*= HbIcon()*/, - const HbDataFormModelItem *parent /*= 0*/) - : CpSettingFormEntryItemData(itemDataHelper, - text, - description, - icon, - parent) -{ -} - -CpThemePluginEntryItemData::~CpThemePluginEntryItemData() -{ -} - -void CpThemePluginEntryItemData::onLaunchView() -{ - HbFileDialog *dlg = new HbFileDialog(); - dlg->setDirectory(QString("C:/ControlPanel/resource")); - dlg->setTitle("Select file:"); - dlg->setPrimaryActionText(QString("Done")); - dlg->setSecondaryActionText(QString("Close")); - QString filePath = dlg->getFileName(); - if (!filePath.isEmpty()) { - setDescription(QFileInfo(filePath).baseName()); - setEntryItemIcon(HbIcon(filePath)); - } - delete dlg; -} - -CpBaseSettingView *CpThemePluginEntryItemData::createSettingView() const -{ - return 0; -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/themeplugin/src/cpthemepluginentryitemdata.h --- a/controlpanel/examples/themeplugin/src/cpthemepluginentryitemdata.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ - -#ifndef CPTHEMEPLUGINENTRYITEMDATA_H -#define CPTHEMEPLUGINENTRYITEMDATA_H - -#include - -class CpThemePluginEntryItemData : public CpSettingFormEntryItemData -{ - Q_OBJECT -public: - explicit CpThemePluginEntryItemData(CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const HbIcon &icon = HbIcon(), - const HbDataFormModelItem *parent = 0); - virtual ~CpThemePluginEntryItemData(); -private slots: - void onLaunchView(); -private: - virtual CpBaseSettingView *createSettingView() const; -}; - -#endif //CPTHEMEPLUGINENTRYITEMDATA_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/themeplugin/themeplugin.pri --- a/controlpanel/examples/themeplugin/themeplugin.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: cpthemeplugin source files -# - -# Input -HEADERS += src/*.h -SOURCES += src/*.cpp \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/themeplugin/themeplugin.pro --- a/controlpanel/examples/themeplugin/themeplugin.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = lib -TARGET = cpthemeplugin - -CONFIG += hb plugin - -LIBS += -lcpframework - -include ( ../example_common.pri ) -include ( themeplugin.pri ) - -symbian { - TARGET.UID3 = 0X20025FDB -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/viewplugin/src/cpsampleview.cpp --- a/controlpanel/examples/viewplugin/src/cpsampleview.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ -#include "cpsampleview.h" -#include -#include -#include -#include -#include -#include - -CpSampleView::CpSampleView(QGraphicsItem *parent) : - CpBaseSettingView(0,parent), - mGroupItem(0), - mSliderItem(0), - mCheckBoxItem(0) - -{ - HbDataForm *form = settingForm(); - if (form) { - HbDataFormModel *model = new HbDataFormModel; - - form->setHeading(tr("View from sample plugin")); - mGroupItem = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, QString("Group")); - - model->appendDataFormItem(mGroupItem); - - mSliderItem = new CpSettingFormItemData(HbDataFormModelItem::SliderItem, - QString("Sample Slider")); - form->addConnection(mSliderItem,SIGNAL(valueChanged(int)),this,SLOT(sliderValueChanged(int))); - mGroupItem->appendChild(mSliderItem); - - mCheckBoxItem = new CpSettingFormItemData(HbDataFormModelItem::CheckBoxItem, - QString("Sample Check Box")); - form->addConnection(mCheckBoxItem,SIGNAL(stateChanged (int)),this,SLOT(checkBoxStateChanged(int))); - mGroupItem->appendChild(mCheckBoxItem); - - form->setModel(model); - } - - -} -CpSampleView::~CpSampleView() -{ -} - -void CpSampleView::sliderValueChanged(int value) -{ - //TODO: store your changes - HbMessageBox::launchInformationMessageBox(QString("slider value changed to:%1").arg(value)); -} -void CpSampleView::checkBoxStateChanged(int state) -{ - //TODO: store your changes - QString str = (state ? "checked" : "un-checked"); - HbMessageBox::launchInformationMessageBox(str); -} - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/viewplugin/src/cpsampleview.h --- a/controlpanel/examples/viewplugin/src/cpsampleview.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ -#ifndef CPSAMPLEVIEW_H -#define CPSAMPLEVIEW_H - -#include - -class HbDataFormModelItem; -class CpSettingFormItemData; - -class CpSampleView : public CpBaseSettingView -{ - Q_OBJECT -public: - explicit CpSampleView(QGraphicsItem *parent = 0); - virtual ~CpSampleView(); -private slots: - //need handling your member's value change - void sliderValueChanged(int value); - void checkBoxStateChanged(int state); -private: - HbDataFormModelItem *mGroupItem; - CpSettingFormItemData *mSliderItem; - CpSettingFormItemData *mCheckBoxItem; -}; -#endif// CPSAMPLEVIEW_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/viewplugin/src/cpviewplugin.cpp --- a/controlpanel/examples/viewplugin/src/cpviewplugin.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ -#include "cpviewplugin.h" -#include "cpsampleview.h" -#include - -CpViewPlugin::CpViewPlugin() -{ -} - -CpViewPlugin::~CpViewPlugin() -{ -} -QList CpViewPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const -{ - return QList() - << new CpSettingFormEntryItemDataImpl( - itemDataHelper, - tr("Entry item from sample view plugin"), - tr("view plugin descriptions")); -} - -Q_EXPORT_PLUGIN2(cpviewplugin, CpViewPlugin); diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/viewplugin/src/cpviewplugin.h --- a/controlpanel/examples/viewplugin/src/cpviewplugin.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ -#ifndef CPVIEWPLUGIN_H -#define CPVIEWPLUGIN_H - -#include -#include - -class CpViewPlugin : public QObject, public CpPluginInterface -{ - Q_OBJECT - Q_INTERFACES(CpPluginInterface) -public: - CpViewPlugin(); - virtual ~CpViewPlugin(); - virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; -}; - -#endif //CPVIEWPLUGIN_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/viewplugin/viewplugin.pri --- a/controlpanel/examples/viewplugin/viewplugin.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -# Input -HEADERS += src/cpviewplugin.h \ - src/cpsampleview.h - -SOURCES += src/cpviewplugin.cpp \ - src/cpsampleview.cpp - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/examples/viewplugin/viewplugin.pro --- a/controlpanel/examples/viewplugin/viewplugin.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = lib -TARGET = cpviewplugin - -include (../example_common.pri) -include (viewplugin.pri) - -symbian: { - TARGET.UID3 = 0x20025FE2 -} - - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/rom/controlpanel.iby --- a/controlpanel/rom/controlpanel.iby Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef __CONTROLPANEL_IBY__ -#define __CONTROLPANEL_IBY__ - -#include -#include - -#define CP_UPGRADABLE_APP_REG_RSC(NAME) data=DATAZ_\PRIVATE\10003A3F\IMPORT\APPS\ ## NAME ## _reg.rsc Private\10003a3f\import\apps\ ## NAME ## _reg.rsc - -file=ABI_DIR\BUILD_DIR\cpframework.dll SHARED_LIB_DIR\cpframework.dll -file=ABI_DIR\BUILD_DIR\cplogger.dll SHARED_LIB_DIR\cplogger.dll - -#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/rom/cp_rom.pri --- a/controlpanel/rom/cp_rom.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -symbian { - BLD_INF_RULES.prj_exports += \ - "$${LITERAL_HASH}include" \ - "rom/controlpanel.iby CORE_MW_LAYER_IBY_EXPORT_PATH(controlpanel.iby)" -} \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/common.pri --- a/controlpanel/src/common.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: controlpanel project - common qmake settings -# - -CONFIG += debug_and_release - -# On win32 and mac, debug and release libraries are named differently. -# We must follow the debug and release settings Qt was compiled with: -# build debug iff Qt built debug, build release iff Qt built release. - -win32|mac { - !contains(QT_CONFIG,debug)|!contains(QT_CONFIG,release) { - CONFIG -= debug_and_release debug release - contains(QT_CONFIG,debug): CONFIG+=debug - contains(QT_CONFIG,release):CONFIG+=release - } -} - -CONFIG(debug, debug|release) { - SUBDIRPART = debug -} else { - SUBDIRPART = release -} - -win32 { - DESTDIR = C:/ControlPanel/$$SUBDIRPART/bin - OBJECTS_DIR = $$PWD/../$$SUBDIRPART/tmp/$$TARGET -} - -# Add the output dirs to the link path too -LIBS += -L$$DESTDIR - -MOC_DIR = moc -OBJECT_DIR = obj -RCC_DIR = rcc - -#For some reason the default include path doesn't include MOC_DIR on symbian -symbian { - INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE - INCLUDEPATH += $$MW_LAYER_PLATFORM_EXPORT_PATH(cplogger) - INCLUDEPATH += $$MOC_DIR - TARGET.CAPABILITY = ALL -TCB - TARGET.EPOCALLOWDLLDATA = 1 -} -win32 { - # add platfrom API for windows - INCLUDEPATH += $$PWD/../controlpanel_plat/inc -} - - - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/bwins/cpframeworku.def --- a/controlpanel/src/cpframework/bwins/cpframeworku.def Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -EXPORTS - ?addLogOutput@Logger@@QAE_NPAVLogOutput@@@Z @ 1 NONAME ABSENT ; bool Logger::addLogOutput(class LogOutput *) - ??0CpItemDataHelper@@QAE@PAVHbDataForm@@@Z @ 2 NONAME ; CpItemDataHelper::CpItemDataHelper(class HbDataForm *) - ?trUtf8@LogOutput@@SA?AVQString@@PBD0@Z @ 3 NONAME ABSENT ; class QString LogOutput::trUtf8(char const *, char const *) - ??1CpItemDataHelper@@UAE@XZ @ 4 NONAME ; CpItemDataHelper::~CpItemDataHelper(void) - ??_ECpSettingFormEntryItemData@@UAE@I@Z @ 5 NONAME ; CpSettingFormEntryItemData::~CpSettingFormEntryItemData(unsigned int) - ?staticMetaObject@CpItemDataHelper@@2UQMetaObject@@B @ 6 NONAME ; struct QMetaObject const CpItemDataHelper::staticMetaObject - ?metaObject@CpBaseSettingView@@UBEPBUQMetaObject@@XZ @ 7 NONAME ; struct QMetaObject const * CpBaseSettingView::metaObject(void) const - ?text@CpSettingFormEntryItemData@@QBE?AVQString@@XZ @ 8 NONAME ; class QString CpSettingFormEntryItemData::text(void) const - ?qt_metacast@CpSettingFormItemData@@UAEPAXPBD@Z @ 9 NONAME ; void * CpSettingFormItemData::qt_metacast(char const *) - ??1LogOutput@@UAE@XZ @ 10 NONAME ABSENT ; LogOutput::~LogOutput(void) - ?qt_metacall@Logger@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 11 NONAME ABSENT ; int Logger::qt_metacall(enum QMetaObject::Call, int, void * *) - ?loadCpLauncherInterface@CpPluginLoader@@SAPAVCpLauncherInterface@@ABVQString@@@Z @ 12 NONAME ; class CpLauncherInterface * CpPluginLoader::loadCpLauncherInterface(class QString const &) - ?loadCpPluginInterface@CpPluginLoader@@SAPAVCpPluginInterface@@ABVQString@@@Z @ 13 NONAME ; class CpPluginInterface * CpPluginLoader::loadCpPluginInterface(class QString const &) - ?staticMetaObject@Logger@@2UQMetaObject@@B @ 14 NONAME ABSENT ; struct QMetaObject const Logger::staticMetaObject - ?loadPlatCpPlugin@CpPluginLoader@@SAPAVCpPluginPlatInterface@@ABVQString@@@Z @ 15 NONAME ABSENT ; class CpPluginPlatInterface * CpPluginLoader::loadPlatCpPlugin(class QString const &) - ?logOutput@Logger@@QAEPAVLogOutput@@ABVQString@@@Z @ 16 NONAME ABSENT ; class LogOutput * Logger::logOutput(class QString const &) - ??_ELogOutput@@UAE@I@Z @ 17 NONAME ABSENT ; LogOutput::~LogOutput(unsigned int) - ?addCpItemPrototype@CpPluginUtility@@SAXPAVHbDataForm@@@Z @ 18 NONAME ; void CpPluginUtility::addCpItemPrototype(class HbDataForm *) - ?qt_metacast@LogOutput@@UAEPAXPBD@Z @ 19 NONAME ABSENT ; void * LogOutput::qt_metacast(char const *) - ?qt_metacast@CpBaseSettingView@@UAEPAXPBD@Z @ 20 NONAME ; void * CpBaseSettingView::qt_metacast(char const *) - ?getStaticMetaObject@CpBaseSettingView@@SAABUQMetaObject@@XZ @ 21 NONAME ; struct QMetaObject const & CpBaseSettingView::getStaticMetaObject(void) - ??1CpSettingFormItemData@@UAE@XZ @ 22 NONAME ; CpSettingFormItemData::~CpSettingFormItemData(void) - ??0CpSettingFormEntryItemData@@QAE@W4EntryItemType@0@PAVHbDataForm@@ABVQString@@22PBVHbDataFormModelItem@@@Z @ 23 NONAME ; CpSettingFormEntryItemData::CpSettingFormEntryItemData(enum CpSettingFormEntryItemData::EntryItemType, class HbDataForm *, class QString const &, class QString const &, class QString const &, class HbDataFormModelItem const *) - ?d_func@CpSettingFormEntryItemData@@ABEPBVCpSettingFormEntryItemDataPrivate@@XZ @ 24 NONAME ; class CpSettingFormEntryItemDataPrivate const * CpSettingFormEntryItemData::d_func(void) const - ?d_func@CpBaseSettingView@@ABEPBVCpBaseSettingViewPrivate@@XZ @ 25 NONAME ; class CpBaseSettingViewPrivate const * CpBaseSettingView::d_func(void) const - ?launchCpPluginView@CpPluginLauncher@@SA_NABVQString@@H@Z @ 26 NONAME ABSENT ; bool CpPluginLauncher::launchCpPluginView(class QString const &, int) - ?aboutToClose@CpBaseSettingView@@IAEXXZ @ 27 NONAME ; void CpBaseSettingView::aboutToClose(void) - ?close@CpBaseSettingView@@MAEXXZ @ 28 NONAME ; void CpBaseSettingView::close(void) - ?modelItemFromModelIndex@CpItemDataHelper@@QAEPAVHbDataFormModelItem@@ABVQModelIndex@@@Z @ 29 NONAME ; class HbDataFormModelItem * CpItemDataHelper::modelItemFromModelIndex(class QModelIndex const &) - ?instance@Logger@@SAPAV1@ABVQString@@@Z @ 30 NONAME ABSENT ; class Logger * Logger::instance(class QString const &) - ?trUtf8@CpSettingFormEntryItemData@@SA?AVQString@@PBD0H@Z @ 31 NONAME ; class QString CpSettingFormEntryItemData::trUtf8(char const *, char const *, int) - ?removeConnection@CpItemDataHelper@@QAEXPAVHbDataFormModelItem@@PBDPAVQObject@@1@Z @ 32 NONAME ; void CpItemDataHelper::removeConnection(class HbDataFormModelItem *, char const *, class QObject *, char const *) - ?returnValueDelivered@CpBaseSettingView@@IAEXABVQVariant@@@Z @ 33 NONAME ; void CpBaseSettingView::returnValueDelivered(class QVariant const &) - ?setDateTimeFormat@Logger@@QAEXABVQString@@@Z @ 34 NONAME ABSENT ; void Logger::setDateTimeFormat(class QString const &) - ?settingForm@CpBaseSettingView@@QBEPAVHbDataForm@@XZ @ 35 NONAME ABSENT ; class HbDataForm * CpBaseSettingView::settingForm(void) const - ??1Logger@@UAE@XZ @ 36 NONAME ABSENT ; Logger::~Logger(void) - ?description@CpSettingFormEntryItemData@@QBE?AVQString@@XZ @ 37 NONAME ; class QString CpSettingFormEntryItemData::description(void) const - ?log@Logger@@QAEXABVQString@@@Z @ 38 NONAME ABSENT ; void Logger::log(class QString const &) - ??_ELogger@@UAE@I@Z @ 39 NONAME ABSENT ; Logger::~Logger(unsigned int) - ?tr@CpItemDataHelper@@SA?AVQString@@PBD0H@Z @ 40 NONAME ; class QString CpItemDataHelper::tr(char const *, char const *, int) - ?setName@LogOutput@@QAEXABVQString@@@Z @ 41 NONAME ABSENT ; void LogOutput::setName(class QString const &) - ?qt_metacall@CpBaseSettingView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 42 NONAME ; int CpBaseSettingView::qt_metacall(enum QMetaObject::Call, int, void * *) - ?trUtf8@CpBaseSettingView@@SA?AVQString@@PBD0H@Z @ 43 NONAME ; class QString CpBaseSettingView::trUtf8(char const *, char const *, int) - ?getStaticMetaObject@CpSettingFormEntryItemData@@SAABUQMetaObject@@XZ @ 44 NONAME ; struct QMetaObject const & CpSettingFormEntryItemData::getStaticMetaObject(void) - ?name@Logger@@QBE?AVQString@@XZ @ 45 NONAME ABSENT ; class QString Logger::name(void) const - ?load@LogOutput@@QAE_NAAVQSettings@@@Z @ 46 NONAME ABSENT ; bool LogOutput::load(class QSettings &) - ??0CpSettingFormEntryItemData@@QAE@AAVCpItemDataHelper@@ABVQString@@1ABVHbIcon@@PBVHbDataFormModelItem@@@Z @ 47 NONAME ; CpSettingFormEntryItemData::CpSettingFormEntryItemData(class CpItemDataHelper &, class QString const &, class QString const &, class HbIcon const &, class HbDataFormModelItem const *) - ?setText@CpSettingFormEntryItemData@@QAEXABVQString@@@Z @ 48 NONAME ; void CpSettingFormEntryItemData::setText(class QString const &) - ?close@Logger@@SAXABVQString@@@Z @ 49 NONAME ABSENT ; void Logger::close(class QString const &) - ?disconnectFromForm@CpItemDataHelper@@QAEXPBDPAVQObject@@0@Z @ 50 NONAME ; void CpItemDataHelper::disconnectFromForm(char const *, class QObject *, char const *) - ?metaObject@CpItemDataHelper@@UBEPBUQMetaObject@@XZ @ 51 NONAME ; struct QMetaObject const * CpItemDataHelper::metaObject(void) const - ??_ECpItemDataHelper@@UAE@I@Z @ 52 NONAME ; CpItemDataHelper::~CpItemDataHelper(unsigned int) - ??1CpSettingFormEntryItemData@@UAE@XZ @ 53 NONAME ; CpSettingFormEntryItemData::~CpSettingFormEntryItemData(void) - ?iconName@CpSettingFormEntryItemData@@QBE?AVQString@@XZ @ 54 NONAME ; class QString CpSettingFormEntryItemData::iconName(void) const - ?staticMetaObject@CpSettingFormItemData@@2UQMetaObject@@B @ 55 NONAME ; struct QMetaObject const CpSettingFormItemData::staticMetaObject - ?createLogOutput@LogOutputFactory@@SAPAVLogOutput@@ABVQString@@@Z @ 56 NONAME ABSENT ; class LogOutput * LogOutputFactory::createLogOutput(class QString const &) - ?setEntryItemIcon@CpSettingFormEntryItemData@@QAEXABVHbIcon@@@Z @ 57 NONAME ; void CpSettingFormEntryItemData::setEntryItemIcon(class HbIcon const &) - ?launchSettingView@CpPluginLauncher@@SAPAVCpBaseSettingView@@ABVQString@@ABVQVariant@@@Z @ 58 NONAME ; class CpBaseSettingView * CpPluginLauncher::launchSettingView(class QString const &, class QVariant const &) - ?entryItemIcon@CpSettingFormEntryItemData@@QBE?AVHbIcon@@XZ @ 59 NONAME ; class HbIcon CpSettingFormEntryItemData::entryItemIcon(void) const - ?qt_metacall@CpSettingFormEntryItemData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 60 NONAME ; int CpSettingFormEntryItemData::qt_metacall(enum QMetaObject::Call, int, void * *) - ?onLaunchView@CpSettingFormEntryItemData@@UAEXXZ @ 61 NONAME ; void CpSettingFormEntryItemData::onLaunchView(void) - ?setLogDateTime@Logger@@QAEX_N@Z @ 62 NONAME ABSENT ; void Logger::setLogDateTime(bool) - ?configure@Logger@@QAEXABVQString@@W4Format@QSettings@@@Z @ 63 NONAME ABSENT ; void Logger::configure(class QString const &, enum QSettings::Format) - ?tr@Logger@@SA?AVQString@@PBD0@Z @ 64 NONAME ABSENT ; class QString Logger::tr(char const *, char const *) - ?trUtf8@CpItemDataHelper@@SA?AVQString@@PBD0H@Z @ 65 NONAME ; class QString CpItemDataHelper::trUtf8(char const *, char const *, int) - ?metaObject@LogOutput@@UBEPBUQMetaObject@@XZ @ 66 NONAME ABSENT ; struct QMetaObject const * LogOutput::metaObject(void) const - ?trUtf8@CpItemDataHelper@@SA?AVQString@@PBD0@Z @ 67 NONAME ; class QString CpItemDataHelper::trUtf8(char const *, char const *) - ??0CpSettingFormEntryItemData@@QAE@PBVHbDataFormModelItem@@@Z @ 68 NONAME ; CpSettingFormEntryItemData::CpSettingFormEntryItemData(class HbDataFormModelItem const *) - ?logDateTime@Logger@@QBE_NXZ @ 69 NONAME ABSENT ; bool Logger::logDateTime(void) const - ??0CpSettingFormEntryItemData@@QAE@PAVHbDataForm@@ABVQString@@1ABVHbIcon@@PBVHbDataFormModelItem@@@Z @ 70 NONAME ; CpSettingFormEntryItemData::CpSettingFormEntryItemData(class HbDataForm *, class QString const &, class QString const &, class HbIcon const &, class HbDataFormModelItem const *) - ?d_func@CpBaseSettingView@@AAEPAVCpBaseSettingViewPrivate@@XZ @ 71 NONAME ; class CpBaseSettingViewPrivate * CpBaseSettingView::d_func(void) - ??0CpSettingFormItemData@@QAE@W4DataItemType@HbDataFormModelItem@@ABVQString@@PBV2@@Z @ 72 NONAME ; CpSettingFormItemData::CpSettingFormItemData(enum HbDataFormModelItem::DataItemType, class QString const &, class HbDataFormModelItem const *) - ?connectToForm@CpItemDataHelper@@QAEXPBDPAVQObject@@0@Z @ 73 NONAME ; void CpItemDataHelper::connectToForm(char const *, class QObject *, char const *) - ?tr@LogOutput@@SA?AVQString@@PBD0@Z @ 74 NONAME ABSENT ; class QString LogOutput::tr(char const *, char const *) - ?setIconName@CpSettingFormEntryItemData@@QAEXABVQString@@@Z @ 75 NONAME ; void CpSettingFormEntryItemData::setIconName(class QString const &) - ?qt_metacast@CpItemDataHelper@@UAEPAXPBD@Z @ 76 NONAME ; void * CpItemDataHelper::qt_metacast(char const *) - ?metaObject@Logger@@UBEPBUQMetaObject@@XZ @ 77 NONAME ABSENT ; struct QMetaObject const * Logger::metaObject(void) const - ?tr@CpSettingFormEntryItemData@@SA?AVQString@@PBD0@Z @ 78 NONAME ; class QString CpSettingFormEntryItemData::tr(char const *, char const *) - ??0Logger@@AAE@ABVQString@@PAVQObject@@@Z @ 79 NONAME ABSENT ; Logger::Logger(class QString const &, class QObject *) - ?addConnection@CpItemDataHelper@@QAEXPAVHbDataFormModelItem@@PBDPAVQObject@@1@Z @ 80 NONAME ; void CpItemDataHelper::addConnection(class HbDataFormModelItem *, char const *, class QObject *, char const *) - ?d_func@CpSettingFormEntryItemData@@AAEPAVCpSettingFormEntryItemDataPrivate@@XZ @ 81 NONAME ; class CpSettingFormEntryItemDataPrivate * CpSettingFormEntryItemData::d_func(void) - ?dateTimeFormat@Logger@@QBE?AVQString@@XZ @ 82 NONAME ABSENT ; class QString Logger::dateTimeFormat(void) const - ??0CpSettingFormItemData@@QAE@PBVHbDataFormModelItem@@@Z @ 83 NONAME ; CpSettingFormItemData::CpSettingFormItemData(class HbDataFormModelItem const *) - ?clearAllLogOutput@Logger@@QAEXXZ @ 84 NONAME ABSENT ; void Logger::clearAllLogOutput(void) - ?qt_metacall@LogOutput@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 85 NONAME ABSENT ; int LogOutput::qt_metacall(enum QMetaObject::Call, int, void * *) - ?setDescription@CpSettingFormEntryItemData@@QAEXABVQString@@@Z @ 86 NONAME ; void CpSettingFormEntryItemData::setDescription(class QString const &) - ?tr@CpSettingFormEntryItemData@@SA?AVQString@@PBD0H@Z @ 87 NONAME ; class QString CpSettingFormEntryItemData::tr(char const *, char const *, int) - ?getStaticMetaObject@CpSettingFormItemData@@SAABUQMetaObject@@XZ @ 88 NONAME ; struct QMetaObject const & CpSettingFormItemData::getStaticMetaObject(void) - ?staticMetaObject@CpSettingFormEntryItemData@@2UQMetaObject@@B @ 89 NONAME ; struct QMetaObject const CpSettingFormEntryItemData::staticMetaObject - ?setParentLogger@LogOutput@@QAEXPAVLogger@@@Z @ 90 NONAME ABSENT ; void LogOutput::setParentLogger(class Logger *) - ?parentLogger@LogOutput@@QAEPAVLogger@@XZ @ 91 NONAME ABSENT ; class Logger * LogOutput::parentLogger(void) - ?qt_metacall@CpSettingFormItemData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 92 NONAME ; int CpSettingFormItemData::qt_metacall(enum QMetaObject::Call, int, void * *) - ?tr@Logger@@SA?AVQString@@PBD0H@Z @ 93 NONAME ABSENT ; class QString Logger::tr(char const *, char const *, int) - ??_ECpBaseSettingView@@UAE@I@Z @ 94 NONAME ; CpBaseSettingView::~CpBaseSettingView(unsigned int) - ?bindToForm@CpItemDataHelper@@QAEXPAVHbDataForm@@@Z @ 95 NONAME ; void CpItemDataHelper::bindToForm(class HbDataForm *) - ??_ECpSettingFormItemData@@UAE@I@Z @ 96 NONAME ; CpSettingFormItemData::~CpSettingFormItemData(unsigned int) - ?getStaticMetaObject@Logger@@SAABUQMetaObject@@XZ @ 97 NONAME ABSENT ; struct QMetaObject const & Logger::getStaticMetaObject(void) - ?trUtf8@CpSettingFormItemData@@SA?AVQString@@PBD0H@Z @ 98 NONAME ; class QString CpSettingFormItemData::trUtf8(char const *, char const *, int) - ?staticMetaObject@CpBaseSettingView@@2UQMetaObject@@B @ 99 NONAME ; struct QMetaObject const CpBaseSettingView::staticMetaObject - ?tr@CpBaseSettingView@@SA?AVQString@@PBD0H@Z @ 100 NONAME ; class QString CpBaseSettingView::tr(char const *, char const *, int) - ?tr@CpBaseSettingView@@SA?AVQString@@PBD0@Z @ 101 NONAME ; class QString CpBaseSettingView::tr(char const *, char const *) - ?setLogLoggerName@Logger@@QAEX_N@Z @ 102 NONAME ABSENT ; void Logger::setLogLoggerName(bool) - ?tr@CpSettingFormItemData@@SA?AVQString@@PBD0@Z @ 103 NONAME ; class QString CpSettingFormItemData::tr(char const *, char const *) - ?closeAll@Logger@@SAXXZ @ 104 NONAME ABSENT ; void Logger::closeAll(void) - ?setSettingForm@CpBaseSettingView@@QAEXPAVHbDataForm@@@Z @ 105 NONAME ABSENT ; void CpBaseSettingView::setSettingForm(class HbDataForm *) - ?tr@CpSettingFormItemData@@SA?AVQString@@PBD0H@Z @ 106 NONAME ; class QString CpSettingFormItemData::tr(char const *, char const *, int) - ?trUtf8@LogOutput@@SA?AVQString@@PBD0H@Z @ 107 NONAME ABSENT ; class QString LogOutput::trUtf8(char const *, char const *, int) - ?trUtf8@CpSettingFormItemData@@SA?AVQString@@PBD0@Z @ 108 NONAME ; class QString CpSettingFormItemData::trUtf8(char const *, char const *) - ?removeLogOutput@Logger@@QAEXPAVLogOutput@@@Z @ 109 NONAME ABSENT ; void Logger::removeLogOutput(class LogOutput *) - ??0CpBaseSettingView@@QAE@PAVQGraphicsWidget@@PAVQGraphicsItem@@@Z @ 110 NONAME ; CpBaseSettingView::CpBaseSettingView(class QGraphicsWidget *, class QGraphicsItem *) - ?widgetFromModelIndex@CpItemDataHelper@@QAEPAVHbWidget@@ABVQModelIndex@@@Z @ 111 NONAME ; class HbWidget * CpItemDataHelper::widgetFromModelIndex(class QModelIndex const &) - ??0LogOutput@@IAE@PAVLogger@@@Z @ 112 NONAME ABSENT ; LogOutput::LogOutput(class Logger *) - ?staticMetaObject@LogOutput@@2UQMetaObject@@B @ 113 NONAME ABSENT ; struct QMetaObject const LogOutput::staticMetaObject - ?trUtf8@CpSettingFormEntryItemData@@SA?AVQString@@PBD0@Z @ 114 NONAME ; class QString CpSettingFormEntryItemData::trUtf8(char const *, char const *) - ?name@LogOutput@@QBE?AVQString@@XZ @ 115 NONAME ABSENT ; class QString LogOutput::name(void) const - ?tr@CpItemDataHelper@@SA?AVQString@@PBD0@Z @ 116 NONAME ; class QString CpItemDataHelper::tr(char const *, char const *) - ?getStaticMetaObject@CpItemDataHelper@@SAABUQMetaObject@@XZ @ 117 NONAME ; struct QMetaObject const & CpItemDataHelper::getStaticMetaObject(void) - ?qt_metacast@CpSettingFormEntryItemData@@UAEPAXPBD@Z @ 118 NONAME ; void * CpSettingFormEntryItemData::qt_metacast(char const *) - ?logLoggerName@Logger@@QBE_NXZ @ 119 NONAME ABSENT ; bool Logger::logLoggerName(void) const - ?qt_metacall@CpItemDataHelper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 120 NONAME ; int CpItemDataHelper::qt_metacall(enum QMetaObject::Call, int, void * *) - ?metaObject@CpSettingFormEntryItemData@@UBEPBUQMetaObject@@XZ @ 121 NONAME ; struct QMetaObject const * CpSettingFormEntryItemData::metaObject(void) const - ?qt_metacast@Logger@@UAEPAXPBD@Z @ 122 NONAME ABSENT ; void * Logger::qt_metacast(char const *) - ?addItemPrototype@CpItemDataHelper@@QAEXPAVHbAbstractViewItem@@@Z @ 123 NONAME ; void CpItemDataHelper::addItemPrototype(class HbAbstractViewItem *) - ?trUtf8@CpBaseSettingView@@SA?AVQString@@PBD0@Z @ 124 NONAME ; class QString CpBaseSettingView::trUtf8(char const *, char const *) - ?getStaticMetaObject@LogOutput@@SAABUQMetaObject@@XZ @ 125 NONAME ABSENT ; struct QMetaObject const & LogOutput::getStaticMetaObject(void) - ?createLogOutput@LogOutputFactory@@SAPAVLogOutput@@ABVQString@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 126 NONAME ABSENT ; class LogOutput * LogOutputFactory::createLogOutput(class QString const &, class QHash const &) - ?addCreateLogOutputEntry@LogOutputFactory@@SAXABVQString@@P6APAVLogOutput@@XZ@Z @ 127 NONAME ABSENT ; void LogOutputFactory::addCreateLogOutputEntry(class QString const &, class LogOutput * (*)(void)) - ?configure@Logger@@QAEXAAVQSettings@@@Z @ 128 NONAME ABSENT ; void Logger::configure(class QSettings &) - ?loadCpPlugin@CpPluginLoader@@SAPAVCpPluginInterface@@ABVQString@@@Z @ 129 NONAME ABSENT ; class CpPluginInterface * CpPluginLoader::loadCpPlugin(class QString const &) - ??1CpBaseSettingView@@UAE@XZ @ 130 NONAME ; CpBaseSettingView::~CpBaseSettingView(void) - ??0CpSettingFormEntryItemData@@QAE@W4EntryItemType@0@AAVCpItemDataHelper@@ABVQString@@22PBVHbDataFormModelItem@@@Z @ 131 NONAME ; CpSettingFormEntryItemData::CpSettingFormEntryItemData(enum CpSettingFormEntryItemData::EntryItemType, class CpItemDataHelper &, class QString const &, class QString const &, class QString const &, class HbDataFormModelItem const *) - ?metaObject@CpSettingFormItemData@@UBEPBUQMetaObject@@XZ @ 132 NONAME ; struct QMetaObject const * CpSettingFormItemData::metaObject(void) const - ?tr@LogOutput@@SA?AVQString@@PBD0H@Z @ 133 NONAME ABSENT ; class QString LogOutput::tr(char const *, char const *, int) - ?trUtf8@Logger@@SA?AVQString@@PBD0H@Z @ 134 NONAME ABSENT ; class QString Logger::trUtf8(char const *, char const *, int) - ?trUtf8@Logger@@SA?AVQString@@PBD0@Z @ 135 NONAME ABSENT ; class QString Logger::trUtf8(char const *, char const *) - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/cpframework.pri --- a/controlpanel/src/cpframework/cpframework.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ - -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: cpframework source files -# - -HEADERS += src/cpviewlauncher.h \ - src/cpbasesettingview_p.h \ - src/cpwatchdog.h \ - src/cputility.h \ - src/cpdataformbuttonentryviewitem.h \ - src/cpdataformlistentryviewitem.h \ - src/cpsettingformentryitemdata_p.h - -SOURCES += src/cppluginlauncher.cpp \ - src/cpviewlauncher.cpp \ - src/cppluginloader.cpp \ - src/cpsettingformentryitemdata.cpp \ - src/cpdataformbuttonentryviewitem.cpp \ - src/cpdataformlistentryviewitem.cpp \ - src/cpsettingformitemdata.cpp \ - src/cpbasesettingview.cpp \ - src/cpbasesettingview_p.cpp \ - src/cpwatchdog.cpp \ - src/cpitemdatahelper.cpp \ - src/cputility.cpp \ - src/cppluginutility.cpp \ - src/cpsettingformentryitemdata_p.cpp diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/cpframework.pro --- a/controlpanel/src/cpframework/cpframework.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = lib -TARGET = cpframework - -include ( ../common.pri ) -include ( ./cpframework.pri ) -include ( ../../controlpanel_plat/inc/controlpanel_plat.pri ) - -RESOURCES += cpframework.qrc - -symbian: { - TARGET.UID3 = 0x20025FDA -} - -CONFIG += Hb xml - -DEFINES += BUILD_CP_FRAMEWORK - -LIBS += -lcplogger - -include ( cpframework_export.pri ) - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/cpframework.qrc --- a/controlpanel/src/cpframework/cpframework.qrc Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - - resources/widgetml/cpdataformlistentryviewitem.widgetml - resources/widgetml/cpdataformlistentryviewitem.css - resources/widgetml/cpdataformlistentryviewitem_color.css - - - resources/icon/qgn_prop_set_default_sub.svg - - \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/cpframework_export.pri --- a/controlpanel/src/cpframework/cpframework_export.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -# -# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: controlpanel project - common qmake settings -# - -symbian: { - # export headers to mw - EXPORT_PLATFORM_HEADERS += \ - ../../controlpanel_plat/inc/cpglobal.h \ - ../../controlpanel_plat/inc/cpbasepath.h \ - ../../controlpanel_plat/inc/cpplugininterface.h \ - ../../controlpanel_plat/inc/cppluginloader.h \ - ../../controlpanel_plat/inc/cppluginlauncher.h \ - ../../controlpanel_plat/inc/cpbasesettingview.h \ - ../../controlpanel_plat/inc/cpitemdatahelper.h \ - ../../controlpanel_plat/inc/cpsettingformitemdata.h \ - ../../controlpanel_plat/inc/cpsettingformentryitemdata.h \ - ../../controlpanel_plat/inc/cpsettingformentryitemdataimpl.h \ - ../../controlpanel_plat/inc/cppluginutility.h \ - ../../controlpanel_plat/inc/cplauncherinterface.h - - headers.sources = $$EXPORT_PLATFORM_HEADERS - for(header, headers.sources):BLD_INF_RULES.prj_exports += "./$$header $$MW_LAYER_PLATFORM_EXPORT_PATH($$basename(header))" -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/eabi/cpframeworku.def --- a/controlpanel/src/cpframework/eabi/cpframeworku.def Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -EXPORTS - _ZN14CpPluginLoader21loadCpPluginInterfaceERK7QString @ 1 NONAME - _ZN14CpPluginLoader23loadCpLauncherInterfaceERK7QString @ 2 NONAME - _ZN15CpPluginUtility18addCpItemPrototypeEP10HbDataForm @ 3 NONAME - _ZN16CpItemDataHelper10bindToFormEP10HbDataForm @ 4 NONAME - _ZN16CpItemDataHelper11qt_metacallEN11QMetaObject4CallEiPPv @ 5 NONAME - _ZN16CpItemDataHelper11qt_metacastEPKc @ 6 NONAME - _ZN16CpItemDataHelper13addConnectionEP19HbDataFormModelItemPKcP7QObjectS3_ @ 7 NONAME - _ZN16CpItemDataHelper13connectToFormEPKcP7QObjectS1_ @ 8 NONAME - _ZN16CpItemDataHelper16addItemPrototypeEP18HbAbstractViewItem @ 9 NONAME - _ZN16CpItemDataHelper16removeConnectionEP19HbDataFormModelItemPKcP7QObjectS3_ @ 10 NONAME - _ZN16CpItemDataHelper16staticMetaObjectE @ 11 NONAME DATA 16 - _ZN16CpItemDataHelper18disconnectFromFormEPKcP7QObjectS1_ @ 12 NONAME - _ZN16CpItemDataHelper19getStaticMetaObjectEv @ 13 NONAME - _ZN16CpItemDataHelper20widgetFromModelIndexERK11QModelIndex @ 14 NONAME - _ZN16CpItemDataHelper23modelItemFromModelIndexERK11QModelIndex @ 15 NONAME - _ZN16CpItemDataHelperC1EP10HbDataForm @ 16 NONAME - _ZN16CpItemDataHelperC2EP10HbDataForm @ 17 NONAME - _ZN16CpItemDataHelperD0Ev @ 18 NONAME - _ZN16CpItemDataHelperD1Ev @ 19 NONAME - _ZN16CpItemDataHelperD2Ev @ 20 NONAME - _ZN16CpPluginLauncher17launchSettingViewERK7QStringRK8QVariant @ 21 NONAME - _ZN16CpPluginLauncher18launchCpPluginViewERK7QStringi @ 22 NONAME ABSENT - _ZN16LogOutputFactory15createLogOutputERK7QString @ 23 NONAME ABSENT - _ZN16LogOutputFactory15createLogOutputERK7QStringRK5QHashIS0_8QVariantE @ 24 NONAME ABSENT - _ZN16LogOutputFactory23addCreateLogOutputEntryERK7QStringPFP9LogOutputvE @ 25 NONAME ABSENT - _ZN17CpBaseSettingView11qt_metacallEN11QMetaObject4CallEiPPv @ 26 NONAME - _ZN17CpBaseSettingView11qt_metacastEPKc @ 27 NONAME - _ZN17CpBaseSettingView12aboutToCloseEv @ 28 NONAME - _ZN17CpBaseSettingView16staticMetaObjectE @ 29 NONAME DATA 16 - _ZN17CpBaseSettingView19getStaticMetaObjectEv @ 30 NONAME - _ZN17CpBaseSettingView20returnValueDeliveredERK8QVariant @ 31 NONAME - _ZN17CpBaseSettingView5closeEv @ 32 NONAME - _ZN17CpBaseSettingViewC1EP15QGraphicsWidgetP13QGraphicsItem @ 33 NONAME - _ZN17CpBaseSettingViewC2EP15QGraphicsWidgetP13QGraphicsItem @ 34 NONAME - _ZN17CpBaseSettingViewD0Ev @ 35 NONAME - _ZN17CpBaseSettingViewD1Ev @ 36 NONAME - _ZN17CpBaseSettingViewD2Ev @ 37 NONAME - _ZN21CpSettingFormItemData11qt_metacallEN11QMetaObject4CallEiPPv @ 38 NONAME - _ZN21CpSettingFormItemData11qt_metacastEPKc @ 39 NONAME - _ZN21CpSettingFormItemData16staticMetaObjectE @ 40 NONAME DATA 16 - _ZN21CpSettingFormItemData19getStaticMetaObjectEv @ 41 NONAME - _ZN21CpSettingFormItemDataC1EN19HbDataFormModelItem12DataItemTypeERK7QStringPKS0_ @ 42 NONAME - _ZN21CpSettingFormItemDataC1EPK19HbDataFormModelItem @ 43 NONAME - _ZN21CpSettingFormItemDataC2EN19HbDataFormModelItem12DataItemTypeERK7QStringPKS0_ @ 44 NONAME - _ZN21CpSettingFormItemDataC2EPK19HbDataFormModelItem @ 45 NONAME - _ZN21CpSettingFormItemDataD0Ev @ 46 NONAME - _ZN21CpSettingFormItemDataD1Ev @ 47 NONAME - _ZN21CpSettingFormItemDataD2Ev @ 48 NONAME - _ZN26CpSettingFormEntryItemData11qt_metacallEN11QMetaObject4CallEiPPv @ 49 NONAME - _ZN26CpSettingFormEntryItemData11qt_metacastEPKc @ 50 NONAME - _ZN26CpSettingFormEntryItemData11setIconNameERK7QString @ 51 NONAME - _ZN26CpSettingFormEntryItemData12onLaunchViewEv @ 52 NONAME - _ZN26CpSettingFormEntryItemData14setDescriptionERK7QString @ 53 NONAME - _ZN26CpSettingFormEntryItemData16setEntryItemIconERK6HbIcon @ 54 NONAME - _ZN26CpSettingFormEntryItemData16staticMetaObjectE @ 55 NONAME DATA 16 - _ZN26CpSettingFormEntryItemData19getStaticMetaObjectEv @ 56 NONAME - _ZN26CpSettingFormEntryItemData7setTextERK7QString @ 57 NONAME - _ZN26CpSettingFormEntryItemDataC2ENS_13EntryItemTypeEP10HbDataFormRK7QStringS5_S5_PK19HbDataFormModelItem @ 58 NONAME - _ZN26CpSettingFormEntryItemDataC2ENS_13EntryItemTypeER16CpItemDataHelperRK7QStringS5_S5_PK19HbDataFormModelItem @ 59 NONAME - _ZN26CpSettingFormEntryItemDataC2EP10HbDataFormRK7QStringS4_RK6HbIconPK19HbDataFormModelItem @ 60 NONAME - _ZN26CpSettingFormEntryItemDataC2EPK19HbDataFormModelItem @ 61 NONAME - _ZN26CpSettingFormEntryItemDataC2ER16CpItemDataHelperRK7QStringS4_RK6HbIconPK19HbDataFormModelItem @ 62 NONAME - _ZN26CpSettingFormEntryItemDataD0Ev @ 63 NONAME - _ZN26CpSettingFormEntryItemDataD1Ev @ 64 NONAME - _ZN26CpSettingFormEntryItemDataD2Ev @ 65 NONAME - _ZN6Logger11qt_metacallEN11QMetaObject4CallEiPPv @ 66 NONAME ABSENT - _ZN6Logger11qt_metacastEPKc @ 67 NONAME ABSENT - _ZN6Logger12addLogOutputEP9LogOutput @ 68 NONAME ABSENT - _ZN6Logger14setLogDateTimeEb @ 69 NONAME ABSENT - _ZN6Logger15removeLogOutputEP9LogOutput @ 70 NONAME ABSENT - _ZN6Logger16setLogLoggerNameEb @ 71 NONAME ABSENT - _ZN6Logger16staticMetaObjectE @ 72 NONAME DATA 16 ABSENT - _ZN6Logger17clearAllLogOutputEv @ 73 NONAME ABSENT - _ZN6Logger17setDateTimeFormatERK7QString @ 74 NONAME ABSENT - _ZN6Logger19getStaticMetaObjectEv @ 75 NONAME ABSENT - _ZN6Logger3logERK7QString @ 76 NONAME ABSENT - _ZN6Logger5closeERK7QString @ 77 NONAME ABSENT - _ZN6Logger8closeAllEv @ 78 NONAME ABSENT - _ZN6Logger8instanceERK7QString @ 79 NONAME ABSENT - _ZN6Logger9configureER9QSettings @ 80 NONAME ABSENT - _ZN6Logger9configureERK7QStringN9QSettings6FormatE @ 81 NONAME ABSENT - _ZN6Logger9logOutputERK7QString @ 82 NONAME ABSENT - _ZN6LoggerC1ERK7QStringP7QObject @ 83 NONAME ABSENT - _ZN6LoggerC2ERK7QStringP7QObject @ 84 NONAME ABSENT - _ZN6LoggerD0Ev @ 85 NONAME ABSENT - _ZN6LoggerD1Ev @ 86 NONAME ABSENT - _ZN6LoggerD2Ev @ 87 NONAME ABSENT - _ZN9LogOutput11qt_metacallEN11QMetaObject4CallEiPPv @ 88 NONAME ABSENT - _ZN9LogOutput11qt_metacastEPKc @ 89 NONAME ABSENT - _ZN9LogOutput12parentLoggerEv @ 90 NONAME ABSENT - _ZN9LogOutput15setParentLoggerEP6Logger @ 91 NONAME ABSENT - _ZN9LogOutput16staticMetaObjectE @ 92 NONAME DATA 16 ABSENT - _ZN9LogOutput19getStaticMetaObjectEv @ 93 NONAME ABSENT - _ZN9LogOutput4loadER9QSettings @ 94 NONAME ABSENT - _ZN9LogOutput7setNameERK7QString @ 95 NONAME ABSENT - _ZN9LogOutputC2EP6Logger @ 96 NONAME ABSENT - _ZN9LogOutputD0Ev @ 97 NONAME ABSENT - _ZN9LogOutputD1Ev @ 98 NONAME ABSENT - _ZN9LogOutputD2Ev @ 99 NONAME ABSENT - _ZNK16CpItemDataHelper10metaObjectEv @ 100 NONAME - _ZNK17CpBaseSettingView10metaObjectEv @ 101 NONAME - _ZNK21CpSettingFormItemData10metaObjectEv @ 102 NONAME - _ZNK26CpSettingFormEntryItemData10metaObjectEv @ 103 NONAME - _ZNK26CpSettingFormEntryItemData11descriptionEv @ 104 NONAME - _ZNK26CpSettingFormEntryItemData13entryItemIconEv @ 105 NONAME - _ZNK26CpSettingFormEntryItemData4textEv @ 106 NONAME - _ZNK26CpSettingFormEntryItemData8iconNameEv @ 107 NONAME - _ZNK6Logger10metaObjectEv @ 108 NONAME ABSENT - _ZNK6Logger11logDateTimeEv @ 109 NONAME ABSENT - _ZNK6Logger13logLoggerNameEv @ 110 NONAME ABSENT - _ZNK6Logger14dateTimeFormatEv @ 111 NONAME ABSENT - _ZNK6Logger4nameEv @ 112 NONAME ABSENT - _ZNK9LogOutput10metaObjectEv @ 113 NONAME ABSENT - _ZNK9LogOutput4nameEv @ 114 NONAME ABSENT - _ZTI16CpItemDataHelper @ 115 NONAME - _ZTI17CpBaseSettingView @ 116 NONAME - _ZTI21CpSettingFormItemData @ 117 NONAME - _ZTI26CpSettingFormEntryItemData @ 118 NONAME - _ZTI6Logger @ 119 NONAME ABSENT - _ZTI9LogOutput @ 120 NONAME ABSENT - _ZTV16CpItemDataHelper @ 121 NONAME - _ZTV17CpBaseSettingView @ 122 NONAME - _ZTV21CpSettingFormItemData @ 123 NONAME - _ZTV26CpSettingFormEntryItemData @ 124 NONAME - _ZTV6Logger @ 125 NONAME ABSENT - _ZTV9LogOutput @ 126 NONAME ABSENT - _ZThn16_N17CpBaseSettingViewD0Ev @ 127 NONAME - _ZThn16_N17CpBaseSettingViewD1Ev @ 128 NONAME - _ZThn8_N17CpBaseSettingViewD0Ev @ 129 NONAME - _ZThn8_N17CpBaseSettingViewD1Ev @ 130 NONAME - _ZThn8_N21CpSettingFormItemDataD0Ev @ 131 NONAME - _ZThn8_N21CpSettingFormItemDataD1Ev @ 132 NONAME - _ZThn8_N26CpSettingFormEntryItemDataD0Ev @ 133 NONAME - _ZThn8_N26CpSettingFormEntryItemDataD1Ev @ 134 NONAME - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/resources/icon/qgn_prop_set_default_sub.svg --- a/controlpanel/src/cpframework/resources/icon/qgn_prop_set_default_sub.svg Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/resources/widgetml/cpdataformlistentryviewitem.css --- a/controlpanel/src/cpframework/resources/widgetml/cpdataformlistentryviewitem.css Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ - -/* - Layout selection -*/ - -CpDataFormListEntryViewItem[hasDescription] { - layout:default; -} - - -CpDataFormListEntryViewItem[!hasDescription] { - layout:singletext; -} - -CpDataFormListEntryViewItem::dataItem_Background -{ -} - -CpDataFormListEntryViewItem::dataItem_Icon -{ - fixed-height: var(hb-param-graphic-size-primary-large); - fixed-width: var(hb-param-graphic-size-primary-large); -} - -CpDataFormListEntryViewItem::dataItem_Label -{ - text-height: var(hb-param-text-height-primary); - size-policy-horizontal: preferred; - font-variant: primary; - text-align: left; - text-line-count-max:1; -} - -CpDataFormListEntryViewItem::dataItem_Description -{ - text-height: var(hb-param-text-height-secondary); - size-policy-horizontal: preferred; - font-variant: secondary; - text-align: left; -} - -CpDataFormListEntryViewItem::dataItem_Icon -{ - left:-var(hb-param-margin-gene-left); - top:-var(hb-param-margin-gene-top); - bottom:var(hb-param-margin-gene-bottom); -} - -CpDataFormListEntryViewItem::dataItem_Label[!hasIcon] -{ - left:-var(hb-param-margin-gene-left); - right:var(hb-param-margin-form-label-right); -} - -CpDataFormListEntryViewItem::dataItem_Label[hasIcon] -{ - left:-var(hb-param-margin-gene-middle-horizontal); - right:var(hb-param-margin-form-label-right); -} - -CpDataFormListEntryViewItem::dataItem_Label[hasDescription] -{ - top:-var(hb-param-margin-gene-top); -} - -CpDataFormListEntryViewItem::dataItem_Description[!hasIcon] -{ - left:-var(hb-param-margin-gene-left); - right:var(hb-param-margin-gene-right); -} - -CpDataFormListEntryViewItem::dataItem_Description[hasIcon] -{ - left:-var(hb-param-margin-gene-middle-horizontal); - right:var(hb-param-margin-gene-right); -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/resources/widgetml/cpdataformlistentryviewitem.widgetml --- a/controlpanel/src/cpframework/resources/widgetml/cpdataformlistentryviewitem.widgetml Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/resources/widgetml/cpdataformlistentryviewitem_color.css --- a/controlpanel/src/cpframework/resources/widgetml/cpdataformlistentryviewitem_color.css Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ - -/* - CpDataFormListEntryViewItem default color definitions. -*/ - -CpDataFormListEntryViewItem::dataItem_Icon { - color: var(qtc_list_item_title_normal); -} - -CpDataFormListEntryViewItem::dataItem_Icon[state="pressed"]{ - color: var(qtc_list_item_pressed); -} - -CpDataFormListEntryViewItem::dataItem_Icon[state="disabled"] { - color: var(qtc_list_item_disabled); -} - -CpDataFormListEntryViewItem::dataItem_Label { - color: var(qtc_list_item_title_normal); -} - -CpDataFormListEntryViewItem::dataItem_Label[state="pressed"] { - color: var(qtc_list_item_pressed); -} - -CpDataFormListEntryViewItem::dataItem_Label[state="disabled"] { - color: var(qtc_list_item_disabled); -} - -CpDataFormListEntryViewItem::dataItem_Description { - color: var(qtc_list_item_title_normal); -} - -CpDataFormListEntryViewItem::dataItem_Description[state="pressed"] { - color: var(qtc_list_item_pressed); -} - -CpDataFormListEntryViewItem::dataItem_Description[state="disabled"] { - color: var(qtc_list_item_disabled); -} - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cpbasesettingview.cpp --- a/controlpanel/src/cpframework/src/cpbasesettingview.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Base class for controlpane plugin views. -* -*/ - -#include "cpbasesettingview.h" -#include "cpbasesettingview_p.h" -#include -#include "cpitemdatahelper.h" - - -/*! - \class CpBaseSettingView - \brief The CpBaseSettingView is the base class for all setting views in controlpanel application. - This class is responsible for processing some common properties, such as setting view's title, content widget and back key action. - */ - - -/*! - \fn void returnValueDelivered(const QVariant &returnValue) - - This signal is emitted when the setting view need to deliver return value to caller. Derived class can - emit the signal in some proper time. -*/ - -/*! - \fn void aboutToClose() - - This signal is emitted when the setting view is about to close. -*/ - -/*! - Constructor of CpBaseSettingView. - */ -CpBaseSettingView::CpBaseSettingView(QGraphicsWidget *widget /*= 0*/,QGraphicsItem *parent /*= 0*/) : - HbView(parent),d_ptr(new CpBaseSettingViewPrivate()) -{ - d_ptr->init(widget,this); -} - -/*! - Destructor of CpBaseSettingView. - */ -CpBaseSettingView::~CpBaseSettingView() -{ - delete d_ptr; -} - - -/*! - Emit aboutToClose() signal to indicate that the view is about to close. - Derived class can override it to do some specified work before exit. - */ -void CpBaseSettingView::close() -{ - emit aboutToClose(); -} - -// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cpbasesettingview_p.cpp --- a/controlpanel/src/cpframework/src/cpbasesettingview_p.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Private implementaion for CpBaseSettingView - * - */ - -#include "cpbasesettingview_p.h" -#include "cpbasesettingview.h" -#include -#include -#include -#include -#include -#include -#include "cpitemdatahelper.h" -#include "cppluginutility.h" - - -CpBaseSettingViewPrivate::CpBaseSettingViewPrivate() : - mBaseSettingView(0), - mSoftKeyBackAction(0) -{ -} - -CpBaseSettingViewPrivate::~CpBaseSettingViewPrivate() -{ - if (mBaseSettingView) { - mBaseSettingView->setNavigationAction (0); - } - - delete mSoftKeyBackAction; - mSoftKeyBackAction = 0; -} - -void CpBaseSettingViewPrivate::init(QGraphicsWidget *widget,CpBaseSettingView *baseSettingView) -{ - mBaseSettingView = baseSettingView; - - if (!widget) { - widget = new HbDataForm(); - // add item prototypes by default. - CpPluginUtility::addCpItemPrototype(qobject_cast(widget)); - } - - mBaseSettingView->setWidget(widget); - - mBaseSettingView->setTitle(hbTrId("txt_cp_title_control_panel")); //give a default title, sub classes need set it correctly - - mSoftKeyBackAction = new HbAction(Hb::BackNaviAction , mBaseSettingView); - QObject::connect(mSoftKeyBackAction, - SIGNAL(triggered()), - mBaseSettingView, - SLOT(_q_softkeyClicked()) ); - - mBaseSettingView->setNavigationAction (mSoftKeyBackAction); -} - -void CpBaseSettingViewPrivate::_q_softkeyClicked() -{ - mBaseSettingView->close(); -} - -#include "moc_cpbasesettingview.cpp" - -//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cpbasesettingview_p.h --- a/controlpanel/src/cpframework/src/cpbasesettingview_p.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Private implementaion for CpBaseSettingView -* -*/ -#ifndef CPBASESETTINGVIEW_P_H -#define CPBASESETTINGVIEW_P_H - -#include - -class CpBaseSettingView; -class HbAction; -class HbDataForm; -class CpItemDataHelper; -class QGraphicsWidget; - -class CpBaseSettingViewPrivate -{ -public: - CpBaseSettingViewPrivate(); - ~CpBaseSettingViewPrivate(); - /* - initialize - */ - void init(QGraphicsWidget *widget,CpBaseSettingView *baseSettingView); - - //SLOTS - void _q_softkeyClicked(); -public: - //DATA - CpBaseSettingView *mBaseSettingView; - HbAction *mSoftKeyBackAction; - HbDataForm *mSettingForm; -}; - -#endif //CPBASESETTINGVIEW_P_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cpdataformbuttonentryviewitem.cpp --- a/controlpanel/src/cpframework/src/cpdataformbuttonentryviewitem.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: View item implementation for button entry item. -* -*/ -#include "cpdataformbuttonentryviewitem.h" -#include -#include -#include -#include -#include -#include -/*! - \class CpDataFormButtonEntryViewItem - \brief The CpDataFormButtonEntryViewItem is a item proto type of HbDataForm which is supplied by control panel. - When you want use setting items which are come from control panel, you should append this class to the proto type list of your data form's instance. - Code example: - \code - HbDataForm *form = new HbDataForm(); - QList protoType = form->itemProtoTypetypes(); - protoType.append(CpDataFormButtonEntryViewItem::createCpItemProtoType()); - form->setItemPrototypes(); - \endcode -*/ -class CpDataFormButtonEntryViewItemPrivate -{ -public: - CpDataFormButtonEntryViewItemPrivate() : mWidget(0) - { - } - ~CpDataFormButtonEntryViewItemPrivate() - { - } - HbWidget *mWidget; -}; - -/*! - Constructor - */ -CpDataFormButtonEntryViewItem::CpDataFormButtonEntryViewItem(QGraphicsItem *parent) -: HbDataFormViewItem(parent),d_ptr(new CpDataFormButtonEntryViewItemPrivate()) -{ -} - -/*! - Destructor of CpDataFormButtonEntryViewItem - */ -CpDataFormButtonEntryViewItem::~CpDataFormButtonEntryViewItem() -{ - delete d_ptr; -} - -/*! - Creates CpDataFormButtonEntryViewItem. This function is called form HbAbstractItemContainer when model is getting parsed for creating items. - */ -HbAbstractViewItem *CpDataFormButtonEntryViewItem::createItem() -{ - return new CpDataFormButtonEntryViewItem(*this); -} - -/*! - Copy constructor of CpDataFormButtonEntryViewItem - */ -CpDataFormButtonEntryViewItem::CpDataFormButtonEntryViewItem(const CpDataFormButtonEntryViewItem &other) -: HbDataFormViewItem(other), d_ptr(new CpDataFormButtonEntryViewItemPrivate(*other.d_ptr)) -{ - -} - -/*! - Assignment operator - */ -CpDataFormButtonEntryViewItem &CpDataFormButtonEntryViewItem::operator=(const CpDataFormButtonEntryViewItem &other) -{ - if (&other == this) { - return *this; - } - - *d_ptr = *(other.d_ptr); - - return *this; -} - -/*! - Inherit from HbAbstractViewItem, return true if the model item can be supported by CpDataFormButtonEntryViewItem. - */ -bool CpDataFormButtonEntryViewItem::canSetModelIndex(const QModelIndex &index) const -{ - int itemTypeId = index.data(HbDataFormModelItem::ItemTypeRole).toInt(); - - return (itemTypeId == CpSettingFormEntryItemData::ButtonEntryItem); -} - -/*! - Inherit from HbDataFormViewItem, return the setting item's widget of control panel - */ -HbWidget *CpDataFormButtonEntryViewItem::createCustomWidget() -{ - HbDataFormModelItem::DataItemType itemType = static_cast( - modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); - - if (itemType == CpSettingFormEntryItemData::ButtonEntryItem) { - HbPushButton *button = new HbPushButton(QString("Push button")); - d_ptr->mWidget = button; - button->setTextAlignment( Qt::AlignLeft ); - return button; - } - - return 0; -} - -/*! - Inherit from HbDataForm. This function is called by hbdataform's framework, - for supporting to load entry item's text, icon and additional text dynamically. - It is not recommended to call this function manually. - */ -void CpDataFormButtonEntryViewItem::restore() -{ - HbDataFormViewItem::restore(); - - // Set widget's properties according to model item's content widget data - // so that the widget can be refreshed - if (d_ptr->mWidget) { - HbDataFormModelItem::DataItemType itemType = static_cast( - modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); - - if(itemType == CpSettingFormEntryItemData::ButtonEntryItem) { - - QModelIndex itemIndex = modelIndex(); - HbDataFormModel *model = static_cast(itemView()->model());; - HbDataFormModelItem *modelItem = static_cast( - model->itemFromIndex(itemIndex)); - - const QMetaObject *metaObj = d_ptr->mWidget->metaObject(); - int count = metaObj->propertyCount(); - for (int i = 0; i < count; i++) { - QMetaProperty metaProperty = metaObj->property(i); - if (metaProperty.isValid() && metaProperty.isWritable()) { - metaProperty.write(d_ptr->mWidget,modelItem->contentWidgetData(metaProperty.name())); - } - - } - } - } -} - -//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cpdataformbuttonentryviewitem.h --- a/controlpanel/src/cpframework/src/cpdataformbuttonentryviewitem.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: View item implementation for button entry item. -* -*/ -#ifndef CPDATAFORMBUTTONENTRYVIEWITEM_H -#define CPDATAFORMBUTTONENTRYVIEWITEM_H - -#include - -class CpDataFormButtonEntryViewItemPrivate; - -class CpDataFormButtonEntryViewItem : public HbDataFormViewItem -{ - Q_OBJECT -public: - explicit CpDataFormButtonEntryViewItem(QGraphicsItem *parent = 0); - virtual ~CpDataFormButtonEntryViewItem(); - - // From HbAbstractViewItem - virtual HbAbstractViewItem *createItem(); - // From HbAbstractViewItem - virtual bool canSetModelIndex(const QModelIndex &index) const; -public slots: - // From HbDataFormViewItem - virtual void restore(); -protected: - CpDataFormButtonEntryViewItem(const CpDataFormButtonEntryViewItem &other); - CpDataFormButtonEntryViewItem &operator = (const CpDataFormButtonEntryViewItem &other); - // From HbAbstractViewItem - virtual HbWidget *createCustomWidget(); -private: - CpDataFormButtonEntryViewItemPrivate *d_ptr; -}; - -#endif // CPDATAFORMBUTTONENTRYVIEWITEM_H - -//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cpdataformlistentryviewitem.cpp --- a/controlpanel/src/cpframework/src/cpdataformlistentryviewitem.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,189 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: View item implementation for list entry item. -* -*/ - -#include "cpdataformlistentryviewitem.h" - -#ifdef HB_EFFECTS - #include "hbeffect.h" -#endif - -#ifdef HB_GESTURE_FW - #include - #include -#endif - -#include -#include -#include -#include - -#define CP_DATAFORMLISTENTRYVIEWITEM QLatin1String("cpdataformlistentryviewitem") - -/** - * Constructor - */ -CpDataFormListEntryViewItem::CpDataFormListEntryViewItem(QGraphicsItem *parent) : - HbDataFormViewItem(parent) -{ - // Add effeect just like item in HbListView -#ifdef HB_EFFECTS - HbEffect::add(CP_DATAFORMLISTENTRYVIEWITEM + "-focus", "listviewitem_press", "pressed"); - HbEffect::add(CP_DATAFORMLISTENTRYVIEWITEM + "-focus", "listviewitem_release", "released"); -#endif -} - -/** - * Destructor - */ -CpDataFormListEntryViewItem::~CpDataFormListEntryViewItem() -{ -} - -/** - * Reimplement by CpDataFormListEntryViewItem, this function return a instance copy. - */ -HbAbstractViewItem* CpDataFormListEntryViewItem::createItem() -{ - return new CpDataFormListEntryViewItem(*this); -} - -/** - * Reimplement by CpDataFormListEntryViewItem, return true when the model item type is - * ListEntryItem - */ -bool CpDataFormListEntryViewItem::canSetModelIndex(const QModelIndex &index) const -{ - HbDataFormModelItem::DataItemType itemType = - static_cast( - index.data(HbDataFormModelItem::ItemTypeRole).toInt()); - - return ( itemType == CpSettingFormEntryItemData::ListEntryItem ); -} - -/** - * Reimplement by CpDataFormListEntryViewItem - * No content widget in custom list item. So return a null pointer directly - */ -HbWidget* CpDataFormListEntryViewItem::createCustomWidget() -{ - // Don't need to create any widget - return 0; -} -/** - * Reimplement by CpDataFormListEntryViewItem. Change the description property for - * custom list item. - */ -void CpDataFormListEntryViewItem::restore() -{ - HbDataFormModelItem::DataItemType itemType = - static_cast (modelIndex().data( - HbDataFormModelItem::ItemTypeRole).toInt()); - - if (itemType == CpSettingFormEntryItemData::ListEntryItem) { - QModelIndex itemIndex = modelIndex(); - HbDataFormModel *model = qobject_cast (itemView()->model()); - if (model) { - HbDataFormModelItem *modelItem = model->itemFromIndex(itemIndex); - if (modelItem->data(HbDataFormModelItem::DescriptionRole).toString().isEmpty()) { - this->setProperty("hasDescription", false); - } - else { - this->setProperty("hasDescription", true); - } - } - } - HbDataFormViewItem::restore(); -} - -/** - * Reimplement by CpDataFormListEntryViewItem, provide the effect when pressing list item - */ -void CpDataFormListEntryViewItem::pressStateChanged(bool pressed, bool animate) -{ -#ifdef HB_EFFECTS - QGraphicsItem *focusItem = primitive("dataItem_Background"); - bool doAnimate = animate; - - if (pressed) { - if (doAnimate) { - HbEffect::cancel(this, "released"); - HbEffect::cancel(focusItem, "released"); - - HbEffect::start(this, CP_DATAFORMLISTENTRYVIEWITEM, "pressed"); - HbEffect::start(focusItem, CP_DATAFORMLISTENTRYVIEWITEM + QString("-focus"), "pressed"); - } - } else { - if (doAnimate) { - HbEffect::cancel(this, "pressed"); - HbEffect::cancel(focusItem, "pressed"); - - HbEffect::start(this, CP_DATAFORMLISTENTRYVIEWITEM, "released"); - HbEffect::start(focusItem, CP_DATAFORMLISTENTRYVIEWITEM + QString("-focus"), "released"); - } else { - HbEffect::cancel(this, "pressed"); - HbEffect::start(this, CP_DATAFORMLISTENTRYVIEWITEM, "released"); - if (focusItem) { - HbEffect::cancel(focusItem, "pressed"); - HbEffect::start(focusItem, CP_DATAFORMLISTENTRYVIEWITEM + QString("-focus"), "released", this); - } - } - } -#endif -} - -#ifdef HB_GESTURE_FW - -/** - * Reimplement by CpDataFormListEntryViewItem, set different graphics for list item's gesture - */ -void CpDataFormListEntryViewItem::gestureEvent(QGestureEvent *event) -{ - HbFrameItem *backgroundItem = static_cast ( primitive("dataItem_Background") ); - HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture)); - - if(backgroundItem && tap) { - switch(tap->state()) { - case Qt::GestureStarted: { - // Set the pressed state - backgroundItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_list_pressed")); - } - break; - case Qt::GestureUpdated: { - - } - break; - case Qt::GestureCanceled: { - // Set the normal state - backgroundItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_list_normal")); - } - break; - case Qt::GestureFinished: { - // Set the normal state - backgroundItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_list_normal")); - } - break; - default: - break; - } - } - - HbDataFormViewItem::gestureEvent( event ); -} -#endif - - -//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cpdataformlistentryviewitem.h --- a/controlpanel/src/cpframework/src/cpdataformlistentryviewitem.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: View item implementation for list entry item. -* -*/ - - -#ifndef CPDATAFORMLISTENTRYVIEWITEM_H -#define CPDATAFORMLISTENTRYVIEWITEM_H - -#include - -class CpDataFormListEntryViewItem : public HbDataFormViewItem -{ - Q_OBJECT -public: - explicit CpDataFormListEntryViewItem(QGraphicsItem *parent = 0); - virtual ~CpDataFormListEntryViewItem(); - // From HbAbstractViewItem - virtual HbAbstractViewItem* createItem(); - // From HbAbstractViewItem - virtual bool canSetModelIndex(const QModelIndex &index) const; -protected: - // From HbDataFormViewItem - virtual HbWidget* createCustomWidget(); - - virtual void restore(); - - // From HbAbstractViewItem - virtual void pressStateChanged(bool pressed, bool animate); -#ifdef HB_GESTURE_FW - // From HbWidgetBase - virtual void gestureEvent(QGestureEvent *event); -#endif -}; - -#endif //CPDATAFORMLISTENTRYVIEWITEM_H - -//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cpitemdatahelper.cpp --- a/controlpanel/src/cpframework/src/cpitemdatahelper.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,312 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Helper class by which a plugin can communicate with the associated dataform. -* -*/ -#include "cpitemdatahelper.h" -#include -#include -#include -#include -#include - -/*! -\internal -*/ -class CpItemDataHelperPrivate -{ -public: - /*! - \internal - */ - class ItemConnection - { - public: - ItemConnection(HbDataFormModelItem *item, - const char *signal, - QObject *receiver, - const char *method) : - mItem(item),mSignal(signal), - mReceiver(receiver),mMethod(method) - { - } - - bool operator == (const ItemConnection &other) - { - return mItem == other.mItem && - mSignal == other.mSignal && - mReceiver == other.mReceiver && - mMethod == other.mMethod; - } - - HbDataFormModelItem *mItem; - QString mSignal; - QObject *mReceiver; - QString mMethod; - }; - - class FormConnection - { - public: - FormConnection(const char *signal, - QObject *receiver, - const char *method) : - mSignal(signal),mReceiver(receiver),mMethod(method) - { - } - - bool operator == (const FormConnection &other) - { - return mSignal == other.mSignal && - mReceiver == other.mReceiver && - mMethod == other.mMethod; - } - QString mSignal; - QObject *mReceiver; - QString mMethod; - }; - - CpItemDataHelperPrivate(HbDataForm *form /*= 0*/) - : mDataForm(form) - { - } - - ~CpItemDataHelperPrivate() - { - } - - void addConnection(HbDataFormModelItem *item, - const char *signal, - QObject *receiver, - const char *method) - { - if (mDataForm) { - mDataForm->addConnection(item,signal,receiver,method); - } - else { - mItemConnections.append(ItemConnection(item,signal,receiver,method)); - } - } - - void removeConnection(HbDataFormModelItem *item, - const char *signal, - QObject *receiver, - const char *method) - { - if (mDataForm) { - mDataForm->removeConnection(item,signal,receiver,method); - } - else { - mItemConnections.removeAll(ItemConnection(item,signal,receiver,method)); - } - } - - void connectToForm(const char *signal, - QObject *receiver, - const char *method) - { - if (mDataForm) { - QObject::connect(mDataForm,signal,receiver,method); - } - else { - mFormConnections.append(FormConnection(signal,receiver,method)); - } - } - - void disconnectFromForm(const char *signal, - QObject *receiver, - const char *method) - { - if (mDataForm) { - QObject::disconnect(mDataForm,signal,receiver,method); - } - else { - mFormConnections.removeAll(FormConnection(signal,receiver,method)); - } - } - - void addItemPrototype(HbAbstractViewItem *prototype) - { - if (prototype) { - if (mDataForm) { - QList protoTypeList = mDataForm->itemPrototypes(); - protoTypeList.append(prototype); - mDataForm->setItemPrototypes(protoTypeList); - } - else { - mItemPrototypes.append(prototype); - } - } - } - - void bindToForm(HbDataForm *form) - { - mDataForm = form; - - if (mDataForm) { - foreach(const ItemConnection &connection,mItemConnections) { - mDataForm->addConnection(connection.mItem,connection.mSignal.toAscii(), - connection.mReceiver,connection.mMethod.toAscii()); - } - mItemConnections.clear(); - - foreach(const FormConnection &connection,mFormConnections) { - QObject::connect(mDataForm,connection.mSignal.toAscii(), - connection.mReceiver,connection.mMethod.toAscii()); - } - mFormConnections.clear(); - - if (!mItemPrototypes.isEmpty()) { - QList protoTypeList = mDataForm->itemPrototypes(); - protoTypeList.append(mItemPrototypes); - mDataForm->setItemPrototypes(protoTypeList); - } - mItemPrototypes.clear(); - } - } - - HbWidget *widgetFromModelIndex(const QModelIndex &index) - { - if (mDataForm) { - HbDataFormViewItem *viewItem = qobject_cast - (mDataForm->itemByIndex(index)); - if (viewItem) { - return viewItem->dataItemContentWidget(); - } - } - return 0; - } - - HbDataFormModelItem *modelItemFromModelIndex(const QModelIndex &index) - { - if (mDataForm) { - HbDataFormModel *dataFormModel = - qobject_cast(mDataForm->model()); - if (dataFormModel) { - return dataFormModel->itemFromIndex(index); - } - } - return 0; - } - -public: - HbDataForm *mDataForm; - QList mItemConnections; - QList mFormConnections; - QList mItemPrototypes; -}; - - -/*! - \class CpItemDataHelper - \brief The CpItemDataHelper class is a helper class to help controlpanel plugins to comminicate with the associated dataform, - such as connecting slots to inner widgets of setting items, add item prototypes. - And add prototypes to dataform. - */ - - -/*! - Constructor of CpItemDataHelper. - */ -CpItemDataHelper::CpItemDataHelper(HbDataForm *form/* = 0*/) -: d(new CpItemDataHelperPrivate(form)) -{ -} - - -/*! - Destructor of CpItemDataHelper. - */ -CpItemDataHelper::~CpItemDataHelper() -{ - delete d; -} - -/*! - Connect a slot to inner widget's signal of setting item. - */ -void CpItemDataHelper::addConnection(HbDataFormModelItem *item, - const char *signal, - QObject *receiver, - const char *method) -{ - d->addConnection(item,signal,receiver,method); -} - -/*! - Disconnect a slot to inner widget's signal of setting item. - */ -void CpItemDataHelper::removeConnection(HbDataFormModelItem *item, - const char *signal, - QObject *receiver, - const char *method) -{ - d->removeConnection(item,signal,receiver,method); -} - -/*! - Connect slot to data form. -*/ -void CpItemDataHelper::connectToForm(const char *signal, - QObject *receiver, - const char *method) -{ - d->connectToForm(signal,receiver,method); -} - -/*! - Disconnect slot from data form. -*/ -void CpItemDataHelper::disconnectFromForm(const char *signal, - QObject *receiver, - const char *method) -{ - d->disconnectFromForm(signal,receiver,method); -} - - -/*! - Add a prototype to data form, to create custom widget for a custom setting item. - */ -void CpItemDataHelper::addItemPrototype(HbAbstractViewItem *prototype) -{ - d->addItemPrototype(prototype); -} - -/*! - Bind the connections and prototypes to a data form. - */ -void CpItemDataHelper::bindToForm(HbDataForm *form) -{ - d->bindToForm(form); -} - - -/*! - Get the HbWidget instance from data form. -*/ -HbWidget *CpItemDataHelper::widgetFromModelIndex(const QModelIndex &index) -{ - return d->widgetFromModelIndex(index); -} - -/*! - Get the HbDataFormModelItem with a QModelIndex from associated data form's model. -*/ -HbDataFormModelItem *CpItemDataHelper::modelItemFromModelIndex(const QModelIndex &index) -{ - return d->modelItemFromModelIndex(index); -} - -//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cppluginlauncher.cpp --- a/controlpanel/src/cpframework/src/cppluginlauncher.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Launch controlpanel plugin setting view in client process. -* -*/ - -#include -#include -#include -#include -#include -#include -#include -#include "cpviewlauncher.h" - -/*! - \class CpPluginLauncher - \brief The CpPluginLauncher class loads a controlpanel plugin at run-time.And display the specify plugin view in client process. -*/ - -/*! - Load and display a plugin view in client process. The client must be a orbit based application. - The pluginFile can either absoulte file path or only file name. - Acceptable format: - sampleplugin - sampleplugin.qtplugin - sampleplugin.dll - C:/resource/qt/plugins/controlpanel/sampleplugin.qtplugin - C:/resource/qt/plugins/controlpanel/sampleplugin.dll -*/ -CpBaseSettingView* CpPluginLauncher::launchSettingView(const QString &pluginFile,const QVariant &hint /*= QVariant()*/) -{ - CpLauncherInterface *plugin = CpPluginLoader::loadCpLauncherInterface(pluginFile); - if (plugin) { - CpBaseSettingView *view = plugin->createSettingView(hint); - if (view) { - CpViewLauncher::launchView(view); - return view; - } - } - - return 0; -} - -//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cppluginloader.cpp --- a/controlpanel/src/cpframework/src/cppluginloader.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include -#include -#include -#include -#include -#include -#include -#include "cputility.h" -#include - - -/*! - \class CpPluginLoader - \brief The CpPluginLoader class loads a controlpanel plugin at run-time. - */ - -#ifdef WIN32 - #define PLUGINFILE_SUFFIX "dll" -#else - #define PLUGINFILE_SUFFIX "qtplugin" -#endif - -/* - * Load the root component object of the plugin from @pluginFile - * if @pluginFile is an absoulte file path, load it directly, if is a - * file name, load the root component from path /resource/qt/plugins/controlpanel -*/ -static QObject* loadPluginInterface(const QString &pluginFile) -{ - CPPERF_LOG( QLatin1String("Loading plugin: ") + pluginFile ); - - QFileInfo fileInfo(pluginFile); - - // scan the plugin file from path /resource/qt/plugins/controlpanel - if (!fileInfo.isAbsolute()) { - QString fileName = fileInfo.fileName(); - if (fileInfo.suffix().compare(PLUGINFILE_SUFFIX,Qt::CaseInsensitive)) { - fileName = fileInfo.baseName() + '.' + PLUGINFILE_SUFFIX; - } - - QStringList pluginDirs = CpUtility::pluginDirectories(); - foreach(const QString &pluginDir,pluginDirs) { - fileInfo.setFile(pluginDir + fileName); - // found a valid plugin file. - if (fileInfo.exists() && QLibrary::isLibrary(fileInfo.absoluteFilePath())) { - CPPERF_LOG( QLatin1String("Valid plugin stub found: ") + fileInfo.absoluteFilePath() ); - break; - } - } - } - - QPluginLoader loader(fileInfo.absoluteFilePath()); - QObject *plugin = loader.instance(); - if (!plugin) { - loader.unload(); - } - - CPPERF_LOG( QLatin1String("Load plugin ") + (plugin ? QLatin1String("succeed.") : QLatin1String("failed.")) ); - - return plugin; -} - -/*! - load a CpPluginInterface by a controlpanel plugin file. - the plugin file can either absoulte file path or only file name. - acceptable format: - sampleplugin - sampleplugin.qtplugin - sampleplugin.dll - C:/resource/qt/plugins/controlpanel/sampleplugin.qtplugin - C:/resource/qt/plugins/controlpanel/sampleplugin.dll - */ -CpPluginInterface *CpPluginLoader::loadCpPluginInterface(const QString &pluginFile) -{ - return qobject_cast(::loadPluginInterface(pluginFile)); -} - -/*! - load a CpLauncherInterface by a controlpanel plugin file. - the plugin file can either absoulte file path or only file name. - acceptable format: - sampleplugin - sampleplugin.qtplugin - sampleplugin.dll - C:/resource/qt/plugins/controlpanel/sampleplugin.qtplugin - C:/resource/qt/plugins/controlpanel/sampleplugin.dll - */ -CpLauncherInterface *CpPluginLoader::loadCpLauncherInterface(const QString &pluginFile) -{ - return qobject_cast(::loadPluginInterface(pluginFile)); -} - - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cppluginutility.cpp --- a/controlpanel/src/cpframework/src/cppluginutility.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Utility class for controlpanel plugins. -* -*/ - -#include "cppluginutility.h" -#include "cpdataformbuttonentryviewitem.h" -#include "cpdataformlistentryviewitem.h" - -#include - -/*! \class CpPluginUtility - \brief This class supply the utility functions for controlpanel plugins. - */ - -/*! - Add item prototypes which are supported by controlpanel framework to a setting form. - */ -void CpPluginUtility::addCpItemPrototype(HbDataForm *settingForm) -{ - if (settingForm) { - QListprototypeList = settingForm->itemPrototypes(); - prototypeList.append(new CpDataFormButtonEntryViewItem()); - prototypeList.append(new CpDataFormListEntryViewItem()); - settingForm->setItemPrototypes(prototypeList); - } -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cpsettingformentryitemdata.cpp --- a/controlpanel/src/cpframework/src/cpsettingformentryitemdata.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,224 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "cpsettingformentryitemdata.h" -#include "cpsettingformentryitemdata_p.h" -#include "cpviewlauncher.h" -#include - - -/*! - \class CpSettingFormEntryItemData - \brief The CpSettingFormEntryItemData can be used to control panel plugin which appears as a setting item. And after clicking - it, a new setting view will open. - */ - -/* - \fn CpSettingFormEntryItemData::createSettingView - - Create a new setting view. - - createSettingView will be called automatically when user click a setting item represented by a CpSettingFormEntryItemData. - - In most cases, you do not need to write a derived class from CpSettingFormEntryItemData, instead, you can simply use template class CpSettingFormEntryItemDataImpl. -*/ - - -/*! - Construct a new CpSettingFormEntryItemData with the given parent. -*/ -CpSettingFormEntryItemData::CpSettingFormEntryItemData(const HbDataFormModelItem *parent /* = 0*/) -: CpSettingFormItemData(parent), d_ptr(new CpSettingFormEntryItemDataPrivate()) -{ - d_ptr->init(this); -} - - -/*! - Construct a new CpSettingFormEntryItemData with the given text,description and parent. -*/ - -CpSettingFormEntryItemData::CpSettingFormEntryItemData(CpItemDataHelper &itemDataHelper, - const QString &text /* = QString()*/, - const QString &description /* = QString()*/, - const HbIcon &icon, - const HbDataFormModelItem *parent /*= 0*/) : - CpSettingFormItemData(HbDataFormModelItem::CustomItemBase,QString(),parent), - d_ptr(new CpSettingFormEntryItemDataPrivate(&itemDataHelper)) -{ - setType ( static_cast (CpSettingFormEntryItemData::ListEntryItem) ); - - d_ptr->init(this); - - setText(text); - setDescription(description); - setIcon(icon.iconName()); -} - -/*! - Construct a new CpSettingFormEntryItemData with the given text,description and parent. -*/ - -CpSettingFormEntryItemData::CpSettingFormEntryItemData(HbDataForm *dataForm, - const QString &text /*= QString()*/, - const QString &description /*= QString()*/, - const HbIcon &icon /*= HbIcon()*/, - const HbDataFormModelItem *parent/* = 0*/) : - CpSettingFormItemData(HbDataFormModelItem::CustomItemBase,QString(),parent), - d_ptr(new CpSettingFormEntryItemDataPrivate(dataForm)) -{ - setType ( static_cast (CpSettingFormEntryItemData::ListEntryItem) ); - - d_ptr->init(this); - - setText(text); - setDescription(description); - setIcon(icon.iconName()); -} - -/*! - Construct a new CpSettingFormEntryItemData with the given type, text, description, icon name, and parent. -*/ -CpSettingFormEntryItemData::CpSettingFormEntryItemData( - EntryItemType type, - CpItemDataHelper &itemDataHelper, - const QString &text /*= QString()*/, - const QString &description /*= QString()*/, - const QString &iconName /*= QString()*/, - const HbDataFormModelItem *parent /*= 0*/) : - CpSettingFormItemData(HbDataFormModelItem::CustomItemBase,QString(),parent), - d_ptr(new CpSettingFormEntryItemDataPrivate(&itemDataHelper)) -{ - setType ( static_cast (type) ); - - d_ptr->init(this); - - setText(text); - setDescription(description); - setIcon(iconName); -} - -/*! - Construct a new CpSettingFormEntryItemData with the given type, text, description, icon name, and parent. -*/ -CpSettingFormEntryItemData::CpSettingFormEntryItemData( - EntryItemType type, - HbDataForm *dataForm, - const QString &text /*= QString()*/, - const QString &description /*= QString()*/, - const QString &iconName /*= QString()*/, - const HbDataFormModelItem *parent /*= 0*/) : - CpSettingFormItemData(HbDataFormModelItem::CustomItemBase,QString(),parent), - d_ptr(new CpSettingFormEntryItemDataPrivate(dataForm)) -{ - setType ( static_cast (type) ); - - d_ptr->init(this); - - setText(text); - setDescription(description); - setIcon(iconName); -} - - -/*! - Destructor. -*/ -CpSettingFormEntryItemData::~CpSettingFormEntryItemData() -{ - delete d_ptr; -} - - -/*! - Get the text string of the entry item. -*/ -QString CpSettingFormEntryItemData::text() const -{ - return d_ptr->text(); -} - -/*! - Set the text string of the entry item. -*/ -void CpSettingFormEntryItemData::setText(const QString &text) -{ - d_ptr->setText(text); -} - -/*! - Get the description string of the entry item. -*/ -QString CpSettingFormEntryItemData::description() const -{ - return d_ptr->description(); -} - -/*! - Set the description string of the entry item. -*/ -void CpSettingFormEntryItemData::setDescription(const QString &description) -{ - d_ptr->setDescription(description); -} - -/*! - Get the icon name of the entry item. -*/ -QString CpSettingFormEntryItemData::iconName() const -{ - return d_ptr->iconName(); -} - -/*! - Set the icon name of the entry item. -*/ -void CpSettingFormEntryItemData::setIconName(const QString &icon) -{ - d_ptr->setIconName(icon); -} - -/*! - Return the icon of the entry item -*/ -HbIcon CpSettingFormEntryItemData::entryItemIcon()const -{ - return d_ptr->entryItemIcon(); -} - -/*! - Set the icon for the entry item -*/ -void CpSettingFormEntryItemData::setEntryItemIcon(const HbIcon& icon) -{ - d_ptr->setEntryItemIcon(icon); -} - -/*! - Launch the setting view when user clicks the entry item. -*/ -void CpSettingFormEntryItemData::onLaunchView() -{ - //avoid being launched more than one times - if (d_ptr->mSettingViewPtr.isNull()) { - d_ptr->mSettingViewPtr = createSettingView(); - if (!d_ptr->mSettingViewPtr.isNull()) { - CpViewLauncher::launchView(d_ptr->mSettingViewPtr.data()); - } - } -} - -//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cpsettingformentryitemdata_p.cpp --- a/controlpanel/src/cpframework/src/cpsettingformentryitemdata_p.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,236 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Private implementatin for class CpSettingFormEntryItemData. -* -*/ -#include "cpsettingformentryitemdata_p.h" -#include -#include -#include -#include -#include -#include -#include - -CpSettingFormEntryItemDataPrivate::CpSettingFormEntryItemDataPrivate() -: mDataForm(0), - mItemDataHelper(0), - mItemPressed(false) -{ - -} - -CpSettingFormEntryItemDataPrivate::CpSettingFormEntryItemDataPrivate(CpItemDataHelper *itemDataHelper) -: mDataForm(0), - mItemDataHelper(itemDataHelper), - mItemPressed(false) -{ - -} - -CpSettingFormEntryItemDataPrivate::CpSettingFormEntryItemDataPrivate(HbDataForm *dataForm) -: mDataForm(dataForm), - mItemDataHelper(0), - mItemPressed(false) -{ - -} - -void CpSettingFormEntryItemDataPrivate::init(CpSettingFormEntryItemData *parent) -{ - mParent = parent; - - HbDataFormModelItem::DataItemType itemType = mParent->type(); - switch (itemType) - { - default: break; - case CpSettingFormEntryItemData::ListEntryItem: - { - if (mItemDataHelper) { - mItemDataHelper->connectToForm(SIGNAL(pressed (QModelIndex)),mParent,SLOT(_q_itemPressed(QModelIndex))); - mItemDataHelper->connectToForm(SIGNAL(activated(QModelIndex)),mParent,SLOT(_q_itemActivated(QModelIndex))); - } - else if (mDataForm) { - QObject::connect( mDataForm,SIGNAL(pressed(QModelIndex)),mParent,SLOT(_q_itemPressed(QModelIndex)) ); - QObject::connect( mDataForm,SIGNAL(activated(QModelIndex)),mParent,SLOT(_q_itemActivated(QModelIndex)) ); - } - } - break; - case CpSettingFormEntryItemData::ButtonEntryItem: - { - if (mItemDataHelper) { - mItemDataHelper->addConnection(mParent,SIGNAL(clicked()),mParent,SLOT(onLaunchView())); - } - else if (mDataForm) { - mDataForm->addConnection(mParent,SIGNAL(clicked()),mParent,SLOT(onLaunchView())); - } - } - break; - } -} - -QString CpSettingFormEntryItemDataPrivate::text() const -{ - HbDataFormModelItem::DataItemType itemType = mParent->type(); - switch (itemType) - { - default: break; - case CpSettingFormEntryItemData::ListEntryItem: - return mParent->label(); - case CpSettingFormEntryItemData::ButtonEntryItem: - return mParent->contentWidgetData(QString("text")).toString(); - } - return QString(); -} - -void CpSettingFormEntryItemDataPrivate::setText(const QString &text) -{ - HbDataFormModelItem::DataItemType itemType = mParent->type(); - switch (itemType) - { - default: break; - case CpSettingFormEntryItemData::ListEntryItem: - mParent->setLabel(text); - break; - case CpSettingFormEntryItemData::ButtonEntryItem: - mParent->setContentWidgetData(QString("text"),QVariant(text)); - break; - } -} - -QString CpSettingFormEntryItemDataPrivate::description() const -{ - HbDataFormModelItem::DataItemType itemType = mParent->type(); - switch (itemType) - { - default: break; - case CpSettingFormEntryItemData::ListEntryItem: - return mParent->data(HbDataFormModelItem::DescriptionRole).toString(); - case CpSettingFormEntryItemData::ButtonEntryItem: - return mParent->contentWidgetData(QString("additionalText")).toString(); - } - return QString(); -} - -void CpSettingFormEntryItemDataPrivate::setDescription(const QString &description) -{ - HbDataFormModelItem::DataItemType itemType = mParent->type(); - switch (itemType) - { - default: break; - case CpSettingFormEntryItemData::ListEntryItem: - mParent->setData(HbDataFormModelItem::DescriptionRole , description); - // set a useless property for model item to emit a datachanged signal - // this is a workaround for informing the change event of description in list item - mParent->setContentWidgetData("Useless", true); - break; - case CpSettingFormEntryItemData::ButtonEntryItem: - mParent->setContentWidgetData(QString("additionalText"),QVariant(description)); - break; - } -} - -QString CpSettingFormEntryItemDataPrivate::iconName() const -{ - HbDataFormModelItem::DataItemType itemType = mParent->type(); - switch (itemType) - { - default: break; - case CpSettingFormEntryItemData::ListEntryItem: - return mParent->icon(); - case CpSettingFormEntryItemData::ButtonEntryItem: - return qvariant_cast(mParent->contentWidgetData(QString("icon"))).iconName(); - } - return QString(); -} - -void CpSettingFormEntryItemDataPrivate::setIconName(const QString &icon) -{ - HbDataFormModelItem::DataItemType itemType = mParent->type(); - switch (itemType) - { - default: break; - case CpSettingFormEntryItemData::ListEntryItem: - mParent->setIcon(icon); - break; - case CpSettingFormEntryItemData::ButtonEntryItem: - mParent->setContentWidgetData(QString("icon"),HbIcon(icon)); - break; - } -} - -HbIcon CpSettingFormEntryItemDataPrivate::entryItemIcon() const -{ - HbDataFormModelItem::DataItemType itemType = mParent->type(); - switch (itemType) - { - default: break; - case CpSettingFormEntryItemData::ListEntryItem: - return HbIcon(mParent->icon()); - case CpSettingFormEntryItemData::ButtonEntryItem: - return qvariant_cast(mParent->contentWidgetData(QString("icon"))); - } - return HbIcon(); -} - -void CpSettingFormEntryItemDataPrivate::setEntryItemIcon(const HbIcon &icon) -{ - HbDataFormModelItem::DataItemType itemType = mParent->type(); - switch (itemType) - { - default: break; - case CpSettingFormEntryItemData::ListEntryItem: - mParent->setIcon(icon.iconName()); - break; - case CpSettingFormEntryItemData::ButtonEntryItem: - mParent->setContentWidgetData(QString("icon"),icon); - break; - } -} - - -void CpSettingFormEntryItemDataPrivate::_q_itemPressed(const QModelIndex &index) -{ - mItemPressed = ( modelItemFromModelIndex(index) == mParent ); -} - - -void CpSettingFormEntryItemDataPrivate::_q_itemActivated(const QModelIndex &index) -{ - if (mItemPressed && modelItemFromModelIndex(index) == mParent) { - mParent->onLaunchView(); - } - mItemPressed = false; -} - - -HbDataFormModelItem *CpSettingFormEntryItemDataPrivate::modelItemFromModelIndex(const QModelIndex &index) -{ - if (mItemDataHelper) { - return mItemDataHelper->modelItemFromModelIndex(index); - } - else if (mDataForm){ - HbDataFormModel *dataFormModel = - qobject_cast(mDataForm->model()); - if (dataFormModel) { - return dataFormModel->itemFromIndex(index); - } - } - - return 0; -} - -#include "moc_cpsettingformentryitemdata.cpp" - -//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cpsettingformentryitemdata_p.h --- a/controlpanel/src/cpframework/src/cpsettingformentryitemdata_p.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Private implementatin for class CpSettingFormEntryItemData. -* -*/ - -#ifndef CPSETTINGFORMENTRYITEMDATA_P_H -#define CPSETTINGFORMENTRYITEMDATA_P_H - -#include -#include -#include -#include - -class CpSettingFormEntryItemData; -class CpItemDataHelper; -class HbDataForm; -class HbDataFormModelItem; -class QModelIndex; - -class CpSettingFormEntryItemDataPrivate -{ -public: - CpSettingFormEntryItemDataPrivate(); - explicit CpSettingFormEntryItemDataPrivate(CpItemDataHelper *itemDataHelper); - explicit CpSettingFormEntryItemDataPrivate(HbDataForm *dataForm); - - void init(CpSettingFormEntryItemData *parent); - - QString text() const; - void setText(const QString &text); - - QString description() const; - void setDescription(const QString &description); - - QString iconName() const; - void setIconName(const QString &icon); - - HbIcon entryItemIcon() const; - void setEntryItemIcon(const HbIcon &icon); - - //private slots implementation - void _q_itemPressed(const QModelIndex &index); - void _q_itemActivated(const QModelIndex &index); - - HbDataFormModelItem *modelItemFromModelIndex(const QModelIndex &index); - - CpSettingFormEntryItemData *mParent; - HbDataForm *mDataForm; - CpItemDataHelper *mItemDataHelper; - QPointer mSettingViewPtr; - bool mItemPressed; -}; - - -#endif //CPSETTINGFORMENTRYITEMDATA_P_H - -//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cpsettingformitemdata.cpp --- a/controlpanel/src/cpframework/src/cpsettingformitemdata.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This class is a control panel defined HbDataFormModelItem -* -*/ -#include "cpsettingformitemdata.h" - -/*! - \class CpSettingFormItemData - \brief The CpSettingFormItemData is a extension to HbSettingItemData. - With this class, user can monitor the value change event by connecting a slot to valueChanged slot. - */ - -/*! - Construct a new CpSettingFormItemData with the given type,label and parent. -*/ -CpSettingFormItemData::CpSettingFormItemData( - HbDataFormModelItem::DataItemType type, - const QString &label, - const HbDataFormModelItem *parent /*= 0*/) : - QObject(), - HbDataFormModelItem(type,label,parent) - -{ -} - -/*! - Construct a new CpSettingFormItemData with the given parent. -*/ -CpSettingFormItemData::CpSettingFormItemData(const HbDataFormModelItem *parent /*= 0*/) : - QObject(), - HbDataFormModelItem(parent) -{ -} - -/*! - Destructor. -*/ -CpSettingFormItemData::~CpSettingFormItemData() -{ -} - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cputility.cpp --- a/controlpanel/src/cpframework/src/cputility.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Utility class for cpframework. -* -*/ -#include "cputility.h" -#include -#include -#include -#include -#include -#include -#include - - -QStringList CpUtility::drives() -{ - static QStringList drives; - - if (drives.empty()) { - CPFW_LOG("device drives:"); -#ifdef WIN32 - drives.append("C:"); - CPFW_LOG("C:"); -#else - QFileInfoList fileInfoList = QDir::drives(); - foreach(const QFileInfo &fileInfo,fileInfoList) { - QString str = fileInfo.filePath(); - if (str.length() > 2) { - str = str.left(2); - } - drives.append(str); - CPFW_LOG(str); - } -#endif - } - - return drives; -} - -static QStringList directoriesFromAllDrives(const QString &baseDir) -{ - QStringList dirs; - - QStringList drives = CpUtility::drives(); - foreach(const QString &drive,drives) { - QString dir = drive + baseDir + QDir::separator(); - if (QFileInfo(dir).exists()) { - dirs.append(dir); - CPFW_LOG(dir); - } - } - - return dirs; -} - -QStringList CpUtility::pluginDirectories() -{ - static QStringList dirs; - if (dirs.empty()) { - CPFW_LOG("ControlPanel plugin derectories:") - dirs = directoriesFromAllDrives(CP_PLUGIN_PATH); - } - return dirs; -} - -QStringList CpUtility::configFileDirectories() -{ - static QStringList dirs; - if (dirs.empty()) { - CPFW_LOG("ControlPanel configuration file derectories:"); - dirs = directoriesFromAllDrives(CP_PLUGIN_CONFIG_PATH); - } - return dirs; -} - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cputility.h --- a/controlpanel/src/cpframework/src/cputility.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Utility class for cpframework. -* -*/ -#ifndef CP_UTILITY_H -#define CP_UTILITY_H - -#include - -class HbDataFormModelItem; -class CpItemDataHelper; - -class CpUtility -{ -public: - /* - get all physical drives of the devices - */ - static QStringList drives(); - - /* - get all controlpanel plugin directories of the device - */ - static QStringList pluginDirectories(); - - /* - get all config directories of the device - */ - static QStringList configFileDirectories(); - -}; - -#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cpviewlauncher.cpp --- a/controlpanel/src/cpframework/src/cpviewlauncher.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This class adds a setting view to main window, and restore previous view when back key clicked. -* -*/ - -#include "cpviewlauncher.h" -#include -#include -#include -#include - -static HbMainWindow *mainWindow() -{ - QList< HbMainWindow* > mainWindows = hbInstance->allMainWindows(); - if (!mainWindows.isEmpty()) { - return mainWindows.front(); - } - return 0; -} - -void CpViewLauncher::launchView(HbView *view) -{ - if (view) { - CpViewLauncher *launcher = new CpViewLauncher(); - launcher->internalLaunchView(view); - } -} - -CpViewLauncher::CpViewLauncher() : - mView(0), - mPreView(0) -{ -} - -CpViewLauncher::~CpViewLauncher() -{ -} - -void CpViewLauncher::internalLaunchView(HbView *view) -{ - //Q_ASSERT(view); should not use - - HbMainWindow *mainWnd = ::mainWindow(); - - if (mainWnd && view) - { - mView = view; - - mPreView = mainWnd->currentView(); - - if (mPreView) { - QObject::connect(mView, SIGNAL(aboutToClose()), this, SLOT(viewDone())); - } - else { - QObject::connect(mView, SIGNAL(aboutToClose()), qApp, SLOT(quit())); - } - - - // activates the plugin view - mainWnd->addView(mView); - mainWnd->setCurrentView(mView); - } -} - -void CpViewLauncher::viewDone() -{ - HbMainWindow *mainWnd = ::mainWindow(); - - if (mainWnd) { - if (mView) { - //restore previous status - mainWnd->removeView(mView); - - mView->deleteLater(); - mView = 0; - - mainWnd->setCurrentView(mPreView); - } - } - - deleteLater(); -} - -//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cpviewlauncher.h --- a/controlpanel/src/cpframework/src/cpviewlauncher.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This class adds a setting view to main window, and restore previous view when back key clicked. -* -*/ - -#ifndef CPVIEWLAUNCHER_H -#define CPVIEWLAUNCHER_H - -#include - -class HbView; -class CpViewLauncher : public QObject -{ - Q_OBJECT -public: - static void launchView(HbView *view); -private slots: - void viewDone(); -private: - Q_DISABLE_COPY(CpViewLauncher) - CpViewLauncher(); - ~CpViewLauncher(); - void internalLaunchView(HbView *view); -private: - HbView *mView; - HbView *mPreView; -}; - -#endif /* CPVIEWLAUNCHER_H */ diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cpwatchdog.cpp --- a/controlpanel/src/cpframework/src/cpwatchdog.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,286 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "cpwatchdog.h" -#include -#include -#include -#include "cplogger.h" - -//const value definition -const int DefaultMaxPluginBlackListedRuns = 5; -const int DefaultWatchdogActivationLimit = 1; -const int WatchdogActivationDisabled = -1; - -//Key definition for QSettings -const QString KeyWatchDogStatus = "WatchDog"; -const QString KeyWatchDogCpRunning = "cprunning"; -const QString KeyWatchDogCrashCounter = "crashcounter"; -const QString KeyWatchDogMaxPluginBlackListedRuns = "maxpluginblacklistedruns"; -const QString KeyWatchDogActivationLimit = "activationlimit"; -const QString KeyWatchDogQuarantine = "Quarantine"; -const QString KeyWatchDogQuarantineUid = "uid"; -const QString KeyWatchDogBlackList = "BlackList"; -const QString KeyWatchDogBlackListUid = "uid"; -const QString KeyWatchDogBlackListRunsAfterCrash = "runsaftercrash"; - -CpWatchDog *CpWatchDog::self = 0; - -CpWatchDog::PluginQuarantine::PluginQuarantine() -: mUid(0), mRunsAfterCrash(0) -{ -} - -void CpWatchDog::PluginQuarantine::read(QSettings &settings) -{ - mUid = settings.value(KeyWatchDogBlackListUid,0).toInt(); - mRunsAfterCrash = settings.value(KeyWatchDogBlackListRunsAfterCrash,0).toInt(); -} - -void CpWatchDog::PluginQuarantine::store(QSettings &settings) -{ - settings.setValue(KeyWatchDogBlackListUid,mUid); - settings.setValue(KeyWatchDogBlackListRunsAfterCrash,mRunsAfterCrash); -} - -CpWatchDog *CpWatchDog::instance() -{ - if (!self) { - self = new CpWatchDog; - } - return self; -} - -CpWatchDog::CpWatchDog() - : mActive(true), - mCrashCounter(0), - mAppRunning(true), - mMaxPluginBlackListedRuns(DefaultMaxPluginBlackListedRuns), - mWatchdogActivationLimit(DefaultWatchdogActivationLimit) -{ - //delete watch dog when application is about to quit. - connect(qApp,SIGNAL(aboutToQuit()),this,SLOT(destroy())); - init(); -} - -CpWatchDog::~CpWatchDog() -{ - reportCleanExit(); - updateBlackListedPluginRunCounters(); - storeState(); -} - -void CpWatchDog::destroy() -{ - delete this; - self = 0; -} - -void CpWatchDog::quarantine(int uid) -{ - if (isActive()) { - mQuarantine.append(uid); - storeQuarantine(); - } -} -void CpWatchDog::removeFromQuarantine(int uid) -{ - if (isActive()) { - int index = mQuarantine.indexOf(uid); - if (index >= 0) { - mQuarantine.remove(index); - storeQuarantine(); - } - } -} - -bool CpWatchDog::isActive() const -{ - return mActive; -} - -bool CpWatchDog::wasCleanExit() const -{ - return !mAppRunning; -} - -void CpWatchDog::reportCleanExit() -{ - mAppRunning = false; - - QSettings settings; - settings.beginGroup(KeyWatchDogStatus); - settings.setValue(KeyWatchDogCpRunning,mAppRunning); - settings.endGroup(); -} - -bool CpWatchDog::isInBlackList(int uid) -{ - bool found = false; - if (isActive()) { - foreach(const PluginQuarantine &quarantine,mBlackList) { - if (quarantine.mUid == uid) { - found = true; - break; - } - } - } - - if (found) { - CPFW_LOG( QLatin1String("Plugin ") + QString("0x%1").arg(uid,0,16) + QLatin1String(" is in black list.")); - } - - return found; -} - -void CpWatchDog::init() -{ - readState(); - - if (!wasCleanExit() - && mWatchdogActivationLimit != WatchdogActivationDisabled) { - mCrashCounter++; - mActive = true; - - for (int i(0); i < mQuarantine.size(); i++) { - if (!isInBlackList(mQuarantine[i])) { - PluginQuarantine quarantine; - quarantine.mUid = mQuarantine[i]; - quarantine.mRunsAfterCrash = 0; - mBlackList.append(quarantine); - mQuarantine.remove(i); - i--; - } - } - } - else { - mActive = false; - mCrashCounter = 0; - mQuarantine.clear(); - } - - mAppRunning = true; - storeState(); -} - -void CpWatchDog::readState() -{ - QSettings settings; - settings.beginGroup(KeyWatchDogStatus); - int appRunning = settings.value(KeyWatchDogCpRunning,0).toInt(); - mAppRunning = (appRunning != 0); - mCrashCounter = settings.value(KeyWatchDogCrashCounter,0).toInt(); - mMaxPluginBlackListedRuns = settings.value( - KeyWatchDogMaxPluginBlackListedRuns,DefaultMaxPluginBlackListedRuns).toInt(); - mWatchdogActivationLimit = settings.value( - KeyWatchDogActivationLimit,DefaultWatchdogActivationLimit).toInt(); - settings.endGroup(); - - readQuarantine(); - readBlackList(); -} - -void CpWatchDog::storeState() -{ - { - QSettings settings; - settings.beginGroup(KeyWatchDogStatus); - settings.setValue(KeyWatchDogCpRunning, mAppRunning ? 1 : 0); - settings.setValue(KeyWatchDogCrashCounter,mCrashCounter); - settings.setValue(KeyWatchDogMaxPluginBlackListedRuns,mMaxPluginBlackListedRuns); - settings.setValue(KeyWatchDogActivationLimit,mWatchdogActivationLimit); - settings.endGroup(); - } //Destructor of QSettings: writes any unsaved changes to permanent storage - - storeQuarantine(); - storeBlackList(); -} - -void CpWatchDog::readQuarantine() -{ - QSettings settings; - int size = settings.beginReadArray(KeyWatchDogQuarantine); - for (int i(0); i < size; i++) { - settings.setArrayIndex(i); - int uid = settings.value(KeyWatchDogQuarantineUid,0).toInt(); - if (uid != 0) { - mQuarantine.append(uid); - } - } - settings.endArray(); -} - -void CpWatchDog::storeQuarantine() -{ - QSettings settings; - - //remove old array data before updating - settings.beginGroup(KeyWatchDogQuarantine); - settings.remove(QString()); - settings.endGroup(); - - settings.beginWriteArray(KeyWatchDogQuarantine); - int size = mQuarantine.size(); - for (int i(0); i < size; i++) { - settings.setArrayIndex(i); - settings.setValue(KeyWatchDogQuarantineUid,mQuarantine[i]); - } - settings.endArray(); -} - -void CpWatchDog::readBlackList() -{ - QSettings settings; - int size = settings.beginReadArray(KeyWatchDogBlackList); - for (int i(0); i < size; i++) { - settings.setArrayIndex(i); - PluginQuarantine quarantine; - quarantine.read(settings); - if (quarantine.mUid != 0) { - mBlackList.append(quarantine); - } - } - settings.endArray(); -} - -void CpWatchDog::storeBlackList() -{ - QSettings settings; - - //remove old array data before updating - settings.beginGroup(KeyWatchDogBlackList); - settings.remove(QString()); - settings.endGroup(); - - settings.beginWriteArray(KeyWatchDogBlackList); - int size = mBlackList.size(); - for (int i(0); i < size; i++) { - settings.setArrayIndex(i); - mBlackList[i].store(settings); - } - settings.endArray(); -} - -void CpWatchDog::updateBlackListedPluginRunCounters() -{ - for (int i(0); i < mBlackList.size(); i++) { - mBlackList[i].mRunsAfterCrash++; - if (mBlackList[i].mRunsAfterCrash > mMaxPluginBlackListedRuns) { - mBlackList.remove(i); - i--; - } - } -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/cpframework/src/cpwatchdog.h --- a/controlpanel/src/cpframework/src/cpwatchdog.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef CPWATCHDOG_H -#define CPWATCHDOG_H - -#include -#include - -#define gWatchDog CpWatchDog::instance() - -#define BEGIN_WATCHDOG_QUARANTINE(PLUGINID) \ - gWatchDog->quarantine(PLUGINID); - -#define END_WATCHDOG_QUARANTINE(PLUGINID) \ - gWatchDog->removeFromQuarantine(PLUGINID); - -class QSettings; -class CpWatchDog : public QObject -{ - Q_OBJECT -public: - static CpWatchDog *instance(); - void quarantine(int uid); - void removeFromQuarantine(int uid); - bool isActive() const; - bool wasCleanExit() const; - void reportCleanExit(); - bool isInBlackList(int uid); -private: - void init(); - void readState(); - void storeState(); - void readQuarantine(); - void storeQuarantine(); - void readBlackList(); - void storeBlackList(); - void updateBlackListedPluginRunCounters(); -public slots: - void destroy(); -private: - Q_DISABLE_COPY(CpWatchDog) - CpWatchDog(); - virtual ~CpWatchDog(); -private: - struct PluginQuarantine - { - PluginQuarantine(); - void read(QSettings &settings); - void store(QSettings &settings); - int mUid; - int mRunsAfterCrash; - }; -private: - bool mActive; - int mCrashCounter; - bool mAppRunning; - int mMaxPluginBlackListedRuns; - int mWatchdogActivationLimit; - QVector mBlackList; - QVector mQuarantine; - static CpWatchDog *self; -}; - -#endif /* CPWATCHDOG_H */ diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/logger/bwins/cploggeru.def --- a/controlpanel/src/logger/bwins/cploggeru.def Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -EXPORTS - ?setLogDateTime@Logger@@QAEX_N@Z @ 1 NONAME ; void Logger::setLogDateTime(bool) - ?tr@Logger@@SA?AVQString@@PBD0@Z @ 2 NONAME ; class QString Logger::tr(char const *, char const *) - ?configure@Logger@@QAEXABVQString@@W4Format@QSettings@@@Z @ 3 NONAME ; void Logger::configure(class QString const &, enum QSettings::Format) - ?addLogOutput@Logger@@QAE_NPAVLogOutput@@@Z @ 4 NONAME ; bool Logger::addLogOutput(class LogOutput *) - ?getStaticMetaObject@Logger@@SAABUQMetaObject@@XZ @ 5 NONAME ; struct QMetaObject const & Logger::getStaticMetaObject(void) - ?setDateTimeFormat@Logger@@QAEXABVQString@@@Z @ 6 NONAME ; void Logger::setDateTimeFormat(class QString const &) - ?metaObject@LogOutput@@UBEPBUQMetaObject@@XZ @ 7 NONAME ; struct QMetaObject const * LogOutput::metaObject(void) const - ?trUtf8@LogOutput@@SA?AVQString@@PBD0@Z @ 8 NONAME ; class QString LogOutput::trUtf8(char const *, char const *) - ??1Logger@@UAE@XZ @ 9 NONAME ; Logger::~Logger(void) - ?logDateTime@Logger@@QBE_NXZ @ 10 NONAME ; bool Logger::logDateTime(void) const - ?log@Logger@@QAEXABVQString@@@Z @ 11 NONAME ; void Logger::log(class QString const &) - ?setLogLoggerName@Logger@@QAEX_N@Z @ 12 NONAME ; void Logger::setLogLoggerName(bool) - ??1LogOutput@@UAE@XZ @ 13 NONAME ; LogOutput::~LogOutput(void) - ?qt_metacall@Logger@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 14 NONAME ; int Logger::qt_metacall(enum QMetaObject::Call, int, void * *) - ??_ELogger@@UAE@I@Z @ 15 NONAME ; Logger::~Logger(unsigned int) - ?closeAll@Logger@@SAXXZ @ 16 NONAME ; void Logger::closeAll(void) - ?tr@LogOutput@@SA?AVQString@@PBD0@Z @ 17 NONAME ; class QString LogOutput::tr(char const *, char const *) - ?setName@LogOutput@@QAEXABVQString@@@Z @ 18 NONAME ; void LogOutput::setName(class QString const &) - ?trUtf8@LogOutput@@SA?AVQString@@PBD0H@Z @ 19 NONAME ; class QString LogOutput::trUtf8(char const *, char const *, int) - ?removeLogOutput@Logger@@QAEXPAVLogOutput@@@Z @ 20 NONAME ; void Logger::removeLogOutput(class LogOutput *) - ?metaObject@Logger@@UBEPBUQMetaObject@@XZ @ 21 NONAME ; struct QMetaObject const * Logger::metaObject(void) const - ?name@Logger@@QBE?AVQString@@XZ @ 22 NONAME ; class QString Logger::name(void) const - ??0Logger@@AAE@ABVQString@@PAVQObject@@@Z @ 23 NONAME ; Logger::Logger(class QString const &, class QObject *) - ?staticMetaObject@Logger@@2UQMetaObject@@B @ 24 NONAME ; struct QMetaObject const Logger::staticMetaObject - ?load@LogOutput@@QAE_NAAVQSettings@@@Z @ 25 NONAME ; bool LogOutput::load(class QSettings &) - ?dateTimeFormat@Logger@@QBE?AVQString@@XZ @ 26 NONAME ; class QString Logger::dateTimeFormat(void) const - ??0LogOutput@@IAE@PAVLogger@@@Z @ 27 NONAME ; LogOutput::LogOutput(class Logger *) - ?staticMetaObject@LogOutput@@2UQMetaObject@@B @ 28 NONAME ; struct QMetaObject const LogOutput::staticMetaObject - ?clearAllLogOutput@Logger@@QAEXXZ @ 29 NONAME ; void Logger::clearAllLogOutput(void) - ??_ELogOutput@@UAE@I@Z @ 30 NONAME ; LogOutput::~LogOutput(unsigned int) - ?logOutput@Logger@@QAEPAVLogOutput@@ABVQString@@@Z @ 31 NONAME ; class LogOutput * Logger::logOutput(class QString const &) - ?close@Logger@@SAXABVQString@@@Z @ 32 NONAME ; void Logger::close(class QString const &) - ?name@LogOutput@@QBE?AVQString@@XZ @ 33 NONAME ; class QString LogOutput::name(void) const - ?qt_metacast@LogOutput@@UAEPAXPBD@Z @ 34 NONAME ; void * LogOutput::qt_metacast(char const *) - ?logLoggerName@Logger@@QBE_NXZ @ 35 NONAME ; bool Logger::logLoggerName(void) const - ?qt_metacall@LogOutput@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 36 NONAME ; int LogOutput::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacast@Logger@@UAEPAXPBD@Z @ 37 NONAME ; void * Logger::qt_metacast(char const *) - ?getStaticMetaObject@LogOutput@@SAABUQMetaObject@@XZ @ 38 NONAME ; struct QMetaObject const & LogOutput::getStaticMetaObject(void) - ?setParentLogger@LogOutput@@QAEXPAVLogger@@@Z @ 39 NONAME ; void LogOutput::setParentLogger(class Logger *) - ?createLogOutput@LogOutputFactory@@SAPAVLogOutput@@ABVQString@@@Z @ 40 NONAME ; class LogOutput * LogOutputFactory::createLogOutput(class QString const &) - ?createLogOutput@LogOutputFactory@@SAPAVLogOutput@@ABVQString@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 41 NONAME ; class LogOutput * LogOutputFactory::createLogOutput(class QString const &, class QHash const &) - ?parentLogger@LogOutput@@QAEPAVLogger@@XZ @ 42 NONAME ; class Logger * LogOutput::parentLogger(void) - ?tr@Logger@@SA?AVQString@@PBD0H@Z @ 43 NONAME ; class QString Logger::tr(char const *, char const *, int) - ?addCreateLogOutputEntry@LogOutputFactory@@SAXABVQString@@P6APAVLogOutput@@XZ@Z @ 44 NONAME ; void LogOutputFactory::addCreateLogOutputEntry(class QString const &, class LogOutput * (*)(void)) - ?configure@Logger@@QAEXAAVQSettings@@@Z @ 45 NONAME ; void Logger::configure(class QSettings &) - ?instance@Logger@@SAPAV1@ABVQString@@@Z @ 46 NONAME ; class Logger * Logger::instance(class QString const &) - ?tr@LogOutput@@SA?AVQString@@PBD0H@Z @ 47 NONAME ; class QString LogOutput::tr(char const *, char const *, int) - ?trUtf8@Logger@@SA?AVQString@@PBD0H@Z @ 48 NONAME ; class QString Logger::trUtf8(char const *, char const *, int) - ?trUtf8@Logger@@SA?AVQString@@PBD0@Z @ 49 NONAME ; class QString Logger::trUtf8(char const *, char const *) - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/logger/eabi/cploggeru.def --- a/controlpanel/src/logger/eabi/cploggeru.def Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -EXPORTS - _ZN16LogOutputFactory15createLogOutputERK7QString @ 1 NONAME - _ZN16LogOutputFactory15createLogOutputERK7QStringRK5QHashIS0_8QVariantE @ 2 NONAME - _ZN16LogOutputFactory23addCreateLogOutputEntryERK7QStringPFP9LogOutputvE @ 3 NONAME - _ZN6Logger11qt_metacallEN11QMetaObject4CallEiPPv @ 4 NONAME - _ZN6Logger11qt_metacastEPKc @ 5 NONAME - _ZN6Logger12addLogOutputEP9LogOutput @ 6 NONAME - _ZN6Logger14setLogDateTimeEb @ 7 NONAME - _ZN6Logger15removeLogOutputEP9LogOutput @ 8 NONAME - _ZN6Logger16setLogLoggerNameEb @ 9 NONAME - _ZN6Logger16staticMetaObjectE @ 10 NONAME DATA 16 - _ZN6Logger17clearAllLogOutputEv @ 11 NONAME - _ZN6Logger17setDateTimeFormatERK7QString @ 12 NONAME - _ZN6Logger19getStaticMetaObjectEv @ 13 NONAME - _ZN6Logger3logERK7QString @ 14 NONAME - _ZN6Logger5closeERK7QString @ 15 NONAME - _ZN6Logger8closeAllEv @ 16 NONAME - _ZN6Logger8instanceERK7QString @ 17 NONAME - _ZN6Logger9configureER9QSettings @ 18 NONAME - _ZN6Logger9configureERK7QStringN9QSettings6FormatE @ 19 NONAME - _ZN6Logger9logOutputERK7QString @ 20 NONAME - _ZN6LoggerC1ERK7QStringP7QObject @ 21 NONAME - _ZN6LoggerC2ERK7QStringP7QObject @ 22 NONAME - _ZN6LoggerD0Ev @ 23 NONAME - _ZN6LoggerD1Ev @ 24 NONAME - _ZN6LoggerD2Ev @ 25 NONAME - _ZN9LogOutput11qt_metacallEN11QMetaObject4CallEiPPv @ 26 NONAME - _ZN9LogOutput11qt_metacastEPKc @ 27 NONAME - _ZN9LogOutput12parentLoggerEv @ 28 NONAME - _ZN9LogOutput15setParentLoggerEP6Logger @ 29 NONAME - _ZN9LogOutput16staticMetaObjectE @ 30 NONAME DATA 16 - _ZN9LogOutput19getStaticMetaObjectEv @ 31 NONAME - _ZN9LogOutput4loadER9QSettings @ 32 NONAME - _ZN9LogOutput7setNameERK7QString @ 33 NONAME - _ZN9LogOutputC2EP6Logger @ 34 NONAME - _ZN9LogOutputD0Ev @ 35 NONAME - _ZN9LogOutputD1Ev @ 36 NONAME - _ZN9LogOutputD2Ev @ 37 NONAME - _ZNK6Logger10metaObjectEv @ 38 NONAME - _ZNK6Logger11logDateTimeEv @ 39 NONAME - _ZNK6Logger13logLoggerNameEv @ 40 NONAME - _ZNK6Logger14dateTimeFormatEv @ 41 NONAME - _ZNK6Logger4nameEv @ 42 NONAME - _ZNK9LogOutput10metaObjectEv @ 43 NONAME - _ZNK9LogOutput4nameEv @ 44 NONAME - _ZTI6Logger @ 45 NONAME - _ZTI9LogOutput @ 46 NONAME - _ZTV6Logger @ 47 NONAME - _ZTV9LogOutput @ 48 NONAME - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/logger/logger.pri --- a/controlpanel/src/logger/logger.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: controlpanel project - common qmake settings -# - -HEADERS += $$PWD/src/*.h -SOURCES += $$PWD/src/*.cpp diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/logger/logger.pro --- a/controlpanel/src/logger/logger.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -# -# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = lib -TARGET = cplogger - -include ( ../common.pri ) -include ( logger.pri) -include ( ../../controlpanel_plat/inc/logger_plat.pri ) - -symbian: { - TARGET.UID3 = 0x20028734 -} - -DEFINES += BUILD_LOGGER_DLL - -include ( logger_export.pri ) - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/logger/logger_export.pri --- a/controlpanel/src/logger/logger_export.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: controlpanel project - common qmake settings -# - -symbian: { - # export headers to mw - EXPORT_PLATFORM_CPLOGGER_HEADERS += \ - ../../controlpanel_plat/inc/logger.h \ - ../../controlpanel_plat/inc/logoutput.h \ - ../../controlpanel_plat/inc/loggerglobal.h \ - ../../controlpanel_plat/inc/logoutputfactory.h \ - ../../controlpanel_plat/inc/cplogger.h - - loggers.sources = $$EXPORT_PLATFORM_CPLOGGER_HEADERS - for(logger, loggers.sources):BLD_INF_RULES.prj_exports += "./$$logger $$MW_LAYER_PLATFORM_EXPORT_PATH(cplogger/$$basename(logger))" -} \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/logger/src/logger.cpp --- a/controlpanel/src/logger/src/logger.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,255 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This class provide log functionality. -* -*/ -#include -#include "logoutput.h" -#include "logoutputimpl.h" -#include -#include -#include -#include -#include -#include -#include -#include "loglogger.h" -#include "logoutputfactory.h" - -typedef QHash LoggerContainer; - -Q_GLOBAL_STATIC(LoggerContainer,theLoggerList) - -class InitLogLogger -{ -public: - InitLogLogger() { - LogOutput *output = new DebugLogOutput(); - output->init(); - Logger::instance(LOGLOGGER_NAME)->addLogOutput(output); - } -} dummy_instance; - -class LoggerPrivate -{ -public: - LoggerPrivate(const QString &name = QString()) - : mName(name), - mDateTimeFormat("hh:mm:ss:zzz"), - mLogDateTime(true), - mLogLoggerName(true) - { - } - - ~LoggerPrivate() - { - clearAllLogOutput(); - } - - void clearAllLogOutput() - { - qDeleteAll(mLogOutputs.begin(),mLogOutputs.end()); - mLogOutputs.clear(); - } - - QString mName; - QString mDateTimeFormat; - QList mLogOutputs; - bool mLogDateTime; - bool mLogLoggerName; -}; - -Logger *Logger::instance(const QString &name) -{ - if (name.isEmpty()) { - LOGGER_LOG("Logger::instance() >> name is empty."); - return 0; - } - - QString nameLower(name); - nameLower.toLower(); - - Logger *logger = theLoggerList()->value(nameLower); - if (!logger) { - logger = new Logger(nameLower); - theLoggerList()->insert(nameLower,logger); - } - - return logger; -} - -void Logger::closeAll() -{ - qDeleteAll(theLoggerList()->begin(),theLoggerList()->end()); - theLoggerList()->clear(); -} - -void Logger::close(const QString &name) -{ - QString nameLower(name); - nameLower.toLower(); - delete theLoggerList()->take(nameLower); -} - -Logger::Logger(const QString &name /*= QString()*/,QObject *parent /*= 0*/) : QObject(parent), - d_ptr(new LoggerPrivate(name)) -{ - -} - -Logger::~Logger() -{ - delete d_ptr; -} - -void Logger::log(const QString &log) -{ - if (d_ptr->mLogOutputs.isEmpty()) { - return; - } - - QString logStr; - - if (d_ptr->mLogDateTime) { - logStr += QDateTime::currentDateTime().toString(d_ptr->mDateTimeFormat) + ' '; - } - - if (d_ptr->mLogLoggerName) { - logStr += '['; - logStr += name(); - logStr += "]:"; - } - - logStr += log; - logStr += LINE_SEPERATOR; - - foreach(LogOutput *logOutput, d_ptr->mLogOutputs) { - logOutput->output(logStr); - } -} - -void Logger::configure(const QString &configFile,QSettings::Format format /*= QSettings::NativeFormat*/) -{ - if (QFileInfo(configFile).exists()) { - QSettings settings(configFile,format); - configure(settings); - } -} - -void Logger::configure(QSettings &settings) -{ - clearAllLogOutput(); - - settings.beginGroup(name()); - QString strOutput = settings.value(LOGGER_OUTPUT).toString(); - d_ptr->mLogDateTime = settings.value(LOGGER_LOGDATETIME,true).toBool(); - d_ptr->mLogLoggerName = settings.value(LOGGER_LOGLOGGERNAME,true).toBool(); - QString strDateTimeFormat = settings.value(LOGGER_DATETIMEFORMAT).toString(); - if (!strDateTimeFormat.isEmpty()) { - d_ptr->mDateTimeFormat = strDateTimeFormat; - } - settings.endGroup(); - - QStringList outputNameList = strOutput.split(' ',QString::SkipEmptyParts); - foreach(const QString &outputName,outputNameList) { - LogOutput *output = LogOutputFactory::createLogOutput(outputName); - if (output) { - output->setParentLogger(this); - if (output->load(settings)) { - addLogOutput(output); - } - else { - delete output; - } - } - } -} - -bool Logger::addLogOutput(LogOutput *output) -{ - if (!output) { - LOGGER_LOG("Logger::addLogOutput >> output is NULL."); - return false; - } - - if ( d_ptr->mLogOutputs.indexOf(output) >= 0) { - LOGGER_LOG("Logger::addLogOutput >> output is already in list."); - return false; - } - - if (logOutput(output->name())) { - LOGGER_LOG( QString("Logger::addLogOutput >> output with the name <") + output->name() + "> is already in list."); - } - - output->setParentLogger(this); - d_ptr->mLogOutputs.append(output); - - return true; -} - -void Logger::removeLogOutput(LogOutput *output) -{ - d_ptr->mLogOutputs.removeAll(output); -} - -LogOutput *Logger::logOutput(const QString &name) -{ - foreach(LogOutput *output,d_ptr->mLogOutputs) { - if (output->name().compare(name,Qt::CaseInsensitive) == 0) { - return output; - } - } - - return 0; -} - -void Logger::clearAllLogOutput() -{ - d_ptr->clearAllLogOutput(); -} - -QString Logger::name() const -{ - return d_ptr->mName; -} - -bool Logger::logDateTime() const -{ - return d_ptr->mLogDateTime; -} - -void Logger::setLogDateTime(bool on) -{ - d_ptr->mLogDateTime = on; -} - -bool Logger::logLoggerName() const -{ - return d_ptr->mLogLoggerName; -} - -void Logger::setLogLoggerName(bool on) -{ - d_ptr->mLogLoggerName = on; -} - -QString Logger::dateTimeFormat() const -{ - return d_ptr->mDateTimeFormat; -} - -void Logger::setDateTimeFormat(const QString &format) -{ - d_ptr->mDateTimeFormat = format; -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/logger/src/loglogger.h --- a/controlpanel/src/logger/src/loglogger.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef LOGLOGGER_H -#define LOGLOGGER_H - -#include "logger.h" - -#define LOGLOGGER_NAME QLatin1String("##loglogger##") - -#ifdef _DEBUG - #define LOGGER_LOG(str) Logger::instance(LOGLOGGER_NAME)->log(str); -#else - #define LOGGER_LOG(str) -#endif - -#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/logger/src/logoutput.cpp --- a/controlpanel/src/logger/src/logoutput.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: An interface to output log string. -* -*/ -#include -#include - -class LogOutputPrivate -{ -public: - LogOutputPrivate(Logger *parentLogger = 0) : mParentLogger(parentLogger) - { - } - Logger *mParentLogger; - QString mName; -}; - - -//LogOutput -LogOutput::LogOutput(Logger *parentLogger /*= 0*/) -: d_ptr(new LogOutputPrivate(parentLogger)) -{ -} - -LogOutput::~LogOutput() -{ - delete d_ptr; -} - -bool LogOutput::load(QSettings &settings) -{ - if (!doLoad(settings)) { - return false; - } - return init(); -} - -Logger *LogOutput::parentLogger() -{ - return d_ptr->mParentLogger; -} - -void LogOutput::setParentLogger(Logger *parentLogger) -{ - d_ptr->mParentLogger = parentLogger; -} - -QString LogOutput::name() const -{ - return d_ptr->mName; -} - -void LogOutput::setName(const QString &name) -{ - d_ptr->mName = name; -} - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/logger/src/logoutputfactory.cpp --- a/controlpanel/src/logger/src/logoutputfactory.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Factory class to create LogOutput. -* -*/ -#include -#include -#include -#include -#include "logoutput.h" -#include "loglogger.h" - -typedef QHash CreateEntryContainer; - -Q_GLOBAL_STATIC(CreateEntryContainer, theCreateEntryList) - -static QString formalizeName(const QString &name) -{ - QString formalName = name; - formalName.toLower(); - formalName = formalName.trimmed(); - return formalName; -} - -LogOutput *LogOutputFactory::createLogOutput(const QString &name) -{ - return createLogOutput(name,QHash()); -} - -LogOutput *LogOutputFactory::createLogOutput(const QString &name, - const QHash &properties /*= QHash()*/) -{ - LogOutputFactory::CREATE_ENTRY entry = theCreateEntryList()->value(formalizeName(name)); - - LogOutput *output = entry ? (*entry)() : 0; - - if (output && !properties.isEmpty()) { - const QMetaObject *metaObj = output->metaObject(); - int count = metaObj->propertyCount(); - for (int i = 0; i < count; i++) { - QMetaProperty metaProperty = metaObj->property(i); - if (metaProperty.isValid() && metaProperty.isWritable()) { - QVariant var = properties.value(metaProperty.name()); - if (var.isValid()) { - metaProperty.write(output,var); - } - } - } - } - - return output; -} - -void LogOutputFactory::addCreateLogOutputEntry(const QString &name,CREATE_ENTRY entry) -{ - if (!entry) { - return; - } - - QString formalName = formalizeName(name); - - if (theCreateEntryList()->value(formalName)) { - LOGGER_LOG(QString("LogOutputFactory::addCreateLogOutputEntry << ") - + QString("create entry with the name:") + formalName + QString("already exists.")); - return; - } - - theCreateEntryList()->insert(formalName,entry); -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/logger/src/logoutputimpl.cpp --- a/controlpanel/src/logger/src/logoutputimpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,204 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "logoutputimpl.h" -#include -#include -#include -#include -#include -#include "logger.h" -#include "loglogger.h" -#include "logoutputfactory.h" - -#ifdef Q_WS_WIN - #include -#endif - -#ifdef Q_OS_SYMBIAN - #include -#endif - -//DebugLogOutput -REGISTER_OUTPUT_LOG(DEBUGOUTPUT_NAME,DebugLogOutput) - -DebugLogOutput::DebugLogOutput() -{ -} - -DebugLogOutput::~DebugLogOutput() -{ -} - -void DebugLogOutput::output(const QString &log) -{ -#if defined(Q_WS_WIN) - QT_WA({ - OutputDebugStringW(reinterpret_cast(log.utf16())); - }, { - OutputDebugStringA(log.toLocal8Bit().data()); - }); -#elif defined(Q_OS_SYMBIAN) - RDebug::Printf(log.toLocal8Bit().data()); -#else - fprintf(stderr, log.toLocal8Bit().data()); - fflush(stderr); -#endif -} - -bool DebugLogOutput::init() -{ - return true; -} - - -bool DebugLogOutput::doLoad(QSettings &settings) -{ - Q_UNUSED(settings); - return true; -} - - -//ConsoleLogOutput - -REGISTER_OUTPUT_LOG(CONSOLEOUTPUT_NAME,ConsoleLogOutput) - -ConsoleLogOutput::ConsoleLogOutput() -{ -} - -ConsoleLogOutput::~ConsoleLogOutput() -{ -} - -void ConsoleLogOutput::output(const QString &log) -{ - printf(log.toLocal8Bit().data()); -} - -bool ConsoleLogOutput::init() -{ - return true; -} - - -bool ConsoleLogOutput::doLoad(QSettings &settings) -{ - Q_UNUSED(settings); - return true; -} - -//FileLogOutput - -REGISTER_OUTPUT_LOG(FILEOUTPUT_NAME,FileLogOutput) - -FileLogOutput::FileLogOutput(const QString &logFilePath /*= QString()*/) : - mLogFile(0),mTextStream(0),mLogFilePath(logFilePath),mTruncateFile(false) -{ -} - -FileLogOutput::~FileLogOutput() -{ - delete mTextStream; - delete mLogFile; -} - -void FileLogOutput::output(const QString &log) -{ - *mTextStream << log; - mTextStream->flush(); -} - -bool FileLogOutput::init() -{ - if (mTextStream) { - delete mTextStream; - mTextStream = 0; - } - - if (mLogFile) { - delete mLogFile; - mLogFile = 0; - } - - QFileInfo fileInfo(mLogFilePath); - QDir parentDir = fileInfo.dir(); - if (!parentDir.exists()) - { - QString path = parentDir.absolutePath(); - parentDir.cdUp(); - parentDir.mkpath(path); - } - - mLogFile = new QFile(mLogFilePath); - QFile::OpenMode mode = QIODevice::WriteOnly | QIODevice::Text; - - if (mTruncateFile) { - mode |= QIODevice::Truncate; - } - else { - mode |= QIODevice::Append; - } - - if (!mLogFile->open(mode)) - { - LOGGER_LOG(QString("FileLogOutput::init << Open open file failed: ") + mLogFilePath); - return false; - } - mTextStream = new QTextStream(mLogFile); - return true; -} - -bool FileLogOutput::doLoad(QSettings &settings) -{ - if (!parentLogger()) { - return false; - } - - settings.beginGroup(parentLogger()->name()); - mLogFilePath = settings.value( - FILEOUTPUT_NAME + SETTINGS_SECTION_SEPERATOR + FILEOUTPUT_LOGFILE).toString(); - mTruncateFile = settings.value( - FILEOUTPUT_NAME + SETTINGS_SECTION_SEPERATOR + FILEOUTPUT_TRUNCATE,QVariant(false)).toBool(); - settings.endGroup(); - - if (mLogFilePath.isEmpty()) { - return false; - } - - return true; -} - -bool FileLogOutput::truncate() const -{ - return mTruncateFile; -} - -void FileLogOutput::setTruncate(bool truncate) -{ - mTruncateFile = truncate; -} - -QString FileLogOutput::logFile() const -{ - return mLogFilePath; -} - -void FileLogOutput::setLogFile(const QString &logFile) -{ - mLogFilePath = logFile; -} - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/logger/src/logoutputimpl.h --- a/controlpanel/src/logger/src/logoutputimpl.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef LOGOUTPUTIMPL_H -#define LOGOUTPUTIMPL_H - -#include -#include - -// name: "debugoutput" -class DebugLogOutput : public LogOutput -{ - Q_OBJECT -public: - DebugLogOutput(); - virtual ~DebugLogOutput(); - virtual void output(const QString &log); - virtual bool init(); -private: - virtual bool doLoad(QSettings &settings); -}; - -// name: "consoleoutput" -class ConsoleLogOutput : public LogOutput -{ - Q_OBJECT -public: - ConsoleLogOutput(); - virtual ~ConsoleLogOutput(); - virtual void output(const QString &log); - virtual bool init(); -private: - virtual bool doLoad(QSettings &settings); -}; - -// name: "fileoutput" - -/* config format: - fileoutput/logfile = C:/data/logs/app.log - fileoutput/truncate = 0 -*/ -class QFile; -class QTextStream; -class FileLogOutput : public LogOutput -{ - Q_OBJECT - Q_PROPERTY(bool truncate READ truncate WRITE setTruncate) - Q_PROPERTY(QString logFile READ logFile WRITE setLogFile) -public: - explicit FileLogOutput(const QString &logFilePath = QString()); - virtual ~FileLogOutput(); - virtual void output(const QString &log); - virtual bool init(); - - bool truncate() const; - void setTruncate(bool truncate); - QString logFile() const; - void setLogFile(const QString &logFile); -private: - virtual bool doLoad(QSettings &settings); -private: - QFile *mLogFile; - QTextStream *mTextStream; - QString mLogFilePath; - bool mTruncateFile; -}; - -#endif //LOGOUTPUTIMPL_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/src/src.pro --- a/controlpanel/src/src.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = subdirs -SUBDIRS = logger cpframework -CONFIG += ordered \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/tsrc.pro --- a/controlpanel/tsrc/tsrc.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = subdirs -SUBDIRS = unit/pluginfortest/firstpluginfortest \ - unit/pluginfortest/secondpluginfortest \ - unit/pluginfortest/thirdpluginfortest \ - unit/testplugin \ - unit/ut_cppluginloader \ - unit/ut_cpbasesettingview \ - unit/ut_cpdataformbuttonentryviewitem \ - unit/ut_cpdataformlistentryviewitem \ - unit/ut_cpitemdatahelper \ - unit/ut_cppluginlauncher \ - unit/ut_cppluginutility \ - unit/ut_cpsettingformentryitemdata \ - unit/ut_cpsettingformitemdata \ - unit/ut_cputility \ - unit/ut_cpviewlauncher \ - unit/ut_cpapi - -CONFIG += ordered - -test.depends = first -test.CONFIG += recursive -autotest.depends = first -autotest.CONFIG += recursive -QMAKE_EXTRA_TARGETS += test autotest diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/pluginfortest/firstpluginfortest/firstpluginfortest.pro --- a/controlpanel/tsrc/unit/pluginfortest/firstpluginfortest/firstpluginfortest.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = lib -TARGET = firstpluginfortest - -MOC_DIR = moc -OBJECT_DIR = obj -RCC_DIR = rcc - -symbian { - INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE - INCLUDEPATH += $$MOC_DIR - TARGET.CAPABILITY = ALL -TCB - TARGET.EPOCALLOWDLLDATA = 1 -} - -CONFIG += hb plugin -LIBS += -lcpframework -CONFIG += symbian_test - -symbian: plugin { # copy qtstub and manifest - - PLUGIN_STUB_PATH = /resource/qt/plugins/controlpanel - - deploy.path = C: - pluginstub.sources = $${TARGET}.dll - pluginstub.path = $$PLUGIN_STUB_PATH - DEPLOYMENT += pluginstub - - qtplugins.path = $$PLUGIN_STUB_PATH - qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin - - for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" -} - -DEPENDPATH += . -INCLUDEPATH += . - -# Input -HEADERS += src/firstpluginfortest.h \ - src/firstpluginviewfortest.h -SOURCES += src/firstpluginfortest.cpp \ - src/firstpluginviewfortest.cpp diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/pluginfortest/firstpluginfortest/src/firstpluginfortest.cpp --- a/controlpanel/tsrc/unit/pluginfortest/firstpluginfortest/src/firstpluginfortest.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ - - -#include "firstpluginfortest.h" -#include "firstpluginviewfortest.h" -#include - -FirstPluginForTest::FirstPluginForTest() -{ -} - -FirstPluginForTest::~FirstPluginForTest() -{ -} -QList FirstPluginForTest::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const -{ - return QList() - << new CpSettingFormEntryItemDataImpl( - itemDataHelper, - tr("The plugin for test"), - tr("TestPlugin.")); -} - -CpBaseSettingView *FirstPluginForTest::createSettingView(const QVariant &hint) const -{ - return 0; -} - -Q_EXPORT_PLUGIN2(FirstPluginForTest, FirstPluginForTest); diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/pluginfortest/firstpluginfortest/src/firstpluginfortest.h --- a/controlpanel/tsrc/unit/pluginfortest/firstpluginfortest/src/firstpluginfortest.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - -//This class is used for the test case "testCpPluginInterface()". CpTestPlugin is a subclass from CpPluginInterface. - -#ifndef FIRSTPLUGINFORTEST_H -#define FIRSTPLUGINFORTEST_H - -#include -#include -#include - -class FirstPluginForTest : public QObject, public CpPluginInterface, public CpLauncherInterface -{ - Q_OBJECT - Q_INTERFACES(CpPluginInterface) - Q_INTERFACES(CpLauncherInterface) -public: - FirstPluginForTest(); - virtual ~FirstPluginForTest(); - virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; - virtual CpBaseSettingView *createSettingView(const QVariant &hint) const; -}; - -#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/pluginfortest/firstpluginfortest/src/firstpluginviewfortest.cpp --- a/controlpanel/tsrc/unit/pluginfortest/firstpluginfortest/src/firstpluginviewfortest.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -#include "firstpluginviewfortest.h" - -#include -#include -#include -#include -#include -#include - -FirstPluginViewForTest::FirstPluginViewForTest(QGraphicsItem *parent) - : CpBaseSettingView(0,parent), - mGroupItem(0), - mSliderItem(0) -{ - HbDataForm *form = qobject_cast(widget()); - if (form) { - HbDataFormModel *model = new HbDataFormModel; - - form->setHeading(tr("View from test plugin")); - mGroupItem = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, QString("Group")); - - model->appendDataFormItem(mGroupItem); - - mSliderItem = new CpSettingFormItemData(HbDataFormModelItem::SliderItem, - QString("New Slider")); - mSliderItem->setContentWidgetData("iconEnabled","FALSE"); - form->addConnection(mSliderItem,SIGNAL(valueChanged(int)),this,SLOT(sliderValueChanged(int))); - mGroupItem->appendChild(mSliderItem); - - form->setModel(model); - } -} -FirstPluginViewForTest::~FirstPluginViewForTest() -{ -} - -void FirstPluginViewForTest::testClose() -{ - close(); -} -void FirstPluginViewForTest::sliderValueChanged(int value) -{ - //Disable the slider alert. - HbMessageBox::information(QString("slider value changed to:%1").arg(value)); -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/pluginfortest/firstpluginfortest/src/firstpluginviewfortest.h --- a/controlpanel/tsrc/unit/pluginfortest/firstpluginfortest/src/firstpluginviewfortest.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -#ifndef FIRSTPLUGINVIEWFORTEST_H -#define FIRSTPLUGINVIEWFORTEST_H - -#include -#include - -class HbDataFormModelItem; -class CpSettingFormItemData; - -class FirstPluginViewForTest : public CpBaseSettingView -{ - Q_OBJECT -public: - explicit FirstPluginViewForTest(QGraphicsItem *parent = 0); - virtual ~FirstPluginViewForTest(); -public: - void testClose(); -private slots: - void sliderValueChanged(int value); - -private: - HbDataFormModelItem *mGroupItem; - CpSettingFormItemData *mSliderItem; -}; -#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/pluginfortest/secondpluginfortest/secondpluginfortest.pro --- a/controlpanel/tsrc/unit/pluginfortest/secondpluginfortest/secondpluginfortest.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = lib -TARGET = secondpluginfortest - -MOC_DIR = moc -OBJECT_DIR = obj -RCC_DIR = rcc - -symbian { - INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE - INCLUDEPATH += $$MOC_DIR - TARGET.CAPABILITY = ALL -TCB - TARGET.EPOCALLOWDLLDATA = 1 -} - -CONFIG += hb plugin -LIBS += -lcpframework -CONFIG += symbian_test - -symbian: plugin { # copy qtstub and manifest - - PLUGIN_STUB_PATH = /resource/qt/plugins/controlpanel - - deploy.path = C: - pluginstub.sources = $${TARGET}.dll - pluginstub.path = $$PLUGIN_STUB_PATH - DEPLOYMENT += pluginstub - - qtplugins.path = $$PLUGIN_STUB_PATH - qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin - - for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" -} - -DEPENDPATH += . -INCLUDEPATH += . - -# Input -HEADERS += src/secondpluginfortest.h \ - src/secondpluginviewfortest.h - -SOURCES += src/secondpluginfortest.cpp \ - src/secondpluginviewfortest.cpp diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/pluginfortest/secondpluginfortest/src/secondpluginfortest.cpp --- a/controlpanel/tsrc/unit/pluginfortest/secondpluginfortest/src/secondpluginfortest.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ - - -#include "secondpluginfortest.h" -#include "secondpluginviewfortest.h" -#include - -SecondPluginForTest::SecondPluginForTest() -{ -} - -SecondPluginForTest::~SecondPluginForTest() -{ -} -QList SecondPluginForTest::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const -{ - return QList() - << new CpSettingFormEntryItemDataImpl( - itemDataHelper, - tr("The plugin for test"), - tr("TestPlugin.")); -} - -CpBaseSettingView *SecondPluginForTest::createSettingView(const QVariant &hint) const -{ - SecondPluginViewForTest *pView = new SecondPluginViewForTest(); - return pView; -} - -Q_EXPORT_PLUGIN2(SecondPluginForTest, SecondPluginForTest); diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/pluginfortest/secondpluginfortest/src/secondpluginfortest.h --- a/controlpanel/tsrc/unit/pluginfortest/secondpluginfortest/src/secondpluginfortest.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - -//This class is used for the test case "testCpPluginInterface()". CpTestPlugin is a subclass from CpPluginInterface. - -#ifndef SECONDPLUGINFORTEST_H -#define SECONDPLUGINFORTEST_H - -#include -#include -#include - -class SecondPluginForTest : public QObject, public CpPluginInterface, public CpLauncherInterface -{ - Q_OBJECT - Q_INTERFACES(CpPluginInterface) - Q_INTERFACES(CpLauncherInterface) -public: - SecondPluginForTest(); - virtual ~SecondPluginForTest(); - virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; - virtual CpBaseSettingView *createSettingView(const QVariant &hint) const; -}; - -#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/pluginfortest/secondpluginfortest/src/secondpluginviewfortest.cpp --- a/controlpanel/tsrc/unit/pluginfortest/secondpluginfortest/src/secondpluginviewfortest.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -#include "secondpluginviewfortest.h" - -#include -#include -#include -#include -#include -#include - -SecondPluginViewForTest::SecondPluginViewForTest(QGraphicsItem *parent) - : CpBaseSettingView(0,parent), - mGroupItem(0), - mSliderItem(0) -{ - HbDataForm *form = qobject_cast(widget()); - if (form) { - HbDataFormModel *model = new HbDataFormModel; - - form->setHeading(tr("View from test plugin")); - mGroupItem = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, QString("Group")); - - model->appendDataFormItem(mGroupItem); - - mSliderItem = new CpSettingFormItemData(HbDataFormModelItem::SliderItem, - QString("New Slider")); - mSliderItem->setContentWidgetData("iconEnabled","FALSE"); - form->addConnection(mSliderItem,SIGNAL(valueChanged(int)),this,SLOT(sliderValueChanged(int))); - mGroupItem->appendChild(mSliderItem); - - form->setModel(model); - } -} -SecondPluginViewForTest::~SecondPluginViewForTest() -{ -} - -void SecondPluginViewForTest::testClose() -{ - close(); -} -void SecondPluginViewForTest::sliderValueChanged(int value) -{ - //Disable the slider alert. - HbMessageBox::information(QString("slider value changed to:%1").arg(value)); -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/pluginfortest/secondpluginfortest/src/secondpluginviewfortest.h --- a/controlpanel/tsrc/unit/pluginfortest/secondpluginfortest/src/secondpluginviewfortest.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -#ifndef SECONDPLUGINVIEWFORTEST_H -#define SECONDPLUGINVIEWFORTEST_H - -#include -#include - -class HbDataFormModelItem; -class CpSettingFormItemData; - -class SecondPluginViewForTest : public CpBaseSettingView -{ - Q_OBJECT -public: - explicit SecondPluginViewForTest(QGraphicsItem *parent = 0); - virtual ~SecondPluginViewForTest(); -public: - void testClose(); -private slots: - void sliderValueChanged(int value); - -private: - HbDataFormModelItem *mGroupItem; - CpSettingFormItemData *mSliderItem; -}; -#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/pluginfortest/thirdpluginfortest/src/thirdpluginfortest.cpp --- a/controlpanel/tsrc/unit/pluginfortest/thirdpluginfortest/src/thirdpluginfortest.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ - - -#include "thirdpluginfortest.h" -#include "thirdpluginviewfortest.h" -#include - -ThirdPluginForTest::ThirdPluginForTest() -{ -} - -ThirdPluginForTest::~ThirdPluginForTest() -{ -} -QList ThirdPluginForTest::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const -{ - return QList() - << new CpSettingFormEntryItemDataImpl( - itemDataHelper, - tr("The plugin for test"), - tr("TestPlugin.")); -} - -CpBaseSettingView *ThirdPluginForTest::createSettingView(const QVariant &hint) const -{ - return 0; -} - -Q_EXPORT_PLUGIN2(ThirdPluginForTest, ThirdPluginForTest); diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/pluginfortest/thirdpluginfortest/src/thirdpluginfortest.h --- a/controlpanel/tsrc/unit/pluginfortest/thirdpluginfortest/src/thirdpluginfortest.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - -//This class is used for the test case "testCpPluginInterface()". CpTestPlugin is a subclass from CpPluginInterface. - -#ifndef THIRDPLUGINFORTEST_H -#define THIRDPLUGINFORTEST_H - -#include -#include -#include - -class ThirdPluginForTest : public QObject, public CpPluginInterface, public CpLauncherInterface -{ - Q_OBJECT - Q_INTERFACES(CpPluginInterface) - Q_INTERFACES(CpLauncherInterface) -public: - ThirdPluginForTest(); - virtual ~ThirdPluginForTest(); - virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; - virtual CpBaseSettingView *createSettingView(const QVariant &hint) const; -}; - -#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/pluginfortest/thirdpluginfortest/src/thirdpluginviewfortest.cpp --- a/controlpanel/tsrc/unit/pluginfortest/thirdpluginfortest/src/thirdpluginviewfortest.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -#include "thirdpluginviewfortest.h" - -#include -#include -#include -#include -#include -#include - -ThirdPluginViewForTest::ThirdPluginViewForTest(QGraphicsItem *parent) - : CpBaseSettingView(0,parent), - mGroupItem(0), - mSliderItem(0) -{ - HbDataForm *form = qobject_cast(widget()); - if (form) { - HbDataFormModel *model = new HbDataFormModel; - - form->setHeading(tr("View from test plugin")); - mGroupItem = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, QString("Group")); - - model->appendDataFormItem(mGroupItem); - - mSliderItem = new CpSettingFormItemData(HbDataFormModelItem::SliderItem, - QString("New Slider")); - mSliderItem->setContentWidgetData("iconEnabled","FALSE"); - form->addConnection(mSliderItem,SIGNAL(valueChanged(int)),this,SLOT(sliderValueChanged(int))); - mGroupItem->appendChild(mSliderItem); - - form->setModel(model); - } -} -ThirdPluginViewForTest::~ThirdPluginViewForTest() -{ -} - -void ThirdPluginViewForTest::testClose() -{ - close(); -} -void ThirdPluginViewForTest::sliderValueChanged(int value) -{ - //Disable the slider alert. - HbMessageBox::information(QString("slider value changed to:%1").arg(value)); -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/pluginfortest/thirdpluginfortest/src/thirdpluginviewfortest.h --- a/controlpanel/tsrc/unit/pluginfortest/thirdpluginfortest/src/thirdpluginviewfortest.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -#ifndef THIRDPLUGINVIEWFORTEST_H -#define THIRDPLUGINVIEWFORTEST_H - -#include -#include - -class HbDataFormModelItem; -class CpSettingFormItemData; - -class ThirdPluginViewForTest : public CpBaseSettingView -{ - Q_OBJECT -public: - explicit ThirdPluginViewForTest(QGraphicsItem *parent = 0); - virtual ~ThirdPluginViewForTest(); -public: - void testClose(); -private slots: - void sliderValueChanged(int value); - -private: - HbDataFormModelItem *mGroupItem; - CpSettingFormItemData *mSliderItem; -}; -#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/pluginfortest/thirdpluginfortest/thirdpluginfortest.pro --- a/controlpanel/tsrc/unit/pluginfortest/thirdpluginfortest/thirdpluginfortest.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = lib -TARGET = thirdpluginfortest - -MOC_DIR = moc -OBJECT_DIR = obj -RCC_DIR = rcc - -symbian { - INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE - INCLUDEPATH += $$MOC_DIR - TARGET.CAPABILITY = ALL -TCB - TARGET.EPOCALLOWDLLDATA = 1 -} - -CONFIG += hb plugin -LIBS += -lcpframework -CONFIG += symbian_test - -symbian: plugin { # copy qtstub and manifest - - PLUGIN_STUB_PATH = /resource/qt/plugins/controlpanel - - deploy.path = C: - pluginstub.sources = $${TARGET}.dll - pluginstub.path = $$PLUGIN_STUB_PATH - DEPLOYMENT += pluginstub - - qtplugins.path = $$PLUGIN_STUB_PATH - qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin - - for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" -} - -DEPENDPATH += . -INCLUDEPATH += . - -# Input -HEADERS += src/thirdpluginfortest.h \ - src/thirdpluginviewfortest.h - -SOURCES += src/thirdpluginfortest.cpp \ - src/thirdpluginviewfortest.cpp diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/testplugin/data/testplugin.cpcfg --- a/controlpanel/tsrc/unit/testplugin/data/testplugin.cpcfg Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/testplugin/src/cppersonalizationplugin.cpp --- a/controlpanel/tsrc/unit/testplugin/src/cppersonalizationplugin.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ - -#include "cppersonalizationplugin.h" -#include -#include -#include - -CpPersonalizationPlugin::CpPersonalizationPlugin() -{ -} - -CpPersonalizationPlugin::~CpPersonalizationPlugin() -{ -} - -QList CpPersonalizationPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const -{ - CpSettingFormItemData *itemData = new CpSettingFormItemData(); - - return QList() << itemData; -} - -CpBaseSettingView *CpPersonalizationPlugin::createSettingView(const QVariant &hint) const -{ - if (hint.toString().compare("profile_view",Qt::CaseInsensitive) == 0) { - return new CpBaseSettingView; - } - return 0; -} - -Q_EXPORT_PLUGIN2(cppersonalizationplugin, CpPersonalizationPlugin); - - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/testplugin/src/cppersonalizationplugin.h --- a/controlpanel/tsrc/unit/testplugin/src/cppersonalizationplugin.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ - -#ifndef CPPERSONALIZATIONPLUGIN_H -#define CPPERSONALIZATIONPLUGIN_H - -#include -#include -#include - -class CpBaseSettingView; -class QVariant; - -class CpPersonalizationPlugin - : public QObject, - public CpPluginInterface, - public CpLauncherInterface -{ - Q_OBJECT - Q_INTERFACES(CpPluginInterface) - Q_INTERFACES(CpLauncherInterface) -public: - CpPersonalizationPlugin(); - virtual ~CpPersonalizationPlugin(); - virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; - virtual CpBaseSettingView *createSettingView(const QVariant &hint) const; -}; - -#endif /* CPPERSONALIZATIONPLUGIN_H */ - - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/testplugin/testplugin.pri --- a/controlpanel/tsrc/unit/testplugin/testplugin.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: cppersonalizationplugin source files -# - -# Input -HEADERS += src/cppersonalizationplugin.h \ - -SOURCES += src/cppersonalizationplugin.cpp \ diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/testplugin/testplugin.pro --- a/controlpanel/tsrc/unit/testplugin/testplugin.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = lib -TARGET = testplugin - -CONFIG += hb plugin -CONFIG += symbian_test - -QMAKE_EXTRA_TARGETS += test autotest - -LIBS += -lcpframework - -include ( testplugin.pri ) - -symbian: { - TARGET.UID3 = 0X2002D6E9 -} - -MOC_DIR = moc -OBJECT_DIR = obj - -symbian: { - INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE - INCLUDEPATH += $$MW_LAYER_PLATFORM_EXPORT_PATH(cplogger) - INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE - INCLUDEPATH += $$MOC_DIR - TARGET.CAPABILITY = ALL -TCB - TARGET.EPOCALLOWDLLDATA = 1 - - deploy.path = C: - headers.sources = data/testplugin.cpcfg - headers.path = /resource/qt/plugins/controlpanel/config - DEPLOYMENT += headers - - # This is for new exporting system coming in garden - for(header, headers.sources):BLD_INF_RULES.prj_exports += "./$$header $$deploy.path$$headers.path/$$basename(header)" -} - -symbian: plugin { # copy qtstub and manifest - - PLUGIN_STUB_PATH = /resource/qt/plugins/controlpanel - - deploy.path = C: - pluginstub.sources = $${TARGET}.dll - pluginstub.path = $$PLUGIN_STUB_PATH - DEPLOYMENT += pluginstub - - qtplugins.path = $$PLUGIN_STUB_PATH - qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin - - for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" -} - - - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_common.pri --- a/controlpanel/tsrc/unit/ut_common.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -QT += testlib - -CONFIG += hb qtestlib -CONFIG += symbian_test - -QMAKE_EXTRA_TARGETS += test autotest - -DEPENDPATH += . - -LIBS += -lcpframework diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpapi/data/controlpanellog.conf --- a/controlpanel/tsrc/unit/ut_cpapi/data/controlpanellog.conf Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -[cpframework] -logdatetime = 1 -logloggername = 1 -datetimeformat = hh:mm:ss -output = debugoutput consoleoutput fileoutput -fileoutput/logfile = C:/data/logs/ut_cpapi/cpframwork.log -fileoutput/truncate = 1 \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpapi/src/cptestpluginentryitem.cpp --- a/controlpanel/tsrc/unit/ut_cpapi/src/cptestpluginentryitem.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -#include "CpTestPluginEntryItem.h" - -#include -#include -#include -CpTestPluginEntryItemData::CpTestPluginEntryItemData(const HbDataFormModelItem *parent /* = 0*/) -{ - -} -CpTestPluginEntryItemData::CpTestPluginEntryItemData(CpItemDataHelper &itemDataHelper, - const QString &text /*= QString()*/, - const QString &description /*= QString()*/, - const HbIcon &icon /*= HbIcon()*/, - const HbDataFormModelItem *parent /*= 0*/) - : CpSettingFormEntryItemData(itemDataHelper, - text, - description, - icon, - parent) -{ -} - -CpTestPluginEntryItemData::~CpTestPluginEntryItemData() -{ -} - -void CpTestPluginEntryItemData::testOnLaunchView() -{ - onLaunchView(); -} -CpBaseSettingView *CpTestPluginEntryItemData::createSettingView() const -{ - return 0; -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpapi/src/cptestpluginentryitem.h --- a/controlpanel/tsrc/unit/ut_cpapi/src/cptestpluginentryitem.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -#ifndef CPTESTPLUGINENTRYITEM_H -#define CPTESTPLUGINENTRYITEM_H -#include - -class CpTestPluginEntryItemData : public CpSettingFormEntryItemData -{ - Q_OBJECT -public: - explicit CpTestPluginEntryItemData(const HbDataFormModelItem *parent /* = 0*/); - explicit CpTestPluginEntryItemData(CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const HbIcon &icon = HbIcon(), - const HbDataFormModelItem *parent = 0); - virtual ~CpTestPluginEntryItemData(); -public slots: - void testOnLaunchView(); -private: - virtual CpBaseSettingView *createSettingView() const; -}; -#endif // CPTESTPLUGINENTRYITEM_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpapi/src/cptestview.cpp --- a/controlpanel/tsrc/unit/ut_cpapi/src/cptestview.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -#include "CpTestView.h" - -#include -#include -#include -#include -#include -#include - -CpTestView::CpTestView(QGraphicsItem *parent) - : CpBaseSettingView(0,parent) -{ - -} -CpTestView::~CpTestView() -{ -} - -void CpTestView::testClose() -{ - close(); -} \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpapi/src/cptestview.h --- a/controlpanel/tsrc/unit/ut_cpapi/src/cptestview.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -#ifndef CPTESTVIEW_H -#define CPTESTVIEW_H - -#include -#include - -class HbDataFormModelItem; -class CpSettingFormItemData; - -class CpTestView : public CpBaseSettingView -{ - Q_OBJECT -public: - explicit CpTestView(QGraphicsItem *parent = 0); - virtual ~CpTestView(); -public: - void testClose(); -}; -#endif - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpapi/src/ut_cpapi.cpp --- a/controlpanel/tsrc/unit/ut_cpapi/src/ut_cpapi.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,694 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: test application for qt control panel public apis. -* -*/ - -#include "ut_cpapi.h" -#include "cptestpluginentryitem.h" -#include "cptestview.h" - -//#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//testing following classes -#include -#include "cpsettingformentryitemdata.h" -#include "cpsettingformentryitemdataimpl.h" -#include -#include -#include -#include -#include -#include -#include -/*! - \class TestCpAPI - \brief class name: TestCpAPI \n - class's description: \n - type of test case: API class test \n - test cases' number totally: 9 \n - */ -void TestCpAPI::initTestCase() -{ - -} - -void TestCpAPI::cleanupTestCase() -{ - QCoreApplication::processEvents(); -} -/*! - Test Case Description: \n   - Verify the class CpBaseSettingView can created corresponding views via different parameters.\n - 1. Fucntion Name: \n    - <1> CpBaseSettingView::CpBaseSettingView(QGraphicsWidget *widget,QGraphicsItem *parent)\n    - <2> virtual void close()\n - 2. Case Descrition: \n   - <1> test the constructor function\n    - <2> Test the close() function. \n - 3. Input Parameters: \n   - <1> widget = 0 , parent = 0 \n    - widget = 0, parent = new HbWidget () \n      - widget = new Hbpushbuton (), parent = 0 \n      - widget = new hbpushbutton(), parent = new HbWidget() \n    - <2> none \n - 4. Expected result: \n    - <1> pview != 0, no crash \n    - <2> no crash \n - */ -void TestCpAPI::testCpBaseSettingView() -{ - //set the parameters as 0 - CpBaseSettingView * pview = new CpBaseSettingView(0); - QVERIFY( pview != 0 ); - HbDataForm *pForm = new HbDataForm(0); - pview->setWidget(pForm); - QVERIFY( qobject_cast(pview->widget()) == pForm ); - delete pview; - pview = 0; - - HbPushButton *widget = new HbPushButton(); - QVERIFY(widget != 0); - // set the first parameter as widget - CpBaseSettingView *pView1 = new CpBaseSettingView(widget); - QVERIFY(pView1!=0); - HbPushButton *button = qobject_cast(pView1->widget()); - QVERIFY(button != 0); - delete pView1; - pView1 = 0; - - // test close() function in CpBaseSettingView class. - CpTestView *pview3 = new CpTestView(); - pview3->testClose(); - delete pview3; - pview3 = 0; -} -/*! - Test Case Description: \n - . Verify this class could create the corresponding control panel defined HbDataFormModelItem. \n\n - Function 1: \n - 1. Fucntion Name: \n    - CpSettingFormItemData(HbDataFormModelItem::DataItemType type, const QString &label, const HbDataFormModelItem *parent = 0) \n - 2. Case Descrition: \n    - Test the constructor function. \n - 3. Input Parameters: \n    - <1> type = HbDataFormModelItem::DataItemType, label = QString, parent = new HbDataFormModelItem(), \n   - <2> type = (HbDataFormModelItem::DataItemType) invaildValue, label = 0, parent = 0 \n - 4. Expected result: \n    - <1> pdata != 0, pdata->type() == type \n    - <2> no crash \n - Function 2: \n - 1. Fucntion Name: \n    - CpSettingFormItemData(const HbDataFormModelItem *parent = 0) \n - 2. Case Descrition: \n    - Test the constructor function. \n - 3. Input Parameters: \n    - none \n - 4. Expected result: \n    - pdata != 0 & no crash \n - Function 3: \n - 1. Fucntion Name: \n    - QString text() const; \n - 2. Case Descrition: \n    - Verify it returns the right text string. \n - 3. Input Parameters: \n    - none \n - 4. Expected result: \n    - return the correct text string \n - Function 4: \n - 1. Fucntion Name: \n    - void setText(const QString &text); \n - 2. Case Descrition: \n    - Verify that the text can be set via this function. \n - 3. Input Parameters: \n    - text = QString(xx) - 4. Expected result: \n    - pItemData->text() == text \n - Function 5: \n - 1. Fucntion Name: \n    - QString description() const; \n - 2. Case Descrition: \n    - Verify that it returns the correct description name. \n - 3. Input Parameters: \n    - none \n - 4. Expected result: \n    - return the correct text string \n - Function 6: \n - 1. Fucntion Name: \n    - void setDescription(const QString &description); \n - 2. Case Descrition: \n    - Verify it can set description successfully. \n - 3. Input Parameters: \n    - description = QString(xx) - 4. Expected result: \n    - pItemData->description() == description \n - Function 7: \n - 1. Fucntion Name: \n    - QString iconName() const;\n - 2. Case Descrition: \n    - Verify it can return the right icon name. \n - 3. Input Parameters: \n    - none \n - 4. Expected result: \n    - return the correct icon name \n - Function 8: \n - 1. Fucntion Name: \n    - void setIconName(const QString &icon); \n - 2. Case Descrition: \n    - Verify it can set the given icon name successfully.\n - 3. Input Parameters: \n    - iconName = QString(xx) - 4. Expected result: \n    - pItemData->iconNmae() == iconName \n - Function 9: \n - 1. Fucntion Name: \n    - void setEntryItemIcon(const HbIcon &icon); \n - 2. Case Descrition: \n    - Verify it can set the item icon successfully. \n - 3. Input Parameters: \n    - icon = HbIcon() - 4. Expected result: \n    - entryItemIcon() == icon \n -*/ -void TestCpAPI::testCpSettingFormEntryItemData() -{ - // create CpTestPluginEntryItemData class firstly - CpItemDataHelper *pHelper = new CpItemDataHelper(); - HbIcon pIcon = HbIcon("icon"); - - // test the first constructor - CpTestPluginEntryItemData *pItemData = new CpTestPluginEntryItemData(0); - QVERIFY (pItemData!=0); - delete pItemData; - pItemData = 0; - - // The second constructor - pItemData = new CpTestPluginEntryItemData(*pHelper, "test","test", pIcon, 0); - QVERIFY (pItemData!=0); - - // test settext() and text() function - QString aText = "strText"; - pItemData->setText(aText); - QString aTextTemp = pItemData->text(); - QVERIFY( aTextTemp == aText); - - // test setDescription() and description() function - QString aDescription = "strDescription"; - pItemData->setDescription(aDescription); - QString aDesTemp = pItemData->description(); - QVERIFY( aDesTemp == aDescription); - - // test setIconName() and iconName() function - QString aIconName = "strIconName"; - pItemData->setIconName(aIconName); - QString aIconTemp = pItemData->iconName(); - QVERIFY( aIconTemp == aIconName); - - // test setEntryItemIcon() and entryItemIcon() function - pItemData->setEntryItemIcon(pIcon); - HbIcon pIconTemp = pItemData->entryItemIcon(); - QVERIFY( pIconTemp == pIcon); - - // test onLaunchView() function - pItemData->onLaunchView(); - - delete pItemData; - pItemData = 0; - delete pHelper; - pHelper = 0; -} - -/*! - Test Case Description: \n - Verify this class could create the corresponding CpSettingFormEntryItemData. \n - Function 1: \n - 1. Fucntion Name: \n    - explicit CpSettingFormEntryItemDataImpl(CpItemDataHelper &itemDataHelper,const QString &text = QString(), \n - const QString &description = QString(),const HbIcon &icon = HbIcon(), \n - const HbDataFormModelItem *parent = 0) \n - 2. Case Descrition: \n    - Test the first constructor function. \n - 3. Input Parameters: \n    - <1> itemDataHelper = CpItemDataHelper, text = Qstring(XX),description = Qstring(XX), - icon = HbIcon(), parent = new HbDataFormModelItem() \n    - <2> itemDataHelper = CpItemDataHelper , text = Qstring(), - description = Qstring(), icon = HbIcon(), parent = 0 \n - 4. Expected result: \n    - <1> pdataimp != 0 \n    - <2> no crash \n - Function 2: \n - 1. Fucntion Name: \n    - explicit CpSettingFormEntryItemDataImpl(HbDataForm *dataForm,const QString &text = QString(), \n             - const QString &description = QString(),const HbIcon &icon = HbIcon(), \n             - const HbDataFormModelItem *parent = 0) \n - 2. Case Descrition: \n    - Test the second constructor function. \n - 3. Input Parameters: \n    - <1> dataform = new HbDataForm(), text = Qstring(XX), description Qstring(XX), - icon = HbIcon(XX), parent = new HbDataFormModelItem(), \n    - <2> dataForm = 0, text = Qstring(), description Qstring(), icon = HbIcon(), parent = 0 \n - 4. Expected result: \n    - pdata != 0 \n - Function 3: \n - 1. Fucntion Name: \n    - explicit CpSettingFormEntryItemDataImpl(EntryItemType type,CpItemDataHelper &itemDataHelper, \n          - const QString &text = QString(),const QString &description = QString(), \n             - const QString &icon = QString(),const HbDataFormModelItem *parent = 0) \n - 2. Case Descrition: \n    - Test the third constructor function. \n - 3. Input Parameters: \n    - <1> type = HbDataFormModelItem::DataItemType, itemDataHelper = CpItemDataHelper, \n       - text = QString(XX), description = QString(XX), icon = QString(XX), parent = new HbDataFormModelItem() \n    - <2> type = HbDataFormModelItem::DataItemType, itemDataHelper = CpItemDataHelper default, \n    - text = QString(), description = QString(), icon = QString(), parent = 0 \n - 4. Expected result: \n    - <1> pdataimp != 0, pdataimp->icon() != icon,\n    - <2> pdataimp != 0, pdataimp->icon() == 0, \n - Function 4: \n - 1. Fucntion Name: \n    - explicit CpSettingFormEntryItemDataImpl(EntryItemType type,HbDataForm *dataForm,const QString &text = QString(),\n          - const QString &description = QString(),const QString &icon = QString(),\n          - const HbDataFormModelItem *parent = 0) \n - 2. Case Descrition: \n    - Test the forth constructor function. \n - 3. Input Parameters: \n    - <1> type = HbDataFormModelItem::DataItemType, dataform = new HbDataForm(), \n          - text = QString(XX), description = QString(XX), icon = QString(XX), parent = new HbDataFormModelItem() \n    - <2> type = HbDataFormModelItem::DataItemType, dataform = 0, text = QString(), \n          - description = QString(), icon = QString(), parent = 0 \n - 4. Expected result: \n    - <1> pdataimp != 0, pdataimp->icon() != icon,\n    - <2> pdataimp != 0, pdataimp->icon() == 0, \n -*/ -void TestCpAPI::testCpSettingFormEntryItemDataImpl() -{ - //Define the parameters for the constructors. - QString strText = "testText"; - QString strDes = "testDescription"; - QString strIcon = "iconString"; - CpItemDataHelper *pHelper = new CpItemDataHelper(); - HbDataFormModelItem *aParent = new HbDataFormModelItem(); - HbIcon icon = HbIcon("icon"); - HbDataForm *pDataform = new HbDataForm(); - CpSettingFormEntryItemData::EntryItemType EType1 = CpSettingFormEntryItemData::ListEntryItem; - CpSettingFormEntryItemData::EntryItemType EType2 = CpSettingFormEntryItemData::ButtonEntryItem; - // test the first constructor function. - CpSettingFormEntryItemDataImpl *pdataimp = - new CpSettingFormEntryItemDataImpl( *pHelper, strText, strDes, icon, aParent ); // first constructor - QVERIFY (pdataimp != 0); - QVERIFY( pdataimp->text() == strText ); - QVERIFY( pdataimp->description()==strDes ); - QVERIFY( pdataimp->icon() == icon.iconName() ); - delete pdataimp; - pdataimp = 0; - pdataimp = new CpSettingFormEntryItemDataImpl( *pHelper, QString(), QString(), icon, 0); - QVERIFY (pdataimp != 0); - delete pdataimp; - pdataimp = 0; - - pdataimp = new CpSettingFormEntryItemDataImpl(0); // set parameter as "0" - QVERIFY (pdataimp != 0); - QVERIFY( pdataimp->text() == 0 ); - QVERIFY( pdataimp->description()==0 ); - delete pdataimp; - pdataimp = 0; - // test the second constructor function. - pdataimp = new CpSettingFormEntryItemDataImpl ( pDataform,strText, strDes, icon, aParent ); //second contructor - QVERIFY( pdataimp->text() == strText ); - QVERIFY( pdataimp->description()==strDes ); - QVERIFY( pdataimp->icon() == icon.iconName() ); - delete pdataimp; - pdataimp = 0; - pdataimp = new CpSettingFormEntryItemDataImpl ( 0, QString(), QString(), icon, 0 ); - QVERIFY (pdataimp != 0); - delete pdataimp; - pdataimp = 0; - // test the third constructor function. - pdataimp = new CpSettingFormEntryItemDataImpl( EType1,*pHelper, strText, strDes, strIcon, aParent );// the third constructor - HbDataFormModelItem::DataItemType EdataItmeTypeTemp1 = pdataimp->type(); - QVERIFY (EdataItmeTypeTemp1 == EType1); - QVERIFY( pdataimp->text() == strText ); - QVERIFY( pdataimp->description()==strDes ); - QVERIFY( pdataimp->icon() == strIcon ); - delete pdataimp; - pdataimp = 0; - // test the forth constructor function. - pdataimp = new CpSettingFormEntryItemDataImpl(EType2,pDataform, strText, strDes, strIcon, aParent );// the fourth constructor - CpSettingFormEntryItemData::DataItemType EdataItmeTypeTemp2 = pdataimp->type(); - QVERIFY (EdataItmeTypeTemp2 == EType2); - QVERIFY( pdataimp->text() == strText ); - QVERIFY( pdataimp->description()==strDes ); - QVERIFY( pdataimp->icon() == strIcon ); - delete pdataimp; - pdataimp = 0; - - delete pHelper; - pHelper=0; - delete pDataform; - pDataform = 0; -} -/*! - provide test data for the testCpSettingFormItemData() -*/ -void TestCpAPI::testCpSettingFormItemData_data() -{ - // add the test data as below - QTest::addColumn("aType"); - QTest::addColumn("aLabel"); - QTest::newRow("FormPageItem value") << (int)HbDataFormModelItem::FormPageItem << "FormPageItem Label"; - QTest::newRow("GroupItem value") << (int)HbDataFormModelItem::GroupItem << "GroupItem Label"; - QTest::newRow("GroupPageItem value") << (int)HbDataFormModelItem::GroupPageItem << "GroupPageItem Label"; - QTest::newRow("TextItem value") << (int)HbDataFormModelItem::TextItem << "TextItem Label"; - QTest::newRow("SliderItem value") << (int)HbDataFormModelItem::SliderItem << "SliderItem Label"; - QTest::newRow("VolumeSliderItem value") << (int)HbDataFormModelItem::VolumeSliderItem << "VolumeSliderItem Label"; - QTest::newRow("CheckBoxItem value") << (int)HbDataFormModelItem::CheckBoxItem << "CheckBoxItem Label"; - QTest::newRow("ToggleValueItem value") << (int)HbDataFormModelItem::ToggleValueItem << "ToggleValueItem Label"; - QTest::newRow("RadioButtonListItem value") << (int)HbDataFormModelItem::RadioButtonListItem << "RadioButtonListItem Label"; - QTest::newRow("MultiselectionItem value") << (int)HbDataFormModelItem::MultiselectionItem << "MultiselectionItem Label"; - QTest::newRow("ComboBoxItem value") << (int)HbDataFormModelItem::ComboBoxItem << "ComboBoxItem Label"; -} -/*! - Test Case Description: \n    - Verify this class could create the corresponding control panel defined HbDataFormModelItem. \n - Function 1: \n - 1. Fucntion Name: \n    - CpSettingFormItemData(HbDataFormModelItem::DataItemType type, const QString &label,const HbDataFormModelItem *parent = 0); \n - 2. Case Descrition: \n    - Test the first constructor function. \n - 3. Input Parameters: \n    - <1> type = HbDataFormModelItem::DataItemType, label = QString, parent = new HbDataFormModelItem() \n    - <2> type = (HbDataFormModelItem::DataItemType) invaildValue, label = 0, parent = 0 \n - 4. Expected result: \n    - <1> pdata != 0, pdata->type() == type \n    - <2> no crash \n - Function 2: \n - 1. Fucntion Name: \n    - CpSettingFormItemData(const HbDataFormModelItem *parent = 0 \n - 2. Case Descrition: \n    - Test the second constructor function. \n - 3. Input Parameters: \n    - <1> parent = new HbDataFormModelItem() \n - 4. Expected result: \n    - <1> pdata != 0, no crash \n -*/ -void TestCpAPI::testCpSettingFormItemData() -{ - // Fectch the test data from testCpSettingFormItemData_data() - QFETCH(int, aType); - QFETCH(QString, aLabel); - // test the constructor using the above data - HbDataFormModelItem::DataItemType itemType = (HbDataFormModelItem::DataItemType)aType; - CpSettingFormItemData *pdata=new CpSettingFormItemData(itemType,aLabel); - QVERIFY( pdata !=0 ); - HbDataFormModelItem::DataItemType itemTemp=pdata->type(); - QVERIFY(itemType==itemTemp); - delete pdata; - pdata=0; -} -/*! - Test Case Description: \n    - To verify all the functions in CpItemdataHelper class. \n - Function 1: \n - 1. Fucntion Name: \n    - explicit CpItemDataHelper(HbDataForm *form = 0) \n - 2. Case Descrition: \n    - Test the first constructor function. \n - 3. Input Parameters: \n    - <1> form = 0 \n - <2> form = new HbDataForm() \n - 4. Expected result: \n    - <1> pHelper != 0 \n    - <2> pHelper != 0 \n - Function 2: \n - 1. Fucntion Name: \n    - void bindToForm(HbDataForm *form) \n - 2. Input Parameters: \n    - <1> form = 0 \n    - <2> form = new HbDataForm() \n - 3. Expected result: \n    - no crash \n - Function 3: \n - 1. Fucntion Name: \n    - void addItemPrototype(HbAbstractViewItem *prototype) \n - 2. Input Parameters: \n    - <1> prototype = HbDataFormViewItem() \n    - <2> prototype = 0 \n - 3. Expected result: \n    - no crash \n - Function 4: \n - 1. Fucntion Name: \n    - void addConnection(HbDataFormModelItem *item, const char *signal, QObject *receiver,const char *method) \n - 2. Input Parameters: \n    - <1> item = new HbDataFormModelItem(), signal = char*, receiver = Qobject*, method = const char* \n    - <2> set all parameters as '0' \n - 3. Expected result: \n    - no crash \n - Function 5: \n - 1. Fucntion Name: \n    - void removeConnection(HbDataFormModelItem *item, const char *signal, Qobject *receiver, const char *method) \n - 2. Input Parameters: \n    - <1> item = new HbDataFormModelItem(), signal = char*, receiver = Qobject*, method = const char*\n    - <2> set all parameters as '0' - 3. Expected result: \n    - no crash \n - Function 6: \n - 1. Fucntion Name: \n    - void connectToForm(const char *signal, QObject *receiver, const char *method) \n - 2. Input Parameters: \n    - <1> signal = char*, receiver = Qobject*, method = const char* \n    - <2> set all parameters as '0' \n - 3. Expected result: \n    - no crash \n - Function 7: \n - 1. Fucntion Name: \n    - HbWidget *widgetFromModelIndex(const QModelIndex &index) \n - 2. Input Parameters: \n    - <1> index = const QModelIndex \n - 3. Expected result: \n    - no crash \n - Function 8: \n - 1. Fucntion Name: \n    - HbDataFormModelItem *modelItemFromModelIndex(const QModelIndex &index) \n - 2. Input Parameters: \n    - <1> index = const QModelIndex() \n    - <2> set all parameters as '0' \n - 3. Expected result: \n    - no crash \n -*/ -void TestCpAPI::testItemDataHelper() -{ - HbDataForm* form = new HbDataForm(); // create a dataform - HbDataFormModel *model = new HbDataFormModel(); - HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); // add a dataformpage - CpSettingFormItemData *mItem = new CpSettingFormItemData(HbDataFormModelItem::SliderItem, - QString("New Slider")); - general->appendChild(mItem); // add a slider to the dataformgroup, use it as a parameter when testing addConnection() function - form->setModel(model); - - // test constructor using default parameter - CpItemDataHelper *phelperdefault = new CpItemDataHelper(0); - QVERIFY (phelperdefault!=0); - - // test constructor using a HbDataForm parameter - CpItemDataHelper *phelperForm = new CpItemDataHelper(form); - QVERIFY (phelperForm!=0); - - // test bindtoForm() - phelperForm->bindToForm(0); - phelperForm->bindToForm(form); - - // test the addItemPrototype() function - int oldProtoTypeListNr = form->itemPrototypes().count(); - HbDataFormViewItem *pitem = new HbDataFormViewItem(); - phelperForm->addItemPrototype(pitem); - int newProtoTypeListNr = form->itemPrototypes().count(); - //Verify that the prototype is added to the prototypelist - QVERIFY( newProtoTypeListNr == oldProtoTypeListNr + 1 ); - - phelperForm->addItemPrototype(0); // pitem = 0 - - // test addConnection() function - char aSignal[] = "asignal"; - char aMethod[] = "amethod"; - phelperForm->addConnection( general, aSignal,mItem,aMethod); - phelperForm->removeConnection(general,aSignal,mItem, aMethod); - phelperForm->addConnection( 0,0,0,0 ); - phelperForm->removeConnection(0,0,0,0); - phelperdefault->addConnection(general, aSignal,mItem,aMethod); - - // test connectToForm() function - phelperForm->connectToForm(aSignal,mItem, aMethod); - phelperForm->disconnectFromForm(aSignal,mItem, aMethod); - phelperForm->connectToForm(0,0,0); - phelperForm->disconnectFromForm(0,0,0); - phelperdefault->connectToForm(aSignal,mItem, aMethod); - - // test widgetFromModelIndex() function - QModelIndex aIndex = model->indexFromItem(mItem); - HbWidget * widget = phelperForm->widgetFromModelIndex(aIndex); - QVERIFY( widget->type() == Hb::ItemType_Slider ); - - // test modelItemFromModelIndex() function - HbDataFormModelItem *itemTest = phelperForm->modelItemFromModelIndex(aIndex); - HbDataFormModelItem *itemGeneral = model->itemFromIndex(aIndex); - QVERIFY(itemTest == itemGeneral); - - delete phelperdefault; - phelperdefault = 0; - delete phelperForm; - phelperForm = 0; - delete form; - form = 0; - delete model; - -} -/*! - Test Case Description: \n    - Verify the class can add the control panel's proto type of setting items( only entry item currently) to the settingForm \n - 1. Fucntion Name: \n    - static void addCpItemPrototype(HbDataForm *settingForm) \n - 2. Case Descrition: \n    - Verify it can add the control panel's proto type of setting items( only entry item currently) to the settingForm \n - 3. Input Parameters: \n    - <1> settingForm = new HbDataForm () \n - <2> settingForm = 0 \n - 4. Expected result: \n    - <1> The proto type is added to the prototype list \n -*/ -void TestCpAPI::testCpPluginUtility() -{ - HbDataForm* form = new HbDataForm(); - int oldListNr = form->itemPrototypes().count(); - CpPluginUtility::addCpItemPrototype(form); // set settingForm = new HbDataForm () - int newListNr = form->itemPrototypes().count(); - QVERIFY( newListNr = oldListNr + 1 ); - - CpPluginUtility::addCpItemPrototype(0); // set settingForm = 0 -} -/*! - Test Case Description: \n    - To verify the class could load the control panel plugin. \n - Function 1: \n - 1. Fucntion Name: \n    - static CpPluginInterface *loadCpPluginInterface(const QString &pluginFile) \n - 2. Case Descrition: \n    - Verify that it can load the cp interface successfully. \n - 3. Input Parameters: \n    - <1> pluginFile = const Qstring (a vaild plugin file) \n    - <2> pluginFile = const Qstring (an invaild plugin file) \n    - <3> pluginFile = 0 \n - 4. Expected result: \n    - no crash \n - Function 2: \n - 1. Fucntion Name: \n    - static CpLauncherInterface *loadCpLauncherInterface(const QString &pluginFile) \n - 2. Case Descrition: \n    - Verify that it can load the cp cplaucher interface successfully. \n - 3. Input Parameters: \n    - <1> pluginFile = const Qstring (a vaild plugin file) \n    - <2> pluginFile = const Qstring (an invaild plugin file) \n    - <3> pluginFile = 0 \n - 4. Expected result: \n    - no crash -*/ -void TestCpAPI::testCpPluginLoader() -{ - // the plugins for test are created via the codes in tsrc/unit/pluginfortest. - QString aInvaildFile = "non_existing_plugin.dll"; - QString aVaildFile1 = "firstpluginfortest"; - QString aVaildFile2 = "secondpluginfortest.dll"; - QString aVaildFile3 = "thirdpluginfortest.qtplugin"; - - CpPluginInterface *pluginInterface = CpPluginLoader::loadCpPluginInterface(aVaildFile1); - QVERIFY(pluginInterface != 0); - - pluginInterface = CpPluginLoader::loadCpPluginInterface(aVaildFile2); - QVERIFY(pluginInterface != 0); - - pluginInterface = CpPluginLoader::loadCpPluginInterface(aVaildFile3); - QVERIFY(pluginInterface != 0); - - //Test the 'loadCpLauncherInterface' function - CpLauncherInterface *pluginLauncherInterface = CpPluginLoader::loadCpLauncherInterface(aInvaildFile); - QVERIFY(pluginLauncherInterface == 0); - - pluginLauncherInterface = CpPluginLoader::loadCpLauncherInterface(aVaildFile1); - QVERIFY(pluginLauncherInterface != 0); - - pluginLauncherInterface = CpPluginLoader::loadCpLauncherInterface(aVaildFile2); - QVERIFY(pluginLauncherInterface != 0); - - pluginLauncherInterface = CpPluginLoader::loadCpLauncherInterface(aVaildFile3); - QVERIFY(pluginLauncherInterface != 0); -} -/*! - Test Case Description: \n    - Test the CP interface can work well. \n - 1. Fucntion Name: \n    - virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const \n - 2. Case Descrition: \n    - Test the create settingformItemData() function, it's a pure vitual function. Define a simple class and test its interface. \n - 3. Input Parameters: \n    - <1> itemDataHelper = CpItemDataHelper \n - 4. Expected result: \n    - <1> no crash \n -*/ -void TestCpAPI::testCpPluginInterface() -{ - CpItemDataHelper *helper = new CpItemDataHelper(); - CpPluginInterface *plugin = CpPluginLoader::loadCpPluginInterface("firstpluginfortest"); - QVERIFY( plugin != 0 ); - QList itemData = plugin->createSettingFormItemData(*helper); - QVERIFY( itemData.size() == 1 ); - qDeleteAll(itemData.begin(),itemData.end()); - itemData.clear(); -} -/*! - Test Case Description: \n    - Test the CP launcher interface can work well.\n - 1. Fucntion Name: \n    - virtual CpBaseSettingView *createSettingView(const QVariant &hint) const \n - 2. Case Descrition: \n    - Test it can create setting view after loading the plugin. \n - 3. Input Parameters: \n    - <1> hint = Qvariant() \n - 4. Expected result: \n    - <1> no crash \n -*/ -void TestCpAPI::testCpLancherInterface() -{ - QVariant hint = QVariant(); - CpLauncherInterface *plugin = CpPluginLoader::loadCpLauncherInterface("secondpluginfortest"); - QVERIFY( plugin != 0 ); - CpBaseSettingView *testView = plugin->createSettingView(hint); - QVERIFY( testView != 0 ); - delete testView; - testView = 0; -} - -void TestCpAPI::testCpLogger() -{ -} - -QTEST_MAIN(TestCpAPI) diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpapi/src/ut_cpapi.h --- a/controlpanel/tsrc/unit/ut_cpapi/src/ut_cpapi.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ -#ifndef UT_CPAPI_H -#define UT_CPAPI_H - -#include - -class HbMainWindow; - -class TestCpAPI : public QObject -{ - Q_OBJECT -private slots: - void initTestCase(); // initialize test data - - void testCpBaseSettingView(); // test basesettingview functions - void testCpSettingFormEntryItemData(); - void testCpSettingFormEntryItemDataImpl(); //test CpSettingFormEntryItemDataImpl functions - void testCpSettingFormItemData_data(); // provide data for "testCpSettingFormItemData()" - void testCpSettingFormItemData(); //test CpSettingFormItemData - void testItemDataHelper(); //testing itemdatahelper class CpItemDataHelper - void testCpPluginUtility(); - void testCpPluginLoader(); //test cppluginloader functions - void testCpPluginInterface(); // test cpplugininterface functions - void testCpLancherInterface(); // test the cpLancherInterface class - void testCpLogger(); //test cplogger functions - void cleanupTestCase(); // Finalize test data -private: - HbMainWindow* mainWindow; -}; - -#endif //UT_CPAPI_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpapi/ut_cpapi.pro --- a/controlpanel/tsrc/unit/ut_cpapi/ut_cpapi.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# Initial Contributors: -# Nokia Corporation - initial contribution. -# Contributors: -# Description: - -TEMPLATE = app -TARGET = ut_cpapi -QT += testlib -CONFIG += hb qtestlib -CONFIG += symbian_test - -QMAKE_EXTRA_TARGETS += test autotest - -DEPENDPATH += . -INCLUDEPATH += src/ \ - ../../../src/inc \ - ../../../controlpanel_plat/inc -LIBS += -lcpframework - -# Input -HEADERS += src/ut_cpapi.h -HEADERS += src/cptestview.h -HEADERS += src/cptestpluginentryitem.h -SOURCES += src/ut_cpapi.cpp -SOURCES += src/cptestview.cpp -SOURCES += src/cptestpluginentryitem.cpp - -symbian*: { - TARGET.CAPABILITY = CAP_APPLICATION - LIBS += -lfirstpluginfortest \ - -lsecondpluginfortest \ - -lthirdpluginfortest - deploy.path = C: - testdlls.sources += firstpluginfortest.dll secondpluginfortest.dll thirdpluginfortest.dll - testdlls.path = /sys/bin - - testqtplugins.sources += ../pluginfortest/firstpluginfortest/qmakepluginstubs/firstpluginfortest.qtplugin \ - ../pluginfortest/secondpluginfortest/qmakepluginstubs/secondpluginfortest.qtplugin \ - ../pluginfortest/thirdpluginfortest/qmakepluginstubs/thirdpluginfortest.qtplugin - testqtplugins.path = /resource/qt/plugins/controlpanel - - DEPLOYMENT += testdlls testqtplugins -} - - - -symbian:BLD_INF_RULES.prj_exports += "data/controlpanellog.conf C:/data/.config/ut_cpapi/controlpanellog.conf" - -unix { - test.commands = /epoc32/RELEASE/WINSCW/udeb/ut_cpapi.exe - autotest.commands = /epoc32/RELEASE/WINSCW/udeb/ut_cpapi.exe -xml -o c:/ut_cpapi.xml -} -else:win32 { - test.CONFIG += recursive - autotest.CONFIG += recursive - build_pass { - test.commands = /epoc32/RELEASE/WINSCW/udeb/ut_cpapi.exe - autotest.commands = /epoc32/RELEASE/WINSCW/udeb/ut_cpapi.exe -xml -o c:/ut_cpapi.xml - } -} \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpbasesettingview/src/mycpbasesettingview.cpp --- a/controlpanel/tsrc/unit/ut_cpbasesettingview/src/mycpbasesettingview.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#include "mycpbasesettingview.h" - -/*! - \class MyCpBaseSettingView - \brief This is a derived class used for protected member functions testing \n - */ - -/*! - * public function, only provide a method for QTest to call the protected close() function. \n - * directly call close() in base class. - */ -void MyCpBaseSettingView::close() - { - CpBaseSettingView::close(); - } - -void MyCpBaseSettingView::testprivate() -{ - MyCpBaseSettingView *p = this; - const QMetaObject *mobj = p->metaObject(); - CpBaseSettingView::qt_metacall( QMetaObject::InvokeMetaMethod,mobj->indexOfSlot("aboutToClose()"),0); - CpBaseSettingView::qt_metacall( QMetaObject::InvokeMetaMethod,mobj->indexOfSlot("_q_softkeyClicked()"),0); - CpBaseSettingView::qt_metacall( QMetaObject::InvokeMetaMethod,mobj->indexOfSlot("_q_viewChanged(HbView *view)"),(void**)(&p)); - QModelIndex idx; - CpBaseSettingView::qt_metacall( QMetaObject::InvokeMetaMethod,mobj->indexOfSlot("_q_itemActivated(const QModelIndex &index)"), ((void **)(&idx)) ); -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpbasesettingview/src/mycpbasesettingview.h --- a/controlpanel/tsrc/unit/ut_cpbasesettingview/src/mycpbasesettingview.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#ifndef MYCPBASESETTINGVIEW_H_ -#define MYCPBASESETTINGVIEW_H_ - -#include -#include - -class MyCpBaseSettingView : public CpBaseSettingView - { - Q_OBJECT - -public: - /*! - * provide a public interface for unit test code to call close() - */ - virtual void close(); - - void testprivate(); - }; - -#endif /* MYCPBASESETTINGVIEW_H_ */ diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpbasesettingview/src/ut_cpbasesettingview.cpp --- a/controlpanel/tsrc/unit/ut_cpbasesettingview/src/ut_cpbasesettingview.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#include "ut_cpbasesettingview.h" - -#include "cpbasesettingview.h" -#include "mycpbasesettingview.h" - -#include -#include -#include - -/*! - \class TestCpBaseSettingView - \brief \n - The TestCpBaseSettingView is used for the unit testing for CpBaseSettingView class. - This unit test is supported by QTest. - There are 3 test cases for this unit. - */ - -void TestCpBaseSettingView::initTestCase() - { - - } - -void TestCpBaseSettingView::cleanupTestCase() - { - QCoreApplication::processEvents(); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: CpBaseSettingView() \n  - 2. Function Descrition: \n    - 2.1 Create CpBaseSettingView object with 0 pointer.\n    - 2.2 call setWidget to set a widget into the view object.\n    - 2.3 verify widget object is set correctly.\n    - 2.4 delete the object.\n   - 3. Input Parameters: \n  - @param: 0\n - 4. Expected result: \n   - CpBaseSettingView object created successfully.\n - */ -void TestCpBaseSettingView::testCpBaseSettingViewWithNullPointer() - { - CpBaseSettingView * pView = new CpBaseSettingView(0); - QVERIFY( pView != 0 ); - - HbDataForm *pForm = new HbDataForm(0); - pView->setWidget(pForm); - HbDataForm *pForm1 = qobject_cast(pView->widget()); - QVERIFY( pForm1 != 0); - QVERIFY( pForm1 == pForm ); - - delete pView; - pView = 0; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: CpBaseSettingView() \n  - 2. Function Descrition: \n   - 2.1 Create CpBaseSettingView object with a widget pointer.\n    - 2.2 verify widget object is set correctly.\n    - 2.3 delete the object.\n   - 3. Input Parameters: \n  - @param: widget pointer. \n - 4. Expected result: \n   - CpBaseSettingView object created successfully.\n - */ -void TestCpBaseSettingView::testCpBaseSettingViewWithPushButtonWidget() - { - HbPushButton *widget = new HbPushButton(); - QVERIFY(widget != 0); - - CpBaseSettingView *pView1 = new CpBaseSettingView(widget); - QVERIFY(pView1!=0); - - HbPushButton *button = qobject_cast(pView1->widget()); - QVERIFY(button != 0); - QVERIFY(button == widget); - - delete pView1; - pView1 = 0; - } - -/*! - * Test protected close() function, must be called in derived class - */ -/*! - * Test Case Description:\n   - * 1. Fucntion Name: close() \n  - 2. Function Descrition: \n   - 2.1 Declare a derived class, MyCpBaseSettingView, create a MyCpBaseSettingView object with default constructor.\n    - 2.2 call close().\n    - 2.3 delete the object.\n   - 3. Input Parameters: \n  - @param: 0\n - 4. Expected result: \n   - view closed.\n - */ -void TestCpBaseSettingView::testCloseWithoutParam() - { - MyCpBaseSettingView * pMyView = new MyCpBaseSettingView(); - QVERIFY( pMyView != 0 ); - HbDataForm *pForm = new HbDataForm(0); - pMyView->setWidget(pForm); - HbDataForm *pForm1 = qobject_cast(pMyView->widget()); - QVERIFY( pForm1 != 0); - QVERIFY( pForm1 == pForm ); - - pMyView->close(); - - delete pMyView; - pMyView = 0; - } - -void TestCpBaseSettingView::testPrivateFunc() - { - MyCpBaseSettingView * pMyView = new MyCpBaseSettingView(); - QVERIFY( pMyView != 0 ); - pMyView->testprivate(); - - delete pMyView; - pMyView = 0; - } - -QTEST_MAIN(TestCpBaseSettingView) diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpbasesettingview/src/ut_cpbasesettingview.h --- a/controlpanel/tsrc/unit/ut_cpbasesettingview/src/ut_cpbasesettingview.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#ifndef UT_CP_BASE_SETTING_VIEW_H -#define UT_CP_BASE_SETTING_VIEW_H - -#include - -class TestCpBaseSettingView : public QObject -{ - Q_OBJECT - -private slots: - void initTestCase(); - void cleanupTestCase(); - -//public slots: - /*! - * Test case 1 for constructor of class CpBaseSettingView - */ - void testCpBaseSettingViewWithNullPointer(); - /*! - * Test case 2 for constructor of class CpBaseSettingView - */ - void testCpBaseSettingViewWithPushButtonWidget(); - /*! - * Test case for protected close() function - */ - void testCloseWithoutParam(); - - void testPrivateFunc(); -}; - -#endif // UT_CP_BASE_SETTING_VIEW_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpbasesettingview/ut_cpbasesettingview.pri --- a/controlpanel/tsrc/unit/ut_cpbasesettingview/ut_cpbasesettingview.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -HEADERS += src/ut_cpbasesettingview.h \ - src/mycpbasesettingview.h - -SOURCES += src/ut_cpbasesettingview.cpp \ - src/mycpbasesettingview.cpp - -INCLUDEPATH += . \ - src/\ - ../../../src/inc \ - ../../../controlpanel_plat/inc diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpbasesettingview/ut_cpbasesettingview.pro --- a/controlpanel/tsrc/unit/ut_cpbasesettingview/ut_cpbasesettingview.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = app -TARGET = ut_cpbasesettingview - -include (../ut_common.pri) -include (ut_cpbasesettingview.pri) - -symbian: { - TARGET.UID3 = 0xEE3E465B -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpdataformbuttonentryviewitem/src/mycpdataformbuttonentryviewitem.cpp --- a/controlpanel/tsrc/unit/ut_cpdataformbuttonentryviewitem/src/mycpdataformbuttonentryviewitem.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#include "mycpdataformbuttonentryviewitem.h" - -/*! - \class MyCpDataFormButtonEntryViewItem - \brief The MyCpDataFormButtonEntryViewItem class is designed for the unit testing for the protected member functions in CpDataFormButtonEntryViewItem class. - */ - -/*! - * Default constructor - */ -MyCpDataFormButtonEntryViewItem::MyCpDataFormButtonEntryViewItem(QGraphicsItem *parent) : CpDataFormButtonEntryViewItem(parent) - { - - } - -/*! - * Copy constructor - */ -MyCpDataFormButtonEntryViewItem::MyCpDataFormButtonEntryViewItem(const MyCpDataFormButtonEntryViewItem& other) : -CpDataFormButtonEntryViewItem(other) - { - - } - -/*! - * This is designed for testing of the copy assignment operator = in class CpDataFormButtonEntryViewItem, - * that operator was declared as protected. - * the detection of self assignment was removed to enable the detection in base class implementation executed. - */ -MyCpDataFormButtonEntryViewItem& MyCpDataFormButtonEntryViewItem::operator=(const MyCpDataFormButtonEntryViewItem& other) - { -// if (&other == this) -// { -// return *this; -// } - - CpDataFormButtonEntryViewItem::operator=(other); - - return *this; - } - -/*! - * this is also for protected member functions testing, call base class implematation directly. - */ -HbWidget * MyCpDataFormButtonEntryViewItem::createCustomWidget() - { - return CpDataFormButtonEntryViewItem::createCustomWidget(); - } - - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpdataformbuttonentryviewitem/src/mycpdataformbuttonentryviewitem.h --- a/controlpanel/tsrc/unit/ut_cpdataformbuttonentryviewitem/src/mycpdataformbuttonentryviewitem.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#ifndef _MY_CP_DATAFORM_BUTTONENTRY_VIEWITEM_H_ -#define _MY_CP_DATAFORM_BUTTONENTRY_VIEWITEM_H_ - -#include "cpdataformbuttonentryviewitem.h" - -#include - -class MyCpDataFormButtonEntryViewItem : public QObject, public CpDataFormButtonEntryViewItem - { -public: - MyCpDataFormButtonEntryViewItem(QGraphicsItem *parent = 0); - MyCpDataFormButtonEntryViewItem(const MyCpDataFormButtonEntryViewItem& other); - - MyCpDataFormButtonEntryViewItem& operator=(const MyCpDataFormButtonEntryViewItem& other); - - HbWidget * createCustomWidget(); - }; - -#endif /* _MY_CP_DATAFORM_BUTTONENTRY_VIEWITEM_H_ */ diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpdataformbuttonentryviewitem/src/ut_cpdataformbuttonentryviewitem.cpp --- a/controlpanel/tsrc/unit/ut_cpdataformbuttonentryviewitem/src/ut_cpdataformbuttonentryviewitem.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,291 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ -#include "ut_cpdataformbuttonentryviewitem.h" - -#include "cpdataformbuttonentryviewitem.h" -#include "mycpdataformbuttonentryviewitem.h" -#include "cpbasesettingview.h" - -#include -#include -#include -#include -#include -#include -#include - -/*! - \class TestCpDataFormButtonEntryViewItem - \brief The TestCpDataFormButtonEntryViewItem class is designed for the unit testing for CpDataFormButtonEntryViewItem class. - This unit test is supported by QTest. - There are total 8 test cases in this unit. - */ - -void TestCpDataFormButtonEntryViewItem::initTestCase() - { - mainWindow = 0; - } - -void TestCpDataFormButtonEntryViewItem::cleanupTestCase() - { - delete mainWindow; - - //if delete mainwindow, test app will be freezing - QCoreApplication::processEvents(); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: CpDataFormButtonEntryViewItem() \n  - 2. Function Descrition: \n    - 2.1 Create CpDataFormButtonEntryViewItem object with a HbDataForm pointer.\n    - 2.2 verify object created successfully.\n    - 2.3 delete the object.\n   - 3. Input Parameters: \n  - @param: HbDataForm pointer.\n - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpDataFormButtonEntryViewItem::testCpDataFormButtonEntryViewItemWithDataFormParent() - { - HbDataForm * form = new HbDataForm(); - QVERIFY( form != 0 ); - - int count0 = form->itemPrototypes().count(); - CpPluginUtility::addCpItemPrototype(form); - int count1 = form->itemPrototypes().count(); - QVERIFY( count0 + 2 == count1 ); - - CpDataFormButtonEntryViewItem * item = new CpDataFormButtonEntryViewItem(form); - QVERIFY(item != 0); - - delete item; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: CpDataFormButtonEntryViewItem() \n  - 2. Function Descrition: \n    - 2.1 Create CpDataFormButtonEntryViewItem object with a 0 pointer.\n    - 2.2 verify object created successfully.\n    - 2.3 delete the object.\n   - 3. Input Parameters: \n  - @param: 0 pointer.\n - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpDataFormButtonEntryViewItem::testCpDataFormButtonEntryViewItemWithNullParent() - { - CpDataFormButtonEntryViewItem * item = new CpDataFormButtonEntryViewItem(); - QVERIFY(item != 0); - - delete item; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: CpDataFormButtonEntryViewItem(const CpDataFormButtonEntryViewItem &ohter) \n  - 2. Function Descrition: \n    - 2.1 Create CpDataFormButtonEntryViewItem object with another CpDataFormButtonEntryViewItem object.\n    - 2.2 verify object created successfully.\n    - 2.3 delete the object.\n   - 3. Input Parameters: \n  - @param: CpDataFormButtonEntryViewItem object.\n - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpDataFormButtonEntryViewItem::testCpDataFormButtonEntryViewItemWithCopyConstructor() - { - MyCpDataFormButtonEntryViewItem * item1 = new MyCpDataFormButtonEntryViewItem(); - QVERIFY( item1 != 0 ); - - MyCpDataFormButtonEntryViewItem * item2 = new MyCpDataFormButtonEntryViewItem(*item1); - QVERIFY( item2 != 0 ); - - delete item1; - delete item2; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name:\n   - HbAbstractViewItem *createItem();\n  - 2. Function Descrition: \n    - 2.1 Create CpDataFormButtonEntryViewItem object.\n    - 2.2 verify object created successfully.\n    - 2.3 call createItem() to create a HbAbstractViewItem object.\n   - 2.4 verify the object is not 0.\n   - 2.5 delete both objects.\n   - 3. Input Parameters: \n  - @param: none.\n - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpDataFormButtonEntryViewItem::testCreateItemWithDataForm() - { - HbDataForm * form = new HbDataForm(); - QVERIFY( form != 0 ); - - int count0 = form->itemPrototypes().count(); - CpPluginUtility::addCpItemPrototype(form); - int count1 = form->itemPrototypes().count(); - QVERIFY( count0 + 2 == count1 ); - - CpDataFormButtonEntryViewItem * item = new CpDataFormButtonEntryViewItem(form); - QVERIFY(item != 0); - - HbAbstractViewItem * pvItem1 = item->createItem(); - QVERIFY(pvItem1 != 0); - - delete pvItem1; - delete item; - delete form; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name:\n   - HbAbstractViewItem *createItem();\n  - 2. Function Descrition: \n    - 2.1 Create CpDataFormButtonEntryViewItem object.\n    - 2.2 verify object created successfully.\n    - 2.3 call createItem() to create a HbAbstractViewItem object.\n   - 2.4 verify the object is not 0.\n   - 2.5 delete both objects.\n   - 3. Input Parameters: \n  - @param: none.\n - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpDataFormButtonEntryViewItem::testCreateItemNoDataForm() - { - CpDataFormButtonEntryViewItem * item = new CpDataFormButtonEntryViewItem(); - QVERIFY(item != 0); - - HbAbstractViewItem * pvItem1 = item->createItem(); - QVERIFY(pvItem1 != 0); - - delete pvItem1; - delete item; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name:\n   - CpDataFormButtonEntryViewItem &operator = (const CpDataFormButtonEntryViewItem &ohter);\n\n  - - 2. Function Descrition: \n    - 2.1 Create CpDataFormButtonEntryViewItem object.\n    - 2.2 verify object created successfully.\n    - 2.3 assign this object to another object.\n   - 2.4 delete object.\n\n   - - 3. Input Parameters: \n\n  - @param: none.\n - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpDataFormButtonEntryViewItem::testAssignmentOperatorWithOtherObject() - { - MyCpDataFormButtonEntryViewItem * item1 = new MyCpDataFormButtonEntryViewItem(); - QVERIFY(item1 != 0); - - MyCpDataFormButtonEntryViewItem item2; - - item2 = *item1; - - delete item1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name:\n   - CpDataFormButtonEntryViewItem &operator = (const CpDataFormButtonEntryViewItem &ohter);\n\n  - - 2. Function Descrition: \n    - 2.1 Create CpDataFormButtonEntryViewItem object.\n    - 2.2 verify object created successfully.\n    - 2.3 assign this object to itself.\n   - 2.4 delete object.\n\n   - - 3. Input Parameters: \n\n  - @param: none.\n - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpDataFormButtonEntryViewItem::testAssignmentOperatorBySelf() - { - MyCpDataFormButtonEntryViewItem * item1 = new MyCpDataFormButtonEntryViewItem(); - QVERIFY(item1 != 0); - - *item1 = *item1; - - delete item1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name:\n   - HbWidget *createCustomWidget(); - - 2. Function Descrition: \n    - - 3. Input Parameters: \n\n  - @param: none.\n - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpDataFormButtonEntryViewItem::testCreateCustomedWidgetWithDataForm() - { - HbDataForm * form = new HbDataForm(); - QVERIFY( form != 0 ); - - int count0 = form->itemPrototypes().count(); - CpPluginUtility::addCpItemPrototype(form); - int count1 = form->itemPrototypes().count(); - QVERIFY( count0 + 2 == count1 ); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl( CpSettingFormEntryItemData::ButtonEntryItem, form, "text", "description" ); - QVERIFY( pdataimp1 !=0 ); - - HbDataFormModel * model = new HbDataFormModel; - QVERIFY( model != 0 ); - - model->appendDataFormItem(pdataimp1); - form->setModel(model); - - mainWindow = new HbMainWindow; - QVERIFY( mainWindow != 0 ); - - CpBaseSettingView *mainView = new CpBaseSettingView(form); - QVERIFY( mainView != 0 ); - - QObject::connect(mainView,SIGNAL(aboutToClose()),qApp,SLOT(quit())); - HbView * view = mainWindow->addView(mainView); - QVERIFY( view != 0 ); - - mainWindow->setCurrentView(mainView); - HbView * curView = mainWindow->currentView(); - QVERIFY( curView == mainView ); - - mainWindow->show(); - } - -QTEST_MAIN(TestCpDataFormButtonEntryViewItem) diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpdataformbuttonentryviewitem/src/ut_cpdataformbuttonentryviewitem.h --- a/controlpanel/tsrc/unit/ut_cpdataformbuttonentryviewitem/src/ut_cpdataformbuttonentryviewitem.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#ifndef TEST_CP_DATAFORM_BUTTONENTRY_VIEWITEM_H -#define TEST_CP_DATAFORM_BUTTONENTRY_VIEWITEM_H - -#include - -class HbMainWindow; - -class TestCpDataFormButtonEntryViewItem : public QObject -{ - Q_OBJECT - -private slots: - void initTestCase(); - void cleanupTestCase(); - -//public slots: - void testCpDataFormButtonEntryViewItemWithDataFormParent(); - void testCpDataFormButtonEntryViewItemWithNullParent(); - void testCpDataFormButtonEntryViewItemWithCopyConstructor(); - - void testCreateItemWithDataForm(); - void testCreateItemNoDataForm(); - - void testAssignmentOperatorWithOtherObject(); - void testAssignmentOperatorBySelf(); - - void testCreateCustomedWidgetWithDataForm(); - -private: - HbMainWindow* mainWindow; -}; - -#endif // TEST_CP_DATAFORM_BUTTONENTRY_VIEWITEM_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpdataformbuttonentryviewitem/ut_cpdataformbuttonentryviewitem.pri --- a/controlpanel/tsrc/unit/ut_cpdataformbuttonentryviewitem/ut_cpdataformbuttonentryviewitem.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -HEADERS += src/ut_cpdataformbuttonentryviewitem.h \ - src/mycpdataformbuttonentryviewitem.h \ - ../../../src/cpframework/src/cpdataformbuttonentryviewitem.h \ - -SOURCES += src/ut_cpdataformbuttonentryviewitem.cpp \ - src/mycpdataformbuttonentryviewitem.cpp \ - ../../../src/cpframework/src/cpdataformbuttonentryviewitem.cpp \ - -INCLUDEPATH += . \ - src/\ - ../../../src/inc \ - ../../../controlpanel_plat/inc \ - ../../../src/cpframework/src diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpdataformbuttonentryviewitem/ut_cpdataformbuttonentryviewitem.pro --- a/controlpanel/tsrc/unit/ut_cpdataformbuttonentryviewitem/ut_cpdataformbuttonentryviewitem.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = app -TARGET = ut_cpdataformbuttonentryviewitem - -include (../ut_common.pri) -include (ut_cpdataformbuttonentryviewitem.pri) - -symbian: { - TARGET.UID3 = 0xE43C01BC -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpdataformlistentryviewitem/src/mycpdataformlistentryviewitem.cpp --- a/controlpanel/tsrc/unit/ut_cpdataformlistentryviewitem/src/mycpdataformlistentryviewitem.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#include "mycpdataformlistentryviewitem.h" - -#include - -/*! - \class MyCpDataFormListEntryViewItem - \brief The MyCpDataFormListEntryViewItem class is designed for the unit testing for the protected member functions in CpDataFormListEntryViewItem class. - */ - -/*! - * Default constructor - */ -MyCpDataFormListEntryViewItem::MyCpDataFormListEntryViewItem(QGraphicsItem *parent) : CpDataFormListEntryViewItem(parent) - { - - } - -/*! - * this is also for protected member functions testing, call base class implematation directly. - */ -HbWidget * MyCpDataFormListEntryViewItem::createCustomWidget() - { - return CpDataFormListEntryViewItem::createCustomWidget(); - } - -void MyCpDataFormListEntryViewItem::pressStateChanged(bool pressed, bool animate) - { - CpDataFormListEntryViewItem::pressStateChanged(pressed, animate); - } - -void MyCpDataFormListEntryViewItem::gestureEvent(QGestureEvent *event) - { - CpDataFormListEntryViewItem::gestureEvent(event); - } diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpdataformlistentryviewitem/src/mycpdataformlistentryviewitem.h --- a/controlpanel/tsrc/unit/ut_cpdataformlistentryviewitem/src/mycpdataformlistentryviewitem.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#ifndef _MY_CP_DATAFORM_LISTENTRY_VIEWITEM_H_ -#define _MY_CP_DATAFORM_LISTENTRY_VIEWITEM_H_ - -#include "cpdataformlistentryviewitem.h" - -#include - -class MyCpDataFormListEntryViewItem : public QObject, public CpDataFormListEntryViewItem - { -public: - MyCpDataFormListEntryViewItem(QGraphicsItem *parent = 0); - - virtual HbWidget * createCustomWidget(); - virtual void pressStateChanged(bool pressed, bool animate); -#ifdef HB_GESTURE_FW - //from HbWidgetBase - virtual void gestureEvent(QGestureEvent *event); -#endif - }; - -#endif /* _MY_CP_DATAFORM_LISTENTRY_VIEWITEM_H_ */ diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpdataformlistentryviewitem/src/ut_cpdataformlistentryviewitem.cpp --- a/controlpanel/tsrc/unit/ut_cpdataformlistentryviewitem/src/ut_cpdataformlistentryviewitem.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,242 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#include "ut_cpdataformlistentryviewitem.h" - -#include "cpdataformlistentryviewitem.h" -#include "CpSettingFormEntryItemDataImpl.h" -#include "mycpdataformlistentryviewitem.h" - -#include -#include -#include -#include -#include -#include -#include - -/*! - \class TestCpDataFormListEntryViewItem - \brief The TestCpDataFormListEntryViewItem class is designed for the unit testing for CpDataFormListEntryViewItem class. - This unit test is supported by QTest. - There are total 6 test cases in this unit. - */ - -void TestCpDataFormListEntryViewItem::initTestCase() - { - mainWindow = 0; - } - -void TestCpDataFormListEntryViewItem::cleanupTestCase() - { - delete mainWindow; - - //if delete mainwindow, test app will be freezing - QCoreApplication::processEvents(); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: CpDataFormListEntryViewItem() \n  - 2. Function Descrition: \n    - 2.1 Create CpDataFormListEntryViewItem object with a HbDataForm pointer.\n    - 2.2 verify object created successfully.\n    - 2.3 delete the object.\n   - 3. Input Parameters: \n  - @param: HbDataForm pointer.\n - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpDataFormListEntryViewItem::testCpDataFormListEntryViewItemWithDataForm() - { - HbDataForm * form = new HbDataForm(); - QVERIFY( form != 0 ); - - int count0 = form->itemPrototypes().count(); - CpPluginUtility::addCpItemPrototype(form); - int count1 = form->itemPrototypes().count(); - QVERIFY( count0 + 2 == count1 ); - - CpDataFormListEntryViewItem * item = new CpDataFormListEntryViewItem(form); - QVERIFY(item != 0); - - delete form; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: CpDataFormListEntryViewItem() \n  - 2. Function Descrition: \n    - 2.1 Create CpDataFormListEntryViewItem object with a 0 pointer.\n    - 2.2 verify object created successfully.\n    - 2.3 delete the object.\n   - 3. Input Parameters: \n  - @param: HbDataForm pointer.\n - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpDataFormListEntryViewItem::testCpDataFormListEntryViewItemWithNullPointer() - { - CpDataFormListEntryViewItem * item = new CpDataFormListEntryViewItem(); - QVERIFY(item != 0); - - delete item; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name:\n   - HbAbstractViewItem *createItem();\n  - 2. Function Descrition: \n    - 2.1 Create CpDataFormListEntryViewItem object.\n    - 2.2 verify object created successfully.\n    - 2.3 call createItem() to create a HbAbstractViewItem object.\n   - 2.4 verify the object is not 0.\n   - 2.5 delete both objects.\n   - 3. Input Parameters: \n  - @param: none.\n - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpDataFormListEntryViewItem::testCreateItemNoDataForm() - { - CpDataFormListEntryViewItem * item = new CpDataFormListEntryViewItem(); - QVERIFY(item != 0); - - HbAbstractViewItem * item1 = item->createItem(); - QVERIFY(item1 != 0); - - delete item1; - delete item; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name:\n   - HbAbstractViewItem *createItem();\n  - 2. Function Descrition: \n    - 2.1 Create CpDataFormListEntryViewItem object.\n    - 2.2 verify object created successfully.\n    - 2.3 call createItem() to create a HbAbstractViewItem object.\n   - 2.4 verify the object is not 0.\n   - 2.5 delete both objects.\n   - 3. Input Parameters: \n  - @param: none.\n - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpDataFormListEntryViewItem::testCreateItemWithDataForm() - { - HbDataForm * form = new HbDataForm(); - QVERIFY( form != 0 ); - - CpDataFormListEntryViewItem * item = new CpDataFormListEntryViewItem(form); - QVERIFY(item != 0); - - HbAbstractViewItem * item1 = item->createItem(); - QVERIFY(item1 != 0); - - delete item; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: CanSetModelIndex();\n   - - 2. Function Descrition: \n    - - 3. Input Parameters: \n  - @param: none.\n - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpDataFormListEntryViewItem::testCanSetModelIndexWithDataForm() - { - HbDataForm * form = new HbDataForm(); - QVERIFY( form != 0 ); - - int count0 = form->itemPrototypes().count(); - CpPluginUtility::addCpItemPrototype(form); - int count1 = form->itemPrototypes().count(); - QVERIFY( count0 + 2 == count1 ); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl( CpSettingFormEntryItemData::ListEntryItem, form, "text", "description" ); - QVERIFY( pdataimp1 !=0 ); - - HbDataFormModel * model = new HbDataFormModel; - QVERIFY( model != 0 ); - - model->appendDataFormItem(pdataimp1); - form->setModel(model); - form->show(); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - HbWidget* createCustomWidget(); - - 2. Function Descrition: \n    - - 3. Input Parameters: \n  - @param: none.\n - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpDataFormListEntryViewItem::testCreateCustomedWidgetNoParam() - { - HbDataForm * form = new HbDataForm(); - QVERIFY( form != 0 ); - - int count0 = form->itemPrototypes().count(); - CpPluginUtility::addCpItemPrototype(form); - int count1 = form->itemPrototypes().count(); - QVERIFY( count0 + 2 == count1 ); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl( CpSettingFormEntryItemData::ListEntryItem, form, "text", "description" ); - QVERIFY( pdataimp1 !=0 ); - - HbDataFormModel * model = new HbDataFormModel; - QVERIFY( model != 0 ); - - model->appendDataFormItem(pdataimp1); - form->setModel(model); - - mainWindow = new HbMainWindow; - QVERIFY( mainWindow != 0 ); - - CpBaseSettingView *mainView = new CpBaseSettingView(form); - QVERIFY( mainView != 0 ); - - QObject::connect(mainView,SIGNAL(aboutToClose()),qApp,SLOT(quit())); - HbView * view = mainWindow->addView(mainView); - QVERIFY( view != 0 ); - - mainWindow->setCurrentView(mainView); - HbView * curView = mainWindow->currentView(); - QVERIFY( curView == mainView ); - - mainWindow->show(); - } - -QTEST_MAIN(TestCpDataFormListEntryViewItem) diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpdataformlistentryviewitem/src/ut_cpdataformlistentryviewitem.h --- a/controlpanel/tsrc/unit/ut_cpdataformlistentryviewitem/src/ut_cpdataformlistentryviewitem.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#ifndef TEST_CP_DATAFORM_LISTENTRY_VIEWITEM_H -#define TEST_CP_DATAFORM_LISTENTRY_VIEWITEM_H - -#include - -class HbMainWindow; - -class TestCpDataFormListEntryViewItem : public QObject -{ - Q_OBJECT - -private slots: - void initTestCase(); - void cleanupTestCase(); - -//public slots: - void testCpDataFormListEntryViewItemWithDataForm(); - void testCpDataFormListEntryViewItemWithNullPointer(); - void testCreateItemNoDataForm(); - void testCreateItemWithDataForm(); - void testCanSetModelIndexWithDataForm(); - void testCreateCustomedWidgetNoParam(); - -private: - HbMainWindow* mainWindow; -}; - -#endif // TEST_CP_DATAFORM_LISTENTRY_VIEWITEM_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpdataformlistentryviewitem/ut_cpdataformlistentryviewitem.pri --- a/controlpanel/tsrc/unit/ut_cpdataformlistentryviewitem/ut_cpdataformlistentryviewitem.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -HEADERS += src/ut_cpdataformlistentryviewitem.h \ - src/mycpdataformlistentryviewitem.h \ - ../../../src/cpframework/src/cpdataformlistentryviewitem.h \ - -SOURCES += src/ut_cpdataformlistentryviewitem.cpp \ - src/mycpdataformlistentryviewitem.cpp \ - ../../../src/cpframework/src/cpdataformlistentryviewitem.cpp \ - -INCLUDEPATH += . \ - src/\ - ../../../src/inc \ - ../../../controlpanel_plat/inc \ - ../../../src/cpframework/src diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpdataformlistentryviewitem/ut_cpdataformlistentryviewitem.pro --- a/controlpanel/tsrc/unit/ut_cpdataformlistentryviewitem/ut_cpdataformlistentryviewitem.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = app -TARGET = ut_cpdataformlistentryviewitem - -include (../ut_common.pri) -include (ut_cpdataformlistentryviewitem.pri) - -symbian: { - TARGET.UID3 = 0xE93910F0 -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpitemdatahelper/src/ut_cpitemdatahelper.cpp --- a/controlpanel/tsrc/unit/ut_cpitemdatahelper/src/ut_cpitemdatahelper.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,753 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#include "ut_cpitemdatahelper.h" - -#include -#include -#include -#include -#include -#include - -/*! - \class TestCpItemDataHelper - \brief The TestCpItemDataHelper class is designed for the unit testing for CpItemDataHelper class. - This unit test is supported by QTest. - There are total 21 test cases in this unit. - */ - -void TestCpItemDataHelper::initTestCase() - { - } - -void TestCpItemDataHelper::cleanupTestCase() - { - QCoreApplication::processEvents(); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: CpItemDataHelper() \n  - 2. Function Descrition: \n    - 2.1 Create CpItemDataHelper object with a 0 pointer.\n    - 2.2 verify object created successfully.\n    - 2.3 delete the object.\n   - 3. Input Parameters: \n  - @param: none.\n - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testCpItemDataHelperWithNullPointer() - { - CpItemDataHelper *pHelper = new CpItemDataHelper(); - QVERIFY(pHelper != 0); - - delete pHelper; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: CpItemDataHelper() \n  - 2. Function Descrition: \n    - 2.1 Create CpItemDataHelper object with a HbDataForm pointer.\n    - 2.2 verify object created successfully.\n    - 2.3 delete the object.\n   - 3. Input Parameters: valid HbDataForm object pointer. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testCpItemDataHelperWithDataForm() - { - HbDataForm* form = new HbDataForm(); - QVERIFY(form != 0); - - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY(model != 0); - HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); - QVERIFY(general != 0); - - form->setModel(model); - - CpItemDataHelper *pHelper = new CpItemDataHelper(form); - QVERIFY(pHelper != 0); - - delete pHelper; - delete form; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: bindToForm() \n  - 2. Function Descrition: \n    - 2.1 Create CpItemDataHelper object with a 0 pointer.\n    - 2.2 call bindToForm later.\n    - 2.3 delete the object.\n   - 3. Input Parameters: 0/HbDataForm object pointer. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testBindToFormWithDataForm() - { - HbDataForm* form = new HbDataForm(); - QVERIFY(form != 0); - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY(model != 0); - HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); - QVERIFY(general != 0); - - form->setModel(model); - - CpItemDataHelper *pHelper = new CpItemDataHelper(); - QVERIFY(pHelper != 0); - - //to increase the branch coverage - pHelper->bindToForm(form); - pHelper->bindToForm(form); - pHelper->bindToForm(0); - pHelper->bindToForm(form); - - delete pHelper; - delete form; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: addItemPrototype() \n  - 2. Function Descrition: \n    - 2.1 Create CpItemDataHelper object with a 0 pointer.\n    - 2.2 call addItemPrototype, provide 0 pointer.\n    - 2.3 delete the object.\n   - 3. Input Parameters: 0. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testAddItemPrototypeWithNullPointer1() - { - HbDataForm* form = new HbDataForm(); - QVERIFY(form != 0); - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY(model != 0); - HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); - QVERIFY(general != 0); - - form->setModel(model); - - CpItemDataHelper *pHelper = new CpItemDataHelper(); - QVERIFY(pHelper != 0); - - int count1 = form->itemPrototypes().count(); - HbDataFormViewItem * pitem1 = 0; - //pass 0 proto type - pHelper->addItemPrototype(pitem1); - int count2 = form->itemPrototypes().count(); - QVERIFY(count1 == count2); - - delete pHelper; - delete form; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: addItemPrototype() \n  - 2. Function Descrition: \n    - 3. Input Parameters: HbDataFormViewItem object pointer. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testAddItemPrototypeWithViewItem1() - { - HbDataForm* form = new HbDataForm(); - QVERIFY(form != 0); - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY(model != 0); - HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); - QVERIFY(general != 0); - - form->setModel(model); - - CpItemDataHelper *pHelper = new CpItemDataHelper(); - QVERIFY(pHelper != 0); - - int count1 = form->itemPrototypes().count(); - HbDataFormViewItem * pitem1 = new HbDataFormViewItem(); - //pass 0 proto type - pHelper->addItemPrototype(pitem1); - int count2 = form->itemPrototypes().count(); - QVERIFY(count1 == count2); - - pHelper->bindToForm(form); - int count3 = form->itemPrototypes().count(); - QVERIFY(count1 + 1 == count3); - - delete pHelper; - delete form; - } - -/*! - * Create CpItemDataHelper instance, call addItemPrototype with 0 - */ -/*! - * Test Case Description:\n   - * 1. Fucntion Name: addItemPrototype() \n  - 2. Function Descrition: \n    - 3. Input Parameters: 0 pointer. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testAddItemPrototypeWithNullPointer2() - { - HbDataForm* form = new HbDataForm(); - QVERIFY(form != 0); - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY(model != 0); - HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); - QVERIFY(general != 0); - - form->setModel(model); - - CpItemDataHelper *pHelper = new CpItemDataHelper(form); - QVERIFY(pHelper != 0); - - int count1 = form->itemPrototypes().count(); - HbDataFormViewItem * pitem1 = 0; - //pass 0 proto type - pHelper->addItemPrototype(pitem1); - int count2 = form->itemPrototypes().count(); - QVERIFY(count1 == count2); - - delete pHelper; - delete form; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: addItemPrototype() \n  - 2. Function Descrition: \n    - 3. Input Parameters: HbDataFormViewItem object pointer. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testAddItemPrototypeWithViewItem2() - { - HbDataForm* form = new HbDataForm(); - QVERIFY(form != 0); - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY(model != 0); - HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); - QVERIFY(general != 0); - - form->setModel(model); - - CpItemDataHelper *pHelper = new CpItemDataHelper(); - QVERIFY(pHelper != 0); - - pHelper->bindToForm(form); - - int count1 = form->itemPrototypes().count(); - HbDataFormViewItem * pitem1 = new HbDataFormViewItem(); - //pass 0 proto type - pHelper->addItemPrototype(pitem1); - int count2 = form->itemPrototypes().count(); - QVERIFY(count1 + 1 == count2); - - delete pHelper; - delete form; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: addConnection(HbDataFormModelItem *item, - const char *signal, - QObject *receiver, - const char *method) \n  - 2. Function Descrition: \n    - 3. Input Parameters: \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testAddConnectionWithnoDataForm() - { - HbDataForm* form = new HbDataForm(); - QVERIFY(form != 0); - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY(model != 0); - HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); - QVERIFY(general != 0); - - form->setModel(model); - - CpItemDataHelper *pHelper = new CpItemDataHelper(); - QVERIFY(pHelper != 0); - - pHelper->addConnection( general, "hello", form, "hello"); - - delete pHelper; - delete form; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: addConnection(HbDataFormModelItem *item, - const char *signal, - QObject *receiver, - const char *method) \n  - 2. Function Descrition: \n    - 3. Input Parameters: \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testAddConnectionWithDataForm() - { - HbDataForm* form = new HbDataForm(); - QVERIFY(form != 0); - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY(model != 0); - HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); - QVERIFY(general != 0); - - form->setModel(model); - - CpItemDataHelper *pHelper = new CpItemDataHelper(form); - QVERIFY(pHelper != 0); - - pHelper->addConnection( general, "hello", form, "hello"); - - delete pHelper; - delete form; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: removeConnection(HbDataFormModelItem *item, - const char *signal, - QObject *receiver, - const char *method) \n  - 2. Function Descrition: \n    - 3. Input Parameters: \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testRemoveConnectionNoDataForm() - { - HbDataForm* form = new HbDataForm(); - QVERIFY(form != 0); - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY(model != 0); - HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); - QVERIFY(general != 0); - - form->setModel(model); - - CpItemDataHelper *pHelper = new CpItemDataHelper(); - QVERIFY(pHelper != 0); - - pHelper->addConnection( general, "hello", form, "hello"); - pHelper->removeConnection(general,"hello", form, "hello"); - - delete pHelper; - delete form; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: removeConnection(HbDataFormModelItem *item, - const char *signal, - QObject *receiver, - const char *method) \n  - 2. Function Descrition: \n    - 3. Input Parameters: \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testRemoveConnectionWithDataForm() - { - HbDataForm* form = new HbDataForm(); - QVERIFY(form != 0); - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY(model != 0); - HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); - QVERIFY(general != 0); - - form->setModel(model); - - CpItemDataHelper *pHelper = new CpItemDataHelper(form); - QVERIFY(pHelper != 0); - - pHelper->addConnection( general, "hello", form, "hello"); - pHelper->removeConnection(general,"hello", form, "hello"); - - delete pHelper; - delete form; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: connectToForm(const char *signal, - QObject *receiver, - const char *method) \n  - 2. Function Descrition: \n    - 3. Input Parameters: \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testConnectToFormNoDataForm() - { - HbDataForm* form = new HbDataForm(); - QVERIFY(form != 0); - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY(model != 0); - HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); - QVERIFY(general != 0); - - form->setModel(model); - - CpItemDataHelper *pHelper = new CpItemDataHelper(); - QVERIFY(pHelper != 0); - - pHelper->connectToForm("hello", form, "hello"); - - delete pHelper; - delete form; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: connectToForm(const char *signal, - QObject *receiver, - const char *method) \n  - 2. Function Descrition: \n    - 3. Input Parameters: \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testConnectToFormWithDataForm() - { - HbDataForm* form = new HbDataForm(); - QVERIFY(form != 0); - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY(model != 0); - HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); - QVERIFY(general != 0); - - form->setModel(model); - - CpItemDataHelper *pHelper = new CpItemDataHelper(form); - QVERIFY(pHelper != 0); - - pHelper->connectToForm("hello", form, "hello"); - - delete pHelper; - delete form; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: disconnectFromForm(const char *signal, - QObject *receiver, - const char *method) \n  - 2. Function Descrition: \n    - 3. Input Parameters: \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testDisconnectToFormNoDataForm() - { - HbDataForm* form = new HbDataForm(); - QVERIFY(form != 0); - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY(model != 0); - HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); - QVERIFY(general != 0); - - form->setModel(model); - - CpItemDataHelper *pHelper = new CpItemDataHelper(); - QVERIFY(pHelper != 0); - - pHelper->connectToForm("hello", form, "hello"); - pHelper->disconnectFromForm("hello", form, "hello"); - - delete pHelper; - delete form; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: disconnectFromForm(const char *signal, - QObject *receiver, - const char *method) \n  - 2. Function Descrition: \n    - 3. Input Parameters: \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testDisconnectToFormWithDataForm() - { - HbDataForm* form = new HbDataForm(); - QVERIFY(form != 0); - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY(model != 0); - HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); - QVERIFY(general != 0); - - form->setModel(model); - - CpItemDataHelper *pHelper = new CpItemDataHelper(form); - QVERIFY(pHelper != 0); - - pHelper->connectToForm("hello", form, "hello"); - pHelper->disconnectFromForm("hello", form, "hello"); - - delete pHelper; - delete form; - delete model; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: HbWidget *widgetFromModelIndex(const QModelIndex &index); \n  - 2. Function Descrition: \n    - 3. Input Parameters: QModelIndex object. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testWidgetFromModelIndexWithDataForm() - { - HbDataForm* form = new HbDataForm(); - QVERIFY( form != 0 ); - - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY( model != 0 ); - - HbDataFormModelItem *general = model->appendDataFormItem(HbDataFormModelItem::TextItem, QString("General")); - QVERIFY( general != 0 ); - - HbDataFormModelItem *special = model->appendDataFormItem(HbDataFormModelItem::SliderItem, QString("Special")); - QVERIFY( special != 0 ); - - CpItemDataHelper *phelper = new CpItemDataHelper(form); - QVERIFY( phelper != 0 ); - - form->setModel(model); - - QModelIndex index = model->indexFromItem(special); - - HbWidget * widget = phelper->widgetFromModelIndex(index); - QVERIFY( widget != 0 ); - QVERIFY( widget->type() == Hb::ItemType_Slider ); - - delete phelper; - delete form; - delete model; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: HbWidget *widgetFromModelIndex(const QModelIndex &index); \n  - 2. Function Descrition: \n    - 3. Input Parameters: QModelIndex object. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testWidgetFromModelIndexNoDataForm() - { - HbDataForm* form = new HbDataForm(); - QVERIFY( form != 0 ); - - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY( model != 0 ); - - HbDataFormModelItem *general = model->appendDataFormItem(HbDataFormModelItem::SliderItem, QString("General")); - QVERIFY( general != 0 ); - - form->setModel(model); - - CpItemDataHelper *phelper = new CpItemDataHelper(); - QVERIFY( phelper != 0 ); - - QModelIndex index = model->indexFromItem(general); - HbWidget * widget = phelper->widgetFromModelIndex(index); - QVERIFY( widget == 0 ); - - phelper->bindToForm(form); - HbWidget * widget1 = phelper->widgetFromModelIndex(index); - QVERIFY( widget1 != 0 ); - QVERIFY( widget1->type() == Hb::ItemType_Slider ); - - delete phelper; - delete form; - delete model; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: HbWidget *widgetFromModelIndex(const QModelIndex &index); \n  - 2. Function Descrition: \n    - 3. Input Parameters: QModelIndex object. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testWidgetFromModelIndexWithDataFormBinded() - { - HbDataForm* form = new HbDataForm(); - QVERIFY( form != 0 ); - - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY( model != 0 ); - - HbDataFormModelItem *general = model->appendDataFormItem(HbDataFormModelItem::SliderItem, QString("General")); - QVERIFY( general != 0 ); - - HbDataFormModelItem * general1 = new HbDataFormModelItem(); - QVERIFY( general1 != 0 ); - - form->setModel(model); - - CpItemDataHelper *phelper = new CpItemDataHelper(form); - QVERIFY( phelper != 0 ); - - QModelIndex index = model->indexFromItem(general1); - HbWidget * widget = phelper->widgetFromModelIndex(index); - QVERIFY( widget == 0 ); - - phelper->bindToForm(form); - HbWidget * widget1 = phelper->widgetFromModelIndex(index); - QVERIFY( widget1 == 0 ); - - delete phelper; - delete form; - delete model; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: HbDataFormModelItem *modelItemFromModelIndex(const QModelIndex &index); \n  - 2. Function Descrition: \n    - 3. Input Parameters: QModelIndex object. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testModelItemFromModelIndexWithDataForm() - { - HbDataForm* form = new HbDataForm(); - QVERIFY( form != 0 ); - - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY( model != 0 ); - - HbDataFormModelItem *general = model->appendDataFormItem(HbDataFormModelItem::TextItem, QString("General")); - QVERIFY( general != 0 ); - - HbDataFormModelItem *special = model->appendDataFormItem(HbDataFormModelItem::SliderItem, QString("Special")); - QVERIFY( special != 0 ); - - CpItemDataHelper *phelper = new CpItemDataHelper(form); - QVERIFY( phelper != 0 ); - - form->setModel(model); - - QModelIndex index = model->indexFromItem(special); - - HbDataFormModelItem * item = phelper->modelItemFromModelIndex(index); - QVERIFY( item != 0 ); - QVERIFY( item->type() == HbDataFormModelItem::SliderItem ); - - delete phelper; - delete form; - delete model; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: HbDataFormModelItem *modelItemFromModelIndex(const QModelIndex &index); \n  - 2. Function Descrition: \n    - 3. Input Parameters: QModelIndex object. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testModelItemFromModelIndexNoDataForm() - { - HbDataForm* form = new HbDataForm(); - QVERIFY( form != 0 ); - - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY( model != 0 ); - - HbDataFormModelItem *general = model->appendDataFormItem(HbDataFormModelItem::SliderItem, QString("General")); - QVERIFY( general != 0 ); - - form->setModel(model); - - CpItemDataHelper *phelper = new CpItemDataHelper(); - QVERIFY( phelper != 0 ); - - QModelIndex index = model->indexFromItem(general); - HbDataFormModelItem * item = phelper->modelItemFromModelIndex(index); - QVERIFY( item == 0 ); - - phelper->bindToForm(form); - - HbDataFormModelItem * item1 = phelper->modelItemFromModelIndex(index); - QVERIFY( item1 != 0 ); - QVERIFY( item1->type() == HbDataFormModelItem::SliderItem ); - - delete phelper; - delete form; - delete model; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: HbDataFormModelItem *modelItemFromModelIndex(const QModelIndex &index); \n  - 2. Function Descrition: \n    - 3. Input Parameters: QModelIndex object. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpItemDataHelper::testModelItemFromModelIndexWithModel() - { - HbDataForm* form = new HbDataForm(); - QVERIFY( form != 0 ); - - HbDataFormModel *model = new HbDataFormModel(); - QVERIFY( model != 0 ); - - HbDataFormModelItem *general = model->appendDataFormItem(HbDataFormModelItem::SliderItem, QString("General")); - QVERIFY( general != 0 ); - - HbDataFormModelItem * general1 = new HbDataFormModelItem(); - QVERIFY( general1 != 0 ); - - CpItemDataHelper *phelper = new CpItemDataHelper(form); - QVERIFY( phelper != 0 ); - - QModelIndex index = model->indexFromItem(general1); - HbDataFormModelItem * item = phelper->modelItemFromModelIndex(index); - QVERIFY( item == 0 ); - - form->setModel(model); - - HbDataFormModelItem * item1 = phelper->modelItemFromModelIndex(index); - QVERIFY( item1 == 0 ); - - delete phelper; - delete form; - delete model; - } - -QTEST_MAIN(TestCpItemDataHelper) diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpitemdatahelper/src/ut_cpitemdatahelper.h --- a/controlpanel/tsrc/unit/ut_cpitemdatahelper/src/ut_cpitemdatahelper.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#ifndef TEST_CP_ITEM_DATA_HELPER_H -#define TEST_CP_ITEM_DATA_HELPER_H - -#include - -class TestCpItemDataHelper : public QObject -{ - Q_OBJECT - -private slots: - void initTestCase(); - void cleanupTestCase(); - -//public slots: - void testCpItemDataHelperWithNullPointer(); - void testCpItemDataHelperWithDataForm(); - - void testBindToFormWithDataForm(); - - void testAddItemPrototypeWithNullPointer1(); - void testAddItemPrototypeWithViewItem1(); - void testAddItemPrototypeWithNullPointer2(); - void testAddItemPrototypeWithViewItem2(); - - void testAddConnectionWithnoDataForm(); - void testAddConnectionWithDataForm(); - - void testRemoveConnectionNoDataForm(); - void testRemoveConnectionWithDataForm(); - - void testConnectToFormNoDataForm(); - void testConnectToFormWithDataForm(); - - void testDisconnectToFormNoDataForm(); - void testDisconnectToFormWithDataForm(); - - void testWidgetFromModelIndexWithDataForm(); - void testWidgetFromModelIndexNoDataForm(); - void testWidgetFromModelIndexWithDataFormBinded(); - - void testModelItemFromModelIndexWithDataForm(); - void testModelItemFromModelIndexNoDataForm(); - void testModelItemFromModelIndexWithModel(); -}; - -#endif // TEST_CP_ITEM_DATA_HELPER_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpitemdatahelper/ut_cpitemdatahelper.pri --- a/controlpanel/tsrc/unit/ut_cpitemdatahelper/ut_cpitemdatahelper.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -HEADERS += src/ut_cpitemdatahelper.h - -SOURCES += src/ut_cpitemdatahelper.cpp - -INCLUDEPATH += . \ - src/\ - ../../../src/inc \ - ../../../controlpanel_plat/inc diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpitemdatahelper/ut_cpitemdatahelper.pro --- a/controlpanel/tsrc/unit/ut_cpitemdatahelper/ut_cpitemdatahelper.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = app -TARGET = ut_cpitemdatahelper - -include (../ut_common.pri) -include (ut_cpitemdatahelper.pri) - -symbian: { - TARGET.UID3 = 0xE1FF1D09 -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpplugin/runtest.bat --- a/controlpanel/tsrc/unit/ut_cpplugin/runtest.bat Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -@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 - -\epoc32\RELEASE\WINSCW\udeb\ut_cpplugin.exe -xml -o c:\ut_cpplugin.xml -copy \epoc32\winscw\c\ut_cpplugin.xml -del \epoc32\winscw\c\ut_cpplugin.xml \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpplugin/src/ut_cpplugin.cpp --- a/controlpanel/tsrc/unit/ut_cpplugin/src/ut_cpplugin.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,176 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "ut_cpplugin.h" -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -//define plugin uids, need replaced by header file -const int PluginUIDs[] = -{ - //0X20025FE2, //viewplugin - //0X20025FE4, //tonesplugin Y - 0X20025FDF, //communicationplugin.pro N - 0X20025FDC, //applicationsettingsplugin.pro N - //0xEEF7E3EC, //3rdpartyappsettingsplugin.pro Y - 0X20025FE5, //personalizationplugin.pro N - 0X20025FE8, //placeholderplugin Y - 0X20025FDD, //placeholder no icon - 0X20025FDE, //key touch - 0X20025FE0, // look and feel - 0X20025FDB, // theme - 0X20025FE1, // privatcy - - -}; -//define whether the plugin has exported view or not -const int PluginHasView[] = -{ - 0, // communication - 0, // application - 0, //personalization - 1, //placeholder - 1, //placeholdernoicon - 0, //accountsplugin - 0, //privacy - 0, //device - 1, //theme - 1, //keytouch - 0 // look and feel -}; - -void TestCpPlugin::initTestCase() -{ - pLoader = new CpPluginLoader(); - mainWindow = new HbMainWindow; - mainWindow->show(); - pluginDlls << "cpcommunicationplugin" - << "cpapplicationsettingsplugin" - << "cppersonalizationplugin" - << "cpplaceholderplugin" - << "cpplaceholdernoiconplugin" - << "cpaccountsplugin" - << "cpprivacyplugin" - << "cpdeviceplugin" - << "cpthemeplugin" - << "cpkeytouchfdbkplugin" - << "cplookfeelplugin"; -} - -void TestCpPlugin::test_loadPluginsName() -{ - - - - int count = pluginDlls.size(); - for( int i=0; iloadCpPlugin( pluginDlls[i] ); - qDebug()<< "Loading plugin [" - << pluginDlls[i]<< "],result is:" - << ( (plugin != 0)? "OK":"Fail" ); - QVERIFY( plugin!= 0 ); - } - -} -void TestCpPlugin::test_loadPluginsName_N() -{ - CpPluginPlatInterface* plugin = pLoader->loadCpPlugin( "" ); - qDebug()<< "Loading plugin [" - << "(empty name)"<< "],result is:" - << ( (plugin == 0)? "OK":"Fail" ); - QVERIFY( plugin == 0 ); -} - -void TestCpPlugin::test_createSettingFormItemData() -{ - CpItemDataHelper *pHelper = new CpItemDataHelper(); - - for( int i = 0; i< plist.count(); ++i) - { - CpPluginPlatInterface* plugin = plist[i]; - if(plugin) - { - CpSettingFormItemData *itemData = plugin->createSettingFormItemData(*pHelper); - bool bToF = (itemData != 0); - qDebug( "Plugin [0X%08X], result is %s", PluginUIDs[i], bToF?"OK":"Fail" ); - // delete itemData; - QVERIFY( bToF ); - } - } - delete pHelper; -} - -void TestCpPlugin::test_launcher_by_Name() -{ - //clear all existing view firstly - int vcount = mainWindow->viewCount(); - int i = 0; - for ( i=vcount-1; i>=0; --i ) - { - QGraphicsWidget * pwgt = mainWindow->removeView( i ); - delete pwgt; - } - //launch plugins list by name - int count = pluginDlls.size(); - for( i=0; iLoading plugin [" - << pluginDlls[i]<< "],result is:" - << ( bret? "OK":"Fail" ); - QVERIFY( bret ); - } -} -void TestCpPlugin::test_launcher_by_Name_N() -{ - bool bret = CpPluginLauncher::launchCpPluginView( "" ); - qDebug()<< "Loading plugin [" - << ""<< "],result is:" - << ( (!bret )? "OK":"Fail" ); - QVERIFY( !bret ); -} - -void TestCpPlugin::cleanupTestCase() -{ - for (int i = 0; i < plist.count(); ++i) - { - CpPluginPlatInterface* plugin = plist[i]; - if (plugin) - { - delete plugin; - plugin = 0; - } - } - if (pLoader) - { - delete pLoader; - pLoader = 0; - } - delete mainWindow; - mainWindow = 0; -} - -QTEST_MAIN(TestCpPlugin) diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpplugin/src/ut_cpplugin.h --- a/controlpanel/tsrc/unit/ut_cpplugin/src/ut_cpplugin.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef UT_CPPLUGIN_H -#define UT_CPPLUGIN_H - -#include -#include -#include - -class CpPluginPlatInterface; -class CpPluginLoader; -class HbMainWindow; - -class TestCpPlugin : public QObject -{ - Q_OBJECT -private slots: - void initTestCase(); // initialize test data - //void test_loadPluginsID(); //loading plugins - //void test_loadPluginsID_N(); //loading plugins(with wrong input) - void test_loadPluginsName(); //loading plugins(by dll name) - void test_loadPluginsName_N(); //loading plugins(by dll name)(with wrong input) - //void test_uid(); // - void test_createSettingFormItemData(); - //void test_launcher_by_ID(); //testing launcher by id - //void test_launcher_by_ID_N(); //testing launcher by id (with wrong input) - void test_launcher_by_Name(); //testing launcher by name - void test_launcher_by_Name_N(); //testing launcher by name (with wrong input) - void cleanupTestCase(); //Finalize test data -private: - QVector plist; // - CpPluginLoader* pLoader; // - QStringList pluginDlls; - HbMainWindow* mainWindow; -}; - - -#endif //UT_CPPLUGIN_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpplugin/ut_cpplugin.pro --- a/controlpanel/tsrc/unit/ut_cpplugin/ut_cpplugin.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = app -TARGET = ut_cpplugin -QT += testlib -CONFIG += hb qtestlib - -unix { - test.commands = /epoc32/RELEASE/WINSCW/udeb/ut_cpplugin.exe - autotest.commands = /epoc32/RELEASE/WINSCW/udeb/ut_cpplugin.exe -xml -o c:/ut_cpplugin.xml -} else:win32 { - test.CONFIG += recursive - autotest.CONFIG += recursive - build_pass { - test.commands =/epoc32/RELEASE/WINSCW/udeb/ut_cpplugin.exe - autotest.commands =/epoc32/RELEASE/WINSCW/udeb/ut_cpplugin.exe -xml -o c:/ut_cpplugin.xml - } -} -QMAKE_EXTRA_TARGETS += test autotest - - - -DEPENDPATH += . - -INCLUDEPATH += . \ - ../../../src/inc \ - ../../../src/cpframework/src \ - ../../../controlpanel_plat/inc - -LIBS += -lcpframework - -# Input -HEADERS += src/ut_cpplugin.h -HEADERS += ../../../src/cpframework/src/cppluginloader.h -HEADERS += ../../../src/cpframework/src/cppluginconfigreader.h -HEADERS += ../../../src/cpframework/src/cputility.h -SOURCES += src/ut_cpplugin.cpp -SOURCES += ../../../src/cpframework/src/cppluginloader.cpp -SOURCES += ../../../src/cpframework/src/cppluginconfigreader.cpp -SOURCES += ../../../src/cpframework/src/cppluginconfig.cpp -SOURCES += ../../../src/cpframework/src/cputility.cpp \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cppluginlauncher/src/ut_cppluginlauncher.cpp --- a/controlpanel/tsrc/unit/ut_cppluginlauncher/src/ut_cppluginlauncher.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#include "ut_cppluginlauncher.h" - -#include "cppluginlauncher.h" -#include "cpbasesettingview.h" - -#include -#include -#include -#include - -/*! - \class TestCpPluginLauncher - \brief The TestCpPluginLauncher class is designed for the unit testing for CpPluginLauncher class. - This unit test is supported by QTest. - There are total 3 test cases in this unit. - */ - -void TestCpPluginLauncher::initTestCase() - { - mainWindow = new HbMainWindow; - mainWindow->show(); - } - -void TestCpPluginLauncher::cleanupTestCase() - { - delete mainWindow; - - //if delete mainwindow, test app will be freezing - QCoreApplication::processEvents(); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n  - static CpBaseSettingView* launchSettingView(const QString &pluginFile,const QVariant &hint = QVariant());  - - 2. Function Descrition: \n    - 2.1 Create view object by call launchSettingView().\n    - 2.2 emit signal to CpBaseSettingView object.\n    - - 3. Input Parameters: \n  - QString &pluginFile: plugin file path, either relative or absolute.\n   - QVariant &hint: hint string, for example, "profile_view".\n   - - 4. Expected result: \n   - CpBaseSettingView object created successfully, signal emit out to view object processed correctly.\n - */ -void TestCpPluginLauncher::testLaunchSettingViewWithCorrectProfileName() - { - CpBaseSettingView * pView1 = CpPluginLauncher::launchSettingView("testplugin.cpcfg", "profile_view"); - QVERIFY(pView1 != 0); - - CpBaseSettingView * pView2 = CpPluginLauncher::launchSettingView("testplugin.cpcfg", "profile_view"); - QVERIFY(pView2 != 0); - - QObject::connect(this, SIGNAL(connectAboutToClose()), pView1, SIGNAL(aboutToClose())); - emit connectAboutToClose(); - - QObject::connect(this, SIGNAL(connectAboutToClose()), pView2, SIGNAL(aboutToClose())); - emit connectAboutToClose(); - emit connectAboutToClose(); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n  - static CpBaseSettingView* launchSettingView(const QString &pluginFile,const QVariant &hint = QVariant());  - - 2. Function Descrition: \n    - 2.1 Create view object by call launchSettingView().\n    - 2.2 emit signal to CpBaseSettingView object.\n    - - 3. Input Parameters: \n  - QString &pluginFile: plugin file path, either relative or absolute.\n   - QVariant &hint: hint string, for example, "profile_view".\n   - - 4. Expected result: \n   - CpBaseSettingView object created successfully, signal emit out to view object processed correctly.\n - */ -void TestCpPluginLauncher::testLaunchSettingViewWithWrongProfileName() - { - CpBaseSettingView * pView1 = CpPluginLauncher::launchSettingView("testplugin.cpcfg", "myprofile_view"); - QVERIFY(pView1 == 0); - - CpBaseSettingView * pView2 = CpPluginLauncher::launchSettingView("testplugin.cpcfg", "myprofile_view"); - QVERIFY(pView2 == 0); - - QObject::connect(this, SIGNAL(connectAboutToClose()), pView1, SIGNAL(aboutToClose())); - emit connectAboutToClose(); - - QObject::connect(this, SIGNAL(connectAboutToClose()), pView2, SIGNAL(aboutToClose())); - emit connectAboutToClose(); - emit connectAboutToClose(); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n  - static CpBaseSettingView* launchSettingView(const QString &pluginFile,const QVariant &hint = QVariant());  - - 2. Function Descrition: \n    - 2.1 Create view object by call launchSettingView().\n    - 2.2 emit signal to CpBaseSettingView object.\n    - - 3. Input Parameters: \n  - QString &pluginFile: plugin file path, either relative or absolute.\n   - QVariant &hint: hint string, for example, "profile_view".\n   - - 4. Expected result: \n   - CpBaseSettingView object created successfully, signal emit out to view object processed correctly.\n - */ -void TestCpPluginLauncher::testLaunchSettingViewWithEmptyParam() - { - CpBaseSettingView * pView1 = CpPluginLauncher::launchSettingView("", ""); - QVERIFY(pView1 == 0); - } - -QTEST_MAIN(TestCpPluginLauncher) diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cppluginlauncher/src/ut_cppluginlauncher.h --- a/controlpanel/tsrc/unit/ut_cppluginlauncher/src/ut_cppluginlauncher.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#ifndef UT_CP_PLUGIN_LAUNCHER_H -#define UT_CP_PLUGIN_LAUNCHER_H - -#include - -class HbMainWindow; - -class TestCpPluginLauncher : public QObject -{ - Q_OBJECT - -signals: - void connectAboutToClose(); - -private slots: - void initTestCase(); - void cleanupTestCase(); - -//public slots: - void testLaunchSettingViewWithCorrectProfileName(); - void testLaunchSettingViewWithWrongProfileName(); - void testLaunchSettingViewWithEmptyParam(); - -private: - HbMainWindow* mainWindow; -}; - -#endif // UT_CP_PLUGIN_LAUNCHER_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cppluginlauncher/ut_cppluginlauncher.pri --- a/controlpanel/tsrc/unit/ut_cppluginlauncher/ut_cppluginlauncher.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -HEADERS += src/ut_cppluginlauncher.h - -SOURCES += src/ut_cppluginlauncher.cpp - -INCLUDEPATH += . \ - src/\ - ../../../src/inc \ - ../../../controlpanel_plat/inc diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cppluginlauncher/ut_cppluginlauncher.pro --- a/controlpanel/tsrc/unit/ut_cppluginlauncher/ut_cppluginlauncher.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = app -TARGET = ut_cppluginlauncher - -include (../ut_common.pri) -include (ut_cppluginlauncher.pri) - -symbian: { - TARGET.UID3 = 0xEEB2ED33 -} - -symbian*: { - deploy.path = C: - - testplugindll.sources = testplugin.dll - testplugindll.path = /sys/bin - - testpluginconfig.sources = ../testplugin/data/testplugin.cpcfg - testpluginconfig.path = /resource/qt/plugins/controlpanel/config - - testpluginstub.sources = ../testplugin/qmakepluginstubs/testplugin.qtplugin - testpluginstub.path = /resource/qt/plugins/controlpanel - - DEPLOYMENT += testplugindll testpluginconfig testpluginstub -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cppluginloader/src/ut_cppluginloader.cpp --- a/controlpanel/tsrc/unit/ut_cppluginloader/src/ut_cppluginloader.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#include "ut_cppluginloader.h" -#include "cppluginloader.h" - -#include - - -/*! - \class TestCpPluginLoader - \brief The TestCpPluginLoader class is designed for the unit testing for CpPluginLoader class. - This unit test is supported by QTest. - There are total 6 test cases in this unit. - */ - -void TestCpPluginLoader::initTestCase() - { - } - -void TestCpPluginLoader::cleanupTestCase() - { - QCoreApplication::processEvents(); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: loadCpPluginInterface() \n  - 2. Function Descrition: \n    - load a plugin file, which is derived from CpPluginInterface class.\n  - 3. Input Parameters: cpcfg file name. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpPluginLoader::testLoadCpPluginInterfaceWithCpcfgFilename() - { - CpPluginInterface * plugin = CpPluginLoader::loadCpPluginInterface("testplugin.cpcfg"); - QVERIFY(plugin != 0); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: loadCpPluginInterface() \n  - 2. Function Descrition: \n    - load a plugin file, which is derived from CpPluginInterface class.\n  - 3. Input Parameters: absolute path of cpcfg file name. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpPluginLoader::testLoadCpPluginInterfaceWithAbsoluteQtpluginPath() - { - CpPluginInterface * plugin = CpPluginLoader::loadCpPluginInterface("/resource/qt/plugins/controlpanel/testplugin.qtplugin"); - QVERIFY(plugin != 0); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: loadCpPluginInterface() \n  - 2. Function Descrition: \n    - load a plugin file, which is derived from CpPluginInterface class.\n  - 3. Input Parameters: qtplugin file name. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpPluginLoader::testLoadCpPluginInterfaceWithQtpluginFilename() - { - CpPluginInterface * plugin = CpPluginLoader::loadCpPluginInterface("testplugin.qtplugin"); - QVERIFY(plugin != 0); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: loadCpLauncherInterface() \n  - 2. Function Descrition: \n    - load a plugin file, which is derived from CpLauncherInterface class.\n  - 3. Input Parameters: defined cpcfg file name. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpPluginLoader::testLoadCpLauncherInterfaceWithCpcfgFilename() - { - CpLauncherInterface * plugin = CpPluginLoader::loadCpLauncherInterface("testplugin.cpcfg"); - QVERIFY(plugin != 0); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: loadCpLauncherInterface() \n  - 2. Function Descrition: \n    - load a plugin file, which is derived from CpLauncherInterface class.\n  - 3. Input Parameters: absolute path of a user defined qtplugin file name. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpPluginLoader::testLoadCpLauncherInterfaceWithAbsoluteQtpluginFilename() - { - CpLauncherInterface * plugin = CpPluginLoader::loadCpLauncherInterface("/resource/qt/plugins/controlpanel/testplugin.qtplugin"); - QVERIFY(plugin != 0); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: loadCpLauncherInterface() \n  - 2. Function Descrition: \n    - load a plugin file, which is derived from CpLauncherInterface class.\n  - 3. Input Parameters: qtplugin file name. \n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpPluginLoader::testLoadCpLauncherInterfaceWithQtpluginFilename() - { - CpLauncherInterface * plugin = CpPluginLoader::loadCpLauncherInterface("testplugin.qtplugin"); - QVERIFY(plugin != 0); - } - -QTEST_APPLESS_MAIN(TestCpPluginLoader) diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cppluginloader/src/ut_cppluginloader.h --- a/controlpanel/tsrc/unit/ut_cppluginloader/src/ut_cppluginloader.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#ifndef UT_CP_PLUGIN_LOADER_H -#define UT_CP_PLUGIN_LOADER_H - -#include - -class TestCpPluginLoader : public QObject -{ - Q_OBJECT - -private slots: - void initTestCase(); - void cleanupTestCase(); - -//public slots: - void testLoadCpPluginInterfaceWithCpcfgFilename(); - void testLoadCpPluginInterfaceWithAbsoluteQtpluginPath(); - void testLoadCpPluginInterfaceWithQtpluginFilename(); - - void testLoadCpLauncherInterfaceWithCpcfgFilename(); - void testLoadCpLauncherInterfaceWithAbsoluteQtpluginFilename(); - void testLoadCpLauncherInterfaceWithQtpluginFilename(); - -}; - -#endif // UT_CP_PLUGIN_LOADER_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cppluginloader/ut_cppluginloader.pri --- a/controlpanel/tsrc/unit/ut_cppluginloader/ut_cppluginloader.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -HEADERS += src/ut_cppluginloader.h - -SOURCES += src/ut_cppluginloader.cpp - -INCLUDEPATH += . \ - src/\ - ../../../src/inc \ - ../../../controlpanel_plat/inc diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cppluginloader/ut_cppluginloader.pro --- a/controlpanel/tsrc/unit/ut_cppluginloader/ut_cppluginloader.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = app -TARGET = ut_cppluginloader - -include (../ut_common.pri) -include (ut_cppluginloader.pri) - -symbian: { - TARGET.UID3 = 0xEC9347EF -} - -symbian*: { - deploy.path = C: - - testplugindll.sources = testplugin.dll - testplugindll.path = /sys/bin - - testpluginconfig.sources = ../testplugin/data/testplugin.cpcfg - testpluginconfig.path = /resource/qt/plugins/controlpanel/config - - testpluginstub.sources = ../testplugin/qmakepluginstubs/testplugin.qtplugin - testpluginstub.path = /resource/qt/plugins/controlpanel - - DEPLOYMENT += testplugindll testpluginconfig testpluginstub -} - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cppluginutility/src/ut_cppluginutility.cpp --- a/controlpanel/tsrc/unit/ut_cppluginutility/src/ut_cppluginutility.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#include "ut_cppluginutility.h" - -#include -#include -#include - -/*! - \class TestCpPluginUtility - \brief This class is used for the unit test for class CpPluginUtility.\n - CpPluginUtility class is a utility class used to provide method to add 2 two new customed prototype into the HbDataForm object. \n - This unit test is supported by QTest. - There are total 2 test cases in this unit. - */ - -void TestCpPluginUtility::initTestCase() - { - } - -void TestCpPluginUtility::cleanupTestCase() - { - QCoreApplication::processEvents(); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: addCpItemPrototype() \n  - 2. Function Descrition: \n    - add 2 new prototype to a HbDataForm object.\n  - 3. Input Parameters: \n  - @param: HbDataForm *settingForm\n - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpPluginUtility::testAddCpItemPrototypeWithDataForm() - { - HbDataForm * settingForm = new HbDataForm(); - QVERIFY(settingForm != 0); - - int count0 = settingForm->itemPrototypes().count(); - CpPluginUtility::addCpItemPrototype(settingForm); - int count1 = settingForm->itemPrototypes().count(); - QVERIFY(count0 + 2 == count1); - - delete settingForm; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: addCpItemPrototype() \n  - 2. Function Descrition: \n    - add 2 new prototype to a HbDataForm object.\n  - 3. Input Parameters: \n  - @param: 0.\n - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpPluginUtility::testAddCpItemPrototypeWithNullPointer() - { - CpPluginUtility::addCpItemPrototype(0); - } - -QTEST_MAIN(TestCpPluginUtility) diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cppluginutility/src/ut_cppluginutility.h --- a/controlpanel/tsrc/unit/ut_cppluginutility/src/ut_cppluginutility.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#ifndef TEST_CP_PLUGIN_UTILITY_H -#define TEST_CP_PLUGIN_UTILITY_H - -#include - -class TestCpPluginUtility : public QObject -{ - Q_OBJECT - -private slots: - void initTestCase(); - void cleanupTestCase(); - -//public slots: - void testAddCpItemPrototypeWithDataForm(); - void testAddCpItemPrototypeWithNullPointer(); -}; - -#endif // TEST_CP_PLUGIN_UTILITY_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cppluginutility/ut_cppluginutility.pri --- a/controlpanel/tsrc/unit/ut_cppluginutility/ut_cppluginutility.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -HEADERS += src/ut_cppluginutility.h - -SOURCES += src/ut_cppluginutility.cpp - -INCLUDEPATH += . \ - src/\ - ../../../src/inc \ - ../../../controlpanel_plat/inc diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cppluginutility/ut_cppluginutility.pro --- a/controlpanel/tsrc/unit/ut_cppluginutility/ut_cppluginutility.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = app -TARGET = ut_cppluginutility - -include (../ut_common.pri) -include (ut_cppluginutility.pri) - -symbian: { - TARGET.UID3 = 0xE0AAA260 -} - - diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpsettingformentryitemdata/src/MyCpSettingFormEntryItemData.cpp --- a/controlpanel/tsrc/unit/ut_cpsettingformentryitemdata/src/MyCpSettingFormEntryItemData.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#include "mycpsettingformentryitemdata.h" - -/*! - \class MyCpSettingFormEntryItemData - \brief The MyCpSettingFormEntryItemData class is designed for the unit testing for the protected member functions in CpSettingFormEntryItemData class. - */ - -/*! - * This is designed to test one constructor in CpSettingFormEntryItemData class. - */ -MyCpSettingFormEntryItemData::MyCpSettingFormEntryItemData(const HbDataFormModelItem *parent /*= 0*/) : -CpSettingFormEntryItemData(parent) - { - - } diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpsettingformentryitemdata/src/MyCpSettingFormEntryItemData.h --- a/controlpanel/tsrc/unit/ut_cpsettingformentryitemdata/src/MyCpSettingFormEntryItemData.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#include "cpsettingformentryitemdata.h" -#include - -class MyCpSettingFormEntryItemData : public CpSettingFormEntryItemData - { -public: - explicit MyCpSettingFormEntryItemData(const HbDataFormModelItem *parent = 0); - - virtual CpBaseSettingView *createSettingView() const - { return new CpBaseSettingView(); } - }; diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpsettingformentryitemdata/src/ut_cpsettingformentryitemdata.cpp --- a/controlpanel/tsrc/unit/ut_cpsettingformentryitemdata/src/ut_cpsettingformentryitemdata.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,926 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#include "ut_cpsettingformentryitemdata.h" - -#include "mycpsettingformentryitemdata.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/*! - \class TestCpSettingFormEntryItemData - \brief This class is used for the unit test for class CpSettingFormEntryItemData.\n - CpSettingFormEntryItemData class is used for access to a control panel setting form entry item data, \n - this class has a pure virtual member function, so it is not allowed to create instance directly, instead of that, \n - developer should a template class CpSettingFormEntryItemDataImpl to create new instance of CpSettingFormEntryItemData.\n - This unit test is supported by QTest.\n - There are total 18 test cases in this unit.\n - */ - -void TestCpSettingFormEntryItemData::initTestCase() - { - - } - -void TestCpSettingFormEntryItemData::cleanupTestCase() - { - QCoreApplication::processEvents(); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl(CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const HbIcon &icon = HbIcon(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(itemDataHelper,text,description,icon,parent);\n  - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - CpItemDataHelper &itemDataHelper\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemDataWithHelperNoForm() - { - CpItemDataHelper *pHelper1 = new CpItemDataHelper(); - QVERIFY( pHelper1 != 0 ); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl( *pHelper1, "text", "description" ); - QVERIFY( pdataimp1 !=0 ); - QString strtxt1 = "input texts"; - pdataimp1->setText(strtxt1); - QVERIFY( pdataimp1->text() == strtxt1 ); - - QString strDes1 = "input descriptions"; - pdataimp1->setDescription(strDes1); - QVERIFY( pdataimp1->description() == strDes1); - - QString strIconName1 = "input iconname"; - pdataimp1->setIconName(strIconName1); - QVERIFY( pdataimp1->iconName() == strIconName1); - - HbIcon itemIcon1(QString("")); - pdataimp1->setEntryItemIcon(itemIcon1); - QVERIFY( pdataimp1->entryItemIcon() == itemIcon1); - - delete pdataimp1; - delete pHelper1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl(CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const HbIcon &icon = HbIcon(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(itemDataHelper,text,description,icon,parent);\n  - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - CpItemDataHelper &itemDataHelper\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemDataWithHelperAndForm() - { - HbDataForm *pForm2 = new HbDataForm(0); - QVERIFY(pForm2 != 0); - - CpItemDataHelper *pHelper2 = new CpItemDataHelper(pForm2); - QVERIFY( pHelper2 != 0 ); - - CpSettingFormEntryItemDataImpl *pdataimp2 = new CpSettingFormEntryItemDataImpl( *pHelper2, "text", "description" ); - QVERIFY( pdataimp2 !=0 ); - QString strtxt2 = "input texts"; - pdataimp2->setText(strtxt2); - QVERIFY( pdataimp2->text() == strtxt2 ); - - QString strDes2 = "input descriptions"; - pdataimp2->setDescription(strDes2); - QVERIFY( pdataimp2->description() == strDes2); - - delete pdataimp2; - delete pHelper2; - delete pForm2; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl(HbDataForm *dataForm, - const QString &text = QString(), - const QString &description = QString(), - const HbIcon &icon = HbIcon(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(dataForm,text,description,icon,parent);\n  - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - HbDataForm *dataForm\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemDataWithForm() - { - HbDataForm * pForm1 = new HbDataForm(); - QVERIFY(pForm1 != 0); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl( pForm1, "text", "description" ); - QVERIFY( pdataimp1 !=0 ); - QString strtxt1 = "input texts"; - pdataimp1->setText(strtxt1); - QVERIFY( pdataimp1->text() == strtxt1 ); - - QString strDes1 = "input descriptions"; - pdataimp1->setDescription(strDes1); - QVERIFY( pdataimp1->description() == strDes1); - - QString strIconName1 = "input iconname"; - pdataimp1->setIconName(strIconName1); - QVERIFY( pdataimp1->iconName() == strIconName1); - - HbIcon itemIcon1(QString("")); - pdataimp1->setEntryItemIcon(itemIcon1); - QVERIFY( pdataimp1->entryItemIcon() == itemIcon1); - - delete pdataimp1; - delete pForm1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl( - EntryItemType type, - CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const QString &icon = QString(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(type,itemDataHelper,text,description,icon,parent);\n  - - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - EntryItemType type\n   - CpItemDataHelper &itemDataHelper\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemDataWithListTypeAndForm() - { - HbDataForm * pForm1 = new HbDataForm(); - QVERIFY(pForm1 != 0); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl( CpSettingFormEntryItemData::ListEntryItem, pForm1, "text", "description" ); - QVERIFY( pdataimp1 !=0 ); - QString strtxt1 = "input texts"; - pdataimp1->setText(strtxt1); - QVERIFY( pdataimp1->text() == strtxt1 ); - - QString strDes1 = "input descriptions"; - pdataimp1->setDescription(strDes1); - QVERIFY( pdataimp1->description() == strDes1); - - QString strIconName1 = "input iconname"; - pdataimp1->setIconName(strIconName1); - QVERIFY( pdataimp1->iconName() == strIconName1); - - HbIcon itemIcon1(QString("")); - pdataimp1->setEntryItemIcon(itemIcon1); - QVERIFY( pdataimp1->entryItemIcon() == itemIcon1); - - delete pdataimp1; - delete pForm1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl( - EntryItemType type, - HbDataForm *dataForm, - const QString &text = QString(), - const QString &description = QString(), - const QString &icon = QString(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(type,dataForm,text,description,icon,parent);\n  - - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - EntryItemType type\n   - HbDataForm *dataForm\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemDataWithButtonTypeAndForm() - { - HbDataForm * pForm1 = new HbDataForm(); - QVERIFY(pForm1 != 0); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl( CpSettingFormEntryItemData::ButtonEntryItem, pForm1, "text", "description" ); - QVERIFY( pdataimp1 !=0 ); - QString strtxt1 = "input texts"; - pdataimp1->setText(strtxt1); - QVERIFY( pdataimp1->text() == strtxt1 ); - - QString strDes1 = "input descriptions"; - pdataimp1->setDescription(strDes1); - QVERIFY( pdataimp1->description() == strDes1); - - QString strIconName1 = "input iconname"; - pdataimp1->setIconName(strIconName1); - QVERIFY( pdataimp1->iconName() == strIconName1); - - HbIcon itemIcon1(QString("")); - pdataimp1->setEntryItemIcon(itemIcon1); - QVERIFY( pdataimp1->entryItemIcon() == itemIcon1); - - delete pdataimp1; - delete pForm1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl( - EntryItemType type, - HbDataForm *dataForm, - const QString &text = QString(), - const QString &description = QString(), - const QString &icon = QString(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(type,dataForm,text,description,icon,parent);\n  - - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - EntryItemType type\n   - HbDataForm *dataForm\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemData005() - { - HbDataForm * pForm1 = new HbDataForm(); - QVERIFY(pForm1 != 0); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl( CpSettingFormEntryItemData::ListEntryItem, pForm1, "text", "description" ); - QVERIFY( pdataimp1 !=0 ); - QString strtxt1 = "input texts"; - pdataimp1->setText(strtxt1); - QVERIFY( pdataimp1->text() == strtxt1 ); - - QString strDes1 = "input descriptions"; - pdataimp1->setDescription(strDes1); - QVERIFY( pdataimp1->description() == strDes1); - - QString strIconName1 = "input iconname"; - pdataimp1->setIconName(strIconName1); - QVERIFY( pdataimp1->iconName() == strIconName1); - - HbIcon itemIcon1(QString("")); - pdataimp1->setEntryItemIcon(itemIcon1); - QVERIFY( pdataimp1->entryItemIcon() == itemIcon1); - - delete pdataimp1; - delete pForm1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl( - EntryItemType type, - HbDataForm *dataForm, - const QString &text = QString(), - const QString &description = QString(), - const QString &icon = QString(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(type,dataForm,text,description,icon,parent);\n  - - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - EntryItemType type\n   - HbDataForm *dataForm\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemData005a() - { - HbDataForm * pForm1 = new HbDataForm(); - QVERIFY(pForm1 != 0); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl( CpSettingFormEntryItemData::ButtonEntryItem, pForm1, "text", "description" ); - QVERIFY( pdataimp1 !=0 ); - QString strtxt1 = "input texts"; - pdataimp1->setText(strtxt1); - QVERIFY( pdataimp1->text() == strtxt1 ); - - QString strDes1 = "input descriptions"; - pdataimp1->setDescription(strDes1); - QVERIFY( pdataimp1->description() == strDes1); - - QString strIconName1 = "input iconname"; - pdataimp1->setIconName(strIconName1); - QVERIFY( pdataimp1->iconName() == strIconName1); - - HbIcon itemIcon1(QString("")); - pdataimp1->setEntryItemIcon(itemIcon1); - QVERIFY( pdataimp1->entryItemIcon() == itemIcon1); - - delete pdataimp1; - delete pForm1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl( - EntryItemType type, - CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const QString &icon = QString(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(type,itemDataHelper,text,description,icon,parent);\n  - - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - EntryItemType type\n   - CpItemDataHelper &itemDataHelper\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemDataWithListTypeAndHelper() - { - CpItemDataHelper *pHelper1 = new CpItemDataHelper(); - QVERIFY(pHelper1 != 0); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl( CpSettingFormEntryItemData::ListEntryItem, *pHelper1, "text", "description" ); - QVERIFY( pdataimp1 !=0 ); - QString strtxt1 = "input texts"; - pdataimp1->setText(strtxt1); - QVERIFY( pdataimp1->text() == strtxt1 ); - - QString strDes1 = "input descriptions"; - pdataimp1->setDescription(strDes1); - QVERIFY( pdataimp1->description() == strDes1); - - QString strIconName1 = "input iconname"; - pdataimp1->setIconName(strIconName1); - QVERIFY( pdataimp1->iconName() == strIconName1); - - HbIcon itemIcon1(QString("")); - pdataimp1->setEntryItemIcon(itemIcon1); - QVERIFY( pdataimp1->entryItemIcon() == itemIcon1); - - delete pdataimp1; - delete pHelper1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl( - EntryItemType type, - CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const QString &icon = QString(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(type,itemDataHelper,text,description,icon,parent);\n  - - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - EntryItemType type\n   - CpItemDataHelper &itemDataHelper\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemDataWithButtonTypeAndHelper() - { - CpItemDataHelper *pHelper1 = new CpItemDataHelper(); - QVERIFY(pHelper1 != 0); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl( CpSettingFormEntryItemData::ButtonEntryItem, *pHelper1, "text", "description" ); - QVERIFY( pdataimp1 !=0 ); - QString strtxt1 = "input texts"; - pdataimp1->setText(strtxt1); - QVERIFY( pdataimp1->text() == strtxt1 ); - - QString strDes1 = "input descriptions"; - pdataimp1->setDescription(strDes1); - QVERIFY( pdataimp1->description() == strDes1); - - QString strIconName1 = "input iconname"; - pdataimp1->setIconName(strIconName1); - QVERIFY( pdataimp1->iconName() == strIconName1); - - HbIcon itemIcon1(QString("")); - pdataimp1->setEntryItemIcon(itemIcon1); - QVERIFY( pdataimp1->entryItemIcon() == itemIcon1); - - delete pdataimp1; - delete pHelper1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl( - EntryItemType type, - CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const QString &icon = QString(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(type,itemDataHelper,text,description,icon,parent);\n  - - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - EntryItemType type\n   - CpItemDataHelper &itemDataHelper\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemDataWithListTypeAndHelperForm() - { - HbDataForm * pForm1 = new HbDataForm(); - QVERIFY(pForm1 != 0); - - CpItemDataHelper *pHelper1 = new CpItemDataHelper(pForm1); - QVERIFY(pHelper1 != 0); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl( CpSettingFormEntryItemData::ListEntryItem, *pHelper1, "text", "description" ); - QVERIFY( pdataimp1 !=0 ); - QString strtxt1 = "input texts"; - pdataimp1->setText(strtxt1); - QVERIFY( pdataimp1->text() == strtxt1 ); - - QString strDes1 = "input descriptions"; - pdataimp1->setDescription(strDes1); - QVERIFY( pdataimp1->description() == strDes1); - - QString strIconName1 = "input iconname"; - pdataimp1->setIconName(strIconName1); - QVERIFY( pdataimp1->iconName() == strIconName1); - - HbIcon itemIcon1(QString("")); - pdataimp1->setEntryItemIcon(itemIcon1); - QVERIFY( pdataimp1->entryItemIcon() == itemIcon1); - - delete pdataimp1; - delete pHelper1; - delete pForm1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl( - EntryItemType type, - CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const QString &icon = QString(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(type,itemDataHelper,text,description,icon,parent);\n  - - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - EntryItemType type\n   - CpItemDataHelper &itemDataHelper\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemDataWithButtonTypeAndHelperForm() - { - HbDataForm * pForm1 = new HbDataForm(); - QVERIFY(pForm1 != 0); - - CpItemDataHelper *pHelper1 = new CpItemDataHelper(pForm1); - QVERIFY(pHelper1 != 0); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl( CpSettingFormEntryItemData::ButtonEntryItem, *pHelper1, "text", "description" ); - QVERIFY( pdataimp1 !=0 ); - QString strtxt1 = "input texts"; - pdataimp1->setText(strtxt1); - QVERIFY( pdataimp1->text() == strtxt1 ); - - QString strDes1 = "input descriptions"; - pdataimp1->setDescription(strDes1); - QVERIFY( pdataimp1->description() == strDes1); - - QString strIconName1 = "input iconname"; - pdataimp1->setIconName(strIconName1); - QVERIFY( pdataimp1->iconName() == strIconName1); - - HbIcon itemIcon1(QString("")); - pdataimp1->setEntryItemIcon(itemIcon1); - QVERIFY( pdataimp1->entryItemIcon() == itemIcon1); - - delete pdataimp1; - delete pHelper1; - delete pForm1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl(HbDataForm *dataForm, - const QString &text = QString(), - const QString &description = QString(), - const HbIcon &icon = HbIcon(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(dataForm,text,description,icon,parent);\n  - - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - HbDataForm *dataForm\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemDataWithFormParam() - { - HbDataForm * form = new HbDataForm(); - QVERIFY(form != 0); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl(form); - QVERIFY( pdataimp1 !=0 ); - QString strtxt1 = "input texts"; - pdataimp1->setText(strtxt1); - QVERIFY( pdataimp1->text() == strtxt1 ); - - QString strDes1 = "input descriptions"; - pdataimp1->setDescription(strDes1); - QVERIFY( pdataimp1->description() == strDes1); - delete pdataimp1; - delete form; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl(CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const HbIcon &icon = HbIcon(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(itemDataHelper,text,description,icon,parent);\n  - - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - CpItemDataHelper &itemDataHelper\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemDataWithHelperParam() - { - CpItemDataHelper *pHelper1 = new CpItemDataHelper(); - QVERIFY(pHelper1 != 0); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl(*pHelper1); - QVERIFY( pdataimp1 !=0 ); - QString strtxt1 = "input texts"; - pdataimp1->setText(strtxt1); - QVERIFY( pdataimp1->text() == strtxt1 ); - - QString strDes1 = "input descriptions"; - pdataimp1->setDescription(strDes1); - QVERIFY( pdataimp1->description() == strDes1); - delete pdataimp1; - delete pHelper1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl(CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const HbIcon &icon = HbIcon(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(itemDataHelper,text,description,icon,parent);\n  - - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - CpItemDataHelper &itemDataHelper\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemDataWithHelperForm() - { - HbDataForm * pForm1 = new HbDataForm(); - QVERIFY(pForm1 != 0); - - CpItemDataHelper *pHelper1 = new CpItemDataHelper(pForm1); - QVERIFY(pHelper1 != 0); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl(*pHelper1); - QVERIFY( pdataimp1 !=0 ); - QString strtxt1 = "input texts"; - pdataimp1->setText(strtxt1); - QVERIFY( pdataimp1->text() == strtxt1 ); - - QString strDes1 = "input descriptions"; - pdataimp1->setDescription(strDes1); - QVERIFY( pdataimp1->description() == strDes1); - delete pdataimp1; - delete pHelper1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl( - EntryItemType type, - CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const QString &icon = QString(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(type,itemDataHelper,text,description,icon,parent);\n  - - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - EntryItemType type\n   - CpItemDataHelper &itemDataHelper\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemDataWithListTypeNullPointer() - { - HbDataForm * pForm1 = new HbDataForm(); - QVERIFY(pForm1 != 0); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl( CpSettingFormEntryItemData::ListEntryItem, 0, "text", "description" ); - QVERIFY( pdataimp1 !=0 ); - QString strtxt1 = "input texts"; - pdataimp1->setText(strtxt1); - QVERIFY( pdataimp1->text() == strtxt1 ); - - QString strDes1 = "input descriptions"; - pdataimp1->setDescription(strDes1); - QVERIFY( pdataimp1->description() == strDes1); - delete pdataimp1; - delete pForm1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl( - EntryItemType type, - CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const QString &icon = QString(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(type,itemDataHelper,text,description,icon,parent);\n  - - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - EntryItemType type\n   - CpItemDataHelper &itemDataHelper\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemDataWithButtonTypeNullPointer() - { - HbDataForm * pForm1 = new HbDataForm(); - QVERIFY(pForm1 != 0); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl( CpSettingFormEntryItemData::ButtonEntryItem, 0, "text", "description" ); - QVERIFY( pdataimp1 !=0 ); - QString strtxt1 = "input texts"; - pdataimp1->setText(strtxt1); - QVERIFY( pdataimp1->text() == strtxt1 ); - - QString strDes1 = "input descriptions"; - pdataimp1->setDescription(strDes1); - QVERIFY( pdataimp1->description() == strDes1); - delete pdataimp1; - delete pForm1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemDataImpl( - EntryItemType type, - CpItemDataHelper &itemDataHelper, - const QString &text = QString(), - const QString &description = QString(), - const QString &icon = QString(), - const HbDataFormModelItem *parent = 0) : - CpSettingFormEntryItemData(type,itemDataHelper,text,description,icon,parent);\n  - - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - EntryItemType type\n   - CpItemDataHelper &itemDataHelper\n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemDataWithInvalidTypeNullPointer() - { - HbDataForm * pForm1 = new HbDataForm(); - QVERIFY(pForm1 != 0); - - CpSettingFormEntryItemDataImpl *pdataimp1 = new CpSettingFormEntryItemDataImpl( CpSettingFormEntryItemData::ButtonEntryItem, 0, "text", "description" ); - QVERIFY( pdataimp1 !=0 ); - QString strtxt1 = "input texts"; - pdataimp1->setText(strtxt1); - QVERIFY( pdataimp1->text() == strtxt1 ); - - QString strDes1 = "input descriptions"; - pdataimp1->setDescription(strDes1); - QVERIFY( pdataimp1->description() == strDes1); - delete pdataimp1; - delete pForm1; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormEntryItemData(const HbDataFormModelItem *parent);\n  - - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - HbDataFormModelItem *parent\n  - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testCpSettingFormEntryItemDataWithParentParam() - { - MyCpSettingFormEntryItemData * item = new MyCpSettingFormEntryItemData(0); - QVERIFY(item != 0); - - delete item; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - onLaunchView();\n  - - 2. Function Descrition: \n    - \n  - 3. Input Parameters: \n   - QString &text\n   - QString &description\n   - HbIcon &icon\n   - HbDataFormModelItem *parent\n  - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormEntryItemData::testOnLaunchViewNoParam() - { - HbDataForm *pForm2 = new HbDataForm(0); - QVERIFY(pForm2 != 0); - - CpItemDataHelper *pHelper2 = new CpItemDataHelper(pForm2); - QVERIFY( pHelper2 != 0 ); - - CpSettingFormEntryItemDataImpl *pdataimp2 = new CpSettingFormEntryItemDataImpl( *pHelper2, "text", "description" ); - QVERIFY( pdataimp2 !=0 ); - - pdataimp2->onLaunchView(); - pdataimp2->onLaunchView(); - - QString strtxt2 = "input texts"; - pdataimp2->setText(strtxt2); - QVERIFY( pdataimp2->text() == strtxt2 ); - - QString strDes2 = "input descriptions"; - pdataimp2->setDescription(strDes2); - QVERIFY( pdataimp2->description() == strDes2); - - delete pdataimp2; - delete pHelper2; - delete pForm2; - } - -QTEST_MAIN(TestCpSettingFormEntryItemData) diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpsettingformentryitemdata/src/ut_cpsettingformentryitemdata.h --- a/controlpanel/tsrc/unit/ut_cpsettingformentryitemdata/src/ut_cpsettingformentryitemdata.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#ifndef UT_CP_SETTING_FORM_ENTRY_ITEM_DATA_H -#define UT_CP_SETTING_FORM_ENTRY_ITEM_DATA_H - -#include - -class TestCpSettingFormEntryItemData : public QObject -{ - Q_OBJECT - -private slots: - void initTestCase(); - void cleanupTestCase(); - -//public slots: - void testCpSettingFormEntryItemDataWithHelperNoForm(); - void testCpSettingFormEntryItemDataWithHelperAndForm(); - void testCpSettingFormEntryItemDataWithForm(); - void testCpSettingFormEntryItemDataWithListTypeAndForm(); - void testCpSettingFormEntryItemDataWithButtonTypeAndForm(); - void testCpSettingFormEntryItemData005(); - void testCpSettingFormEntryItemData005a(); - void testCpSettingFormEntryItemDataWithListTypeAndHelper(); - void testCpSettingFormEntryItemDataWithButtonTypeAndHelper(); - void testCpSettingFormEntryItemDataWithListTypeAndHelperForm(); - void testCpSettingFormEntryItemDataWithButtonTypeAndHelperForm(); - void testCpSettingFormEntryItemDataWithFormParam(); - void testCpSettingFormEntryItemDataWithHelperParam(); - void testCpSettingFormEntryItemDataWithHelperForm(); - void testCpSettingFormEntryItemDataWithListTypeNullPointer(); - void testCpSettingFormEntryItemDataWithButtonTypeNullPointer(); - void testCpSettingFormEntryItemDataWithInvalidTypeNullPointer(); - void testCpSettingFormEntryItemDataWithParentParam(); - - void testOnLaunchViewNoParam(); -}; - -#endif // UT_CP_SETTING_FORM_ENTRY_ITEM_DATA_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpsettingformentryitemdata/ut_cpsettingformentryitemdata.pri --- a/controlpanel/tsrc/unit/ut_cpsettingformentryitemdata/ut_cpsettingformentryitemdata.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -HEADERS += src/ut_cpsettingformentryitemdata.h \ - src/mycpsettingformentryitemdata.h - -SOURCES += src/ut_cpsettingformentryitemdata.cpp \ - src/mycpsettingformentryitemdata.cpp - -INCLUDEPATH += . \ - src/\ - ../../../src/inc \ - ../../../controlpanel_plat/inc diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpsettingformentryitemdata/ut_cpsettingformentryitemdata.pro --- a/controlpanel/tsrc/unit/ut_cpsettingformentryitemdata/ut_cpsettingformentryitemdata.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = app -TARGET = ut_cpsettingformentryitemdata - -include (../ut_common.pri) -include (ut_cpsettingformentryitemdata.pri) - -symbian: { - TARGET.UID3 = 0xEF97598F -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpsettingformitemdata/src/ut_cpsettingformitemdata.cpp --- a/controlpanel/tsrc/unit/ut_cpsettingformitemdata/src/ut_cpsettingformitemdata.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,335 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#include "ut_cpsettingformitemdata.h" - -#include -#include - -/*! - \class TestCpSettingFormItemData - \brief This class is used for the unit test for class CpSettingFormItemData.\n - CpSettingFormItemData class is derived from HbDataFormModelItem, customed model item for control panel.\n - This unit test is supported by QTest.\n - There are total 11 test cases in this unit.\n - */ - -void TestCpSettingFormItemData::initTestCase() - { - } - -void TestCpSettingFormItemData::cleanupTestCase() - { - QCoreApplication::processEvents(); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormItemData(HbDataFormModelItem::DataItemType type, - const QString &label, - const HbDataFormModelItem *parent = 0);\n  - - 2. Function Descrition: \n    - Construct a new CpSettingFormItemData with the given type,label and parent.\n  - 3. Input Parameters: \n   - HbDataFormModelItem::DataItemType type\n   - QString &label\n   - HbDataFormModelItem *parent\n  - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormItemData::testCpSettingFormItemDataWithTypeTextItem() - { - CpSettingFormItemData *pdata = new CpSettingFormItemData( HbDataFormModelItem::TextItem, "label" ); - QVERIFY( pdata !=0 ); - QVERIFY( pdata->type() == HbDataFormModelItem::TextItem ); - QVERIFY( pdata->label() == "label"); - - delete pdata; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormItemData(HbDataFormModelItem::DataItemType type, - const QString &label, - const HbDataFormModelItem *parent = 0);\n  - - 2. Function Descrition: \n    - Construct a new CpSettingFormItemData with the given type,label and parent.\n  - 3. Input Parameters: \n   - HbDataFormModelItem::DataItemType type\n   - QString &label\n   - HbDataFormModelItem *parent\n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormItemData::testCpSettingFormItemDataWithTypeSliderItem() - { - CpSettingFormItemData *pdata = new CpSettingFormItemData( HbDataFormModelItem::SliderItem, "label" ); - QVERIFY( pdata !=0 ); - QVERIFY( pdata->type() == HbDataFormModelItem::SliderItem ); - QVERIFY( pdata->label() == "label"); - - delete pdata; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormItemData(HbDataFormModelItem::DataItemType type, - const QString &label, - const HbDataFormModelItem *parent = 0);\n  - - 2. Function Descrition: \n    - Construct a new CpSettingFormItemData with the given type,label and parent.\n  - 3. Input Parameters: \n   - HbDataFormModelItem::DataItemType type\n   - QString &label\n   - HbDataFormModelItem *parent\n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormItemData::testCpSettingFormItemDataWithTypeVolumeSliderItem() - { - CpSettingFormItemData * pdata = new CpSettingFormItemData( HbDataFormModelItem::VolumeSliderItem, "label" ); - QVERIFY( pdata !=0 ); - QVERIFY( pdata->type() == HbDataFormModelItem::VolumeSliderItem ); - QVERIFY( pdata->label() == "label"); - - delete pdata; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormItemData(HbDataFormModelItem::DataItemType type, - const QString &label, - const HbDataFormModelItem *parent = 0);\n  - - 2. Function Descrition: \n    - Construct a new CpSettingFormItemData with the given type,label and parent.\n  - 3. Input Parameters: \n   - HbDataFormModelItem::DataItemType type\n   - QString &label\n   - HbDataFormModelItem *parent\n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormItemData::testCpSettingFormItemDataWithTypeCheckBoxItem() - { - CpSettingFormItemData * pdata = new CpSettingFormItemData( HbDataFormModelItem::CheckBoxItem, "label" ); - QVERIFY( pdata !=0 ); - QVERIFY( pdata->type() == HbDataFormModelItem::CheckBoxItem ); - QVERIFY( pdata->label() == "label"); - - delete pdata; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormItemData(HbDataFormModelItem::DataItemType type, - const QString &label, - const HbDataFormModelItem *parent = 0);\n  - - 2. Function Descrition: \n    - Construct a new CpSettingFormItemData with the given type,label and parent.\n  - 3. Input Parameters: \n   - HbDataFormModelItem::DataItemType type\n   - QString &label\n   - HbDataFormModelItem *parent\n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormItemData::testCpSettingFormItemDataWithTypeToggleValueItem() - { - CpSettingFormItemData * pdata = new CpSettingFormItemData( HbDataFormModelItem::ToggleValueItem, "label" ); - QVERIFY( pdata !=0 ); - QVERIFY( pdata->type() == HbDataFormModelItem::ToggleValueItem ); - QVERIFY( pdata->label() == "label"); - - delete pdata; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormItemData(HbDataFormModelItem::DataItemType type, - const QString &label, - const HbDataFormModelItem *parent = 0);\n  - - 2. Function Descrition: \n    - Construct a new CpSettingFormItemData with the given type,label and parent.\n  - 3. Input Parameters: \n   - HbDataFormModelItem::DataItemType type\n   - QString &label\n   - HbDataFormModelItem *parent\n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormItemData::testCpSettingFormItemDataWithTypeRadioButtonListItem() - { - CpSettingFormItemData * pdata = new CpSettingFormItemData( HbDataFormModelItem::RadioButtonListItem, "label" ); - QVERIFY( pdata !=0 ); - QVERIFY( pdata->type() == HbDataFormModelItem::RadioButtonListItem ); - QVERIFY( pdata->label() == "label"); - - delete pdata; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormItemData(HbDataFormModelItem::DataItemType type, - const QString &label, - const HbDataFormModelItem *parent = 0);\n  - - 2. Function Descrition: \n    - Construct a new CpSettingFormItemData with the given type,label and parent.\n  - 3. Input Parameters: \n   - HbDataFormModelItem::DataItemType type\n   - QString &label\n   - HbDataFormModelItem *parent\n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormItemData::testCpSettingFormItemDataWithTypeMultiselectionItem() - { - CpSettingFormItemData * pdata = new CpSettingFormItemData( HbDataFormModelItem::MultiselectionItem, "label" ); - QVERIFY( pdata !=0 ); - QVERIFY( pdata->type() == HbDataFormModelItem::MultiselectionItem ); - QVERIFY( pdata->label() == "label"); - - delete pdata; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormItemData(HbDataFormModelItem::DataItemType type, - const QString &label, - const HbDataFormModelItem *parent = 0);\n  - - 2. Function Descrition: \n    - Construct a new CpSettingFormItemData with the given type,label and parent.\n  - 3. Input Parameters: \n   - HbDataFormModelItem::DataItemType type\n   - QString &label\n   - HbDataFormModelItem *parent\n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormItemData::testCpSettingFormItemDataWithTypeComboBoxItem() - { - CpSettingFormItemData * pdata = new CpSettingFormItemData( HbDataFormModelItem::ComboBoxItem, "label" ); - QVERIFY( pdata !=0 ); - QVERIFY( pdata->type() == HbDataFormModelItem::ComboBoxItem ); - QVERIFY( pdata->label() == "label"); - - delete pdata; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormItemData(HbDataFormModelItem::DataItemType type, - const QString &label, - const HbDataFormModelItem *parent = 0);\n  - - 2. Function Descrition: \n    - Construct a new CpSettingFormItemData with the given type,label and parent.\n  - 3. Input Parameters: \n   - HbDataFormModelItem::DataItemType type\n   - QString &label\n   - HbDataFormModelItem *parent\n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormItemData::testCpSettingFormItemDataWithParent() - { - CpSettingFormItemData * pdata = new CpSettingFormItemData( HbDataFormModelItem::SliderItem, "parent", 0 ); - QVERIFY( pdata !=0 ); - QVERIFY( pdata->type() == HbDataFormModelItem::SliderItem ); - - CpSettingFormItemData * cdata = new CpSettingFormItemData( HbDataFormModelItem::TextItem, "label", pdata); - QVERIFY( cdata != 0 ); - QVERIFY( cdata->type() == HbDataFormModelItem::TextItem ); - - delete pdata; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormItemData(HbDataFormModelItem::DataItemType type, - const QString &label, - const HbDataFormModelItem *parent = 0);\n  - - 2. Function Descrition: \n    - Construct a new CpSettingFormItemData with the given type,label and parent.\n  - 3. Input Parameters: \n   - HbDataFormModelItem::DataItemType type\n   - QString &label\n   - HbDataFormModelItem *parent\n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormItemData::testCpSettingFormItemDataNoParameter() - { - CpSettingFormItemData * pdata = new CpSettingFormItemData(); - QVERIFY( pdata !=0 ); - pdata->setType(HbDataFormModelItem::SliderItem); - pdata->setLabel("label"); - - QVERIFY( pdata->type() == HbDataFormModelItem::SliderItem ); - delete pdata; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - CpSettingFormItemData(HbDataFormModelItem::DataItemType type, - const QString &label, - const HbDataFormModelItem *parent = 0);\n  - - 2. Function Descrition: \n    - Construct a new CpSettingFormItemData with the given type,label and parent.\n  - 3. Input Parameters: \n   - HbDataFormModelItem::DataItemType type\n   - QString &label\n   - HbDataFormModelItem *parent\n  - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpSettingFormItemData::testCpSettingFormItemDataWithParentNoType() - { - CpSettingFormItemData * pdata = new CpSettingFormItemData( HbDataFormModelItem::SliderItem, "parent", 0 ); - QVERIFY( pdata !=0 ); - QVERIFY( pdata->type() == HbDataFormModelItem::SliderItem ); - - CpSettingFormItemData * cdata = new CpSettingFormItemData(pdata); - QVERIFY( cdata != 0 ); - cdata->setType(HbDataFormModelItem::TextItem); - QVERIFY( cdata->type() == HbDataFormModelItem::TextItem ); - - delete pdata; - } - -QTEST_APPLESS_MAIN(TestCpSettingFormItemData) diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpsettingformitemdata/src/ut_cpsettingformitemdata.h --- a/controlpanel/tsrc/unit/ut_cpsettingformitemdata/src/ut_cpsettingformitemdata.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#ifndef TEST_CP_SETTING_FORM_ITEM_DATA_H -#define TEST_CP_SETTING_FORM_ITEM_DATA_H - -#include - -class TestCpSettingFormItemData : public QObject -{ - Q_OBJECT - -private slots: - void initTestCase(); - void cleanupTestCase(); - -//public slots: - void testCpSettingFormItemDataWithTypeTextItem(); - void testCpSettingFormItemDataWithTypeSliderItem(); - void testCpSettingFormItemDataWithTypeVolumeSliderItem(); - void testCpSettingFormItemDataWithTypeCheckBoxItem(); - void testCpSettingFormItemDataWithTypeToggleValueItem(); - void testCpSettingFormItemDataWithTypeRadioButtonListItem(); - void testCpSettingFormItemDataWithTypeMultiselectionItem(); - void testCpSettingFormItemDataWithTypeComboBoxItem(); - void testCpSettingFormItemDataWithParent(); - void testCpSettingFormItemDataNoParameter(); - void testCpSettingFormItemDataWithParentNoType(); -}; - -#endif // TEST_CP_SETTING_FORM_ITEM_DATA_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpsettingformitemdata/ut_cpsettingformitemdata.pri --- a/controlpanel/tsrc/unit/ut_cpsettingformitemdata/ut_cpsettingformitemdata.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -HEADERS += src/ut_cpsettingformitemdata.h -SOURCES += src/ut_cpsettingformitemdata.cpp - -INCLUDEPATH += . \ - src/\ - ../../../src/inc \ - ../../../controlpanel_plat/inc diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpsettingformitemdata/ut_cpsettingformitemdata.pro --- a/controlpanel/tsrc/unit/ut_cpsettingformitemdata/ut_cpsettingformitemdata.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = app -TARGET = ut_cpsettingformitemdata - -include (../ut_common.pri) -include (ut_cpsettingformitemdata.pri) - -symbian: { - TARGET.UID3 = 0xEA4617EA -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cputility/src/ut_cputility.cpp --- a/controlpanel/tsrc/unit/ut_cputility/src/ut_cputility.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,190 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ -#include "ut_cputility.h" -#include "cputility.h" - -#include - -/*! - \class TestCpUtility - \brief This class is used for the unit test for class CpUtility.\n - CpUtility class is an utility class to provide functionalities about drive and dir related processing.\n - This unit test is supported by QTest.\n - There are total 6 test cases in this unit.\n - */ - -void TestCpUtility::initTestCase() - { - } - -void TestCpUtility::cleanupTestCase() - { - QCoreApplication::processEvents(); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - static CpUtility::drives();\n  - - 2. Function Descrition: \n    - Get and store driver letter into QStringList object, using QDir::drives().\n  - 3. Input Parameters: none.\n   - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpUtility::testDrivesOnce() - { - QStringList strListDrives = CpUtility::drives(); - QVERIFY(!strListDrives.isEmpty()); - - verifyDrivesList(strListDrives); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - static CpUtility::drives();\n  - - 2. Function Descrition: \n    - Get and store driver letter into QStringList object, using QDir::drives().\n  - 3. Input Parameters: none.\n   - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpUtility::testDrivesRepeatTwice() - { - QStringList strListDrives1 = CpUtility::drives(); - QVERIFY(!strListDrives1.isEmpty()); - - verifyDrivesList(strListDrives1); - - QStringList strListDrives2 = CpUtility::drives(); - QVERIFY(!strListDrives2.isEmpty()); - - verifyDrivesList(strListDrives2); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - static CpUtility::pluginDirectories();\n  - - 2. Function Descrition: \n    - Get and store plugin directories into QStringList object.\n  - 3. Input Parameters: none.\n   - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpUtility::testPluginDirectoriesOnce() - { - QStringList strListDirs = CpUtility::pluginDirectories(); - QVERIFY(!strListDirs.isEmpty()); - - verifyDirectoriesList(strListDirs); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - static CpUtility::pluginDirectories();\n  - - 2. Function Descrition: \n    - Get and store plugin directories into QStringList object.\n  - 3. Input Parameters: none.\n   - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpUtility::testPluginDirectoriesRepeatTwice() - { - QStringList strListDirs1 = CpUtility::pluginDirectories(); - QVERIFY(!strListDirs1.isEmpty()); - - verifyDirectoriesList(strListDirs1); - - QStringList strListDirs2 = CpUtility::pluginDirectories(); - QVERIFY(!strListDirs2.isEmpty()); - - verifyDirectoriesList(strListDirs2); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - static CpUtility::configFileDirectories();\n  - - 2. Function Descrition: \n    - Get and store cpcfg file directories into QStringList object.\n  - 3. Input Parameters: none.\n   - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpUtility::testConfigFileDirectoriesOnce() - { - QStringList strListConfigDirs = CpUtility::configFileDirectories(); - QVERIFY(!strListConfigDirs.isEmpty()); - - verifyConfigFileDirectories(strListConfigDirs); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - static CpUtility::configFileDirectories();\n  - - 2. Function Descrition: \n    - Get and store cpcfg file directories into QStringList object.\n  - 3. Input Parameters: none.\n   - - 4. Expected result: \n   - case run without verify failed.\n - */ -void TestCpUtility::testConfigFileDirectoriesRepeatTwice() - { - QStringList strListConfigDirs1 = CpUtility::configFileDirectories(); - QVERIFY(!strListConfigDirs1.isEmpty()); - - verifyConfigFileDirectories(strListConfigDirs1); - - QStringList strListConfigDirs2 = CpUtility::configFileDirectories(); - QVERIFY(!strListConfigDirs2.isEmpty()); - - verifyConfigFileDirectories(strListConfigDirs2); - } - -void TestCpUtility::verifyDrivesList(const QStringList &strList) - { - QVERIFY( strList.contains("C:", Qt::CaseInsensitive) ); - QVERIFY( strList.contains("Z:", Qt::CaseInsensitive) ); - } - -void TestCpUtility::verifyDirectoriesList(const QStringList &strList) - { - QVERIFY( strList.contains(QString("C:/resource/qt/plugins/controlpanel") + QDir::separator(), Qt::CaseInsensitive)); - } - -void TestCpUtility::verifyConfigFileDirectories(const QStringList &strList) - { - QVERIFY( strList.contains(QString("C:/resource/qt/plugins/controlpanel/config") + QDir::separator(), Qt::CaseInsensitive)); - } - -QTEST_APPLESS_MAIN(TestCpUtility) diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cputility/src/ut_cputility.h --- a/controlpanel/tsrc/unit/ut_cputility/src/ut_cputility.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#ifndef TEST_CP_UTILITY_H -#define TEST_CP_UTILITY_H - -#include - -class TestCpUtility : public QObject -{ - Q_OBJECT - -private slots: - void initTestCase(); - void cleanupTestCase(); - -//public slots: - void testDrivesOnce(); - void testDrivesRepeatTwice(); - - void testPluginDirectoriesOnce(); - void testPluginDirectoriesRepeatTwice(); - - void testConfigFileDirectoriesOnce(); - void testConfigFileDirectoriesRepeatTwice(); - -private: - void verifyDrivesList(const QStringList &strList); - void verifyDirectoriesList(const QStringList &strList); - void verifyConfigFileDirectories(const QStringList &strList); -}; - -#endif // TEST_CP_PLUGIN_UTILITY_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cputility/ut_cputility.pri --- a/controlpanel/tsrc/unit/ut_cputility/ut_cputility.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -HEADERS += src/ut_cputility.h \ - ../../../src/cpframework/src/cputility.h \ - -SOURCES += src/ut_cputility.cpp \ - ../../../src/cpframework/src/cputility.cpp - -INCLUDEPATH += . \ - src/\ - ../../../src/inc \ - ../../../controlpanel_plat/inc \ - ../../../src/cpframework/src diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cputility/ut_cputility.pro --- a/controlpanel/tsrc/unit/ut_cputility/ut_cputility.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = app -TARGET = ut_cputility - -include (../ut_common.pri) -include (ut_cputility.pri) - -symbian: { - TARGET.UID3 = 0xE98BA02A -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpviewlauncher/src/ut_cpviewlauncher.cpp --- a/controlpanel/tsrc/unit/ut_cpviewlauncher/src/ut_cpviewlauncher.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,173 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ -#include "ut_cpviewlauncher.h" - -#include "cpviewlauncher.h" -#include "cpbasesettingview.h" - -#include -#include -#include -#include -#include -#include - -/*! - \class TestCpViewLauncher - \brief This class is used for the unit test for class CpViewLauncher.\n - CpViewLauncher class is used for add a HbView into current HbMainWindow, \n - and set the new added HbView instance as current view object, then completed \n - related signal/slot setting.\n - This unit test is supported by QTest.\n - There are total 3 test cases in this unit.\n - */ - -/*! - * init function called by QTest framework. - */ -void TestCpViewLauncher::initTestCase() - { - } - -/*! - * cleanup function used by QTest framework. - */ -void TestCpViewLauncher::cleanupTestCase() - { - QCoreApplication::processEvents(); - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - static void launchView(HbView *view);\n  - - 2. Function Descrition: \n    - Launch an exist CpBaseSettingView object, add the CpBaseSettingView object into HbMainWindow.\n  - 3. Input Parameters: \n   - @param: HbView *view\n - - 4. Expected result: \n   - View can't be launched for there is no HbMainWindow created.\n - */ -void TestCpViewLauncher::testLaunchViewNoMainWindow() - { - CpBaseSettingView * pView1 = new CpBaseSettingView(0); - QVERIFY( pView1 != 0 ); - HbDataForm *pForm = new HbDataForm(0); - QVERIFY( pForm != 0 ); - - pView1->setWidget(pForm); - HbDataForm *pForm1 = qobject_cast(pView1->widget()); - QVERIFY( pForm1 != 0); - QVERIFY( pForm1 == pForm ); - - CpBaseSettingView * pView2 = new CpBaseSettingView(pForm); - QVERIFY( pView2 != 0 ); - - QObject::connect(this, SIGNAL(callAboutToClose()), pView1, SIGNAL(aboutToClose())); - QObject::connect(this, SIGNAL(callAboutToClose()), pView2, SIGNAL(aboutToClose())); - - CpViewLauncher::launchView(pView1); - CpViewLauncher::launchView(pView2); - - emit callAboutToClose(); - emit callAboutToClose(); - - delete pView1; - delete pView2; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - static void launchView(HbView *view);\n  - - 2. Function Descrition: \n    - Launch an exist CpBaseSettingView object, add the CpBaseSettingView object into HbMainWindow.\n  - 3. Pre-condition: \n    - HbMainWindow object created correctly. - - 4. Input: a pointer to CpBaseSettingView object\n   - @param: HbView *view\n - - 5. Expected result: \n   - View launched successfully.\n - */ -void TestCpViewLauncher::testLaunchViewWithMainWindow() - { - mainWindow = new HbMainWindow; - QVERIFY( mainWindow != 0 ); - - mainWindow->show(); - - CpBaseSettingView * pView1 = new CpBaseSettingView(0); - QVERIFY( pView1 != 0 ); - HbDataForm *pForm = new HbDataForm(0); - QVERIFY( pForm != 0 ); - - pView1->setWidget(pForm); - HbDataForm *pForm1 = qobject_cast(pView1->widget()); - QVERIFY( pForm1 != 0); - QVERIFY( pForm1 == pForm ); - - CpBaseSettingView * pView2 = new CpBaseSettingView(pForm); - QVERIFY( pView2 != 0 ); - - QObject::connect(this, SIGNAL(callAboutToClose()), pView1, SIGNAL(aboutToClose())); - QObject::connect(this, SIGNAL(callAboutToClose()), pView2, SIGNAL(aboutToClose())); - - QObject::connect(this, SIGNAL(callAboutToClose()), qApp, SLOT(quit())); - - CpViewLauncher::launchView(pView1); - CpViewLauncher::launchView(pView2); - - emit callAboutToClose(); - emit callAboutToClose(); - - delete mainWindow; - mainWindow = 0; - } - -/*! - * Test Case Description:\n   - * 1. Fucntion Name: \n   - static void launchView(HbView *view);\n  - - 2. Function Descrition: \n    - Launch an exist CpBaseSettingView object, add the CpBaseSettingView object into HbMainWindow.\n  - 3. Input Parameters: \n   - @param: 0\n - 4. Expected result: \n   - launchView do nothing for the 0 parameter.\n - */ -void TestCpViewLauncher::testLaunchViewNoView() - { - HbPushButton *widget = new HbPushButton(); - QVERIFY(widget != 0); - CpBaseSettingView *pView1 = new CpBaseSettingView(widget); - QVERIFY(pView1!=0); - HbPushButton *button = qobject_cast(pView1->widget()); - QVERIFY(button != 0); - QVERIFY(button == widget); - - CpViewLauncher::launchView(0); - - delete pView1; - } - -QTEST_MAIN(TestCpViewLauncher) diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpviewlauncher/src/ut_cpviewlauncher.h --- a/controlpanel/tsrc/unit/ut_cpviewlauncher/src/ut_cpviewlauncher.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* test application for qt control panel public apis. -*/ - -#ifndef UT_CP_VIEW_LAUNCHER_H -#define UT_CP_VIEW_LAUNCHER_H - -#include - -class HbMainWindow; - -class TestCpViewLauncher : public QObject -{ - Q_OBJECT - -signals: - void callAboutToClose(); - -private slots: - void initTestCase(); - void cleanupTestCase(); - -//public slots: - void testLaunchViewNoMainWindow(); - void testLaunchViewWithMainWindow(); - void testLaunchViewNoView(); - -private: - HbMainWindow* mainWindow; -}; - -#endif // UT_CP_VIEW_LAUNCHER_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpviewlauncher/ut_cpviewlauncher.pri --- a/controlpanel/tsrc/unit/ut_cpviewlauncher/ut_cpviewlauncher.pri Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -HEADERS += src/ut_cpviewlauncher.h \ - ../../../src/cpframework/src/cpviewlauncher.h - -SOURCES += src/ut_cpviewlauncher.cpp \ - ../../../src/cpframework/src/cpviewlauncher.cpp - -INCLUDEPATH += . \ - src/\ - ../../../src/inc \ - ../../../controlpanel_plat/inc diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_cpviewlauncher/ut_cpviewlauncher.pro --- a/controlpanel/tsrc/unit/ut_cpviewlauncher/ut_cpviewlauncher.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = app -TARGET = ut_cpviewlauncher - -include (../ut_common.pri) -include (ut_cpviewlauncher.pri) - -symbian: { - TARGET.UID3 = 0xEF52815A -} diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_profileengwrapper/runtest.bat --- a/controlpanel/tsrc/unit/ut_profileengwrapper/runtest.bat Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -@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 - -\epoc32\RELEASE\WINSCW\udeb\ut_profileengwrapper.exe -xml -o c:\ut_ut_profileengwrapper.xml -copy \epoc32\winscw\c\ut_profileengwrapper.xml -del \epoc32\winscw\c\ut_profileengwrapper.xml \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_profileengwrapper/src/ut_profileengwrapper.cpp --- a/controlpanel/tsrc/unit/ut_profileengwrapper/src/ut_profileengwrapper.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "ut_profileengwrapper.h" -#include "cpprofileengine.h" -#include "cpprofile.h" -#include "cpprofiledef.h" -#include -#include -#include - - -void TestProfileEngWrapper::initTestCase() -{ - mProfileEng = new CpProfileEngine(); - QVERIFY(mProfileEng != 0); -} - -void TestProfileEngWrapper::testProfileList() -{ - QStringList profileList = mProfileEng->profileList(); - - QVERIFY(profileList.size() > 0); - - qDebug() << "read all profiles:\r\n"; - foreach(const QString &name,profileList) { - qDebug() << name << "\t"; - } - qDebug() << "\r\n"; -} - -void TestProfileEngWrapper::testModifyProfile() -{ - CpProfile *generalProfile = mProfileEng->profile(CpProfileGeneralId); - - int prevolume = generalProfile->ringingVolume(CpProfileKnownCaller); - qDebug() << "before modifying volume:" << prevolume << "\r\n"; - - int newvolume = prevolume + 1; - generalProfile->setRingingVolume(CpProfileKnownCaller, newvolume); - mProfileEng->saveProfile(generalProfile); - - qDebug() << "after modifying volume:" << generalProfile->ringingVolume(CpProfileKnownCaller) << "\r\n"; - - generalProfile->setRingingVolume(CpProfileKnownCaller, prevolume); - mProfileEng->saveProfile(generalProfile); - - QVERIFY(prevolume == generalProfile->ringingVolume(CpProfileKnownCaller)); -} - -void TestProfileEngWrapper::testCreateAndDeleteProfile() -{ - QStringList profileList = mProfileEng->profileList(); - qDebug() << "origion size:" << profileList.size() << "\r\n"; - - //create a profile - CpProfile *newProfile = mProfileEng->createProfile(); - mProfileEng->saveProfile(newProfile); - - QStringList newProfileList = mProfileEng->profileList(); - - qDebug() << "size after creating new:" << newProfileList.size() << "\r\n"; - QVERIFY(profileList.size() + 1 == newProfileList.size()); - - mProfileEng->deleteProfile(newProfile->id()); - newProfileList = mProfileEng->profileList(); - qDebug() << "size after deleting new:" << newProfileList.size() << "\r\n"; - QVERIFY(profileList.size() == newProfileList.size()); - -} - -void TestProfileEngWrapper::cleanupTestCase() -{ - delete mProfileEng; - mProfileEng = 0; -} - -QTEST_MAIN(TestProfileEngWrapper) diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_profileengwrapper/src/ut_profileengwrapper.h --- a/controlpanel/tsrc/unit/ut_profileengwrapper/src/ut_profileengwrapper.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0"" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef UT_PROFILEENGWRAPPER_H -#define UT_PROFILEENGWRAPPER_H - -#include - -class CpProfileEngine; - -class TestProfileEngWrapper : public QObject -{ - Q_OBJECT -private slots: - void initTestCase(); // initialize test data - - void testProfileList(); - void testModifyProfile(); - void testCreateAndDeleteProfile(); - - void cleanupTestCase(); //Finalize test data -private: - CpProfileEngine *mProfileEng; -}; - - -#endif //UT_PROFILEENGWRAPPER_H diff -r 8ee96d21d9bf -r 7e0eff37aedb controlpanel/tsrc/unit/ut_profileengwrapper/ut_profileengwrapper.pro --- a/controlpanel/tsrc/unit/ut_profileengwrapper/ut_profileengwrapper.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE = app -TARGET = ut_profileengwrapper -DEPENDPATH += . src -INCLUDEPATH += . ../../../src/cpplugins/profileenginewapper/src - -QT += testlib -CONFIG += qtestlib -TARGET.CAPABILITY = ALL -TCB -symbian:LIBS += -lprofileenginewapper - -unix { - test.commands = /epoc32/RELEASE/WINSCW/udeb/ut_profileengwrapper.exe - autotest.commands = /epoc32/RELEASE/WINSCW/udeb/ut_profileengwrapper.exe -xml -o c:/ut_profileengwrapper.xml -} else:win32 { - test.CONFIG += recursive - autotest.CONFIG += recursive - build_pass { - test.commands =/epoc32/RELEASE/WINSCW/udeb/ut_profileengwrapper.exe - autotest.commands =/epoc32/RELEASE/WINSCW/udeb/ut_profileengwrapper.exe -xml -o c:/ut_profileengwrapper.xml - } -} -QMAKE_EXTRA_TARGETS += test autotest - -# Input -HEADERS += src/ut_profileengwrapper.h -SOURCES += src/ut_profileengwrapper.cpp diff -r 8ee96d21d9bf -r 7e0eff37aedb ftuwizardmodel/ftuwizardmodel.pro --- a/ftuwizardmodel/ftuwizardmodel.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: Project file for FTU wizard model -# - -TEMPLATE = lib - -DEPENDPATH += . \ - inc -INCLUDEPATH += . \ - inc - -TARGET = ftuwizardmodel - -CONFIG += qt debug_and_release warn_on hb -INCLUDEPATH += ./inc -DEFINES += FTUWIZARDMODEL_LIB -QMAKE_CXXFLAGS.CW += -w error - -# Input -HEADERS += ./inc/*.h - -windows { - CONFIG(release, debug|release) { - DESTDIR = ../../bin/release/ - OBJECTS_DIR = win32/release/obj - } - - CONFIG(debug, debug|release) { - DESTDIR = ../../bin/debug/ - OBJECTS_DIR = win32/debug/obj - } -} - -symbian { - TARGET.UID3 = 0x20027009 - TARGET.CAPABILITY = ALL -TCB - TARGET.EPOCALLOWDLLDATA = 1 -# INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE -} - -#deployment configuration, deploy as a dll. -symbian { - deploy_ftuwizardmodel.sources = ftuwizardmodel.dll - deploy_ftuwizardmodel.path = \sys\bin - DEPLOYMENT += deploy_ftuwizardmodel - BLD_INF_RULES.prj_exports += \ - "rom/ftuwizardmodel.iby CORE_MW_LAYER_IBY_EXPORT_PATH(ftuwizardmodel.iby)" -} - -#ONLY FOR DEVELOPMENT! REMOVE THIS BEFORE EACH HS_Domain RELEASE! -symbian: MMP_RULES += EXPORTUNFROZEN diff -r 8ee96d21d9bf -r 7e0eff37aedb ftuwizardmodel/inc/ftuwizard.h --- a/ftuwizardmodel/inc/ftuwizard.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,246 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: FtuWizard class definition -* -*/ - - -#ifndef FTUWIZARD_H -#define FTUWIZARD_H - -#include "ftuwizardmodellib.h" - -#include -#include -#include -#include -#include - -class QGraphicsWidget; - -/** - * @ingroup group_ftuwizardmodel - * @brief Represents a wizard plugin visualization information. - * - * FtuWizardSetting struct contains the information needed to construct the GUI in - * the FTU fw. - * - * @lib ?library - * @since S60 ?S60_version - */ - -typedef struct { - /** - * The default icon to be shown in table of contents UI component. - */ - QFileInfo mTocDefaultIcon; - /** - * The pressed icon to be shown in table of contents UI component. - */ - QFileInfo mTocPressedIcon; - /** - * The focussed icon to be shown in table of contents UI component. - */ - QFileInfo mTocFocussedIcon; - /** - * The text to be shown in table of contents UI component. - */ - QString mTocLabel; - /** - * Informs Framework whether a plugin is having any ftu view or not. - * It should be set to false by plugin if it has any FTU view to be shown - * when the plugin is activated. It should be set to true if plugin - * is invoking any service/wizard, when plugin is selected/activated. - */ - bool mNoViews; -} FtuWizardSetting; - -/** - * @ingroup group_ftuwizardmodel - * @brief Represents a wizard plugin in the framework. - * - * FtuWizard is an interface through which setting wizard plugin can be - * executed in the FTU fw. - * - * @lib ?library - * @since S60 ?S60_version - */ - -class FTUWIZARDMODEL_EXPORT FtuWizard : public QObject -{ - Q_OBJECT -public: - /** - * The reason why the FTU fw and the wizard plugin is being shut down. - */ - enum ShutdownReason {MemoryLow, GraphicsMemoryLow, NormalBoot}; - -public: - - /** - * Destructor. - * @since S60 ?S60_version. - */ - virtual ~FtuWizard(){} - - /** - * Called by the FTU fw during initialize cycle of the wizard, it is during - * this phase the wizard widget - * usually creates its initial view. - * Once the initialization is done, wizardInitialized signal must be - * emitted. - * @param cenrepOwnerId Id of the owner of Cenrep holding wizard completion Information. - * @param wizardIdx Index of the Cenrep key for a wizard. - * If wizard is invoking another application, it should provide cenrepOwnerId and wizardIdx - * to the application. Application should write 1 into the wizardIdx cenrep on completion. - - * @since S60 ?S60_version. - */ - virtual void initializeWizard(qint32 cenrepOwnerId, int wizardIdx) = 0; - - /** - * Called by the FTU fw when the wizard becomes the current wizard. - * @since S60 ?S60_version. - */ - virtual void activateWizard() = 0; - - /** - * Called by the FTU fw when the wizard is no longer being displayed. - */ - virtual void deactivateWizard() = 0; - - /** - * Called by the FTU fw before the wizard destructor is called. - * @param reason The reason why the ftu fw is being killed. - * @return The mode how wizard plugin is shut down. - * true means the wizard can be deleted immediately. - * false means the wizard signals with shutdownDone when it can - * be released. - */ - virtual bool shutdownWizard(ShutdownReason reason) = 0; - - /** - * Called by the FTU fw to set the wizard size. - * @param geometry The rectangle allocated to this wizard. - */ - virtual void resizeWizard(const QRectF& geometry) = 0; - - /** - * This wizard setting values is queryed by the FTU fw to get the display - * properties of the wizard required to be shown in the FTU fw's table of - * contents view and menu strip (e.g the icon & name of the wizard). - * The information must be available once the plugin instance has been - * created. - * @return The plugin wizard gui settings. - */ - virtual const FtuWizardSetting& wizardSettings() = 0; - - /** - * Called by FTU fw when back button is clicked in the plugin view. - * In this method the wizard plugin can implement internally showing and - * hiding GUI elements if the plugin has multiple 'views'. - * @return true if back event is handled internally in wizard plugin - * false if the FTU fw is to handle the event. - */ - virtual bool handleBackEvent() = 0; - - /** - * Called by FTU fw to get the date when the settings have been saved. - * @return The date when wizard settings have been completed. - */ - virtual QDate wizardCompletedDate() = 0; - -protected: - - /** - * Constructor. - * @since S60 ?S60_version. - */ - FtuWizard(){} - - -signals: - /** - * Emit this signal to update the text of the info text widget. - * @param caller The calling wizard plugin instance. - * @param text The info text to be shown. - */ - void infoTextUpdated(FtuWizard *caller, QString text); - - /** - * Emit this signal notify the progress on wizard settings. - * @param caller The calling wizard plugin instance. - * @param showCompleteness True if the progress is being indicated on the - * UI. - * @param completenessPercentage The progress of the settings operation. - */ - void progressUpdated(FtuWizard *caller, bool showProgess, - int progressPercentage); - - /** - * Emit this signal when changing the view inside the wizard plugin. - * @param caller The calling wizard plugin instance. - * @param viewWidget The new plugin view widget to be shown. - */ - void viewChanged(FtuWizard *caller, QGraphicsWidget* viewWidget); - - /** - * Adds an over-lay widget on top of the current view, used to add an - * overlay animation on top of the current view - * @param caller The calling wizard plugin instance. - * @param overlay The overlay widget to be added. - */ - void overlayAdded(FtuWizard *caller, QGraphicsWidget* overlay); - - /** - * Removes the overlay widget added by addOverlay signal. - * @param caller The calling wizard plugin instance. - * @param overlay The overlay widget to be removed. - */ - void overlayRemoved(FtuWizard *caller, QGraphicsWidget* overlay); - - /** - * Emit this signal to indicate initialization is done. - * @param caller The calling wizard plugin instance. - * @param success True if succeeded, false otherwise. - */ - void wizardInitialized(FtuWizard *caller, bool success); - - /** - * Emit this signal to indicate that the wizard plugin can be deleted. - * Note that this signal does not need to be emitted if true is returned - * from shutdownWizard. - * @param caller The calling wizard plugin instance. - */ - void shutdownCompleted(FtuWizard *caller); - - /** - * Emit this signal to indicate that the wizard plugin wants a custom view menu to be shown. - * from shutdownWizard. - * @param caller The calling wizard plugin instance. - * @param menu The HbMenu instance that needs to be shown on the view - */ - void updateMainMenu(FtuWizard *caller, HbMenu * menu); - - /** - * Emit this signal to indicate that the wizard plugin wants to be deactivated. - * Wizard is deactivated and Table of Contents is shown by the application. - * @param caller The calling wizard plugin instance. - */ - void wizardDeactivated(FtuWizard *caller); - -}; - -#endif // FTUWIZARD_H - diff -r 8ee96d21d9bf -r 7e0eff37aedb ftuwizardmodel/inc/ftuwizardfactory.h --- a/ftuwizardmodel/inc/ftuwizardfactory.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: FtuWizardFactory class definition -* -*/ - - -#ifndef FTUWIZARDFACTORY_H -#define FTUWIZARDFACTORY_H - - -class FtuWizard; - -/** - * @ingroup group_ftuwizardmodel - * @brief A factory class through which the wizard plugin can be instantiated. - * - * FtuWizardFactory contains a factory method to create a wizard plugin instance. - * - * @lib ?library - * @since S60 ?S60_version - */ - -class FtuWizardFactory -{ -public: - /** - * Instantiates a wizard plugin object. - * @return The constructed wizard plugin object. - * @since S60 ?S60_version. - */ - virtual FtuWizard* createWizard() const = 0; -}; - -Q_DECLARE_INTERFACE(FtuWizardFactory, "ftu.nokia.com.FtuWizardFactory/1.0"); - -#endif // FTUWIZARDFACTORY_H diff -r 8ee96d21d9bf -r 7e0eff37aedb ftuwizardmodel/inc/ftuwizardmodellib.h --- a/ftuwizardmodel/inc/ftuwizardmodellib.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Internal file for exporting FTUWizardModel interfaces -* -*/ - - -#ifndef FTUWIZARDMODELLIB_H -#define FTUWIZARDMODELLIB_H - -#ifdef FTUWIZARDMODEL_LIB - #define FTUWIZARDMODEL_EXPORT Q_DECL_EXPORT -#else - #define FTUWIZARDMODEL_EXPORT Q_DECL_IMPORT -#endif - -#endif - diff -r 8ee96d21d9bf -r 7e0eff37aedb ftuwizardmodel/rom/ftuwizardmodel.iby --- a/ftuwizardmodel/rom/ftuwizardmodel.iby Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: FTU wizard model iby file. -* -*/ - -#ifndef __FTUWIZARDMODEL_IBY__ -#define __FTUWIZARDMODEL_IBY__ - - -//////////////////////////////////////// -// Ftuwizardmodel -//////////////////////////////////////// - -file=ABI_DIR\BUILD_DIR\ftuwizardmodel.dll SHARED_LIB_DIR\ftuwizardmodel.dll - -#endif // __FTUWIZARDMODEL_IBY__ diff -r 8ee96d21d9bf -r 7e0eff37aedb group/bld.inf --- a/group/bld.inf Tue Aug 31 15:29:50 2010 +0300 +++ b/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -26,6 +26,7 @@ #include "../gsprofilesrv_plat/group/bld.inf" #include "../gsprofilesrv_pub/group/bld.inf" +#include "../gssettingsuis/group/bld.inf" #include "../profilesservices/group/bld.inf" PRJ_TESTMMPFILES diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/filelist_api/filelist_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/filelist_api/filelist_api.metaxml Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,18 @@ + + + FileList API + An UI for the file selection lists. + c++ + profilesservices + + + + + + + + + no + no + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/filelist_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/filelist_api/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: File that exports the files belonging to +: FileList API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/FileListModel.hrh MW_LAYER_PLATFORM_EXPORT_PATH(FileListModel.hrh) +../inc/CFLDController.h MW_LAYER_PLATFORM_EXPORT_PATH(CFLDController.h) +../inc/MFLDFileListBoxObserver.h MW_LAYER_PLATFORM_EXPORT_PATH(MFLDFileListBoxObserver.h) +../inc/CFLDFileListContainer.h MW_LAYER_PLATFORM_EXPORT_PATH(CFLDFileListContainer.h) +../inc/FileListModel.rh MW_LAYER_PLATFORM_EXPORT_PATH(FileListModel.rh) diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/filelist_api/inc/CFLDController.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/filelist_api/inc/CFLDController.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,238 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CFLDController observes the list box and invokes a MFLDFileProcessor +* if the timer expires. +* +* +*/ + + + +#ifndef __CFLDCONTROLLER_H__ +#define __CFLDCONTROLLER_H__ + +// INTERNAL INCLUDES +#include "MFLDFileListBoxObserver.h" + +// EXTERNAL INCLUDES +#include +#include // For RConeResourceLoader + +// FORWARD DECLARATIONS +class MFLDFileObserver; +class MFLDFileProcessor; +class RWindow; + +#ifdef RD_VIDEO_AS_RINGING_TONE + class CFLDSoftKeyChanger; +#endif + +// CLASS DECLARATION + +/** +* CFLDController observes the list box and invokes a MFLDFileProcessor +* if the timer expires. +* +* @lib filelist.lib +* @since 2.1 +*/ +class CFLDController + : public CBase, public MFLDFileListBoxObserver + { + + private: // Enumerations + + // These match with the ones in Profile Engine + enum TRingingTypes + { + ERingingTypeRinging = 0, + ERingingTypeAscending, + ERingingTypeRingOnce, + ERingingTypeBeepOnce, + ERingingTypeSilent + }; + public: // Constructors and destructors + + /** + * Completes the construction of CFLDController. + * @param aWindow A reference to window handle + */ + IMPORT_C void CompleteConstructionL( RWindow& aWindow ); + + /** + * Destructor + */ + IMPORT_C virtual ~CFLDController(); + + /** + * Two-phased static constructor. + * @param aShowErrorMsgs Show an error note if the file format is not supported + * @param aDelay The delay in microseconds until the timer expires + * @return A pointer to a fully constructed CController instance + */ + IMPORT_C static CFLDController* NewL( TBool aShowErrorMsgs, + TTimeIntervalMicroSeconds32 aDelay ); + + /** + * Two-phased static constructor, leaves a pointer to cleanup stack + * @param aShowErrorMsgs Show an error note if the file format is not supported + * @param aDelay The delay in microseconds until the timer expires + * @return A pointer to a fully constructed CController instance + */ + IMPORT_C static CFLDController* NewLC( TBool aShowErrorMsgs, + TTimeIntervalMicroSeconds32 aDelay ); + + private: // Constructors and destructors + + /** + * Constructor + * @param aShowErrorMsgs Show an error note if the file format is not supported + * @param aDelay The delay in microseconds until the timer expires + */ + CFLDController( TBool aShowErrorMsgs, + TTimeIntervalMicroSeconds32 aDelay ); + + /** + * Second phase constructor + */ + void ConstructL( ); + + public: // New methods + + /** + * Set the delay until the timer expires. + * @param aDelay The delay in microseconds + */ + IMPORT_C void SetDelay( TTimeIntervalMicroSeconds32 aDelay ); + + /** + * Set the volume level on which the sound is played + * If this method is not called, audio and video players + * uses the setting in active profile. + * @param aVolume The volume level + */ + IMPORT_C void SetVolume( TInt aVolume ); + + /** + * Sets the ringing type + * If this method is not called, audio and video players + * uses the setting in active profile. + * @param aRingingType The ringing type (see enum TRingingTypes) + */ + IMPORT_C void SetRingingType( TInt aRingingType ); + + /** + * Sets vibrating alert on or off. + * If this method is not called, audio and video players + * uses the setting in active profile. + * @param aVibra True: Vibra is on. False: Vibra is off. + */ + IMPORT_C void SetVibra( TBool aVibra ); + + /** + * Sets the file observer for the class. + * The file observer is asked if the file is ok to be processed. + * @since 2.5 + * @param aFileObserver Pointer to the file observer. + */ + IMPORT_C void SetFileObserver( MFLDFileObserver* aFileObserver ); + + /** + * Sets 3d-effects on or off. + * If this method is called using parameter EFalse 3d-effects are + * always disabled even though those are set in active profile. + * Otherwise toneplayer uses the setting in active profile. + * @param a3dEffects True: 3dEffects are on. False: 3dEffects are off. + */ + IMPORT_C void Set3dEffects( TBool a3dEffects ); + + /** + * Release allocated resources + */ + void Release(); + + private: // New methods + + /** + * This callback method is called when the timer expires. Calls + * MFLDFileProcessor::ProcessFileL(). + * @param aPtr pointer to CFLDController + * @return Returns always zero + */ + static TInt HandleTimerTickL( TAny* aPtr ); + + public: // Methods derived from MFLDFileListBoxObserver + + /** + * Receives the event notification from the file list box + */ + IMPORT_C void HandleFileListBoxEventL( TFileListBoxEvent aEvent, + const TDesC& aFileName ); + /** + * Passes softkey notifications to the file list box + */ + void HandleSoftKeyState( TFileListSoftKeyState& aSoftKeyState ); + + private: // Data + + /// Own: Pointer to the file handler + MFLDFileProcessor* iAudioProcessor; + +#ifdef RD_VIDEO_AS_RINGING_TONE + /// Own: Pointer to the file handler + MFLDFileProcessor* iVideoProcessor; +#endif + /// Own: Pointer to timer + CPeriodic* iTimer; + + /// Ref: Pointer to window + RWindow* iWindow; + + /// Currently focused file in the list + TFileName iCurrentFile; + + /// The delay in microseconds until timer expires + TTimeIntervalMicroSeconds32 iDelay; + + /// Ref: Pointer to file observer + MFLDFileObserver* iFileObserver; + +#ifdef RD_VIDEO_AS_RINGING_TONE + /// Own: Pointer to the sofkey changer + CFLDSoftKeyChanger* iSoftKeyChanger; +#endif + /// Ringingvolume + TInt iRingingVolume; + + /// Ringingtype + TInt iRingingType; + + /// Vibrasetting (on/off) + TBool iVibra; + + /// Show errors + TBool iShowErrorMsgs; + + /// Resourceloader which loads used resources + RConeResourceLoader iResourceLoader; + + /// 3DSettings (on/off) + TBool i3dEffects; + + }; + +#endif // __CFLDCONTROLLER_H__ + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/filelist_api/inc/CFLDFileListContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/filelist_api/inc/CFLDFileListContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,276 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* FileListContainer owns the list box, the model, and the controller, +* and it is used to launch the popup list. +* +* +*/ + + + +#ifndef __CFLDFILELISTCONTAINER_H__ +#define __CFLDFILELISTCONTAINER_H__ + +// INTERNAL INCLUDES + +// EXTERNAL INCLUDES +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CFLDDRMImplementation; +class CFLDFileListModel; +class CFLDController; + +// CLASS DECLARATION +/** +* FileListContainer owns the list box, the model, and the controller, +* and it is used to launch the popup list. +* +* @lib filelist.lib +* @since 2.1 +*/ +class CFLDFileListContainer + : public CBase + { + public: // Constructors and destructors + + /** + * Two-phase static constructor + * @return A pointer to a fully constructed CFLDFileListContainer instance + */ + IMPORT_C static CFLDFileListContainer* NewL(); + + /** + * Two-phase static constructor + * @return A pointer to a fully constructed CFLDFileListContainer instance. + */ + IMPORT_C static CFLDFileListContainer* NewLC(); + + /** + * Two-phase static constructor + * @param aResourceId A CLF model resource, see CLFContentListing.rh + * @return A pointer to a fully constructed CFLDFileListContainer instance + */ + IMPORT_C static CFLDFileListContainer* NewL( + const TInt aResourceId ); + + /** + * Two-phase static constructor + * @param aResourceId A CLF model resource, see CLFContentListing.rh + * @return A pointer to a fully constructed CFLDFileListContainer instance. + */ + IMPORT_C static CFLDFileListContainer* NewLC( + const TInt aResourceId ); + + /** + * Two-phase static constructor + * @param aResourceId A CLF model resource, see CLFContentListing.rh + * @param aDirectoriesResourceId A resource using FILELISTDIRECTORIES + * structure, see FileListModel.rh for details + * @return A pointer to a fully constructed CFLDFileListContainer instance + */ + IMPORT_C static CFLDFileListContainer* NewL( + const TInt aResourceId, const TInt aDirectoriesResourceId ); + + /** + * Two-phase static constructor + * @param aResourceId A CLF model resource, see CLFContentListing.rh + * @param aDirectoriesResourceId A resource using FILELISTDIRECTORIES + * structure, see FileListModel.rh for details + * @return A pointer to a fully constructed CFLDFileListContainer instance + */ + IMPORT_C static CFLDFileListContainer* NewLC( + const TInt aResourceId, const TInt aDirectoriesResourceId ); + + /** + * Destructor + */ + IMPORT_C virtual ~CFLDFileListContainer(); + + private: // Constructors and destructors + + /** + * Constructor + */ + CFLDFileListContainer(); + + /** + * Second phase constructor + * @param aResourceId A CLF model resource, see CLFContentListing.rh + * @param aDirectoriesResourceId A resource using FILELISTDIRECTORIES + * structure, see FileListModel.rh for details + */ + void ConstructL( + const TInt aResourceId, const TInt aDirectoriesResourceId ); + + public: // New methods + + /** + * Set the automated content type + * @param aAutomatedType: type of automated content + */ + IMPORT_C void SetAutomatedType( + CDRMHelper::TDRMHelperAutomatedType aAutomatedType ); + + /** + * Launches a popup list for browsing files + * @param aFileName The selected file name will be stored here. If the selected + * item was not a file but a null text item, aFileName will contain KNullDesC. + * If aFileName contains something already, CFLDFileListContainer tries to find + * the name on the list and focus on it. + * NOTE: Size of aFileName must be KMaxFileName, otherwise KErrNotFound is + * returned (aFileName is compared against TFileName entities). + * @param aPopupTitle If this parameter is given, sets the title text of the popup + * @return True: User selected a file, and its name is stored in aFileName. + * False: No file selected because user pressed cancel. + */ + IMPORT_C TBool LaunchL( TDes& aFileName, const TDesC& aPopupTitle = KNullDesC ); + + /** + * Adds a text (e.g. "None") as the first item of the list, + * which will not be sorted among the file name items. + * @param aItemText A descriptor containing the null item text + */ + IMPORT_C void InsertNullItemL( const TDesC& aItemText ); + + /** + * Adds a text (e.g. "None") as the first item of the list, + * which will not be sorted among the file name items. + * @param aItemText A descriptor containing the null item text + * @param aFileName A descriptor containing the ringing tone file name for null item + */ + IMPORT_C void InsertNullItemL( const TDesC& aItemText, const TDesC& aFileName ); + + /** + * Adds a text (e.g. "None") as the last item of the list, + * which will not be sorted among the file name items. + * @param aItemText A descriptor containing the null item text + */ + IMPORT_C void InsertEndNullItemL( const TDesC& aItemText ); + + /** + * Adds a text (e.g. "None") as the last item of the list, + * which will not be sorted among the file name items. + * @param aItemText A descriptor containing the null item text + * @param aFileName A descriptor containing the ringing tone file name for null item + */ + IMPORT_C void InsertEndNullItemL( const TDesC& aItemText, const TDesC& aFileName ); + + /** + * Set the delay until the timer expires. + * @param aDelay The delay in microseconds + */ + IMPORT_C void SetDelay( TTimeIntervalMicroSeconds32 aDelay ); + + /** + * Set the volume level on which the sound is played. + * If this method is not called, toneplayer uses the setting in active profile. + * @param aVolume The volume level + */ + IMPORT_C void SetVolume( TInt aVolume ); + + /** + * Sets the ringing type + * If this method is not called, toneplayer uses the setting in active profile. + * @param aRingingType The ringing type (see CFLDRingingTonePlayer::TRingingTypes) + */ + IMPORT_C void SetRingingType( TInt aRingingType ); + + /** + * Sets vibrating alert on or off. + * If this method is not called, toneplayer uses the setting in active profile. + * @param aVibra True: Vibra is on. False: Vibra is off. + */ + IMPORT_C void SetVibra( TBool aVibra ); + + /** + * Adds a new MIME type into blocking list. + * @param aMimeType The blocked MIME type + */ + IMPORT_C void AddExclusiveMimeTypeL( const TDesC& aMimeType ); + + /** + * Adds a new media type into blocking list. + * @param aMediaType The blocked media type (see TCLFMediaType enumeration + * inside CFLContentListing.hrh) + */ + IMPORT_C void AddExclusiveMediaTypeL( const TInt32 aMediaType ); + + /** + * Sets wanted mime types. Overrides all settings defined inside + * resource, defined with AddExclusive -methods or with + * SetWanted -methods. + * @param aMimeTypes The array containing wanted MIME types + */ + IMPORT_C void SetWantedMimeTypesL( const MDesCArray& aMimeTypes ); + + /** + * Sets wanted media types. Overrides all settings defined inside + * resource, defined with AddExclusive -methods or with + * SetWanted -methods. + * @param aMediaTypes The array containing wanted media types + */ + IMPORT_C void SetWantedMediaTypesL( const TArray& aMediaTypes ); + + /** + * Removes all the defined exlusive MIME types + */ + IMPORT_C void ResetExclusiveMimeTypes(); + + /** + * Removes all the defined exlusive media types + */ + IMPORT_C void ResetExclusiveMediaTypes(); + + /** + * Sets the maximum file size for the list. + * @param aMaxFileSize The maximum file size in bytes. If you want to + * allow all file sizes, set this to KFLDNoSizeFiltering + * (defined in FileListModel.hrh). + * @since 3.1 + */ + IMPORT_C void SetMaxFileSize( const TInt aMaxFileSize ); + + /** + * Sets 3d-effects on or off. + * If this method is called using parameter EFalse 3d-effects are + * always disabled even though those are set in active profile. + * Otherwise toneplayer uses the setting in active profile. + * @param a3dEffects True: 3dEffects are on. False: 3dEffects are off. + */ + IMPORT_C void Set3dEffects( TBool a3dEffects ); + + private: // Data + + /// Own: The file list model + CFLDFileListModel* iModel; + + /// Own: The controller + CFLDController* iController; + + /// Own: DRM implementation + CFLDDRMImplementation* iDRMImplementation; + + /// Resourceloader which loads used resources + RConeResourceLoader iResourceLoader; + + }; + +#endif // __CFLDFILELISTCONTAINER_H__ + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/filelist_api/inc/FileListModel.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/filelist_api/inc/FileListModel.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This file contains declarations for resources of File List. +* The file can be included in C++ or resource file. +* +* +*/ + + +#ifndef __FILELISTMODEL_HRH__ +#define __FILELISTMODEL_HRH__ + +// CONSTANTS + +enum TSortCriteria { EAlphaAscending, EAlphaDescending, EDateAscending, EDateDescending }; + +#define KFLDNoSizeFiltering 0x7fffffff + +enum // CBA constants + { + EFldSoftkeyVideoPreview = 0x6000, + EFldSoftkeyVideoPreviewSelect + }; + +#endif + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/filelist_api/inc/FileListModel.rh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/filelist_api/inc/FileListModel.rh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This file contains declarations for resources of File List. +* The file can be included only in resource file. +* +* +*/ + + +#include + +// STRUCTURE DEFINITIONS + +// --------------------------------------------------------- +// FILELISTDIRECTORIES +// --------------------------------------------------------- +// +/** + + Content Listing Framework won't scan the ROM so we must + define which ROM directories are wanted into FileList model. + These definitions are put into RomDirectories -section. + + If user wants to define specific locations where tones are + searched in phone ( C: and E: ), these definitions are put into + PhoneDirectories -section. NOTE: these locations must be + inside C:\\data and E: folders ( including subdirectories ). + If this definition is left empty, use all the locations + scanned by CLF. + + Here is an example of the usage: + + RESOURCE FILELISTDIRECTORIES r_fld_directories + { + // Scan these ROM directories + RomDirectories = + { + LBUF { txt = text_rom_root_path text_sounds_path; }, + LBUF { txt = text_rom_root_path text_digital_sounds_path; }, + LBUF { txt = text_rom_root_path text_simple_sounds_path; } + }; + + // Show only these these phone directories. + PhoneDirectories = + { + LBUF { txt = "c:\\data\\sounds\\simple\\"; } + }; +*/ + +STRUCT FILELISTDIRECTORIES + { + // LTEXT array of ROM directories to be scanned + STRUCT RomDirectories[]; + + // LTEXT array of directories on phone and memorycard + STRUCT PhoneDirectories[]; + } +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/filelist_api/inc/MFLDFileListBoxObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/filelist_api/inc/MFLDFileListBoxObserver.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* MFLDFileListBoxObserver defines an abstract interface to observe +* file list box events. +* +*/ + + + +#ifndef __MFLDFILELISTBOXOBSERVER_H__ +#define __MFLDFILELISTBOXOBSERVER_H__ + +// INTERNAL INCLUDES + +// EXTERNAL INCLUDES +#include + +// FORWARD DECLARATIONS +class RWindow; + +// CLASS DEFINITION + +/** +* MFLDFileListBoxObserver defines an abstract interface to observe +* file list box events. +*/ +class MFLDFileListBoxObserver + { + public: // Enumerations + enum TFileListBoxEvent + { + EFocusChanged = 1, + EListBoxClosed, + EOtherKeyEvent, + EVideoPreview, + EVideoPreviewSelected, + EVideoPreviewCanceled + }; + + enum TFileListSoftKeyState + { + EToneSelectionSoftKeyState = 1, + EPreviewSoftKeyState, + EPreviewSelectSoftKeyState + }; + + protected: // Constructors and destructors + + /** + * Destructor. + */ + virtual ~MFLDFileListBoxObserver() {} + + public: // New methods + + /** + * Receives information about a file list box event + * @param aEvent The event type that happened + * @param aFileName The file name that is currently focused, or KNullDesC + * construct different components using existing window. + */ + virtual void HandleFileListBoxEventL( TFileListBoxEvent aEvent, + const TDesC& aFileName = KNullDesC ) = 0; + + /** + * Method for listbox to receive current state of the softkeys. + * @param aSoftKeyState This parameter will return the softkey state + * TFileListSoftKeyState as a return parameter + */ + virtual void HandleSoftKeyState( TFileListSoftKeyState& aSoftKeyState ) = 0; + + }; + +#endif // __MFLDFILELISTBOXOBSERVER_H__ + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/ftuwizardmodel_api/ftuwizardmodel_api.metaxml --- a/gsprofilesrv_plat/ftuwizardmodel_api/ftuwizardmodel_api.metaxml Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - Ftuwizardmodel API - FtuWizard is an interface through which setting wizard plugin can be executed in the FTU fw. - c++ - ftuwizardmodel - - - - - - no - no - - diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/ftuwizardmodel_api/ftuwizardmodel_api.pro --- a/gsprofilesrv_plat/ftuwizardmodel_api/ftuwizardmodel_api.pro Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: Project file for FTU wizard model -# - -TEMPLATE = subdirs -BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " - - -PLATFORM_HEADERS += inc/ftuwizard.h \ - inc/ftuwizardfactory.h \ - inc/ftuwizardmodellib.h - -for(filename,PLATFORM_HEADERS){ - BLD_INF_RULES.prj_exports *= "$$filename MW_LAYER_PLATFORM_EXPORT_PATH($$basename(filename))" - } - diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/ftuwizardmodel_api/inc/ftuwizard.h --- a/gsprofilesrv_plat/ftuwizardmodel_api/inc/ftuwizard.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,245 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: FtuWizard class definition -* -*/ - - -#ifndef FTUWIZARD_H -#define FTUWIZARD_H - -#include "ftuwizardmodellib.h" - -#include -#include -#include -#include -#include - -class QGraphicsWidget; - -/** - * @ingroup group_ftuwizardmodel - * @brief Represents a wizard plugin visualization information. - * - * FtuWizardSetting struct contains the information needed to construct the GUI in - * the FTU fw. - * - * @lib ?library - * @since S60 ?S60_version - */ - -typedef struct { - /** - * The default icon to be shown in table of contents UI component. - */ - QFileInfo mTocDefaultIcon; - /** - * The pressed icon to be shown in table of contents UI component. - */ - QFileInfo mTocPressedIcon; - /** - * The focussed icon to be shown in table of contents UI component. - */ - QFileInfo mTocFocussedIcon; - /** - * The text to be shown in table of contents UI component. - */ - QString mTocLabel; - /** - * Informs Framework whether a plugin is having any ftu view or not. - * It should be set to false by plugin if it has any FTU view to be shown - * when the plugin is activated. It should be set to true if plugin - * is invoking any service/wizard, when plugin is selected/activated. - */ - bool mNoViews; -} FtuWizardSetting; - -/** - * @ingroup group_ftuwizardmodel - * @brief Represents a wizard plugin in the framework. - * - * FtuWizard is an interface through which setting wizard plugin can be - * executed in the FTU fw. - * - * @lib ?library - * @since S60 ?S60_version - */ - -class FTUWIZARDMODEL_EXPORT FtuWizard : public QObject -{ - Q_OBJECT -public: - /** - * The reason why the FTU fw and the wizard plugin is being shut down. - */ - enum ShutdownReason {MemoryLow, GraphicsMemoryLow, NormalBoot}; - -public: - - /** - * Destructor. - * @since S60 ?S60_version. - */ - virtual ~FtuWizard(){} - - /** - * Called by the FTU fw during initialize cycle of the wizard, it is during - * this phase the wizard widget - * usually creates its initial view. - * Once the initialization is done, wizardInitialized signal must be - * emitted. - * @param cenrepOwnerId Id of the owner of Cenrep holding wizard completion Information. - * @param wizardIdx Index of the Cenrep key for a wizard. - * If wizard is invoking another application, it should provide cenrepOwnerId and wizardIdx - * to the application. Application should write 1 into the wizardIdx cenrep on completion. - * @since S60 ?S60_version. - */ - virtual void initializeWizard(qint32 cenrepOwnerId, int wizardIdx) = 0; - - /** - * Called by the FTU fw when the wizard becomes the current wizard. - * @since S60 ?S60_version. - */ - virtual void activateWizard() = 0; - - /** - * Called by the FTU fw when the wizard is no longer being displayed. - */ - virtual void deactivateWizard() = 0; - - /** - * Called by the FTU fw before the wizard destructor is called. - * @param reason The reason why the ftu fw is being killed. - * @return The mode how wizard plugin is shut down. - * true means the wizard can be deleted immediately. - * false means the wizard signals with shutdownDone when it can - * be released. - */ - virtual bool shutdownWizard(ShutdownReason reason) = 0; - - /** - * Called by the FTU fw to set the wizard size. - * @param geometry The rectangle allocated to this wizard. - */ - virtual void resizeWizard(const QRectF& geometry) = 0; - - /** - * This wizard setting values is queryed by the FTU fw to get the display - * properties of the wizard required to be shown in the FTU fw's table of - * contents view and menu strip (e.g the icon & name of the wizard). - * The information must be available once the plugin instance has been - * created. - * @return The plugin wizard gui settings. - */ - virtual const FtuWizardSetting& wizardSettings() = 0; - - /** - * Called by FTU fw when back button is clicked in the plugin view. - * In this method the wizard plugin can implement internally showing and - * hiding GUI elements if the plugin has multiple 'views'. - * @return true if back event is handled internally in wizard plugin - * false if the FTU fw is to handle the event. - */ - virtual bool handleBackEvent() = 0; - - /** - * Called by FTU fw to get the date when the settings have been saved. - * @return The date when wizard settings have been completed. - */ - virtual QDate wizardCompletedDate() = 0; - -protected: - - /** - * Constructor. - * @since S60 ?S60_version. - */ - FtuWizard(){} - - -signals: - /** - * Emit this signal to update the text of the info text widget. - * @param caller The calling wizard plugin instance. - * @param text The info text to be shown. - */ - void infoTextUpdated(FtuWizard *caller, QString text); - - /** - * Emit this signal notify the progress on wizard settings. - * @param caller The calling wizard plugin instance. - * @param showCompleteness True if the progress is being indicated on the - * UI. - * @param completenessPercentage The progress of the settings operation. - */ - void progressUpdated(FtuWizard *caller, bool showProgess, - int progressPercentage); - - /** - * Emit this signal when changing the view inside the wizard plugin. - * @param caller The calling wizard plugin instance. - * @param viewWidget The new plugin view widget to be shown. - */ - void viewChanged(FtuWizard *caller, QGraphicsWidget* viewWidget); - - /** - * Adds an over-lay widget on top of the current view, used to add an - * overlay animation on top of the current view - * @param caller The calling wizard plugin instance. - * @param overlay The overlay widget to be added. - */ - void overlayAdded(FtuWizard *caller, QGraphicsWidget* overlay); - - /** - * Removes the overlay widget added by addOverlay signal. - * @param caller The calling wizard plugin instance. - * @param overlay The overlay widget to be removed. - */ - void overlayRemoved(FtuWizard *caller, QGraphicsWidget* overlay); - - /** - * Emit this signal to indicate initialization is done. - * @param caller The calling wizard plugin instance. - * @param success True if succeeded, false otherwise. - */ - void wizardInitialized(FtuWizard *caller, bool success); - - /** - * Emit this signal to indicate that the wizard plugin can be deleted. - * Note that this signal does not need to be emitted if true is returned - * from shutdownWizard. - * @param caller The calling wizard plugin instance. - */ - void shutdownCompleted(FtuWizard *caller); - - /** - * Emit this signal to indicate that the wizard plugin wants a custom view menu to be shown. - * from shutdownWizard. - * @param caller The calling wizard plugin instance. - * @param menu The HbMenu instance that needs to be shown on the view - */ - void updateMainMenu(FtuWizard *caller, HbMenu * menu); - - /** - * Emit this signal to indicate that the wizard plugin wants to be deactivated. - * Wizard is deactivated and Table of Contents is shown by the application. - * @param caller The calling wizard plugin instance. - */ - void wizardDeactivated(FtuWizard *caller); - -}; - -#endif // FTUWIZARD_H - diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/ftuwizardmodel_api/inc/ftuwizardfactory.h --- a/gsprofilesrv_plat/ftuwizardmodel_api/inc/ftuwizardfactory.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: FtuWizardFactory class definition -* -*/ - -#ifndef FTUWIZARDFACTORY_H -#define FTUWIZARDFACTORY_H - - -class FtuWizard; - -/** - * @ingroup group_ftuwizardmodel - * @brief A factory class through which the wizard plugin can be instantiated. - * - * FtuWizardFactory contains a factory method to create a wizard plugin instance. - * - * @lib ?library - * @since S60 ?S60_version - */ - -class FtuWizardFactory -{ -public: - /** - * Instantiates a wizard plugin object. - * @return The constructed wizard plugin object. - * @since S60 ?S60_version. - */ - virtual FtuWizard* createWizard() const = 0; -}; - -Q_DECLARE_INTERFACE(FtuWizardFactory, "ftu.nokia.com.FtuWizardFactory/1.0"); - -#endif // FTUWIZARDFACTORY_H diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/ftuwizardmodel_api/inc/ftuwizardmodellib.h --- a/gsprofilesrv_plat/ftuwizardmodel_api/inc/ftuwizardmodellib.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Internal file for exporting FTUWizardModel interfaces -* -*/ - -#ifndef FTUWIZARDMODELLIB_H -#define FTUWIZARDMODELLIB_H - -#ifdef FTUWIZARDMODEL_LIB - #define FTUWIZARDMODEL_EXPORT Q_DECL_EXPORT -#else - #define FTUWIZARDMODEL_EXPORT Q_DECL_IMPORT -#endif - -#endif - diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/group/bld.inf --- a/gsprofilesrv_plat/group/bld.inf Tue Aug 31 15:29:50 2010 +0300 +++ b/gsprofilesrv_plat/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -23,6 +23,14 @@ PRJ_MMPFILES #include "../profiles_engine_api/group/bld.inf" +#include "../profiles_mediafilelist_api/group/bld.inf" +#include "../filelist_api/group/bld.inf" + +#include "../settings_backgroundimage_api/group/bld.inf" +#include "../settings_framework_api/group/bld.inf" +#include "../settings_launch_api/group/bld.inf" +#include "../settings_listbox_api/group/bld.inf" +#include "../settings_plugin_api/group/bld.inf" #include "../settings_uis_cenrep_collection_api/group/bld.inf" PRJ_TESTMMPFILES diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/profiles_engine_api/group/bld.inf --- a/gsprofilesrv_plat/profiles_engine_api/group/bld.inf Tue Aug 31 15:29:50 2010 +0300 +++ b/gsprofilesrv_plat/profiles_engine_api/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -42,13 +42,6 @@ ../inc/MProfileName.h MW_LAYER_PLATFORM_EXPORT_PATH(MProfileName.h) ../inc/MProfile.h MW_LAYER_PLATFORM_EXPORT_PATH(MProfile.h) -/* Since 10.1 */ -../inc/MProfileVibraSettings.h MW_LAYER_PLATFORM_EXPORT_PATH(MProfileVibraSettings.h) -../inc/MProfileExtraTones2.h MW_LAYER_PLATFORM_EXPORT_PATH(MProfileExtraTones2.h) -../inc/MProfileSetExtraTones2.h MW_LAYER_PLATFORM_EXPORT_PATH(MProfileSetExtraTones2.h) -../inc/MProfileExtended2.h MW_LAYER_PLATFORM_EXPORT_PATH(MProfileExtended2.h) -../inc/MProfileEngineExtended2.h MW_LAYER_PLATFORM_EXPORT_PATH(MProfileEngineExtended2.h) - ../inc/MProfileEngineExtended.h MW_LAYER_PLATFORM_EXPORT_PATH(MProfileEngineExtended.h) ../inc/MProfileExtended.h MW_LAYER_PLATFORM_EXPORT_PATH(MProfileExtended.h) ../inc/MProfilePresence.h MW_LAYER_PLATFORM_EXPORT_PATH(MProfilePresence.h) @@ -68,8 +61,6 @@ ../inc/MProfileSetFeedbackSettings.h MW_LAYER_PLATFORM_EXPORT_PATH(MProfileSetFeedbackSettings.h) ../inc/MProfileSetPttSettings.h MW_LAYER_PLATFORM_EXPORT_PATH(MProfileSetPttSettings.h) ../inc/MProfileSetTones.h MW_LAYER_PLATFORM_EXPORT_PATH(MProfileSetTones.h) -//Since 10.1 -../inc/MProfileSetVibraSettings.h MW_LAYER_PLATFORM_EXPORT_PATH(MProfileSetVibraSettings.h) ../inc/SecondaryDisplayProfilesAPI.h MW_LAYER_PLATFORM_EXPORT_PATH(secondarydisplay/SecondaryDisplayProfilesAPI.h) diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/profiles_engine_api/inc/MProfileEngineExtended2.h --- a/gsprofilesrv_plat/profiles_engine_api/inc/MProfileEngineExtended2.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Extended profile engine interface 2. -* -*/ - - - -#ifndef __MPROFILEENGINEEXTENDED2_H__ -#define __MPROFILEENGINEEXTENDED2_H__ - -// INCLUDES -#include - -// DATA TYPES - -// FUNCTION PROTOTYPES -class MProfileEngineExtended2; -/** -* Create extended profile engine, ownership transfered. -* -* @lib ProfileEng.lib -* @since 10.1 -*/ - -IMPORT_C MProfileEngineExtended2* CreateProfileEngineExtended2L(); - -/** -* Create extended profile engine, ownership transfered. -* -* @param aFs An open file server session, ownership is NOT transferred. -* aFs must remain connected for the lifetime of the returned object. -* @lib ProfileEng.lib -* @since 10.1 -*/ -IMPORT_C MProfileEngineExtended2* CreateProfileEngineExtended2L( RFs* aFs ); - -// FORWARD DECLARATIONS -class MProfileExtended2; - -// CLASS DECLARATION - -/** -* Extended profile engine interface. -* This interface extend MProfileEngine interface and -* offers methods to get profile settings and store profile settings. -* -* @lib N/A -* @since 2.0 -*/ -class MProfileEngineExtended2 : public MProfileEngineExtended - { - protected: // Destructor - - virtual ~MProfileEngineExtended2() {}; - - public: // New functions - - /** - * Create extended profile, ownership transfered. - * @since 2.0 - * @param aId Profile ID - * @return Instance of the MProfileExtended - */ - virtual MProfileExtended2* Profile2LC( TInt aId ) = 0; - - /** - * Create extended profile, ownership transfered. - * @since 2.0 - * @param aId Profile ID - * @return Instance of the MProfileExtended - */ - virtual MProfileExtended2* Profile2L( TInt aId ) = 0; - - /** - * Store profile settings. Leaves with KErrAccessDenied if one or more - * of the settings of the target profile is/are read-only. - * @since 2.0 - * @param aProfile Profile - */ - virtual void CommitChange2L( MProfileExtended2& aProfile ) = 0; - - - /** - * Returns Master volume - * @since 10.1 - */ - virtual TInt MasterVolumeL() const = 0; - - /** - * Set master volume - * @since 10.1 - * @param aMasterVolume: new master volume to be set - */ - virtual void SetMasterVolumeL( TInt aMasterVolume ) = 0; - - /** - * Returns Master vibra - * @since 10.1 - */ - virtual TBool MasterVibraL() const = 0; - - /** - * Set master vibra - * @since 10.1 - * @param aMasterVibra: new master vibra to be set ETrue: On EFalse: Off - */ - virtual void SetMasterVibraL( TBool aMasterVibra ) = 0; - - /** - * Returns silence mode - * @since 10.1 - */ - virtual TBool SilenceModeL() const = 0; - - /** - * Set silence mode - * @since 10.1 - * @param aSilenceMode: new silence mode to be set ETrue: On EFalse: Off - */ - virtual void SetSilenceModeL( TBool aSilenceMode ) = 0; - - }; - -#endif // __MPROFILEENGINEEXTENDED_H__ - -// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/profiles_engine_api/inc/MProfileExtended2.h --- a/gsprofilesrv_plat/profiles_engine_api/inc/MProfileExtended2.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Extended profile interface. -* -*/ - - - -#ifndef __MPROFILEEXTENDED2_H__ -#define __MPROFILEEXTENDED2_H__ - -// INCLUDES -#include - -// DATA TYPES - -// FORWARD DECLARATIONS - -class MProfileExtraTones2; -class MProfileSetExtraTones2; -class MProfileVibraSettings; -class MProfileSetVibraSettings; - -// CLASS DECLARATION - -/** -* Extended profile interface. -* This interface extend MProfile interface. -* -* @lib N/A -* @since 10.1 -*/ -class MProfileExtended2 : public MProfileExtended - { - protected: // Destructor - - virtual ~MProfileExtended2() {}; - - public: // New functions - - /** - * Returns profile extra Tones 2 settings interface. - * @since 10.1 - * @return get rofile Extra Tones 2 settings - */ - virtual const MProfileExtraTones2& ProfileExtraTones2() const = 0; - - /** - * Returns profile set extra tones 2 settings interface. - * @since 10.1 - * @return set profile extra tones 2 settings interface. - */ - virtual MProfileSetExtraTones2& ProfileSetExtraTones2() = 0; - - /** - * Returns profile vibra settings interface. - * @since 10.1 - * @return get profile vibra settings. - */ - virtual const MProfileVibraSettings& ProfileVibraSettings() const = 0; - - /** - * Returns set vibra settings interface. - * @since 10.1 - * @return set profile vibra settings. - */ - virtual MProfileSetVibraSettings& ProfileSetVibraSettings() = 0; - - }; - -#endif // __MPROFILEEXTENDED_H__ - -// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/profiles_engine_api/inc/MProfileExtraTones2.h --- a/gsprofilesrv_plat/profiles_engine_api/inc/MProfileExtraTones2.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Profile extra tones2 interface. -* -*/ - - - -#ifndef __MPROFILEEXTRATONES2_H -#define __MPROFILEEXTRATONES2_H - -// INCLUDES -#include -#include - -// CLASS DECLARATION - -/** -* Profile extra tones interface. -* This interface offers method to get IM message alert tone file name. -* -* @lib N/A -* @since 10.1 -*/ -class MProfileExtraTones2 : public MProfileExtraTones - { - protected: // Destructor - - virtual ~MProfileExtraTones2() {}; - - public: - /** - * Returns reminder tone file name. - * @since 10.1 - * @return Returns reminder tone file name. - */ - virtual const TDesC& ReminderTone() const = 0; - - /** - * Returns clock alarm tone file name. - * @since 10.1 - * @return Returns clock alarm tone file name. - */ - virtual const TDesC& ClockAlarmTone() const = 0; - }; - - -#endif // __MPROFILEEXTRATONES2_H - -// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetExtraTones2.h --- a/gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetExtraTones2.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Set profile extra tones2 interface. -* -*/ - - - -#ifndef __MPROFILESETEXTRATONES2_H -#define __MPROFILESETEXTRATONES2_H - -// INCLUDES -#include -#include - -// CLASS DECLARATION - -/** -* Set profile extra tones2 interface. -* This interface offers methods to set IM message alert tone file name. -* -* @lib N/A -* @since 10.1 -*/ -class MProfileSetExtraTones2 : public MProfileSetExtraTones - { - protected: // Destructor - - virtual ~MProfileSetExtraTones2() {}; - - public: // New functions - - /** - * Set reminder tone. - * @since 10.1 - * @param aReminderTone File name of the reminder tone. - */ - virtual void SetReminderToneL( - const TDesC& aReminderTone ) = 0; - - /** - * Set clock alarm tone. - * @since 10.1 - * @param aClockAlarmTone File name of the clock alarm tone. - */ - virtual void SetClockAlarmToneL( - const TDesC& aClockAlarmTone ) = 0; - - }; - - -#endif // __MPROFILESETEXTRATONES2_H - -// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetVibraSettings.h --- a/gsprofilesrv_plat/profiles_engine_api/inc/MProfileSetVibraSettings.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: MProfileSetVibraSettings interface. -* -*/ - - -#ifndef __MPROFILESETVIBRASETTINGS_H -#define __MPROFILESETVIBRASETTINGS_H - -// INCLUDES -#include - -// CLASS DECLARATION - -/** -* Profile set vibra settings interface. -* This interface offers methods to set vibra settings -* -* @lib N/A -* @since 10.1 -*/ -class MProfileSetVibraSettings -{ -protected: // Destructor - - virtual ~MProfileSetVibraSettings() {}; - -public: - - /** - * set alert vibra settings - * @since 10.1 - * @param aAlertVibra vibra settings - */ - virtual void SetAlertVibra(TInt aAlertVibra) = 0; - - - /** - * set ring alert vibra - * @since 10.1 - * @param aRingAlertVibra ETrue: On EFalse: Off - */ - virtual void SetRingAlertVibra(TBool aRingAlertVibra) = 0; - - /** - * set message alert vibra - * @since 10.1 - * @param aMessageAlertVibra ETrue: On EFalse: Off - */ - virtual void SetMessageAlertVibra(TBool aMessageAlertVibra) = 0; - - /** - * set Email alert vibra - * @since 10.1 - * @param aEmailAlertVibra ETrue: On EFalse: Off - */ - virtual void SetEmailAlertVibra(TBool aEmailAlertVibra) = 0; - - /** - * set reminder alert vibra - * @since 10.1 - * @param aReminderAlarmVibra ETrue: On EFalse: Off - */ - virtual void SetReminderAlarmVibra(TBool aReminderAlarmVibra) = 0; - - /** - * set information vibra - * @since 10.1 - * @param aInformationVibra ETrue: On EFalse: Off - */ - virtual void SetInformationVibra(TBool aInformationVibra) = 0; -}; - -#endif - -//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/profiles_engine_api/inc/MProfileVibraSettings.h --- a/gsprofilesrv_plat/profiles_engine_api/inc/MProfileVibraSettings.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Extended profile interface. -* -*/ - -#ifndef __MPROFILEVIBRASETTINGS_H -#define __MPROFILEVIBRASETTINGS_H - - -// INCLUDES -#include - -// CLASS DECLARATION - -/** -* Profile vibra settings interface. -* This interface offers methods to get vibra settings -* -* @lib N/A -* @since 10.1 -*/ -class MProfileVibraSettings -{ -protected: // Destructor - - virtual ~MProfileVibraSettings() {}; - -public: - - /** - * Returns alert vibra settings - * @since 10.1 - * @return Returns vibra settings - */ - virtual TInt AlertVibra() const = 0; - - /** - * Returns ring alert vibra - * @since 10.1 - * @return Returns ring alert vibra - */ - virtual TBool RingAlertVibra() const = 0; - - /** - * Returns message alert vibra - * @since 10.1 - * @return Returns message alert vibra - */ - virtual TBool MessageAlertVibra() const = 0; - - /** - * Returns Email alert vibra - * @since 10.1 - * @return Returns Email alert vibra - */ - virtual TBool EmailAlertVibra() const = 0; - - /** - * Returns reminder alert vibra - * @since 10.1 - * @return Returns reminder alert vibra - */ - virtual TBool ReminderAlarmVibra() const = 0; - - /** - * Returns information vibra - * @since 10.1 - * @return Returns information alert vibra - */ - virtual TBool InformationVibra() const = 0; -}; - -#endif // __MPROFILEVIBRASETTINGS_H - -//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/profiles_engine_api/inc/ProfileEng.hrh --- a/gsprofilesrv_plat/profiles_engine_api/inc/ProfileEng.hrh Tue Aug 31 15:29:50 2010 +0300 +++ b/gsprofilesrv_plat/profiles_engine_api/inc/ProfileEng.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -63,9 +63,7 @@ EProfileSettingId3DEcho = 0x00000018, EProfileSettingIdTactileFeedback = 0x00000019, EProfileSettingIdAudioFeedback = 0x0000001A, - EProfileSettingIdReminderTone = 0x0000001B, - EProfileSettingIdClockAlarmTone = 0x0000001C, - EProfileSettingIdAlertVibra = 0x0000001D + EProfileSettingIdEmailVibra=0x0000001B }; #endif // __PROFILEENG_HRH__ diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/profiles_engine_api/inc/ProfileEngineDomainCRKeys.h --- a/gsprofilesrv_plat/profiles_engine_api/inc/ProfileEngineDomainCRKeys.h Tue Aug 31 15:29:50 2010 +0300 +++ b/gsprofilesrv_plat/profiles_engine_api/inc/ProfileEngineDomainCRKeys.h Wed Sep 01 12:20:44 2010 +0100 @@ -56,22 +56,6 @@ const TUint32 KProEngDefaultImTone = 0x7F00000C; /** - * Default reminder tone for all profiles. String value. Read-only. - * - * Central Repository file of the key: KCRUidProfileEngine. - * - */ -const TUint32 KProEngDefaultReminderTone = 0x7F00001B; - -/** - * Default clock alarm tone for all profiles. String value. Read-only. - * - * Central Repository file of the key: KCRUidProfileEngine. - * - */ -const TUint32 KProEngDefaultClockAlarmTone = 0x7F00001C; - -/** * This integer indicates the maximum file size (kilo bytes) of ring tone * files that can be selected as voice call ringing tone. * diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/profiles_engine_api/inc/ProfileEngineInternalCRKeys.h --- a/gsprofilesrv_plat/profiles_engine_api/inc/ProfileEngineInternalCRKeys.h Tue Aug 31 15:29:50 2010 +0300 +++ b/gsprofilesrv_plat/profiles_engine_api/inc/ProfileEngineInternalCRKeys.h Wed Sep 01 12:20:44 2010 +0100 @@ -83,68 +83,6 @@ */ const TUint32 KProEngActiveAudioFeedback = 0x7E00001A; -/** -* Absolute file path of ring tone of the currently active profile, string. -* Since 10.1 -**/ -const TUint32 KProEngActiveRingTone = 0x7E00001B; - -/** -* Absolute file path of message tone of the currently active profile, string. -* Since 10.1 -**/ -const TUint32 KProEngActiveMessageTone = 0x7E00001C; - -/** -* Absolute file path of reminder tone of the currently active profile, string. -* Since 10.1 -**/ -const TUint32 KProEngActiveReminderTone = 0x7E00001D; - -/** -* Absolute file path of clock alarm tone of the currently active profile, string. -* Since 10.1 -**/ -const TUint32 KProEngActiveClockAlarmTone = 0x7E00001E; - -/** -* Alert vibra setting of the currently active profile, string. -* -* Since 10.1 -* -* Possible values (bit OR): -* -* enum TProfileAlertVibra - { - EProfileNoAlertVibra = 0x00000000, - EProfileRingAlertVibra = 0x00000001, - EProfileMessageAlertVibra = 0x00000002, - EProfileEmailAlertVibra = 0x00000004, - EProfileReminderAlarmVibra = 0x00000008, - EProfileClockAlarmVibra = 0x00000010, - EProfileInformationVibra = 0x00000020 - }; -* -**/ -const TUint32 KProEngActiveAlertVibra = 0x7E00001F; - -/** -* Master volume for all profiles, int -* Since 10.1 -**/ -const TUint32 KProEngMasterVolume = 0x80000200; - -/** -* Master vibra for all profiles, int -* Since 10.1 -**/ -const TUint32 KProEngMasterVibra = 0x80000201; - -/** -* Silence mode, bool 1: On 0: Off -* Since 10.1 -**/ -const TUint32 KProEngSilenceMode = 0x80000202; #endif // PROFILEENGINEINTERNALCRKEYS_H diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/profiles_engine_api/inc/ProfileInternal.hrh --- a/gsprofilesrv_plat/profiles_engine_api/inc/ProfileInternal.hrh Tue Aug 31 15:29:50 2010 +0300 +++ b/gsprofilesrv_plat/profiles_engine_api/inc/ProfileInternal.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -32,10 +32,7 @@ EProfileTactileFeedbackOff = 0, EProfileTactileFeedbackLevel1 = 1, EProfileTactileFeedbackLevel2 = 2, - EProfileTactileFeedbackLevel3 = 3, - //Since 10.1 - EProfileTactileFeedbackLevel4 = 4, - EProfileTactileFeedbackLevel5 = 5 + EProfileTactileFeedbackLevel3 = 3 }; enum TProfileAudioFeedback @@ -43,10 +40,7 @@ EProfileAudioFeedbackOff = 0, EProfileAudioFeedbackLevel1 = 1, EProfileAudioFeedbackLevel2 = 2, - EProfileAudioFeedbackLevel3 = 3, - //Since 10.1 - EProfileAudioFeedbackLevel4 = 4, - EProfileAudioFeedbackLevel5 = 5 + EProfileAudioFeedbackLevel3 = 3 }; enum TProfile3DToneEffect @@ -73,26 +67,6 @@ EProfile3DEchoUnderwater = 28 }; -// Since 10.1 -enum TProfileAlertVibra - { - EProfileNoAlertVibra = 0x00000000, - EProfileRingAlertVibra = 0x00000001, - EProfileMessageAlertVibra = 0x00000002, - EProfileEmailAlertVibra = 0x00000004, - EProfileReminderAlarmVibra = 0x00000008, - EProfileClockAlarmVibra = 0x00000010, - EProfileInformationVibra = 0x00000020 - }; - -// Deprecated Since 10.1 -enum TProfileMasterVolume - { - EProfileMasterVolumeSoft = 1, - EProfileMasterVolumeMed = 5, - EProfileMasterVolumeLoud = 10 - }; - #endif // PROFILEINTERNAL_HRH // End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/profiles_engine_api/inc/TProfileToneSettings.h --- a/gsprofilesrv_plat/profiles_engine_api/inc/TProfileToneSettings.h Tue Aug 31 15:29:50 2010 +0300 +++ b/gsprofilesrv_plat/profiles_engine_api/inc/TProfileToneSettings.h Wed Sep 01 12:20:44 2010 +0100 @@ -38,6 +38,7 @@ TProfileKeypadVolume iKeypadVolume; TInt iRingingVolume; // 1 - 10 TBool iVibratingAlert; // ETrue = On + TBool iEmailVibratingAlert; TBool iWarningAndGameTones; // ETrue = On TInt iMediaVolume; // 1 - 10 TBool iTextToSpeech; // ETrue = On diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/profiles_engine_api/tsrc/group/bld.inf --- a/gsprofilesrv_plat/profiles_engine_api/tsrc/group/bld.inf Tue Aug 31 15:29:50 2010 +0300 +++ b/gsprofilesrv_plat/profiles_engine_api/tsrc/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -21,4 +21,4 @@ // bld.inf // Part of EUnit library test -//#include "../../../../profilesapplication/Profiles/ProfileEngine/tsrc/public/basic/EngineMdlTest/group/bld.inf" +#include "../../../../profilesapplication/Profiles/ProfileEngine/tsrc/public/basic/EngineMdlTest/group/bld.inf" diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/profiles_mediafilelist_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/profiles_mediafilelist_api/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: File that exports the files belonging to +: MediaFileList API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/mediafilelist.h MW_LAYER_PLATFORM_EXPORT_PATH(mediafilelist.h) diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/profiles_mediafilelist_api/inc/mediafilelist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/profiles_mediafilelist_api/inc/mediafilelist.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,187 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface of MediaFileList. Provide some API for +* the user to use mediafilelist +* +*/ + + + + +#ifndef MEDIALFILELIST_H +#define MEDIALFILELIST_H + +// INCLUDES +#include +#include + + +// FORWARD DECLARATIONS +class CMediaFileDialog; + + + +// CLASS DECLARATION + +/** +* Public API for displaying media file list. List is used for +* selecting/previewing audio and video files. +* +* @lib mediafilelist.lib +* @since Series60_5.1 +* +*/ +class CMediaFileList : public CBase + { + public: + enum TMediaFileListAttribute + { + // max media file size + EAttrFileSize = 0, + // ringing volume (TProfileRingingVolume from Profile.hrh) + EAttrVolume, + // ringing type, (TProfileRingingType from Profile.hrh) + EAttrRingingType, + // vibra on/off (Boolean) + EAttrVibra, + // 3D effect (TProfile3DToneEffect from ProfileInternal.hrh) + EAttr3DEffect, + // 3D echo (TProfile3DToneEcho from ProfileInternal.hrh) + EAttr3DEcho, + // excluded mime type text + EAttrExcludeMimeType, + // for file protection checking + EAttrAutomatedType, + // media file dialog title + EAttrTitle, + // excluded folder (see enum TFolderType) + EAttrExcludeFolder + }; + + enum TMediaFileType + { + EMediaFileTypeAudio = 0, + EMediaFileTypeVideo + }; + + enum TNullItemIcon + { + ENullItemIconNone = 0, + ENullItemIconDefaultTone, + ENullItemIconOff + }; + + enum TFolderType + { + EFolderDownload = 0, + EFolderVideos + }; + + public: + /** + * Two-phased constructor. + */ + IMPORT_C static CMediaFileList* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CMediaFileList(); + + private: + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CMediaFileList(); + + public: + + /** + * Shows Media file list. + * @since Series60_5.1 + * @param aFileName Selected media file name full path. + * @param aNullItem Selected null item index. Possible values: + * KErrNotFound - item is not null item or Download item + * 0 - Download item + * 1 - first null item + * 2 - second null item + * + * @param aInfo Extra information, set to NULL if not used. + * @param aDesInfo Extra information, set to KNullDesC if not used. + * @return ETrue if user selected media file, EFalse otherwise. + */ + IMPORT_C TBool ShowMediaFileListL( TDes* aFileName, TInt* aNullItem, + TInt* aInfo, TDes* aDesInfo ); + + /** + * Set Media file list attribute. See enum TMediaFileListAttribute for + * list of supported attributes. + * @since Series60_5.1 + * @param aAttr Attribute id. + * @param aValue Attribute value. + * @return None. + */ + IMPORT_C void SetAttrL( TInt aAttr, TInt aValue ); + + /** + * Set Media file list attribute. See enum TMediaFileListAttribute for + * list of supported attributes. + * @since Series60_5.1 + * @param aAttr Attribute id. + * @param aValue Attribute value. + * @return None. + */ + IMPORT_C void SetAttrL( TInt aAttr, const TDesC& aValue ); + + /** + * Set Media file list attribute. Currently not in use. + * @since Series60_5.1 + * @param aAttr Attribute id. + * @param aValue Attribute value. + * @return None. + */ + IMPORT_C void SetAttrL( TInt aAttr, TAny* aValue ); + + /** + * Set Media file list null item. Null items are custom list items + * that appear at the end of the media file list main view. + * @since Series60_5.1 + * @param aText Null item text. + * @param aMediaFile File that is played when null items gets focused. + * Use KNullDesC if not used. + * @param aMediaFileType Media file type. See enum TMediaFileType for + supported media types. + * @param aIconId Null item icon id. See enum TNullItemIcon for + supported icons. + * @return None. + */ + IMPORT_C void SetNullItemL( const TDesC& aText, const TDesC& aMediaFile, + TInt aMediaFileType, TInt aIconId ); + + + + private: + CMediaFileDialog* iDialog; + }; + + + +#endif // MEDIALFILELIST_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/profiles_mediafilelist_api/profiles_mediafilelist_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/profiles_mediafilelist_api/profiles_mediafilelist_api.metaxml Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,14 @@ + + +MediaFileList API +An UI for the media file selection lists. +c++ +profilesservices + + + + +no +no + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_backgroundimage_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_backgroundimage_api/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: File that exports the files belonging to +: Settings Backgroundimage API +* +*/ + + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/GsAsyncImageHandling.h MW_LAYER_PLATFORM_EXPORT_PATH(gsasyncimagehandling.h) +../inc/BackgroundImage.h MW_LAYER_PLATFORM_EXPORT_PATH(backgroundimage.h) +../inc/MGsAsyncImageHandlingObserver.h MW_LAYER_PLATFORM_EXPORT_PATH(mgsasyncimagehandlingobserver.h) diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_backgroundimage_api/inc/BackgroundImage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_backgroundimage_api/inc/BackgroundImage.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,213 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class definition for the background image API +* +*/ + + + + +#ifndef BACKGROUNDIMAGE_H +#define BACKGROUNDIMAGE_H + +// INCLUDES +#include +#include + +#include +#include "gsasyncimagehandling.h" + + +// CONSTANTS +const TInt KGSBackgroundImageValue = 0; + +// DATA TYPES +enum TGSWallpaperType + { + EGSWallpaperIdle, + EGSWallpaperPinboard, + EGSWallpaperWelcome, + EGSVTStillImage + }; + +// FORWARD DECLARATIONS +class RSharedDataClient; + +// CLASS DECLARATION + +/** +* CGSBackgroundImage is the background image API class of GS app. +* It provides functions to get and set background image values. +*/ +class CGSBackgroundImage : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CGSBackgroundImage* NewL(); + + /** + * Destructor. + */ + IMPORT_C ~CGSBackgroundImage(); + + public: // New functions + + /** + * Returns background image mode. + * @return 0: no image + * 1: image + */ + IMPORT_C TInt BackgroundImageL(); + + /** + * Stores background image mode to shared data. + * @param aImage Background image mode. + */ + IMPORT_C void SetBackgroundImageL(const TInt aImage); + + /** + * Converts an idle background image to bitmap and scales it to fit the + * screen if necessary. + * + * After successful conversion, the background image path is stored + * into shared data. + * + * @param aImagePath Descriptor which contains the background image + * path. Max length is KGSMaxImagePath. + */ + IMPORT_C void SetBackgroundImagePathL(const TDesC& aImagePath); + + /** + * Converts an idle background image to bitmap, scales it to fit the + * screen if necessary, and stores it to the given file. + * + * Background image path is not stored into shared data, but must be + * set separately. + * + * @param aImagePath Descriptor which contains the background image + * path. Max length is KGSMaxImagePath. + * @param aBmpFileName Descriptor which contains the bitmap file name. + * Converted image is again stored back in this variable. + */ + IMPORT_C void SetBackgroundImagePathL(const TDesC& aImagePath, + TDes& aBmpFileName); + + /** + * Converts the welcome note image to bitmap, scales it to fit the screen if + * necessary. + * Stores the bitmap to mbm file. Stores welcome note image path to shared data. + * + * @param aImagePath Descriptor which contains the welcome note image path. + * Max length is KGSMaxImagePath. + */ + IMPORT_C void SetWelcomeNoteImageL(const TDesC& aImagePath, + CGSAsyncImageHandling& aImgHandler ); + + + /** + * Converts the background image to bitmap, scales it to fit the + * screen if necessary, and stores it to the given file. + * + * Background image path is not stored into shared data, but must be + * set separately. + * + * @since 2.6 + * + * @param aImagePath Descriptor which contains the background image + * path. Max length is KGSMaxImagePath. + * @param aBmpFileName Descriptor which contains the bitmap file name. + * Converted image is again stored back in this variable. + * @param aWallpaperType Type of the wallpaper. + */ + IMPORT_C void SetBackgroundImagePathL( + const TDesC& aImagePath, + TDes& aBmpFileName, + TGSWallpaperType aWallpaperType ); + + /** + * Set the current image path for Still Image + * + */ + IMPORT_C void SetVTStillImagePathL( const TDesC& aImagePath, + CGSAsyncImageHandling& aImgHandler ); + + /* + * Returns if Personalisation application exists in device + * @return 1: Personalisation application exists in device + * otherwise: Personalisation application does not exist in device + */ + IMPORT_C TInt GetPlnsStatus(); + + /* + * Checking presence of the personalisation application on the + * device + */ + IMPORT_C void IsPersonalisationApplicationL(); + + /* + * Removing image + * + */ + IMPORT_C void DeleteImageL( const TDesC& aImagePath ); + + + private: + + /** + * C++ default constructor. + */ + CGSBackgroundImage(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: + + void LoadImageL( const TDesC& aImagePath, + TInt aWidth, TInt aHeight, + TBool aBgImage, + TGSWallpaperType aWallpaperType ); + + void SaveBitmapsL( TDes& aBmpFileName, + const TDesC& aOriginalFullname ); + public: // Data + TInt iPlnsInDevice; //for personalisation app check + + private: // Data + RSharedDataClient* iClient; //handle to shared data client + CFbsBitmap* iBitmap; //for scaling/dithering of bitmap + + CRepository* iPersonalizationRepository; + CRepository* iStartupConfRepository; + CRepository* iTelephonyRepository; + TDisplayMode iDisplayMode; //4k/64k display support + + RPhCltServer iPhoneClient; + RLibrary iLibrary; + + CGSAsyncImageHandling* iImgHandler; + + // Reserved pointer for future extension + //TAny* iReserved; + + }; + +#endif // CGSBACKGROUNDIMAGE_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_backgroundimage_api/inc/GsAsyncImageHandling.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_backgroundimage_api/inc/GsAsyncImageHandling.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + + +#ifndef GS_ASYNC_IMAGE_HANDLE_H +#define GS_ASYNC_IMAGE_HANDLE_H + +#include +#include +#include +#include +#include +#include "mgsasyncimagehandlingobserver.h" + +// CONSTANTS +const TInt KGSMimeStringLength = 50; + +// DATA TYPES +enum TGSBgImageType + { + EGSWelcomeNoteImage, + EGSVtStillImage + }; + +enum TGSImgState + { + EGSWelcomeConversion, + EGSWelcomeScaling, + EGSVTConversion, + EGSVTScaling + }; + +// FORWARD DECLARTION +class CImageDecoder; +class MGSAsyncImageHandlingObserver; + + +// CLASS DECLARTION +class CGSAsyncImageHandling : public CActive + { + public: + // Static constructor + IMPORT_C static CGSAsyncImageHandling* NewL( + RFs& aFs, + MGSAsyncImageHandlingObserver* aObserver, + const TDesC& aDestinationPath ); + + // Destructor + ~CGSAsyncImageHandling(); + + /* + * Asynchronous loading/scaling/dithering of an image. + * The image is converted to a bitmap. + */ + void ProcessImageL( const TDesC& aFilename, + TInt aScreenWidth, + TInt aScreenHeight, + TGSBgImageType aBgImageType ); + + TDisplayMode GetDisplayMode( const TFrameInfo& aFrameInfo ); + + private: + // C++ constructor + CGSAsyncImageHandling( RFs& aFs, + MGSAsyncImageHandlingObserver* aObserver, + const TDesC& aDestinationPath ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + TSize CalculateLoadSize(TFrameInfo& aFrameInfo, + const TSize aScreenSize ); + + void SaveVTStillImageL(); + + private: + // From CActive + void RunL(); + TInt RunError( TInt aError ); + void DoCancel(); + void Release(); + + private: + MGSAsyncImageHandlingObserver* iObserver; + + // File session + RFs& iFs; + + // Image decoder + CImageDecoder* iDecoder; + + // Currently open file Mime-string + TBuf8 iMimeString; + + CFbsBitmap* iBitmap; + + const TDesC& iDestinationPath; + TInt iBgImageType; + + RPhCltServer iPhoneClient; + RLibrary iLibrary; + CRepository* iStartupRepository; + CBitmapScaler* iBitmapScaler; + TSize iScaleSize; + TInt iState; + + }; + +#endif // GS_ASYNC_IMAGE_HANDLE_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_backgroundimage_api/inc/MGsAsyncImageHandlingObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_backgroundimage_api/inc/MGsAsyncImageHandlingObserver.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Observer class for asynchronous image handling. +* +*/ + + + +#ifndef MGS_ASYNC_IMAGE_HANDLING_OBSERVER_H +#define MGS_ASYNC_IMAGE_HANDLING_OBSERVER_H + +// INCLUDES +#include + +// CLASS DECLARATION +/** +* Pure virtual observer class to notify events from CGSAsyncImageHandling. +* +* @lib GsEngine.lib +*/ +class MGSAsyncImageHandlingObserver + { + public: // New functions + + /** + * Notifies that image handling is complete. + * image handling involves loading, scaling and dithering + * @param aError Error value if something went wrong. + */ + virtual void ImageHandlingCompleteL( TInt aError ) = 0; + }; + +#endif // MGS_ASYNC_IMAGE_HANDLING_OBSERVER_H + +// End of File \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_backgroundimage_api/settings_backgroundimage_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_backgroundimage_api/settings_backgroundimage_api.metaxml Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,18 @@ + + + Settings Backgroundimage API + Sets & gets background image, welcome bitmap + c++ + gssettingsuis + + + + + + + + + no + no + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_backgroundimage_api/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_backgroundimage_api/tsrc/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +../../../../gssettingsuis/Gs/tsrc/public/basic/group/T_GSBackgroundImage.mmp +gnumakefile settings_backgroundimage_api.mk + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_backgroundimage_api/tsrc/group/settings_backgroundimage_api.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_backgroundimage_api/tsrc/group/settings_backgroundimage_api.mk Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,41 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + del \epoc32\RELEASE\winscw\udeb\Z\sys\bin\T_GSListBox.dll /f + +LIB : do_nothing + +CLEANLIB : do_nothing + +RESOURCE : do_nothing + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : do_nothing + +FINAL : + echo COPYING + copy \epoc32\RELEASE\winscw\udeb\T_GSListBox.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /y diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: File that exports the files belonging to +: Settings Framework API +* +*/ + + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/GSCommon.rh MW_LAYER_PLATFORM_EXPORT_PATH(gscommon.rh) +../inc/GSSettingId.h MW_LAYER_PLATFORM_EXPORT_PATH(gssettingid.h) +../inc/GSChildViewManager.h MW_LAYER_PLATFORM_EXPORT_PATH(gschildviewmanager.h) +../inc/MGSSettingPSObserver.h MW_LAYER_PLATFORM_EXPORT_PATH(mgssettingpsobserver.h) +../inc/GSBaseView.h MW_LAYER_PLATFORM_EXPORT_PATH(gsbaseview.h) +../loc/gs.loc MW_LAYER_LOC_EXPORT_PATH(gs.loc) +../inc/GSPrivatePluginProviderIds.h MW_LAYER_PLATFORM_EXPORT_PATH(gsprivatepluginproviderids.h) +../inc/GSTabbedViewOwner.h MW_LAYER_PLATFORM_EXPORT_PATH(gstabbedviewowner.h) +../inc/GeneralSettingsVariant.hrh MW_LAYER_PLATFORM_EXPORT_PATH(generalsettingsvariant.hrh) +../inc/GSBaseContainer.h MW_LAYER_PLATFORM_EXPORT_PATH(gsbasecontainer.h) +../inc/GSParentPlugin.h MW_LAYER_PLATFORM_EXPORT_PATH(gsparentplugin.h) +../inc/GSTabHelper.h MW_LAYER_PLATFORM_EXPORT_PATH(gstabhelper.h) +../inc/GSPluginLoader.h MW_LAYER_PLATFORM_EXPORT_PATH(gspluginloader.h) +../inc/GSMainView.h MW_LAYER_PLATFORM_EXPORT_PATH(gsmainview.h) +../inc/GSCommon.hrh MW_LAYER_PLATFORM_EXPORT_PATH(gscommon.hrh) +../inc/GSTabbedView.h MW_LAYER_PLATFORM_EXPORT_PATH(gstabbedview.h) +../inc/GSParentContainer.h MW_LAYER_PLATFORM_EXPORT_PATH(gsparentcontainer.h) +../inc/GSPubSubsListener.h MW_LAYER_PLATFORM_EXPORT_PATH(gspubsubslistener.h) +../inc/MGSWatchDog.h MW_LAYER_PLATFORM_EXPORT_PATH(mgswatchdog.h) diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/GSBaseContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSBaseContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,133 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for GS plugin containers. +* +*/ + + +#ifndef GSBASECONTAINER_H +#define GSBASECONTAINER_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION + +/** +* Base class for GS view containers. Use not necessary. +* +* @lib GSFramework.lib +* @since Series60_3.1 +*/ +class CGSBaseContainer : public CCoeControl +{ + public: // Constructors and destructor + + /** + * Symbian OS default constructor. + */ + IMPORT_C virtual void ConstructL( const TRect& aRect ) = 0; + + /** + * Constructs all common parts of the container. + * + * @param aRect Listbox control's rect. + * @param aResTitleId Resource id for title. + * @param aResLbxId Resource id for listbox. + */ + IMPORT_C void BaseConstructL( const TRect& aRect, + TInt aResTitleId, + TInt aResLbxId ); + + /** + * Constructor. + */ + IMPORT_C CGSBaseContainer(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CGSBaseContainer(); + + public: // New + + /** + * Sets selected item in the listbox. + * @param aIndex Index of the item. + */ + IMPORT_C virtual void SetSelectedItem( TInt aIndex ); + + /** + * Returns selected item in the listbox. + * @return Seleced item index or 0 if no valid lbx. + */ + IMPORT_C virtual TInt SelectedItem(); + + /** + * Set focus on the selected listbox. For animated skins feature. + */ + IMPORT_C void FocusChanged( TDrawNow aDrawNow ); + + public: // From CCoeControl + + /** + * See base class. + */ + IMPORT_C void HandleResourceChange( TInt aType ); + + protected: // New + + /** + * Constructs listbox. + * @param aResLbxId Resource id for listbox. + */ + virtual void ConstructListBoxL( TInt aResLbxId ); + + private: // From CCoeControl + + /** + * See base class. + */ + IMPORT_C void SizeChanged(); + + /** + * See base class. + */ + IMPORT_C TInt CountComponentControls() const; + + /** + * See base class. + */ + IMPORT_C CCoeControl* ComponentControl( TInt /*aIndex*/ ) const; + + /** + * See base class. + */ + IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + public: // Data + + // Pointer to newly created list box. + CEikTextListBox* iListBox; + + protected: // Data + + // European look and feel. + TBool iElaf; +}; + +#endif // GSBASECONTAINER_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/GSBaseView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSBaseView.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,213 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Base class for settings views. +* +*/ + + +#ifndef GSBASEVIEW_H +#define GSBASEVIEW_H + +// INCLUDES +#include + +#include +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CGSBaseContainer; +class CAknNavigationDecorator; + +// CLASS DECLARATION + +/** +* CGSBaseView view class +* Base class for GS plugin views. +* +* @lib GSFramework.lib +* @since Series60_3.1 +*/ +class CGSBaseView : public CGSPluginInterface , public MEikListBoxObserver + { + public: + + // Panic code used in this class + enum KGSViewPanicCodes + { + EGSViewPanicNullPtr = 1 + }; + + public: // Constructors and destructor + + /** + * C++ default constructor + */ + IMPORT_C CGSBaseView(); + + /** + * Symbian OS default constructor. + */ + IMPORT_C virtual void ConstructL()=0; + + /** + * Destructor. + */ + IMPORT_C ~CGSBaseView(); + + public: // New + + /** + * This function is used to set the current item in the listbox. + * @param aIndex Current item. Default value is 0 i.e. the first item + * of the list. + */ + IMPORT_C virtual void SetCurrentItem( TInt aIndex = 0 ); + + /** + * Returns the container this view has. + * @return pointer to container, does not transfer ownership. + */ + IMPORT_C CGSBaseContainer* Container(); + + /** + * Opens the nearest localized resourcefile using aResourceLoader. + * aResourceLoader should be opened only once before closing it. + * Otherwise it will raise a panic. Therefore it is better to have + * multiple resource loaders. Uses KDC_RESOURCE_FILES_DIR. + * + * @param aResourceFileName Drive and name of resource file in format + * : + * @param aResourceLoader Resource loader for the resource. The loader + * must not be opened allready or it will raise + * a panic. It is caller's responsibility to + * close the resource loader after using the + * resource. + */ + IMPORT_C void OpenLocalizedResourceFileL( + const TDesC& aResourceFileName, + RConeResourceLoader& aResourceLoader ); + + public: // From CGSPluginInterface + + /** + * See base class. + */ + IMPORT_C virtual void ResetSelectedItemIndex(); + + public: // From CAknView + + /** + * See base class. + */ + IMPORT_C void DoActivateL( const TVwsViewId& aPrevViewId, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ); + + /** + * See base class. + */ + IMPORT_C void DoDeactivate(); + + protected: // New + + /** + * Sets the correct navi pane for the view (eg. tabs, string etc.). + */ + IMPORT_C virtual void SetNaviPaneL(); + + /** + * Creates context for view's navi pane. + * @param aResourceId Resource id for navi pane context's resource. + */ + IMPORT_C virtual void CreateNaviPaneContextL( TInt aResourceId ); + + /** + * Creates container, + */ + IMPORT_C virtual void CreateContainerL(); + + /** + * Functionality for creating a container. Called by DoActivateL(). + * Implemented by sub-class. + */ + IMPORT_C virtual void NewContainerL() = 0; + + protected: // From CAknView + + /** + * See base class. + */ + void HandleClientRectChange(); + + protected: // From MEikListBoxObserver + + /** + * See base class. + */ + void HandleListBoxEventL( CEikListBox* aListBox, + TListBoxEvent aEventType ); + + private: // New + + /** + * Handles listbox selection. Called by HandleListBoxEventL. + * Implement by sub-class. + */ + virtual void HandleListBoxSelectionL() = 0; + + /** + * Creates navi control container when needed + */ + CAknNavigationControlContainer* NaviControlContainerL(); + + public: // Data + + TVwsViewId iPrevViewId; // Previous view UID + + protected: // Data + + // Pointer to application UI. + CAknViewAppUi* iAppUi; + + // Pointer to the container + CGSBaseContainer* iContainer; + + // Navi pane + CAknNavigationDecorator* iNaviPaneContext; + + // Pointer to the navi control container + CAknNavigationControlContainer* iNaviControlContainer; + + // Currently selected listbox item + TInt iCurrentItem; + + // First item in the listbox + TInt iTopItemIndex; + + // European look and feel + TBool iElaf; + + // Resource loader + RConeResourceLoader iResourceLoader; + + private: // Data + + }; + +#endif // GSBASEVIEW_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/GSChildViewManager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSChildViewManager.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef GSChildViewManager_H +#define GSChildViewManager_H + +// Classes referenced +class CGSPluginInterface; + +class MGSChildViewManager + { +public: + virtual void TransferDynamicPluginL( CGSPluginInterface* aPlugin ) = 0; + }; + + +#endif // GSChildViewManager_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/GSCommon.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSCommon.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Common GS menu commands and other common constants. +* +*/ + + +#ifndef GSCOMMON_HRH +#define GSCOMMON_HRH + +// Common GS menu commands. Start from 500 so everything below 500 is free for +// use for plugins. The values are based on the assumption that Avkon process +// commands constants start from 4000 and CBA constants start from 3000 so +// these will not be overwritten. +// +enum TGSMenuCommands + { + EGSCmdAppChange = 500, + EGSCmdAppEdit, + EGSCmdAppHelp, + EGSCmdAppNew, + EGSCmdAppOpen, + EGSMSKCmdAppChange + }; + +enum TGSListBoxItemVisibility + { + EGSListBoxItemTypeIsAlwaysVisible = 0, + EGSListBoxItemTypeIsDynamic + }; + +#endif // GSCOMMON_HRH +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/GSCommon.rh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSCommon.rh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains common declarations for resources of GS. +* The file can be included only in resource file. +* +*/ + + +#ifndef GSCOMMON_RH +#define GSCOMMON_RH + +#include + +// Global definitions + +// STRUCTURE DEFINITIONS + +// --------------------------------------------------------- +// gs_link_apps +// It defines structure to contain information about apps +// to be able to included in the softkey list. +// --------------------------------------------------------- +// +STRUCT GS_LINK_APPS + { + STRUCT apps[]; + } + +// --------------------------------------------------------- +// gs_app +// It defines structure that contains information about +// a single app. +// --------------------------------------------------------- +// +STRUCT GS_APP + { + WORD id; + LONG app = -1; + } + +// --------------------------------------------------------- +// gs_feature_array +// It defines structure to contain information about items +// to be able to included in the listbox. +// --------------------------------------------------------- +// +STRUCT GS_FEATURE_ARRAY + { + STRUCT items[]; + } + +// --------------------------------------------------------- +// gs_feature +// It defines structure that contains information about +// a single listbox item. +// --------------------------------------------------------- +// +STRUCT GS_FEATURE + { + LTEXT txt = ""; + WORD item = -1; + BYTE type = EGSListBoxItemTypeIsAlwaysVisible; + } + +#endif // GSCOMMON_RH +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/GSMainView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSMainView.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,215 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Main view. +* +*/ + + + +#ifndef GSMAINVIEW_H +#define GSMAINVIEW_H + +// INCLUDES +#include "gspluginloader.h" +#include "gschildviewmanager.h" +#include +#include +#include +#include +#include + +// CONSTANTS +_LIT( KGSMainViewResourceFileName, "z:GSApp.rsc" ); + +// FORWARD DECLARATIONS +class CGSMainContainer; +class CGSPluginInterface; + +// CLASS DECLARATION + +/** +* CGSMainView view class +* +* Main view of GS +* +* This view is responsible for visualizing the first level of settings +* plugins. +* +*/ +class CGSMainView : + public CAknView, + public MGSPluginLoadObserver, + public MGSTabbedViewOwner, + public MGSChildViewManager + { + public: // Constructors and destructor + + CGSMainView(); + + /** + * Symbian OS two-phased constructor + * @return GS main view. + */ + static CGSMainView* NewL(); + + /** + * Symbian OS two-phased constructor + * @return GS main view. + */ + static CGSMainView* NewLC(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + /** + * Destructor + */ + ~CGSMainView(); + + public: // New + + /** + * Returns pointer to the owned plugins. + */ + CArrayPtrFlat* Plugins(); + + /** + * Updates plugin's view. This can be used when child plugin's values + * are changed. + */ + void UpdateView(); + + /** + * represent the position of ListBox + */ + struct TListBoxPosition + { + /** + * The three items are all set to -1 as an initial value because their legal + * value should be no less than 0. + */ + inline void Reset() + { + iCurrentItemIndex = -1; + iItemOffsetInPixels = -1; + iTopItemIndex = -1; + } + TInt iCurrentItemIndex; + TInt iItemOffsetInPixels; + TInt iTopItemIndex; + }; + + public: // From CAknView + + /** + * See base view. + */ + TUid Id() const; + + public: // From MGSPluginLoadObserver + + /** + * See base view. + */ + void HandlePluginLoaded( KGSPluginLoaderStatus aStatus ); + + public: // From MGSChildViewManager + + /** + * See base view. + */ + void TransferDynamicPluginL( CGSPluginInterface* aPlugin ); + + public: // From MGSTabbedViewOwner + + /** + * See base view. + */ + CArrayPtrFlat* TabbedViews(); + + /** + * See base class. + */ + void TabChangedL( TUid selectedTabUid ); + + protected: // From CAknView + + /** + * See base view. + */ + void DoActivateL( + const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * See base view. + */ + void DoDeactivate(); + + /** + * See base view. + */ + void HandleCommandL( TInt aCommand ); + + protected: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + private: + + /** + * Opens the nearest localized resourcefile. + */ + void OpenLocalizedResourceFileL( const TDesC& aResourceFileName ); + + /** + * Creates new container. + */ + void NewContainerL(); + + private: // Data + + // Pointer to Application UI. Not owned. + CAknViewAppUi* iAppUi; + + // Pointer to owned container. + CGSMainContainer* iContainer; + + // GS plug-ins owned by this view. CGSPluginLoader defines the + // ordering of items. + CArrayPtrFlat* iPluginArray; + + // Asynchronous loader for the GS plug-ins. + CGSPluginLoader* iPluginLoader; + + // Resource loader. + RConeResourceLoader iResourceLoader; + + // UID of the selected plugin in the container's lbx. + TUid iSelectedPluginUid; + + //keep the exact position of the listbox including current item index, + //ItemOffsetInPixels and TopItemindex + TListBoxPosition iPosition; + + //record the screen mode, portrait/landscape + TBool iIsLandscapeOrientation; + }; + + +#endif // GSMAINVIEW_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/GSParentContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSParentContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,242 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for GSParentPlugin. +* +*/ + + +#ifndef GSPARENTCONTAINER_H +#define GSPARENTCONTAINER_H + +#include "gsparentplugin.h" +#include +#include +#include // For loading icons +#include +#include +#include + +// CLASS DECLARATION +class CAknViewAppUi; +class CGSPluginInterface; +class CAknSingleLargeStyleListBox; +class MGSWatchDog; +class CGsContainerExt; + +/** +* Container class for the GS Main view. +* @lib GSFramework.lib +* @since Series60_3.1 +*/ +class CGSParentContainer : public CCoeControl, public MEikListBoxObserver + { + public: // Constructors and destructor + + /** + * Symbian OS constructor. + * Required by the base class. + */ + /*void ConstructL( + const TRect& aRect, + CAknViewAppUi* aAppUi, + CArrayPtrFlat* aPluginArray, + TInt aTitleRscId );*/ + + /** + * Symbian OS constructor. + * Required by the base class. + */ + void ConstructL( + const TRect& aRect, + CAknViewAppUi* aAppUi, + CArrayPtrFlat* aPluginArray, + TInt aTitleRscId, + CGSParentPlugin* aParentPlugin, + TGSListboxTypes aListBoxType = + EGSListBoxTypeSingleLarge ); + + /** + * Destructor. + */ + ~CGSParentContainer(); + + public: // New + + /** + * Updates iListBox. Listbox is updated depending on the type of the + * listbox. Plugins are inserted to listbox only if they are visible. + */ + void UpdateListBoxL(); + + /** + * @return Pointer to owned listbox + */ + CEikListBox* ListBox(); + + /** + * @return Plugin which is selected in the lbx or NULL if no plugins + * exist. + */ + CGSPluginInterface* SelectedPlugin(); + + /** + * Sets selected lbx item using the UID of the item. If the item is not + * existing or visible anymore, selected item is the first item in the + * lbx. + */ + void SetSelectedItem( TUid aSelectedItemUid ); + + /** + * @return Plugin which is top in the lbx or NULL if no plugins + * exist. + */ + CGSPluginInterface* TopPlugin(); + + /** + * Sets top lbx item using the UID of the item. + */ + void SetTopItem( TUid aTopItemUid ); + + /** + * Set the empty text of list box. + */ + void SetListBoxEmptyTextL(const TDes& aEmpty ); + + /** + * Store listbox's exact position. + * @param aPosition includes the exact position of the listbox. + */ + void StoreListBoxPositionL( CGSParentPlugin::TListBoxPosition& aPosition ); + + /** + * Restore listbox's exact position. + * @param aPosition includes the exact position of the listbox. + * @param aScreenModeChanged indicates whether the screen mode is changed. + */ + void RestoreListBoxPositionL( const CGSParentPlugin::TListBoxPosition& aPosition, TBool aScreenModeChanged ); + + public: // From CCoeControl + + /** + * Set focus on the selected listbox. For animated skins feature. + */ + IMPORT_C void FocusChanged( TDrawNow aDrawNow ); + + /** + * See base class. + */ + void HandleResourceChange( TInt aType ); + + /** + * See base class. + */ + void GetHelpContext( TCoeHelpContext& aContext ) const; + + public: //New + + void HandleSelectionKeyL(); + + protected: // From MEikListBoxObserver + + /** + * Handles listbox events. + * @param aListBox Listbox where the event occurred. + * @param aEventType Event type. + */ + void HandleListBoxEventL( CEikListBox* aListBox, + TListBoxEvent aEventType ); + + private: // New + + /** + * Creates a listbox. + */ + void CreateListBoxL( TGSListboxTypes aListBoxType ); + + /** + * Adds plugin data to listbox. + * @param aPlugin A plugin whose data is to be used. + * @param aItemTextArray Array for plugin texts and format strings used + * by lbx. + * @param aIconArray Array for icons used in lbx. + * @param aIconCounter Counter for inserted icons, will be updated. + */ + void AddPluginDataToLbxL( CGSPluginInterface* aPlugin, + CDesCArray* aItemTextArray, + CAknIconArray* aIconArray, + TInt& aIconCounter ); + + private: // From CCoeControl + + /** + * See base class. + */ + void SizeChanged(); + + /** + * See base class. + */ + TInt CountComponentControls() const; + + /** + * See base class. + */ + CCoeControl* ComponentControl(TInt /*aIndex*/) const; + + /** + * See base class. + */ + TKeyResponse OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ); + + private: // Data + + // Application UI. Not owned. + CAknViewAppUi* iAppUi; + + // Owned listbox. + CEikListBox* iListBox; + + // Type of iListBox. + TGSListboxTypes iListBoxType; + + // Pointer to listbox model's item texts. Note that the indexes of + // listbox items are mapped directly to the indexes in plugin array. + // Plugin which maps to selected listbox item index in plugin array is + // activated when item is selected in listbox. + // + // Owned by iListBox. + // + CDesCArray* iItemTextArray; + + // Array of the child plugins. Owned by CGSParentPlugin. + CArrayPtrFlat* iPluginArray; + + // Array of pointers to iPluginArray plugins which are visible. + // This is the actual array which is displayed by the listbox. + // It is needed because iPluginArray also contains non-visible plugins + // and therefore the indexes do not match to lbx items. + CArrayPtrFlat* iVisiblePlugins; + + // Pointer to parent plugin. Not owned. + CGSParentPlugin* iParentPlugin; + + // Pointer to GSWatchDog owned by GS Application document. Not owned. + CGsContainerExt* iExt; + }; + + +#endif // GSPARENTCONTAINER_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/GSParentPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSParentPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,362 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class header for plugins containing other plugins. +* +*/ + + +#ifndef GSPARENTPLUGIN_H +#define GSPARENTPLUGIN_H + +// INCLUDES +#include "gspluginloader.h" +#include "gsplugininterface.h" +#include "gschildviewmanager.h" + +#include +#include +#include + +// CONSTANTS +_LIT( KGSParentPluginResourceFileName, "z:GSParentPluginRsc.rsc" ); + +/** +* Used by CGSParentPlugin::ListBoxType(). These enumerations are used to define +* the desired type of the listbox. Enumerations here are currently implemented +* by CGSParentPlugin. Additional types can be defined later as long as the +* values for previous types are not changed. +*/ +enum TGSListboxTypes + { + // CAknSingleLargeStyleListBox for + // list_single_large_pane + EGSListBoxTypeSingleLarge = 1, // Default + // CAknSettingStyleListBox for + // list_setting_pane and + // list_big_single_setting_pane + EGSListBoxTypeSettings, + // CAknDouble2LargeStyleListBox for + // list_double2_large_graphic_pane + EGSListBoxTypeDouble2Large, + // CAknDoubleLargeStyleListBox for + // list_double_large_graphic_pane + // Note: Only different layout than EGSListBoxTypeDouble2Large + EGSListBoxTypeDoubleLarge + }; + +/** +* Indexes to flags that are used for different customisation options for parent +* plugin. The flags define for example optimization options for loading child +* plugins. +*/ +enum TGSOptionFlagIndexes + { + // On: Will load child plugins when parent plugin is activated. + // Off: Will load child plugins on initialization of the parent plugin. + EGSLoadChildrenOnActivation, + // On: Will delete child plugins when parent plugin is deactivated. + // Off: Will delete child plugins when parent plugin is destroyed. + EGSDeleteChildrenOnDeactivation // CURRENTLY NOT IMPLEMENTED! + }; + +// FORWARD DECLARATIONS +class CGSParentContainer; + +// CLASS DECLARATION + +/** +* CGSParentPlugin view class. Thus is a base class for plugins owning other +* plugins as their sub-views. +* +* @lib GSFramework.lib +* @since Series60_3.1 +*/ +class CGSParentPlugin : public CGSPluginInterface, + public MGSPluginLoadObserver, + public MGSChildViewManager +{ + public: // Constructors and destructor + + /** + * Destructor. + */ + IMPORT_C ~CGSParentPlugin(); + + public: // New + + /** + * Opens the nearest localized resourcefile using aResourceLoader. + * aResourceLoader should be opened only once before closing it. + * Otherwise it will raise a panic. Therefore it is better to have + * multiple resource loaders. Uses KDC_RESOURCE_FILES_DIR. + * + * @param aResourceFileName Drive and name of resource file in format + * : + * @param aResourceLoader Resource loader for the resource. The loader + * must not be opened allready or it will raise + * a panic. It is caller's responsibility to + * close the resource loader after using the + * resource. + */ + IMPORT_C void OpenLocalizedResourceFileL( + const TDesC& aResourceFileName, + RConeResourceLoader& aResourceLoader ); + + /** + * Symbian OS default constructor. Call this from sub classes. + * + * @param aViewTitleRscId Id for the view's resource. + * @parem aTitleRscId Id for the view's title resource. + */ + IMPORT_C void BaseConstructL( TInt aViewRscId, TInt aTitleRscId ); + + /** + * @return UID of the upper level view which launched this view. Note + * that it is not always the previous view because a view can + * be activated also by returning from another view. + */ + IMPORT_C virtual TUid UpperLevelViewUid(); + + /** + * Defines the type of the used listbox visualising the child plugins. + * Classes deriving from CGSParentContainer can override this function + * to define the used type of the listbox. Otherwise default value + * EGSListBoxTypeSingleLarge is used. + * + * @return Type of the listbox. See TGSListboxTypes for + * types. + */ + IMPORT_C virtual TGSListboxTypes ListBoxType(); + + /** + * Updates plugin's view. This can be used when child plugin's values + * are changed. + */ + IMPORT_C virtual void UpdateView(); + + /** + * Defines custom options for parent plugin. Use TGSOptionFlagIndexes to + * enable a combination of bit flags. + * + * @param aOptionFlags Option combination created by combining binary + * option flags. + */ + IMPORT_C virtual void SetOptionFlags( TBitFlags& aOptionFlags ); + + /** + * Gets currently used option flags. + * + * @return Binary option flags used by this plugin. + */ + IMPORT_C virtual const TBitFlags& OptionFlags() const; + + /** + * Provides help context. This should be implemented by CGSParentPlugin + * sub class in case help is needed. Normally this is defined in + * CCoeControl derived class but since all parent plugin implementations + * have only CGSParentContainer class as the only CCoeControl derived + * class, and need still their own unique help contexts, this function + * is needed in view level class. + */ + IMPORT_C virtual void GetHelpContext( TCoeHelpContext& aContext ); + + /** + * @return Plugin which is selected in the lbx or NULL if no plugins + * or iContainer exist. + */ + IMPORT_C CGSPluginInterface* SelectedPlugin(); + + /** + * Attempts to change child plugin load priority on next RunL cycle. + * Use this if parent needs to change plugin loader priority. Normally + * when parent plugin view is opened, it is advisable to increase loader + * priority to get child plugins loaded faster. + * + * @param aPriority Desired priority. + */ + void RequestPriority( CActive::TPriority aPriority ); + + public: // From CGSPluginInterface + + /** + * See base class. + */ + IMPORT_C void ResetSelectedItemIndex(); + + public: // From MGSPluginLoadObserver + + /** + * See base class. + */ + IMPORT_C void HandlePluginLoaded( KGSPluginLoaderStatus aStatus ); + + public: //New + + /** + * Checks if the MSK label needs to be adjusted. + */ + void CheckMiddleSoftkeyLabelL(); + + /** + * Adds given resource text as MSK to CBA. Use either this or + * SetMiddleSoftKeyLabelTextL in in case text is used deirectly instead + * of resource. + * + * @param aResourceId middle softkey label. + * @param aCommandId command that should be performed when MSK + * is pressed. + * @since S60 v3.1 + */ + void SetMiddleSoftKeyLabelL( const TInt aResourceId, const TInt aCommandId ); + + /** + * Adds given text as MSK to CBA. + * + * @param aMskLabel middle softkey label. + * @param aCommandId command that should be performed when MSK + * is pressed. + * @since S60 v3.1 + */ + void SetMiddleSoftKeyLabelTextL( const TPtr aMskLabel, const TInt aCommandId ); + + /** + * represent the position of ListBox + */ + struct TListBoxPosition + { + /** + * The three items are all set to -1 as an initial value because their legal + * value should be no less than 0. + */ + inline void Reset() + { + iCurrentItemIndex = -1; + iItemOffsetInPixels = -1; + iTopItemIndex = -1; + } + TInt iCurrentItemIndex; + TInt iItemOffsetInPixels; + TInt iTopItemIndex; + }; + + public: // From MGSChildViewManager + + IMPORT_C void TransferDynamicPluginL( CGSPluginInterface* aPlugin ); + + protected: // From CAknView + + /** + * See base class. + */ + IMPORT_C void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * See base class. + */ + IMPORT_C void DoDeactivate(); + + /** + * See base class. + */ + IMPORT_C void HandleCommandL( TInt aCommand ); + + /** + * See base class. + */ + IMPORT_C CGSParentPlugin(); + + protected: // From MEikMenuObserver + + /** + * See base class. + */ + IMPORT_C void DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ); + + private: // New + + /** + * Constructs container for this view. + */ + void ConstructContainerL(); + + /** + * Remove command from MSK. + * @param aMskCommandId ID of the command to be removed. + */ + void RemoveCommandFromMSK( TInt aMskCommandId ); + + /** + * Used in lazy loading. Starts loading the plugins. + */ + void StartAsyncPluginLoadL(); + + protected: // Data + + // Previous view UID. + TVwsViewId iPrevViewId; + + private: // Data + + // Application UI. + CAknViewAppUi* iAppUi; + + // Owned container. + CGSParentContainer* iContainer; + + // GS plug-ins owned by this view. + // CGSPluginLoader defines the ordering of plugins. + CArrayPtrFlat* iPluginArray; + + // Asynchronous loader for the GS plug-ins. + CGSPluginLoader* iPluginLoader; + + // Resource loader. + RConeResourceLoader iResourceLoader; + + // Resource id for the title. + TInt iTitleRscId; + + // UID of the selected plugin in the container's lbx. Uid is used + // instead of simple index because it is unambiguous whereas index + // could refer to wrong plugin in case plugin order or count is + // changed. + TUid iSelectedPluginUid; + + // Combination of binary flags that can be set to alter parent plugin + // behaviour. + TBitFlags iOptionFlags; + + // This stores the desired MSK command ID. + TInt iMskCommandId; + + // UID of the top plugin in the container's lbx. Uid is used + // instead of simple index because it is unambiguous whereas index + // could refer to wrong plugin in case plugin order or count is + // changed. + TUid iTopPluginUid; + + //keep the exact position of the listbox including current item index, + //ItemOffsetInPixels and TopItemindex + TListBoxPosition iPosition; + + //record the screen mode, portrait/landscape + TBool iIsLandscapeOrientation; +}; + + +#endif // GSPARENTPLUGIN_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/GSPluginLoader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSPluginLoader.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,368 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class definition for CGSPluginLoader +* +*/ + + + +#ifndef GSPLUGINLOADER_H +#define GSPLUGINLOADER_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// Value for a to b comparison result when logically a == b. +const TInt KGSComparisonEqual = 0; + +// Value for a to b comparison result when logically a < b. +const TInt KGSComparisonBefore = -1; + +// Value for a to b comparison result when logically a > b. +const TInt KGSComparisonAfter = 1; + +// CLASS DEFINITIONS +class CGSPluginInterface; +class MGSPluginLoadObserver; +class CAknViewAppUi; +class REComSession; +class CAknColumnListBox; +class CAknInfoPopupNoteController; +class CGSBaseDocument; +class MGSWatchDog; + +/** +* CGSPluginLoader. Mechanism used to load plugins asynchronously. Uses +* MGSPluginLoadObserver as a callback. +* +* @lib GSFramework.lib +* @since Series60_30.1 +*/ +class CGSPluginLoader : public CActive + { + public: // Constructor and destructor + + /** + * Two-phased constructor. + * + * @param aAppUi Pointer to application UI. Does not take ownership. + */ + IMPORT_C static CGSPluginLoader* NewL( CAknViewAppUi* aAppUi ); + + /** + * Destructor + */ + IMPORT_C ~CGSPluginLoader(); + + private: // Internal construction + + /** + * Default C++ contructor + */ + CGSPluginLoader(); + + /** + * Symbian OS default constructor + * @return void + */ + void ConstructL( CAknViewAppUi* aAppUi ); + + public: // API + + /** + * Starts loading GS plug-ins asynchronously. Will call + * MGSPluginLoadObserver::HandlePluginLoaded() each time a plug-in is + * loaded and when all plugins are loaded. + * + * CGSPluginLoader transfers the ownership of each loaded plugin view to + * CAknViewAppUi. It is client's responsibility to remove the views from + * CAknViewAppUi and delete the plugins if necessary. + * + * @param aInterfaceUid Uid ofthe interfaces to be loaded. + * @param aParentUid Uid of the parent. Only children of this parent + * will be loaded. + * @param aPluginArray An array for the loaded GS plug-ins. + * CGSPluginLoader does not take the ownership of this array. + */ + IMPORT_C void LoadAsyncL( + TUid aInterfaceUid, + TUid aParentUid, + CArrayPtrFlat* aPluginArray ); + + /** + * Load a specific plugin instance synchronously. + * + * @param aInterfaceUid Uid ofthe interfaces to be loaded. + * @param aImplementationUid Uid of the implementation to load + */ + CGSPluginInterface& LoadSyncL( TUid aInterfaceUid, TUid aImplementationUid ); + + /** + * Sets observer for this loader. Only one observer per loader in one + * time is possible. + */ + IMPORT_C void SetObserver(MGSPluginLoadObserver* aObserver); + + /** + * Aborts asynchronous loading of the GS plug-ins. + */ + IMPORT_C void AbortAsyncLoad(); + + /** + * Sorts the plugin array. + * + * Sorting criterias: + * + * 1. Order number if provider category is Internal. + * 2. Provider category. Precedence as follows: + * 1. KGSPluginProviderInternal + * 2. EGSPluginProviderOEM + * 3. EGSPluginProviderOperator + * 4. EGSPluginProvider3rdParty + * 3. Alphabetical + * + * @param aPlugins The array which will be sorted. + */ + IMPORT_C void SortPluginsL( CArrayPtrFlat* aPlugins ); + + + /** + * Attempts to change CActive priority on next RunL cycle. Use this if + * needed to change plugin loader priority. Normally when parent plugin + * view is opened, it is advisable to increase loader priority to get + * child plugins loaded faster. + * + * @param aPriority Desired priority. + */ + IMPORT_C void RequestPriority( CActive::TPriority aPriority ); + + private: // Internal methods + + /** + * Starts loading next plugin. + */ + void LoadNextPluginL(); + + /** + * Creates a plugin instance from given UID. Ownership is transferred. + */ + CGSPluginInterface& CreatePluginInstanceL( + const CImplementationInformation& aImpInfo ); + + /** + * Notifies MGSPluginLoadObserver. + */ + void NotifyProgress(); + + /** + * Notifies MGSPluginLoadObserver. + */ + void NotifyFinished(); + + /** + * Wait for the next round of CActive execution. + */ + void CompleteOwnRequest(); + + // Insertion function used by sorting: + + /** + * Inserts plugin in the correct position in the array using sorting + * criterias. Assumes aPlugins is ordered. + * + * @param aPlugin The plugin to be inserted. + * @param aPlugins Array in which the plugin is inserted into the + * corresponding location. + */ + void InsertPluginInOrderL( + CGSPluginInterface* aPlugin, + CArrayPtrFlat* aPlugins ); + + // Comparison functions: + + /** + * Compares plugins according to comparison criterias. + * + * Note: GS internal comparison constants such as KGSComparisonEqual are + * different from the ones outputted by this function. This is because + * this function is also usable by RArray sort -functionality but BC + * cannot be broken in GS. + * + * @return Negative value: If aFirst before aSecond. + * 0: If equal. + * Positive value: If aSecond before aFirst. + */ + static TInt Compare( const CGSPluginInterface& aFirst, + const CGSPluginInterface& aSecond ); + + /** + * Precedence is as follows: + * 1. KGSPluginProviderInternal + * 2. EGSPluginProviderOEM + * 3. EGSPluginProviderOperator + * 4. EGSPluginProvider3rdParty + * + * @return KGSComparisonEqual = equal categories + * KGSComparisonBefore = aFirst is before aSecond + * KGSComparisonAfter = aFirst is after aSecond + */ + static TInt CompareCategory( + const CGSPluginInterface& aFirst, + const CGSPluginInterface& aSecond ); + /** + * + * @return KGSComparisonEqual = equal captions + * KGSComparisonBefore = aFirst is before aSecond + * KGSComparisonAfter = aFirst is after aSecond + */ + static TInt CompareCaption( + const CGSPluginInterface& aFirst, + const CGSPluginInterface& aSecond ); + /** + * + * @return KGSComparisonEqual = equal indexes + * KGSComparisonBefore = aFirst is before aSecond + * KGSComparisonAfter = aFirst is after aSecond + */ + static TInt CompareIndex( + const CGSPluginInterface& aFirst, + const CGSPluginInterface& aSecond ); + + private: // Utility methods + + /** + * Parses descriptor to UID. + */ + static TInt ParseToUid( const TDesC8& aSource, TUid& aTarget ); + + /** + * Parsers plugin's order number + */ + static TInt ParseOrderNumber( const TDesC8& aSource, TInt& aOrderNumber ); + + /** + * Print debug information. + */ + static void PrintInfoDebugL( const CImplementationInformation& aInfo, + TInt aIterator, + TInt aPluginCount ); + /** + * Print ordering debug data. + */ + void CGSPluginLoader::PrintOrderTracesL( + CArrayPtrFlat* aPlugins ); + + /** + * Display loading error popup message. + */ + void DisplayErrorPopupL( TInt aError, + const CImplementationInformation* aInfo ); + + private: // From CActive + + /** + * See base class. + */ + void RunL(); + + /** + * See base class. + */ + TInt RunError( TInt aError ); + + /** + * See base class. + */ + void DoCancel(); + + private: // Data + + + // Pluginloader goes through this array and loads the plugins into + // iPluginArray if they fulfill the criterias. + RImplInfoPtrArray iImplInfoArray; + + // Used as an iterator to maintain location in iImplInfoArray. + TInt iImplInfoArrayIterator; + + // Array of loaded plugins.Plugins are owned by iAppUi. Only the array + // pointers are owned by this class and therefore only reset array. + CArrayPtrFlat* iPluginArray; + + // UID for plugin parent. + TUid iParentUid; + + // Pointer to app UI. Not owned. + CAknViewAppUi* iAppUi; + + // Pointer to observer. Not owned. + MGSPluginLoadObserver* iObserver; + + // Number of RunL calls. + TInt iRunLDebugCount; + + // For debugging: shows a note in case of a crashing plugin + CAknInfoPopupNoteController* iErrorPopup; + + // Reference to GS application owned watchdog. Not onwed. + MGSWatchDog* iWatchDog; + + // Reference to document. Not owned. + CGSBaseDocument* iDocument; + + // Desired oactive object priority for loading child plugins. + CActive::TPriority iRequestedPriority; + }; + + +/** +* Interface for GSPluginLoader observer. MGSPluginLoadObserver gets +* notifications when plugins are loaded. +* +* @lib GSFramework.lib +* @since Series60_30.1 +*/ +class MGSPluginLoadObserver + { + public: // Enums + enum KGSPluginLoaderStatus + { + // One plugin loaded successfully, continue to next. + EGSSuccess, + // Loading one plugin failed, contiue to next. + EGSFail, + // Client called AbortAsyncLoad(), finished loading. + EGSAborted, + // All plugins loaded successfully, finished loading. + EGSFinished, + // Severe error with loader, finished loading. + EGSError + }; + + public: // New + + /** + * CGSPluginLoader calls this function when each plug-in is loaded or + * loading is finished.. + */ + IMPORT_C virtual void HandlePluginLoaded( + KGSPluginLoaderStatus aStatus ) = 0; + }; + + +#endif // GSPLUGINLOADER_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/GSPrivatePluginProviderIds.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSPrivatePluginProviderIds.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Ids for private plug-in providers. +* +*/ + + + +#ifndef GSPRIVATEPROVIDERIDS_H +#define GSPRIVATEPROVIDERIDS_H + +// CONSTANTS + +/** +* Private id used for S60 internally provided GS plug-ins. This must not be +* disclosed to other parties. Using this id allows the plugin to be handled +* with more rights than other plugins: +* - Inserted before other plugins in listboxes. +* - Can define their order in the listbox. +* - Plug-in can belong also to other views than applications-view. +* +*/ +const TInt KGSPluginProviderInternal = 87329234; + + +#endif // GSPRIVATEPROVIDERIDS_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/GSPubSubsListener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSPubSubsListener.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Listener for Publish and subscribe data. +* +*/ + + + +#ifndef GSPUBSUBSGSETTINGS_H +#define GSPUBSUBSGSETTINGS_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class MGSSettingPSObserver; + +// CLASS DECLARATION + +/** +* RProperty poller. +* +* @lib gs.lib +* @since Series 60 3.0 +*/ +NONSHARABLE_CLASS( CGSPubSubsListener ) : public CActive + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aUid the Uid to use + * @param aKey item's key + * @param aObserver callback interface for notification + * @return instance of CVtEngPubSubsListener + */ + IMPORT_C static CGSPubSubsListener* NewL( const TUid aUid, + const TInt aKey, MGSSettingPSObserver* aObserver ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CGSPubSubsListener(); + + public: // New functions. + + /** + * Gets integer value from P & S. + * @param aVal a value in return + * @return error code + */ + IMPORT_C TInt Get( TInt& aVal ); + + /** + * Gets 8 bit string value from P&S. + * @param aVal a value in return + * @return error code + */ + IMPORT_C TInt Get( TDes8& aVal ); + + /** + * Gets 16 bit descriptor value from P&S. + * @param aVal a value in return + * @return error code + */ + IMPORT_C TInt Get( TDes16& aVal ); + + private: // From CActive. + + /** @see CActive::RunL */ + virtual void RunL(); + + /** @see CActive::Cancel */ + virtual void DoCancel(); + + /** @see CActive::RunError */ + virtual TInt RunError( TInt aError ); + + /** + * Starts the listening (RunL). + */ + void StartListening(); + + private: + + /** + * C++ default constructor. + * @param aUid the Uid to use + * @param aKey item's key + * @param aObserver callback interface for notification + */ + CGSPubSubsListener( const TUid aUid, TInt aKey, + MGSSettingPSObserver* aObserver ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + + // UID of the monitored item. + TUid iUid; + + // ID of the monitored item. + TInt iId; + + // Property to subscribe to. + RProperty iProperty; + + // The notification interface. + MGSSettingPSObserver* iCallback; + }; + +#endif // GSPUBSUBSGSETTINGS_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/GSSettingId.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSSettingId.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: All the setting IDs are declared here +* +*/ + + +#ifndef GSSETTINGID_H +#define GSSETTINGID_H + + +// CONSTANTS + +// buffer size constants +const TInt KGSBufSize128 = 128; + +const TInt KGSMapSize = 8; + +// connection packet data +const TInt KGSSettIdV42Comp = 1; + +// accessory display +const TInt KGSSettIdAccIU = 0; + + +enum { + KGSHeadsetDefProfile, + KGSLoopsetDefProfile, + KGSBTAudioDefProfile, + KGSTTYDefProfile + }; + +// call display +enum { + KGSSettIdOwnNumberSending, + KGSSettIdCallWaiting, + KGSSettIdCallCompletionWhenBusy, + KGSSettIdSummaryAfterCall, + KGSSettIdPhoneLineUsed, + KGSSettIdPhoneLineBlocking, + KGSSettIdSoftRejectText + }; + +#endif // GSSETTINGID_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/GSTabHelper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSTabHelper.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,170 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Utility class for creating tab groups. +* +*/ + + +#ifndef GSTABHELPER_H +#define GSTABHELPER_H + +#include "gsplugininterface.h" +#include "gstabbedviewowner.h" + +#include +#include +#include + + +// Forward declarations +class CAknNavigationControlContainer; +class CAknNavigationDecorator; +class CAknTabGroup; +class MGSTabbedView; + + +/** +* CGSTabHelper is used to create dynamic tabs from either +* - CGSPluginInterface* array (plugins) +* - MGSTabbedView* interface Array (local views owned by plugin). +* +* How to use: +* +* 1. Call CreateTabGroupL() from the plugin's/view's DoActivate(). Providing an +* array of all the plugins/views which should be in the tab group including +* the plugin/view itself. +* +* 2. Call RemoveTabGroup() from the plugin's/view's DoDeactivate(). +* +* 3. It is recommended to use CGSTabHelper* as an member variable owned by the +* plugin/view class. +* +* @lib GSFramework.lib +* @since Series60_3.1 +*/ +class CGSTabHelper : public CBase, public MAknTabObserver + { + public: // Constructors & destructors + + /** + * Symbian OS two-phased constructor + * @return + */ + IMPORT_C static CGSTabHelper* NewL(); + + /** + * Symbian OS two-phased constructor + * @return + */ + IMPORT_C static CGSTabHelper* NewLC(); + + /** + * Destructor. + */ + IMPORT_C ~CGSTabHelper(); + + public: // New + + /** + * This function is for views implementing MGSTabbedViewOwner. Such may + * be needed in case view needs to update its selected item according to + * tab selection. + * + * Creates and adds a tab group to navipane. The number of visible tabs + * is 4 unless there are less tabbed views in which case the number of + * tabs equal the number of tabbed views. + * + * @param aActiveViewUid UID of the view whose tab should be activated + * when the tab group is added to the navi pane. + * @param aTabOwner Reference to the owner of the tabbed views. + */ + IMPORT_C void CreateTabGroupL( TUid aActiveViewUid, + MGSTabbedViewOwner* aTabOwner ); + + /** + * This function is for plugin implementation. + * + * Creates and adds a tab group to navipane. The number of visible tabs + * is 4 unless there are less tabbed views in which case the number of + * tabs equal the number of tabbed views. + * + * @param aActiveViewUid UID of the view whose tab should be activated + * when the tab group is added to the navi pane. + * @param aTabbedViews References to the views which belong to the tab + * group. + */ + IMPORT_C void CreateTabGroupL( + TUid aActiveViewUid, + CArrayPtrFlat* aTabbedViews ); + + /** + * This function is for local view implementation. + * + * Creates and adds a tab group to navipane. The number of visible tabs + * is 4 unless there are less tabbed views in which case the number of + * tabs equal the number of tabbed views. + * + * @param aActiveViewUid UID of the view whose tab should be activated + * when the tab group is added to the navi pane. + * @param aTabbedViews References to the views which belong to the tab + * group. + */ + IMPORT_C void CreateTabGroupL( + TUid aActiveViewUid, + CArrayPtrFlat* aTabbedViews ); + + /** + * Removes the topmost tab group from navi pane. + */ + IMPORT_C void RemoveTabGroup(); + + public: // From MAknTabObserver + + /** + * See base class. + */ + IMPORT_C void TabChangedL( TInt aIndex ); + + protected: // New + + /** + * C++ default constructor. + */ + CGSTabHelper(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + private: // Data + + // Container for navigation control object. + CAknNavigationControlContainer* iNaviContainer; + + // Navigation decorator object. Created and owned. + CAknNavigationDecorator* iNaviDecorator; + + // Tab group. + CAknTabGroup* iTabGroup; + + // Pointer to App UI. Not owned. + CAknViewAppUi* iAppUi; + + // Pointer to owner (parent) of the tabbed views. + MGSTabbedViewOwner* iTabOwner; + }; + +#endif // GSTABHELPER_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/GSTabbedView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSTabbedView.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Header file for MGSTabbedView class. +* +*/ + + +#ifndef GSTABBEDVIEW_H +#define GSTABBEDVIEW_H + +#include + +class CGulIcon; + +/** +* Interface to be used when creating tab groups. Used by CGSTabHelper. +* +*/ +class MGSTabbedView + { + public: // New + + /** + * Creates new icon for tab. Ownership is transferred to client. + */ + virtual CGulIcon* CreateTabIconL() = 0; + + /** + * UID of the tab. + */ + virtual TUid Id() const = 0; + + }; + +#endif // GSTABBEDVIEW_H +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/GSTabbedViewOwner.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSTabbedViewOwner.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for MGSTabbedViewOwner class. +* +*/ + + +#ifndef GSTABBEDVIEWOWNER_H +#define GSTABBEDVIEWOWNER_H + +#include + +class CGSPluginInterface; + +/** +* Interface for MGSTabbedView owner class. Views owning tabbed sub-views +* implement this. +*/ +class MGSTabbedViewOwner + { + public: + /** + * @return Reference to owned tabbed views which should be included in + * the sub-view's tab group. + */ + virtual CArrayPtrFlat* TabbedViews() = 0; + + /** + * Parent view implements this to handle switching tabs. This is needed + * in case parent view needs to update selected item index according to + * tab selection. + * + * @param selectedTabUid UID of the selected tab item. + */ + virtual void TabChangedL( TUid selectedTabUid ) = 0; + }; + +#endif // GSTABBEDVIEWOWNER_H +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/GeneralSettingsVariant.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GeneralSettingsVariant.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef GENERALSETTINGSVARIANT_HRH +#define GENERALSETTINGSVARIANT_HRH + +/** +* EGSConfigOTAAutoUpdate is on/off setting for Automatic update of service. +* When it is set on in TGeneralSettingsLocalVariantFlags OTA is enabled. +*/ +#define EGSConfigOTAAutoUpdate 0x00000001 + +/** +* EGSConfigAutoRedial is on/off setting for Automatic redial. +* When it is set on in TGeneralSettingsLocalVariantFlags +* automatic redial is enabled. +*/ +#define EGSConfigAutoRedial 0x00000002 + +/** +* EGSConfig2G3GNetworkIcon is on/off setting for 2G/3G network icon display. +* When it is set ON in KGeneralSettingsLVFlags +* display of 2G/3G icon in network selection list is enabled. +* Used in GSM/WCDMA builds ONLY. +*/ +#define EGSConfig2G3GNetworkIcon 0x00000004 + +/** +* EGSConfigPowerSaveLed is on/off setting for Power Save LED mode setting. +* When it is set ON in KGeneralSettingsLVFlags +* Power Save LED mode item is displayed in the Display settings. +*/ +#define EGSConfigPowerSaveLed 0x00000008 + +/** +* EGSConfigRestrictedSendCallerId is on/off setting for Restricted Send +* Caller ID setting. +* When it is set ON in KGeneralSettingsLVFlags +* Send Caller ID "Set by network" mode item is hidden in the Call settings. +*/ +#define EGSConfigRestrictedSendCallerId 0x00000010 + +/** +* EGSConfigSecureSendCallerId is on/off setting for Secure Send Caller ID +* setting. +* When it is set ON in KGeneralSettingsLVFlags +* Send Caller ID mode item can only be changed in the Call settings +* if a valid security code is entered. +*/ +#define EGSConfigSecureSendCallerId 0x00000020 + +/** +* EGSConfigNoAutoToAutoNetworkSearch is on/off setting for Network search when +* the network selection setting is Automatic and the user selects Automatic +* again. This contradicts the Telefonica request that this should be disabled. +* +* If this value is set, auto-to-auto net search is disabled == Telefonica. +* +* Default: Automatic to Automatic Network search is enabled = 0. +*/ +#define EGSConfigNoAutoToAutoNetworkSearch 0x00000040 + +/** +* EGSConfigOperatorIdle is on/off setting for enabling Operator Idle when +* this is been supported by the operator. +* If this value is set, The user can use the Operator Idle +* instead of Active Idle. +* This feature is Operator Specific +*/ +#define EGSConfigOperatorIdle 0x00000080 + + +#endif // GENERALSETTINGSVARIANT_HRH + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/MGSSettingPSObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/MGSSettingPSObserver.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Observer interface for indicating publish and subscribe +* setting changes +* +*/ + + + + +#ifndef MGSSETTINGPSOBSERVER_H +#define MGSSETTINGPSOBSERVER_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* Observer interface for indicating setting changes +* +* @lib GSTelPlugin +* @since 3.1 +*/ +class MGSSettingPSObserver + { + public: // New functions + + /** + * Handler for setting changed event + * @param aUid uid of setting + * @param aId id of setting + * @param aStatus status of completed AO operation + */ + virtual void HandleNotifyPSL( const TUid aUid, const TInt& aKey, + const TRequestStatus& aStatus ) = 0; + }; + +#endif // MGSSETTINGPSOBSERVER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/inc/MGSWatchDog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/inc/MGSWatchDog.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef GSWATCHDOG_INTERFACE_H +#define GSWATCHDOG_INTERFACE_H + +// System includes +#include + +#ifdef _DEBUG + #define GS_ENABLE_WATCH_DOG +#endif + + +// CONSTANTS + +// CLASS DECLARATION + +/** +* MGSWatchDog is responsible for quarantining plugins and updating blacklist +* for crashing GS plugins. This is the class responsible for keeping GS +* application functional even if some plugin to panics all the time. +* +* This is the interface for GSWatchDog. Client has no need to know the actual +* implementation as it is owned by GS application. +* +* @since Series60_3.2 +*/ +class MGSWatchDog + { + public: // New + + /** + * Adds plugin to quarantine. In case GS crashes, quarantined plugin + * will be blacklisted so it is not loaded in next GS run. Same plugin + * can be quarantined multiple times or even have several uid instances + * in quarantine if needed as long as all these are removed + * correspondingly. + * + * NOTE: Plugin must ALWAYS be removed from quarantine after plugin's + * function execution. + * 1. QuarantineL(). + * 2. Call quarantined plugin function. + * 3. RemoveFromQuarantineL(). + * + * @param aPluginUid uid of the quarantined plugin. + */ + virtual void QuarantineL( TUid aPluginUid ) = 0; + + /** + * Removes plugin from quarantine. In case plugin is not removed from + * quarantine before GS exits, the plugin will be blacklisted during + * next GS startup. + * + * @param aPluginUid uid of the plugin to be removed from quarantine. + */ + virtual void RemoveFromQuarantineL( TUid aPluginUid ) = 0; + + /** + * @return ETrue if GS exited cleanly last time. + * EFalse if GS crashed during last execution. + */ + virtual TBool WasCleanExitL() = 0; + + /** + * This must be called in all the cases GS exits normally. If GS panics, + * this will not be called resulting in banning of all quarantined + * plugins.Increments iRunsAfterCrash counter for blacklisted plugins. + * Sets iGSAppRunning to EFalse. + */ + virtual void ReportCleanExitL() = 0; + + /** + * Checks if plugin is in blacklist. This can be used to determine if + * plugin should be loaded. + * + * @return ETrue in case plugin is in blacklist and should not be loaded. + * EFalse in case plugin should not be loaded + */ + virtual TBool IsInBlackList( TUid aPluginUid ) = 0; + + }; + +#endif // GSWATCHDOG_INTERFACE_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/loc/gs.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/loc/gs.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Common localization strings for General Settings +* +*/ + + + +// LOCALISATION STRINGS + +// **OPTIONS MENU + +//d:Command in Options list +//d:Opens the highlighted item +//l:list_single_pane_t1_cp2 +//w: +//r: 3.1 +// +#define qtn_set_options_open "Open" + +//d:Command in Options list +//d:Opens value changing dialog of highlighted item +//l:list_single_pane_t1_cp2 +//w: +//r: 3.1 +// +#define qtn_set_options_change "Change" + +// **IMAGE LOADING WAIT NOTE + +//d:Text for image loading wait note +//d:Shown when welcome note image or background image has been selected from image list +//l:popup_note_wait_window +//w: +//r:3.1 +// +#define qtn_set_loading_image "Loading the image..." + + +// **IMAGE ERROR INFORMATION NOTES + +//d:Text for image corrupted information note +//d:Shown when selected background or welcome note image is corrupted or in wrong format. +//l:popup_note_window +//w: +//r:3.1 +// +#define qtn_set_image_format_wrong "Image is corrupted or in wrong format. Can not be selected." + +//d:Text for image too large information note +//d:Shown when selected background or welcome note image is too large to be opened +// in memory +//l:popup_note_window +//w: +//r:3.1 +// +#define qtn_set_image_too_large "Image size is too large. Image can not be selected." + + +// End of File + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/settings_framework_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/settings_framework_api.metaxml Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,18 @@ + + + Settings Framework API + Loads device settings plug-ins. Provides extensions & utilities for plugins. + c++ + gssettingsuis + + + + + + + + + no + no + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/tsrc/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +../../../../gssettingsuis/Gs/tsrc/public/basic/group/MT_GSFramework.mmp +gnumakefile settings_framework_api.mk + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_framework_api/tsrc/group/settings_framework_api.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_framework_api/tsrc/group/settings_framework_api.mk Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,41 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + del \epoc32\RELEASE\winscw\udeb\Z\sys\bin\MT_GSFramework.dll /f + +LIB : do_nothing + +CLEANLIB : do_nothing + +RESOURCE : do_nothing + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : do_nothing + +FINAL : + echo COPYING + copy \epoc32\RELEASE\winscw\udeb\MT_GSFramework.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /y diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_launch_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_launch_api/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: File that exports the files belonging to +: Settings Launch API +* +*/ + + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/GSLauncher.h MW_LAYER_PLATFORM_EXPORT_PATH(gslauncher.h) + diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_launch_api/inc/GSLauncher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_launch_api/inc/GSLauncher.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Launches GS views. +* +*/ + + + + +#ifndef C_GSLAUNCHER_H +#define C_GSLAUNCHER_H + +#include +#include +#include + + + +class CGSLauncherExtension; +/** + * Launches general settings with specific plug-in opened. + * Using this API, a client may request a general settings view to be shown. + * Implementation will launch general settings if it is not yet running. + * + * Example usage of the interface: + * @code + * CGSLauncher* l = CGSLauncher::NewLC(); + * l->LaunchGSViewL ( yourPluginUid, TUid::Uid(0), KNullDesC8 ); + * CleanupStack::PopAndDestroy(l); + * @endcode + * + * @lib gslauncher.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS(CGSLauncher) : public CBase + { + +public: + + /** + * Two-phased constructors. + */ + IMPORT_C static CGSLauncher* NewL(); + + IMPORT_C static CGSLauncher* NewLC(); + + + /** + * Destructor. + */ + virtual ~CGSLauncher(); + + /** + * Launches general settings with specific plug-in activated. + * Launching of plug-in's local views is not supported. + * General settings application is started if it's not running. + * Any application embedded into general settings will be closed. + * + * Needs capability: SwEvent + * + * @since S60 5.0 + * @param aTarget Target plug-in's view id. (CAknView::Id()) + * @param aCustomMessageId For client data. Passed to the plug-in. + * @param aCustomMessage For client data. Passed to the plug-in. + * @return none + */ + IMPORT_C void LaunchGSViewL( const TUid aTarget,const TUid aCustomMessageId + ,const TDesC8& aCustomMessage ); + + +protected: + +private: + + CGSLauncher(); + + void ConstructL(); + +private: // data + CGSLauncherExtension* iExt; + }; + +#endif // C_GSLAUNCHER_H diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_launch_api/settings_launch_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_launch_api/settings_launch_api.metaxml Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,15 @@ + + +Settings launch API +Launches general settings with spesific view opened. + +c++ +gssettingsuis + + + + +no +no + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_launch_api/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_launch_api/tsrc/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +../../../../gssettingsuis/Gs/tsrc/public/basic/group/MT_CGSLauncher.mmp +gnumakefile settings_launch_api.mk + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_launch_api/tsrc/group/settings_launch_api.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_launch_api/tsrc/group/settings_launch_api.mk Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,41 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + del \epoc32\RELEASE\winscw\udeb\Z\sys\bin\MT_CGSLauncher.dll /f + +LIB : do_nothing + +CLEANLIB : do_nothing + +RESOURCE : do_nothing + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : do_nothing + +FINAL : + echo COPYING + copy \epoc32\RELEASE\winscw\udeb\MT_CGSLauncher.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /y diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_listbox_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_listbox_api/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: File that exports the files belonging to +: Settings listbox API +* +*/ + + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/GSListBox.h MW_LAYER_PLATFORM_EXPORT_PATH(gslistbox.h) diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_listbox_api/inc/GSListBox.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_listbox_api/inc/GSListBox.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,257 @@ +/* +* Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* class description for CGSListBox & CGSListBoxItemTextArray. +* +*/ + + + +#ifndef GS_LIST_BOX_H +#define GS_LIST_BOX_H + +#include +#include +#include +#include + +class CAknRadioButtonSettingPage; +class CEikListBox; + + +/*================================================ +* CGSListboxEntry: class to map feature->item index when selected +* from a listbox. This is required when there are features which are +* dynamically shown/hidden. +================================================*/ +class CGSListboxEntry : public CBase + { + public: + IMPORT_C static CGSListboxEntry* NewLC( TResourceReader& aReader ); + IMPORT_C static CGSListboxEntry* NewLC( TInt aFeatureId ); + IMPORT_C static CGSListboxEntry* NewLC( + TUint32 aResId, CCoeEnv& aEnv, TInt aFeatureId ); + IMPORT_C ~CGSListboxEntry(); + + public: // Accessors + IMPORT_C TInt FeatureId() const; + IMPORT_C const TDesC& Caption() const; + IMPORT_C TInt Type() const; + + public: // Manipulators + IMPORT_C void SetDynamicTextL( const TDesC& aText ); + IMPORT_C void SetDynamicTextDoublePaneL( const TDesC& aText ); + + private: + CGSListboxEntry(); + void ConstructL( TResourceReader& aReader ); + void ConstructL( TUint32 aResId, CCoeEnv& aEnv, TInt aFeatureId ); + + private: + inline TInt StaticTextLength() const { return iStaticTextLength; } + + private: + + /** + * The length of the static text which does not change + */ + TInt iStaticTextLength; + + /** + * The static text and dynamic text combined. We can always + * change the dynamic part due to the fact that we know + * the length (prefix) of the static part. + */ + HBufC* iCaption; + + /** + * One of either EGSListBoxItemTypeIsAlwaysVisible or + * EGSListBoxItemTypeIsDynamic + */ + TInt iType; + + /** + * The id of this feature + */ + TInt iFeatureId; + + /** + * Maximum Length of the Dynamic text which doesnot change.. + * This has been added after inclusion Double Pane List Box + */ + TInt iDynamicTextSize; + }; + + + +/*================================================ +================================================*/ +class CGSItemTextArray : public CBase, public MDesCArray + { + public: + enum TVisibility + { + EInvisible = 0, + EVisible = 1 + }; + + public: + IMPORT_C static CGSItemTextArray* NewL( + TUint32 aResId, + CCoeEnv& aEnv ); + ~CGSItemTextArray(); + + protected: + CGSItemTextArray(); + void ConstructL( TUint32 aResId, CCoeEnv& aEnv ); + void ConstructL( TUint32 aResId, CCoeEnv& aEnv, TInt aCount ); + + public: // From MDesCArray + IMPORT_C TInt MdcaCount() const; + IMPORT_C TPtrC MdcaPoint( TInt aIndex ) const; + + public: // API + + /** + * Used to add dynamic text to the end of an existing model item + */ + IMPORT_C void SetDynamicTextL( TInt aFeatureId, + const TDesC& aAdditionalText ); + + /** + * Used to add dynamic text to the end of an existing model item + * When Double Pane List box is used CAknDoubleStyleListBox + */ + IMPORT_C void SetDynamicTextDoublePaneL( TInt aFeatureId, + const TDesC& aAdditionalText ); + + /** + * Specify that this item should be visible / invisible in the + * iCurrentlyDisplayedEntries array + */ + IMPORT_C void SetItemVisibilityL( TInt aFeatureId, + TVisibility aVisibility ); + + /** + * Access the id of the currently selected feature + */ + IMPORT_C virtual TInt CurrentFeature() const; + + /** + * Set the currently selected feature id + */ + IMPORT_C TInt IndexForFeatureIdL(TInt aFeatureId) const; + + /** + * Returns the feature id corresponding to an index + */ + IMPORT_C TInt FeatureIdByIndex(TInt aIndex) const; + + /** + * + */ + IMPORT_C const CGSListboxEntry* FeatureByIdL( TInt aFeatureId ) const; + + /** + * + */ + IMPORT_C static HBufC* GetItemCaptionFromFeatureIdLC(TUint32 aResourceId, TInt aFeatureId, CCoeEnv& aCone); + + + private: + static TBool CompareEntries( const CGSListboxEntry& aLeft, + const CGSListboxEntry& aRight ); + + + protected: + + /** + * All the entries which may potentially be contained within the listbox + * model. This array is owned and destroyed by this class. + */ + RPointerArray< CGSListboxEntry > iAllEntries; + + /** + * The entries which are currently displayed within the listbox. These + * pointers are actually owned in the iAllEntries array and therefore + * this array must not be 'ResetAndDestroyed()' (but rather just Reset()) + * from within this class' destructor. + */ + RPointerArray< CGSListboxEntry > iCurrentlyDisplayedEntries; + }; + + +/*================================================ +================================================*/ +class CGSRadioButtonSettingPageItemTextArray : public CGSItemTextArray + { + public: + IMPORT_C static CGSRadioButtonSettingPageItemTextArray* NewL( + TUint32 aResId, + CCoeEnv& aEnv, + CAknRadioButtonSettingPage* aSettingPage = NULL + ); + + private: + CGSRadioButtonSettingPageItemTextArray( CAknRadioButtonSettingPage* aSettingPage ); + + public: // FROM CGSItemTextArray + IMPORT_C TInt CurrentFeature() const; + + public: // New API + IMPORT_C void SetRadioButtonSettingPage( CAknRadioButtonSettingPage& aPage ); + + private: + + /** + * Underlying setting page + */ + CAknRadioButtonSettingPage* iSettingPage; + }; + + + +/*================================================ +* CGSListBoxItemTextArray: This class acts as a wrapper class for +* CGSListboxEntry. Instance of this class is created from the +* calling function. +================================================*/ +class CGSListBoxItemTextArray : public CGSItemTextArray + { + public: + IMPORT_C static CGSListBoxItemTextArray* NewL( + TUint32 aResId, + CEikListBox& aListBox, + CCoeEnv& aEnv ); + IMPORT_C static CGSListBoxItemTextArray* NewL( + TUint32 aResId, + CEikListBox& aListBox, + CCoeEnv& aEnv, + TInt aCount ); + + private: + CGSListBoxItemTextArray( CEikListBox& aListBox ); + + public: // FROM CGSItemTextArray + IMPORT_C TInt CurrentFeature() const; + + private: + + /** + * Underlying listbox + */ + CEikListBox& iListBox; + }; + +#endif //GS_LIST_BOX_H diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_listbox_api/settings_listbox_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_listbox_api/settings_listbox_api.metaxml Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,18 @@ + + + Settings listbox API + Helper to show listbox in device settings plugins + c++ + gssettingsuis + + + + + + + + + no + no + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_listbox_api/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_listbox_api/tsrc/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +../../../../gssettingsuis/Gs/tsrc/public/basic/group/T_GSListBox.mmp +gnumakefile settings_listbox_api.mk + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_listbox_api/tsrc/group/settings_listbox_api.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_listbox_api/tsrc/group/settings_listbox_api.mk Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,41 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + del \epoc32\RELEASE\winscw\udeb\Z\sys\bin\T_GSBackgroundImage.dll /f + +LIB : do_nothing + +CLEANLIB : do_nothing + +RESOURCE : do_nothing + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : do_nothing + +FINAL : + echo COPYING + copy \epoc32\RELEASE\winscw\udeb\T_GSBackgroundImage.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /y diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: File that exports the files belonging to +: Settings Plugin API +* +*/ + + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/GSPluginInterface.h MW_LAYER_PLATFORM_EXPORT_PATH(gsplugininterface.h) +../inc/GSFWViewUIDs.h MW_LAYER_PLATFORM_EXPORT_PATH(gsfwviewuids.h) diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/inc/GSFWViewUIDs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/inc/GSFWViewUIDs.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View UIDs for GS FW +* These UIDs are used to identify the parent of the view/plugin. The same UID +* is used for both plugin and view identification. +* +*/ + + +#ifndef GSFWVIEWUIDS_H +#define GSFWVIEWUIDS_H + + +// Use this UID if plugin belongs to Main view: +const TUid KGSMainViewUid = { 0x1020723B }; + + +// No item is selected in the container's listbox +const TUid KGSNoneSelected = { 0x00000000 }; + +// UIDs used by the sub-view plugins: + +// Use this UID if plugin belongs to General view: +const TUid KGSGenPluginUid = { 0x10207237 }; + +// Use this UID if plugin belongs to Telephony view: +const TUid KGSTelPluginUid = { 0x1020723D }; + +// Use this UID if plugin belongs to Connection view: +const TUid KGSConPluginUid = { 0x10207250 }; + +// Use this UID if plugin belongs to Applications view: +const TUid KGSAppsPluginUid = { 0x10207239 }; + +// Use this UID if plugin belongs to Personalisation view: +const TUid KGSPrslnPluginUid = { 0x10207252 }; + +// Use this UID if plugin belongs to Security view: +const TUid KGSSecurityPluginUid = { 0x1020743A }; + +// Use this UID if plugin belongs to Standby view: +const TUid KGSStandbyPluginUid = { 0x1020743F }; + +// UID of General Settings application. +// This UID is used for accessing the help IDs controlled by GS help files +const TUid KUidGS = { 0x100058EC }; + +// Use this UID if plugin belongs to Packet Data: +const TUid KGSPDataPluginUid = { 0x1020724E }; + +// Use this UID if plugin belongs to Interaction: +const TUid KGSInteractionPluginUid = { 0x10283343 }; + +// Use this UID if plugin belongs to Administration: +const TUid KGSAdminPluginUid = { 0x10283341 }; + +// Use this UID if plugin belongs to Device Management: +const TUid KGSDeviceManagementPluginUid = { 0x10283317 }; + +// Use this UID if plugin belongs to Device Updates: +const TUid KGSDeviceUpdatesPluginUid = { 0x1028331B }; + +// Use this UID if plugin belongs to Synchronisation view: +const TUid KGSSynchronisationPluginUid = { 0x10283319 }; + +// Use this UID if plugin belongs to Installations view: +const TUid KGSInstallationsPluginUid = { 0x10283321 }; + +#endif // GSFWVIEWUIDS_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/inc/GSPluginInterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/inc/GSPluginInterface.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,420 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for CGSPluginInterface class. +* +*/ + + +#ifndef GSPLUGININTERFACE_H +#define GSPLUGININTERFACE_H + +// System includes +#include // For default icons +#include + +#include +#include +#include +#include +#include +#include + +// Constant for plugin interface: +const TUid KGSPluginInterfaceUid = { 0x10207236 }; + +// Constant for listbox icon type: +const TUid KGSIconTypeLbxItem = { 0x10207357 }; +// Constant for listbox settings item icon type: +const TUid KGSIconTypeLbxSettingsItem = { 0x102750C5 }; +// Constant for tab icon type: +const TUid KGSIconTypeTab = { 0x10207358 }; +// Constant for icon in D-Column: +const TUid KGSIconTypeDColumn = { 0x10207359 }; + + +// Constant for indexing (iOrder): +const TInt KGSPluginNotIndexed = -1; + +_LIT( KGSDefaultIconFileName, "Z:Gsfwicon.mbm" ); + +/** +* This enum is used for defining custom operations types. +*/ +enum TGSCustomOperationType + { + // This operation type returns current status of the plugin's view. + // If the plugin's view is active, ETrue will be returned, otherwise + // EFalse. Currently supported by GSStandbyPlugin. + EGSCustomOperationViewActive = 1 + }; + +/** +* Used by GetValue(). These are the keys for retrieving a specific +* value. This enum can be extended to provide other values as well as +* long as the original keys are not changed. +*/ +enum TGSPluginValueKeys + { + // Value for this key is the localized string to be shown in the second row + // of a listbox item. Plugins providing second row of text should provide + // value for this key. Second row of list item text is used for following + // listbox types: + // - EGSListBoxTypeSingleLarge + // - EGSListBoxTypeDouble2Large. + // For plugins listed in these listbox types, second row value can either + // be defined or left empty. + EGSPluginKeySettingsItemValueString = 1, + // Localized string to be used in case of custom MSK and menu activation + // item. See TGSMenuActivationItems. + EGSCustomMenuActivationText + }; + +/** +* Used by PluginItemType(). These enumerations define the desired appearance +* of the plugin in a parent plugin's listbox. Please notice that the parent +* listbox type cannot be altered by a child plugin so plugins using these must +* be aware of the parent plugin listbox type. Safest alternative is to leave +* default implementation for ItemType() in which case EGSItemTypeSingleLarge is +* used. This should fit most of the listbox types. Additionall types can be +* implemented and defined as long as the old enumerations will not be changed. +* +* Different type of items are handled differently: +* - In case of CAknView type items, such as EGSItemTypeSingleLarge and +* EGSItemTypeSetting, the plugin's DoActivate() is called when user selects +* the item. +* - In case of items supporting dialogs, such as EGSItemTypeSettingDialog and +* EGSItemTypeSettingIconDialog, HandleSelection() is called instead of +* DoActivate(). +* +* Item types can be described in a matrix: +* X: Normal list tems with large icon, +* settings items, +* settings items with icon +* Y: Items providing CAknView - activated by DoActivate(), +* items providing dialog - activated by HandleSelection() +* +* All combinations of these are not allowed/supported. +*/ +enum TGSListboxItemTypes + { + // CAknSingleLargeStyleListBox item: + // Caption of the item is a descriptor from GetCaptionL(). + // Icon is from CreateIconL( KGSIconTypeLbxItem ). + EGSItemTypeSingleLarge = 1, // Default + // CAknSettingStyleListBox item providing a CAknView: + // 1st row content is a descriptor from GetCaptionL() + // 2nd row content is a descriptor (can be empty string id needed) from + // GetValue( ..., EGSPluginKeySettingsItemValueString ). + EGSItemTypeSetting, + // CAknSettingStyleListBox item providing a CAknView: + // 1st row content is a descriptor from GetCaptionL() + // 2nd row content is a icon from CreateIconL( KGSIconTypeLbxSettingsItem ) + // GetValue(, EGSPluginKeySettingsItemValueString ). + EGSItemTypeSettingIcon, + // CAknSettingStyleListBox item launching a dialog: + // 1st row content is a descriptor from GetCaptionL() + // 2nd row content is a descriptor (can be empty string id needed) from + // GetValue( ..., EGSPluginKeySettingsItemValueString ). + EGSItemTypeSettingDialog, + // CAknSingleLargeStyleListBox item launching a dialog: + // Caption of the item is a descriptor from GetCaptionL(). + // Icon is from CreateIconL( KGSIconTypeLbxItem ). + EGSItemTypeSingleLargeDialog + }; + +/** +* These are used to define the type of the menu item which opens the selected +* plugin. By default, parent plugin's menu has 'Open' item for child plugins. +* If parent plugin's menu must have 'Change' instead of 'Open' for activating +* the plugin, use EGSMenuActivationItemChange. This functionality is just for +* the visual aspects for views in GS - requested by UI design. Plugins are +* handled logically similarly regardless this value. +*/ +enum TGSMenuActivationItems + { + // Default - will use the item defined in menu resource. + EGSMenuActivationItemDefault = 0, + // Menu should contain 'Open' Item. + EGSMenuActivationItemOpen = 1, + // Menu should contain 'Change' item. + EGSMenuActivationItemChange, + // Menu should contain custom text which is defined by GetValue() function: + // GetValue( EGSCustomMenuActivationText, ... ); + // NOTE: When this custom menu item is selected, used menu command ID is + // EGSCmdAppChange. This might be checked in for example plugin's + // HandleCommand(). If text is empy, MSK is empty and there's no + // corresponding item in options menu. + EGSMenuActivationItemCustom + }; + +/** +* Selection types. Used in HandleSelection(). +*/ +enum TGSSelectionTypes + { + // User selected the item by pressing selection key. + EGSSelectionBySelectionKey = 1, + // User selected the item by selecting a command from the menu. + EGSSelectionByMenu + }; + +/** +* Interface class for GS plugin. All GS plugins will implement this class. +* +* The main functionality GS framework will use from CAknView is: +* -DoActivate() +* -DoDeactivate() +* -Id() +* functions. +* +* Id() function must return the value of the plugin implementation UID. This +* means that the main view of the plugin will have the same UID as the plugin +* implementation. This will prevent multiple plugins from having same view +* UIDs as their main view. If plugin has more views, it is plugin's +* responsibility to ensure that the UIDs of the other views are unique. This +* can be done for example reserving a unique UID from Symbian. +* +* Most of the functions have implementation using default values. Override +* functions if different values or implementations are desired. +* +* CGSPluginInterface UID = 0x10207236 +* +* See GSFWViewUIDs.h for plugin UIDs. +* +* Plugin implementation UID will be used when defining the parent view of a +* plugin. If plugin belongs to application settings view, set the +* ApplicationSettingsView plugin implementation Uid as a value in the plugin's +* default_data field in plugin's implementation info resource file. +* +* Needed libraries (at least): +* GSEcomPlugin.lib +* GSFramework.lib +* egul.lib +* aknskins.lib +* efsrv.lib +* +* @lib GSFramework.lib +* @since Series60_3.1 +*/ +class CGSPluginInterface: public CAknView + { + + // CGSPluginLoader accesses iOrder which should not be accessed outside. + friend class CGSPluginLoader; + + public: // Constructors & destructors + + /** + * Creates new GS plugin having the given UID. + * Uses Leave code KErrNotFound if implementation is not found. + * + * @param aImplementationUid Implementation UID of the plugin to be + * created. + * @param aInitParams Plugin's initialization parameters. Make sure you know + * what the plugin expects as initialization parameters. This + * should be an agreement between the plugin client and the + * plugin. Parameter can be used for example as sharing a common + * data model between multiple plugins. + */ + IMPORT_C static CGSPluginInterface* NewL( + const TUid aImplementationUid, + TAny* aInitParams ); + + /** + * Destructor + */ + IMPORT_C ~CGSPluginInterface(); + + public: // New + + /** + * Method for getting caption of this plugin. This should be the + * localized name of the settings view to be shown in parent view. + * + * @param aCaption pointer to Caption variable + */ + virtual void GetCaptionL( TDes& aCaption ) const = 0; + + /** + * Function for getting plugin's value for a certain key. + * Override to provide own functionality. + * + * @param aKey Key for the value to be retrieved. + * @parem aValue Value for the given gey in TDes format. + */ + IMPORT_C virtual void GetValue( const TGSPluginValueKeys aKey, + TDes& aValue ); + + /** + * This function is called in case plugin is an item in a settings + * listbox and user selects the item. Override this if plugin needs to + * provide functionality for item selection. + * + * Default implementation activates the plugin. + * @param aSelectionType Defines how user selected the plugin. See + * TGSSelectionTypes. + */ + IMPORT_C virtual void HandleSelection( + const TGSSelectionTypes aSelectionType ); + + /** + * This defines the appearance of the plugin in a parent plugin listbox. + * Default value is EGSItemTypeSingleLarge. Please notice that the + * parent listbox type cannot be defined by a child plugin so plugins + * using these must be aware of the parent plugin listbox type. + * + * @return Desired listbox presentation and functional type for the + * plugin. + */ + IMPORT_C virtual TGSListboxItemTypes ItemType(); + + /** + * This function is only used for child plugins. Defines the dynamic + * menu item that activates this plugin from parent plugin. This menu + * item will override the item defined in resource file. Normally + * 'Open' is used to open the child plugin. Override this to change the + * activation to for example 'Change'. TGSMenuActivationItems defines the + * different possible menu items that can be used to open this plugin. + * + * Note: This also defines MSK. Menu activation item and MSK have + * identical label and behaviour. An exception to this is + * when custom text is empty: in this case MSK is empty but there + * is no item in options menu (no empty item in menu). + * + * @ return Type of the menu item and MSK that should activate this + * child plugin from parent plugin. + */ + IMPORT_C virtual TGSMenuActivationItems MenuActivationItem(); + + /** + * Creates a new icon of desired type. Override this to provide custom + * icons. Othervise default icon is used for KGSIconTypeLbxItem. Other + * icons are empty. Ownership of the created icon is transferred to the + * caller. + * NOTE: Return NULL if icon is not to be displayed. + * + * Icon type UIDs (use these defined constants): + * KGSIconTypeLbxItem - ListBox item icon. + * KGSIconTypeLbxSettingsItem - Settings item icon. + * KGSIconTypeTab - Tab icon. + * KGSIconTypeDColumn - Small icon in D-column. + * + * @param aIconType UID Icon type UID of the icon to be created. + * @return Pointer of the icon or NULL. + */ + IMPORT_C virtual CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * Method for reading the ID of the plugin provider category. See + * TGSPluginProviderCategory. PluginProviderCategory can be used for + * sorting plugins. + * + * Default value is EGSPluginProvider3rdParty. Override this function + * to change the category. + * + * @return Plugin provider category ID defined by + * TGSPluginProviderCategory + */ + IMPORT_C virtual TInt PluginProviderCategory() const; + + /** + * Reserved for future use/plugin's custom functionality. This can be + * overwritten if plugin needs to have custom functionality which cannot + * be fulfilled otherwise. + * + * Use TGSCustomOperationType enumeration as aParam1 to + * define operation type. + */ + IMPORT_C virtual TAny* CustomOperationL( TAny* aParam1, TAny* aParam2 ); + + /** + * Method for checking, if plugin should be visible and used in GS FW. + * (for example shown in listbox of the parent view). + * + * On default plugin is visible. Overwrite this function to enable or + * disable your plugin dynamically. + * + * @return ETrue if plugin should be visible in GS. + * @return EFalse if plugin should not be visible in GS. + */ + IMPORT_C virtual TBool Visible() const; + + /** + * Resets plugin's selected item index if this is supported. Default + * implementation does nothing. This is needed when navigating from + * child plugin back to parent plugin. In this case child plugin should + * reset selected index in its listbox. + */ + IMPORT_C virtual void ResetSelectedItemIndex(); + + /** + * Sets the Index of the plugin in listbox. Used for CGSPluginLoader. Default + * value is KGSPluginNotIndexed which means not ordered. This value is + * read, if defined, from the opaque_data field of the plugin's resource + * definition. Index starts from 0. + */ + IMPORT_C void SetOrder( TInt aOrder ); + + /** + * In case plug-in is loaded outside GS application and CGSPluginLoader, + * cleaning up plug-in's ECOM resources must be done manually. + * + * Example: + * CGSPluginInterface* myPlugin = CGSPluginInterface::NewL(...); + * REComSession::DestroyedImplementation( myPlugin->GetEcomDestructorKey() ); + * delete myPlugin; + * + * @return UID of the plug-in instance which can be used to free dependent ECOM resources. + */ + IMPORT_C TUid GetEcomDestructorKey(); + + protected: // New + + /** + * C++ constructor. + */ + IMPORT_C CGSPluginInterface(); + + public: // Enumerations + + /** + * Category of the plugin provider. Provider's type affects the sorting + * of the plugins. Type EGSPluginProvider3rdParty plugins are allowed + * to be loaded only by Applications-plugin. Other categories may exist + * but they should be used only internally. + **/ + enum TGSPluginProviderCategory + { + EGSPluginProviderOEM = 1, + EGSPluginProviderOperator = 2, + EGSPluginProvider3rdParty = 3 + }; + + private: // Data + + // ECOM plugin instance UID. + TUid iDtor_ID_Key; + + /** + * Index of the plugin in listbox. Used for CGSPluginLoader. Default + * value is KGSPluginNotIndexed which means not ordered. This value is + * read, if defined, from the opaque_data field of the plugin's resource + * definition. Index starts from 0. + */ + TInt iOrder; + + }; + +#endif // GSPLUGININTERFACE_H +//End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/settings_plugin_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/settings_plugin_api.metaxml Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,18 @@ + + + Settings Plugin API + API for the device settings plug-ins. + c++ + gssettingsuis + + + + + + + + + no + no + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/bwins/SettingsPluginApiTestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/bwins/SettingsPluginApiTestu.def Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &) + diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/conf/tcSettingsPluginApiTest.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/conf/tcSettingsPluginApiTest.cfg Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,21 @@ +#1 +[Test] +title GetValue +run testscripter c:\testframework\ui_SettingsPluginApiTest.cfg 1 +[Endtest] +#2 +[Test] +title MenuActivationItem +run testscripter c:\testframework\ui_SettingsPluginApiTest.cfg 2 +[Endtest] +#3 +[Test] +title Visible +run testscripter c:\testframework\ui_SettingsPluginApiTest.cfg 3 +[Endtest] +#4 +[Test] +title ResetSelectedItemIndex +run testscripter c:\testframework\ui_SettingsPluginApiTest.cfg 4 +[Endtest] + diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/conf/ui_SettingsPluginApiTest.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/conf/ui_SettingsPluginApiTest.cfg Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,31 @@ +#1 +[Test] +title CallGetValueL +create SettingsPluginApiTest foobar +foobar CallGetValueL +delete foobar +[Endtest] +#2 +[Test] +title CallMenuActivationItemL +create SettingsPluginApiTest foobar +foobar CallMenuActivationItemL +delete foobar +[Endtest] +#3 +[Test] +title CallVisibleL +create SettingsPluginApiTest foobar +foobar CallVisibleL +delete foobar +[Endtest] +#4 +[Test] +title CallResetSelectedItemIndexL +create SettingsPluginApiTest foobar +foobar CallResetSelectedItemIndexL +delete foobar +[Endtest] + + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/eabi/SettingsPluginApiTestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/eabi/SettingsPluginApiTestu.def Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,5 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + _ZTI13CTestGSPlugin @ 2 NONAME ; ## + _ZTV13CTestGSPlugin @ 3 NONAME ; ## + diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Personalisation application localised resource IBY +* +*/ + + +/* +----------------------------------------------------------------------------- + + DESCRIPTION + + stiftestframework_SettingsPluginApiTest.iby file specifies needed test components for + ROM image + +----------------------------------------------------------------------------- +*/ + +#ifndef SETTINGSPLUGINAPITEST__IBY +#define SETTINGSPLUGINAPITEST__IBY + +file=ABI_DIR\BUILD_DIR\SettingsPluginApiTest.DLL SHARED_LIB_DIR\SettingsPluginApiTest.DLL + +data=\epoc32\data\z\system\data\testframework_SettingsPluginApiTest.ini testframework\testframework_SettingsPluginApiTest.ini + +data=\epoc32\data\z\system\data\tcSettingsPluginApiTest.cfg testframework\tcSettingsPluginApiTest.cfg + +data=\epoc32\data\z\system\data\ui_SettingsPluginApiTest.cfg testframework\ui_SettingsPluginApiTest.cfg + +#endif // SETTINGSPLUGINAPITEST__IBY \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification file of DasClientApiTest +* +*/ + + +#include +#include + +TARGET SettingsPluginApiTest.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E3 + +CAPABILITY ALL -TCB + +DEFFILE SettingsPluginApiTest.def + + +#ifdef SBSV2 + USERINCLUDE ../inc + + APP_LAYER_SYSTEMINCLUDE + + SOURCEPATH ../src +#else // SBSV2 not defined +USERINCLUDE ..\inc + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ..\src +#endif // SBSV2 + +SOURCE SettingsPluginApiTest.cpp +SOURCE SettingsPluginApiTestblocks.cpp +SOURCE TestGSPlugin.cpp + +LIBRARY euser.lib +LIBRARY stiftestinterface.lib +LIBRARY stiftestengine.lib +LIBRARY avkon.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY eiksrv.lib +LIBRARY GSFramework.lib +LIBRARY GSEcomPlugin.lib + +LANG SC + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.pkg Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,63 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: Installation file for STIF +; +; +; +; +; Installation file for STIF +; + +; Languages +&EN + +; Provide value for uid +#{"STIF"},(0x00000000),1,1,0,TYPE=SA + +; Series60 product id for S60 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Logo +; None + +; Package signature - Optional +; None + +; Start of Package body + +; Condition blocks +; None + +; Options list +; None + +; Install files +"\epoc32\release\armv5\udeb\SettingsPluginApiTest.dll" - "!:\Sys\Bin\SettingsPluginApiTest.dll" +"\epoc32\winscw\c\SettingsPluginApiTest.bat"-"!:\SettingsPluginApiTest.bat" +; Embedded SIS +; None + +; End of Package body + +; PKG dependencies +; None + +; PKG capabilities +; None diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project SettingsPluginApiTest +* +*/ + + + +PRJ_PLATFORMS +// specify the platforms your component needs to be built for here +// defaults to WINS MARM so you can ignore this if you just build these +DEFAULT + + +#ifdef SBSV2 + PRJ_TESTEXPORTS + SettingsPluginApiTest.iby /epoc32/rom/include/SettingsPluginApiTest.iby + ../init/SettingsPluginApiTest.bat /epoc32/winscw/c/SettingsPluginApiTest.bat + + ../init/testframework_SettingsPluginApiTest.ini /epoc32/data/z/system/data/testframework.ini + ../init/testframework_SettingsPluginApiTest.ini /epoc32/winscw/c/TestFramework/testframework.ini + ../init/testframework_SettingsPluginApiTest.ini /epoc32/wins/c/TestFramework/testframework.ini + + ../conf/ui_SettingsPluginApiTest.cfg /epoc32/winscw/c/TestFramework/ui_SettingsPluginApiTest.cfg + ../conf/ui_SettingsPluginApiTest.cfg /epoc32/data/z/system/data/ui_SettingsPluginApiTest.cfg + ../conf/ui_SettingsPluginApiTest.cfg /epoc32/wins/c/ui_SettingsPluginApiTest.cfg + + ../conf/tcSettingsPluginApiTest.cfg /epoc32/wins/c/TestFramework/tcSettingsPluginApiTest.cfg + ../conf/tcSettingsPluginApiTest.cfg /epoc32/data/z/system/data/tcSettingsPluginApiTest.cfg + ../conf/tcSettingsPluginApiTest.cfg /epoc32/winscw/c/TestFramework/tcSettingsPluginApiTest.cfg + +#else // SBSV2 not defined + PRJ_TESTEXPORTS + + SettingsPluginApiTest.iby \epoc32\rom\include\SettingsPluginApiTest.iby + ..\init\SettingsPluginApiTest.bat \epoc32\winscw\c\SettingsPluginApiTest.bat + + ..\init\testframework_SettingsPluginApiTest.ini \epoc32\data\z\system\data\testframework.ini + ..\init\testframework_SettingsPluginApiTest.ini \epoc32\winscw\c\TestFramework\testframework.ini + ..\init\testframework_SettingsPluginApiTest.ini \epoc32\wins\c\TestFramework\testframework.ini + + ..\conf\ui_SettingsPluginApiTest.cfg \epoc32\winscw\c\TestFramework\ui_SettingsPluginApiTest.cfg + ..\conf\ui_SettingsPluginApiTest.cfg \epoc32\data\z\system\data\ui_SettingsPluginApiTest.cfg + ..\conf\ui_SettingsPluginApiTest.cfg \epoc32\wins\c\ui_SettingsPluginApiTest.cfg + + ..\conf\tcSettingsPluginApiTest.cfg \epoc32\wins\c\TestFramework\tcSettingsPluginApiTest.cfg + ..\conf\tcSettingsPluginApiTest.cfg \epoc32\data\z\system\data\tcSettingsPluginApiTest.cfg + ..\conf\tcSettingsPluginApiTest.cfg \epoc32\winscw\c\TestFramework\tcSettingsPluginApiTest.cfg + +#endif // SBSV2 + +PRJ_EXPORTS + +PRJ_TESTMMPFILES +SettingsPluginApiTest.mmp + +PRJ_MMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/inc/SettingsPluginApiTest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/inc/SettingsPluginApiTest.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,159 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of class CSettingsPluginApiTest +* +*/ + + +#ifndef C_SETTINGSPLUGINAPITEST_H +#define C_SETTINGSPLUGINAPITEST_H + +// INCLUDES +#include +#include +#include +#include +#include +#include + +#include "TestGSPlugin.h" + +// MACROS +#define TEST_CLASS_VERSION_MAJOR 0 +#define TEST_CLASS_VERSION_MINOR 0 +#define TEST_CLASS_VERSION_BUILD 0 +// User MACROS +#define KErrGeneral -2 +#define KFirstOption 1 +#define KSecondtOption 2 + +//define client flags +#define KFlagNoObserver 1 +#define KFlagReserved1 2 +#define KFlagReserved2 4 +// Logging path +_LIT( KSettingsPluginApiTestLogPath, "\\logs\\testframework\\SettingsPluginApiTest\\" ); +// Log file +_LIT( KSettingsPluginApiTestLogFile, "SettingsPluginApiTest.txt" ); +_LIT( KSettingsPluginApiTestLogFileWithTitle, "SettingsPluginApiTest_[%S].txt" ); + +// +/** +* CSettingsPluginApiTest test class for STIF Test Framework TestScripter. +* @since S60 5.0 +*/ + +NONSHARABLE_CLASS(CSettingsPluginApiTest) : public CScriptBase/*,public MAknServerAppExitObserver*/ + { +public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CSettingsPluginApiTest* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~CSettingsPluginApiTest(); + +/*private: + //function from MAknServerAppExitObserver. is used to handle the exit of the server. + + void HandleServerAppExit(TInt aReason);*/ + +public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @since S60 5.0 + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + +private: + + /** + * C++ default constructor. + */ + CSettingsPluginApiTest( CTestModuleIf& aTestModuleIf ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Frees all resources allocated from test methods. + * @since S60 5.0 + */ + void Delete(); + + /** + * Test method. + * @since S60 5.0 + * @param aItem Script line containing parameters. + * @return Symbian OS error code. + */ + + TInt SetupCGSParentPluginL(); + + virtual TInt CallGetValueL( CStifItemParser& aItem ); + + virtual TInt CallMenuActivationItemL( CStifItemParser& aItem ); + + virtual TInt CallVisibleL( CStifItemParser& aItem ); + + virtual TInt CallResetSelectedItemIndexL( CStifItemParser& aItem ); + + /** + * Method used to log version of test class + */ + void SendTestClassVersion(); + + /** + * Turn off ScreenSaver + * @since S60 5.0 + * @return Symbian OS error code. + */ + void TurnOffScreenSaver(); + + /** + * Restore ScreenSaver + * @since S60 5.0 + * @return Symbian OS error code. + */ + void RestoreScreenSaver(); + +private: // Data + + /** + * ScreenSaver Property + */ + TInt iOldScreenSaverProperty; + + CTestGSPlugin* iTestGsPlugin; + + /** + * description_of_pointer_member + * Not own. + */ + CGSPluginInterface* iGSPluginInterface; + + }; + +#endif // C_SETTINGSPLUGINAPITEST_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/inc/TestGSPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/inc/TestGSPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef TESTGSPLUGIN_H +#define TESTGSPLUGIN_H + +// INCLUDES +#include + + + +// CLASS DECLARATION + +class CTestGSPlugin : public CGSParentPlugin + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static CTestGSPlugin* NewL(); + static CTestGSPlugin* NewLC(); + /** + * Destructor + */ + ~CTestGSPlugin(); + + + public: + + void GetCaptionL( TDes& aCaption ) const; + + TUid Id() const; + + private: // Constructors and destructors + + CTestGSPlugin(); + void ConstructL(); + + }; + +#endif // TESTGSPLUGIN_H +// End of File \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/init/SettingsPluginApiTest.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/init/SettingsPluginApiTest.bat Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,21 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +md e:\bctest +md e:\bctest\Results + +ATSINTERFACE.EXE -testmodule testcombiner -config C:\TestFramework\uiSettingsPluginApiTest.cfg +copy c:\Logs\TestFramework\TestReport.txt e:\bctest\results\SETTINGS_TEST.txt \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/init/testframework_SettingsPluginApiTest.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/init/testframework_SettingsPluginApiTest.ini Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,181 @@ +# +# This is STIFTestFramework initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set following test engine settings: +# - Set Test Reporting mode. TestReportMode's possible values are: +# + 'Summary': Summary of the tested test cases. +# + 'Environment': Hardware and software info. +# + 'TestCases': Test case report. +# + 'FullReport': Set of all above ones. +# + Example 'TestReportMode= Summary TestCases' +# +# - CreateTestReport setting controls report creation mode +# + YES, Test report will created. +# + NO, No Test report. +# +# - File path indicates the base path of the test report. +# - File name indicates the name of the test report. +# +# - File format indicates the type of the test report. +# + TXT, Test report file will be txt type, for example 'TestReport.txt'. +# + HTML, Test report will be html type, for example 'TestReport.html'. +# +# - File output indicates output source of the test report. +# + FILE, Test report logging to file. +# + RDEBUG, Test report logging to using rdebug. +# +# - File Creation Mode indicates test report overwriting if file exist. +# + OVERWRITE, Overwrites if the Test report file exist. +# + APPEND, Continue logging after the old Test report information if +# report exist. + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: + # 'Summary', 'Environment', 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= C:\LOGS\TestFramework\ +TestReportFileName= TestReport + +TestReportFormat= TXT # Possible values: TXT or HTML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND +UITestingSupport= Yes +SeparateProcesses= YES +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Module configurations start +# Modules are added between module tags +# tags. Module name is specified after ModuleName= tag, like +# ModuleName= SettingsPluginApiTest +# Modules might have initialisation file, specified as +# IniFile= YYYYYY +# Modules might have several configuration files, like +# TestCaseFile= NormalCases.txt +# TestCaseFile= SmokeCases.txt +# TestCaseFile= ManualCases.txt + +# (TestCaseFile is synonym for old term ConfigFile) + +# Following case specifies demo module settings. Demo module +# does not read any settings from file, so tags +# IniFile and TestCaseFile are not used. +# In the simplest case it is enough to specify only the +# name of the test module when adding new test module + +[New_Module] +ModuleName= testcombiner +TestCaseFile= c:\testframework\tcSettingsPluginApiTest.cfg +[End_Module] + +#[New_Module] +#ModuleName= testscripter +#TestCaseFile= c:\testframework\ui_SettingsPluginApiTest.cfg +#[End_Module] + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +#Load testmoduleSettingsPluginApiTest, optionally with initialization file and/or test case files +#[New_Module] +#ModuleName= testmodulexxx + +#TestModuleSettingsPluginApiTest used initialization file +#IniFile= init.txt + +#TestModuleSettingsPluginApiTest used configuration file(s) +#TestCaseFile= testcases1.cfg +#TestCaseFile= testcases2.cfg +#TestCaseFile= manualtestcases.cfg + +#[End_Module] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set STIFTestFramework logging overwrite parameters for Logger. +# Hardware and emulator environment logging path and styles can +# be configured from here to overwrite the Logger's implemented values. +# +# Settings description: +# - Indicates option for creation log directory/directories. If log directory/directories +# is/are not created by user they will make by software. +# + YES, Create log directory/directories if not allready exist. +# + NO, Log directory/directories not created. Only created one is used. +# +# - Overwrite emulator path setting. +# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined +# Logger's path 'D:\\LOGS\\Module\\' with those definition the path +# will be 'C:\LOGS\TestFramework\LOGS\Module\' +# +# - Overwrite emulator's logging format. +# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. +# + HTML, Log file(s) will be html type(s), for example 'Module.html'. +# +# - Overwrited emulator logging output source. +# + FILE, Logging to file(s). +# + RDEBUG, Logging to using rdebug(s). +# +# - Overwrite hardware path setting (Same description as above in emulator path). +# - Overwrite hardware's logging format(Same description as above in emulator format). +# - Overwrite hardware's logging output source(Same description as above in emulator output). +# +# - File Creation Mode indicates file overwriting if file exist. +# + OVERWRITE, Overwrites if file(s) exist. +# + APPEND, Continue logging after the old logging information if file(s) exist. +# +# - Will thread id include to the log filename. +# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. +# + NO, No thread id to log file(s), Example filename 'Module.txt'. +# +# - Will time stamps include the to log file. +# + YES, Time stamp added to each line in log file(s). Time stamp is +# for example'12.Nov.2003 115958 LOGGING INFO' +# + NO, No time stamp(s). +# +# - Will line breaks include to the log file. +# + YES, Each logging event includes line break and next log event is in own line. +# + NO, No line break(s). +# +# - Will event ranking include to the log file. +# + YES, Event ranking number added to each line in log file(s). Ranking number +# depends on environment's tics, for example(includes time stamp also) +# '012 12.Nov.2003 115958 LOGGING INFO' +# + NO, No event ranking. +# + +[Logger_Defaults] + +#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' + +CreateLogDirectories= YES # Possible values: YES or NO + +EmulatorBasePath= C:\LOGS\TestFramework\ +EmulatorFormat= HTML # Possible values: TXT or HTML +EmulatorOutput= FILE # Possible values: FILE or RDEBUG + +#HardwareBasePath= D:\LOGS\TestFramework\ +#HardwareFormat= HTML # Possible values: TXT or HTML +#HardwareOutput= FILE # Possible values: FILE or RDEBUG + +FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +#ThreadIdToLogFile= YES # Possible values: YES or NO +#WithTimeStamp= YES # Possible values: YES or NO +#WithLineBreak= YES # Possible values: YES or NO +#WithEventRanking= YES # Possible values: YES or NO + +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/SettingsPluginApiTest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/SettingsPluginApiTest.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,181 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of class CSettingsPluginApiTest +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include + +#include "SettingsPluginApiTest.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CSettingsPluginApiTest::CSettingsPluginApiTest +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CSettingsPluginApiTest::CSettingsPluginApiTest( CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ) + { + } + +// ----------------------------------------------------------------------------- +// CSettingsPluginApiTest::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CSettingsPluginApiTest::ConstructL() + { + //Read logger settings to check whether test case name is to be + //appended to log file name. + RSettingServer settingServer; + TInt ret = settingServer.Connect(); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Struct to StifLogger settigs. + TLoggerSettings loggerSettings; + // Parse StifLogger defaults from STIF initialization file. + ret = settingServer.GetLoggerSettings(loggerSettings); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Close Setting server session + settingServer.Close(); + + TFileName logFileName; + + if(loggerSettings.iAddTestCaseTitle) + { + TName title; + TestModuleIf().GetTestCaseTitleL(title); + logFileName.Format(KSettingsPluginApiTestLogFileWithTitle, &title); + } + else + { + logFileName.Copy(KSettingsPluginApiTestLogFile); + } + + iLog = CStifLogger::NewL( KSettingsPluginApiTestLogPath, + logFileName, + CStifLogger::ETxt, + CStifLogger::EFile, + EFalse ); + + SendTestClassVersion(); + + TurnOffScreenSaver(); + } + +// ----------------------------------------------------------------------------- +// CSettingsPluginApiTest::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CSettingsPluginApiTest* CSettingsPluginApiTest::NewL( CTestModuleIf& aTestModuleIf ) + { + CSettingsPluginApiTest* self = new( ELeave ) CSettingsPluginApiTest( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + + } + +// Destructor +CSettingsPluginApiTest::~CSettingsPluginApiTest() + { + + // Delete resources allocated from test methods + Delete(); + + // Delete logger + delete iLog; + + } + +//----------------------------------------------------------------------------- +// CSettingsPluginApiTest::SendTestClassVersion +// Method used to send version of test class +//----------------------------------------------------------------------------- +// +void CSettingsPluginApiTest::SendTestClassVersion() + { + TVersion moduleVersion; + moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; + moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; + moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; + + TFileName moduleName; + moduleName = _L( "SettingsPluginApiTest.dll" ); + + TBool newVersionOfMethod = ETrue; + TestModuleIf().SendTestModuleVersion( moduleVersion, moduleName, + newVersionOfMethod ); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + return ( CScriptBase* ) CSettingsPluginApiTest::NewL( aTestModuleIf ); + } + +// ----------------------------------------------------------------------------- +// Turn off ScreenSaver +// ----------------------------------------------------------------------------- +// +void CSettingsPluginApiTest::TurnOffScreenSaver() + { + //TInt Get(TUid aCategory, TUint aKey, TInt &aValue); + TInt err1 = RProperty::Get( KPSUidScreenSaver, KScreenSaverAllowScreenSaver, + iOldScreenSaverProperty ); + TInt err2 = RProperty::Set( KPSUidScreenSaver, KScreenSaverAllowScreenSaver, + KScreenSaverAllowScreenSaver ); + RDebug::Printf( "screensaver property=%d err1=%d err2=%d\n", + iOldScreenSaverProperty, err1, err2 ); + } + +// ----------------------------------------------------------------------------- +// Restore ScreenSaver +// ----------------------------------------------------------------------------- +// +void CSettingsPluginApiTest::RestoreScreenSaver() + { + RProperty::Set( KPSUidScreenSaver, KScreenSaverAllowScreenSaver, + iOldScreenSaverProperty ); + User::ResetInactivityTime(); + } + + +// End of File + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/SettingsPluginApiTestblocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/SettingsPluginApiTestblocks.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,231 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This cpp file has the functions to test SettingsPluginApi. +* +*/ + + +// [INCLUDE FILES] +#include +#include +#include +#include "SettingsPluginApiTest.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CSettingsPluginApiTest::Delete +// Delete here all resources allocated and opened from test methods. +// Called from destructor. +// ----------------------------------------------------------------------------- +// +void CSettingsPluginApiTest::Delete() + { + if ( iGSPluginInterface ) + { + delete iGSPluginInterface; + iGSPluginInterface = NULL; + } + + } + +// ----------------------------------------------------------------------------- +// CSettingsPluginApiTest::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CSettingsPluginApiTest::RunMethodL( + CStifItemParser& aItem ) + { + + static TStifFunctionInfo const KFunctions[] = + { + // First string is the function name used in TestScripter script file. + // Second is the actual implementation member function. + ENTRY( "CallGetValueL", CSettingsPluginApiTest::CallGetValueL ), + ENTRY( "CallMenuActivationItemL", CSettingsPluginApiTest::CallMenuActivationItemL ), + ENTRY( "CallVisibleL", CSettingsPluginApiTest::CallVisibleL ), + ENTRY( "CallResetSelectedItemIndexL", CSettingsPluginApiTest::CallResetSelectedItemIndexL ), + // [test cases entries] + }; + + const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + + } + +// ----------------------------------------------------------------------------- +// CSettingsPluginApiTest::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CSettingsPluginApiTest::SetupCGSParentPluginL() + { + TRAPD( error, iTestGsPlugin = CTestGSPlugin::NewL() ); + + if ( KErrNone == error ) + { + iGSPluginInterface = static_cast ( iTestGsPlugin ); + } + + return error; + } + +// ----------------------------------------------------------------------------- +// CServicesDbApiTest::CallGetValueL +// Is used to test CGSPluginInterface::GetValue +// ----------------------------------------------------------------------------- +TInt CSettingsPluginApiTest::CallGetValueL( CStifItemParser& /*aItem*/ ) + { + // + TInt result = 0; + TRAPD( error, result = SetupCGSParentPluginL() ); + if( KErrNone != error ) + { + iLog->Log( _L( "Initial GSPluginInterface failed,the failed code is %d" ), error ); + return error; + } + else + { + if( KErrNone != result ) + { + return result; + } + }; + TBuf<256> value; + TRAPD( errorCall, iGSPluginInterface->GetValue( EGSPluginKeySettingsItemValueString, value ) ); + if( errorCall != KErrNone ) + { + iLog->Log( _L( "Function GetValue is called failed. The failed code is %d" ), errorCall ); + return errorCall; + } + else + { + iLog->Log( _L( "Function GetValue called successfully." ) ); + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CServicesDbApiTest::CallMenuActivationItemL +// Is used to test CGSPluginInterface::MenuActivationItem +// ----------------------------------------------------------------------------- +TInt CSettingsPluginApiTest::CallMenuActivationItemL( CStifItemParser& /*aItem*/ ) + { + // + TInt result = 0; + TRAPD( error, result = SetupCGSParentPluginL() ); + if(KErrNone != error) + { + iLog->Log( _L( "Initial GSPluginInterface failed,the failed code is %d" ), error ); + return error; + } + else + { + if( KErrNone != result ) + { + return result; + } + }; + TGSMenuActivationItems GsMenuActivationItems; + TRAPD( errorCall, GsMenuActivationItems = iGSPluginInterface->MenuActivationItem() ); + if( errorCall != KErrNone ) + { + iLog->Log( _L( "Function MenuActivationItem is called failed. The failed code is %d" ), errorCall ); + return errorCall; + } + else + { + iLog->Log( _L( "Function MenuActivationItem is called successfully." ) ); + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CServicesDbApiTest::CallVisibleL +// Is used to test CGSPluginInterface::Visible +// ----------------------------------------------------------------------------- +TInt CSettingsPluginApiTest::CallVisibleL( CStifItemParser& /*aItem*/ ) + { + // + TInt result = 0; + TRAPD( error, result = SetupCGSParentPluginL() ); + if(KErrNone != error) + { + iLog->Log( _L( "Initial GSPluginInterface failed,the failed code is %d" ), error ); + return error; + } + else + { + if( KErrNone != result ) + { + return result; + } + }; + TBool IsVisible; + TRAPD( errorCall, IsVisible = iGSPluginInterface->Visible() ); + if( errorCall != KErrNone ) + { + iLog->Log( _L( "Function Visible is called failed. The failed code is %d" ), errorCall ); + return errorCall; + } + else + { + iLog->Log( _L( "Function Visible is called successfully." ) ); + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CServicesDbApiTest::CallResetSelectedItemIndexL +// Is used to test CGSPluginInterface::ResetSelectedItemIndex +// ----------------------------------------------------------------------------- +TInt CSettingsPluginApiTest::CallResetSelectedItemIndexL( CStifItemParser& /*aItem*/ ) + { + // + TInt result = 0 ; + TRAPD( error, result = SetupCGSParentPluginL() ); + if(KErrNone != error) + { + iLog->Log( _L( "Initial GSPluginInterface failed,the failed code is %d" ), error ); + return error; + } + else + { + if( KErrNone != result ) + { + return result; + } + }; + TRAPD( errorCall, iGSPluginInterface->ResetSelectedItemIndex() ); + if( errorCall != KErrNone ) + { + iLog->Log( _L( "Function ResetSelectedItemIndex is called failed. The failed code is %d" ), errorCall ); + return errorCall; + } + else + { + iLog->Log( _L( "Function ResetSelectedItemIndex is called successfully." ) ); + } + + return KErrNone; + } + +// +// [End of File] diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/TestGSPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/TestGSPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "TestGSPlugin.h" + + + +// CONSTRUCTION +CTestGSPlugin* CTestGSPlugin::NewL() + { + CTestGSPlugin* self = CTestGSPlugin::NewLC(); + CleanupStack::Pop(); + + return self; + } + +CTestGSPlugin* CTestGSPlugin::NewLC() + { + CTestGSPlugin* self = new( ELeave ) CTestGSPlugin(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor +CTestGSPlugin::~CTestGSPlugin() + { + } + +// Default constructor +CTestGSPlugin::CTestGSPlugin() + { + } + +// Second phase construct +void CTestGSPlugin::ConstructL() + { + } + + +void CTestGSPlugin::GetCaptionL( TDes& /*aCaption*/ ) const + { + + } + +TUid CTestGSPlugin::Id() const + { + return KNullUid; + } + +// END OF FILE diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_plat/settings_uis_cenrep_collection_api/inc/SettingsInternalCRKeys.h --- a/gsprofilesrv_plat/settings_uis_cenrep_collection_api/inc/SettingsInternalCRKeys.h Tue Aug 31 15:29:50 2010 +0300 +++ b/gsprofilesrv_plat/settings_uis_cenrep_collection_api/inc/SettingsInternalCRKeys.h Wed Sep 01 12:20:44 2010 +0100 @@ -142,16 +142,6 @@ */ const TUint32 KSettingsAPSettingsSupported = 0x00000003; - -/** -* Current airplane mode -* -* Possible values are: -* 0 = airplane mode (offline mode) Off -* 1 = airplane mode (offline mode) On -*/ -const TUint32 KSettingsAirplaneMode = 0x00000004; - /** * Terminal personalization settings CR UID */ @@ -319,6 +309,15 @@ const TUint32 KSettingsOpticalJoystickStatus = 0x00000019; /** +* To save active / deactive Handwriting input methods when you click editor +* Integer value. +* Default value: 1 +* 0 = Simple HWR will not be opened when user click editor. +* 1 = Simple HWR will be opened when user click editor. +*/ +const TUint32 KSettingsSimpleHWR = 0x0000001A; + +/** * Telephony settings CR UID. */ const TUid KCRUidTelephonySettings = {0x101F877E}; @@ -685,6 +684,370 @@ */ const TUint32 KSettingsPowerSavingQuery = 0x00000001; +/** +* Slide Settings CR UID. +*/ +const TUid KCRUidSlideSettings = {0x20015159}; + +enum TSlideSetting + { + ESlideSettingOff = 0, + ESlideSettingOn + }; + +/********************************************************** + * User settings for slide handling + * + */ + +/** + * Used to control which behavior is chosen when closing the cover. + * Possible values are 0=Off, 1=On + */ +const TUint32 KSlideCloseCover = 0x00000001; + +const TUint32 KSlideOpenCoverUri = 0x00000002; + +const TUint32 KSlideOpenCoverCaption = 0x00000003; + +/** + * This setting defines whether keyguard is activated by closing the cover + * + * Possible values: + * 0: Closing cover does not activate keyguard. + * 1: Closing the cover activates keyguard. + * 2: User is asked "Do you want to activate keyguard?". + * 3: Automatic - keyguard returns to the state before opening the cover. + */ +const TUint32 KSlideKeyguard = 0x00000004; +enum TSlideSettingKeyguard + { + ESlideSettingsKeyguardActivatingOff = 0, + ESlideSettingsKeyguardActivatingOn, + ESlideSettingsKeyguardActivatingAskMe, + ESlideSettingsKeyguardActivatingAutomatic + }; + +/** + * Used to control if audio is routed when opening the slide. + * Possible values are 0=routing not changed, 1=routing changed + */ +const TUint32 KSlideAudioRouting = 0x00000005; + +/** + * User setting for Intelligent Slide + * Possible values are listed in TSlideSetting + */ +const TUint32 KSlideAutomaticAction = 0x00000010; + +/********************************************************** + * Configurability settings + * This group of settings is used to specify which slide behavior is enabled + * Different slide types need different items + * For example ITU-T slide need call handling with slide + * And full-Qwerty slide does not use call handling but requires audio routing with slide + */ + +/** + * Defines which localisation to use for slide settings + * Possible values + * 0: Slide + * 1: Cover + * 2: Flip + * 3: Fold + * 4: Swivel + * 5: reserved + */ +const TUint32 KSlideTerminology = 0x00000101; + +/** + * Slide Events to react to + * Depending on this value, different P/S keys in KPSUidHWRM are used for monitoring the slide state + * Possible values are + * 0: Grip + * 1: Flip + * 2: Twist + */ +const TUint32 KSlideShowEventType = 0x00000102; + +/** + * Perform call handling with slide + * Possible values + * 0: Disabled + * 1: Enabled + */ +const TUint32 KSlideShowCallHandling = 0x00000110; + +/** + * Perform audio routing with slide + * Possible values + * 0: Disabled + * 1: Enabled + */ +const TUint32 KSlideShowAudioRouting = 0x00000111; + +/** + * Perform keypad lock handling with slide + * Possible values + * 0: Disabled + * 1: Enabled + */ +const TUint32 KSlideShowKeypadlock = 0x00000112; + +/** + * Application launch when slide open in idle + * Possible values + * 0: Disabled + * 1: Enabled + */ +const TUint32 KSlideShowAppLaunch = 0x00000113; + +/** + * Go to idle with slide close + * Possible values + * 0: Disabled + * 1: Enabled + */ +const TUint32 KSlideShowGoToIdle = 0x00000114; + +/** + * Device lock with slide + * Possible values + * 0: Disabled + * 1: Enabled + */ +const TUint32 KSlideShowDeviceLock = 0x00000115; + +/********************************************************** + * Intelligent Slide configurability settings + * The following items describe in which applications/views + * Intelligent slide feature is enabled + * + */ + +/** + * Messaging Main View + * Possible values are listed in TSlideSetting + */ +const TUint32 KMessagingMainView = 0x00001001; + +/** + * Messaging Message List View + * Possible values are listed in TSlideSetting + */ +const TUint32 KMessagingMessageListView = 0x00001002; + +/** + * Messaging One Row Message List View + * Possible values are listed in TSlideSetting + */ +const TUint32 KMessagingOneRowMessageListView = 0x00001003; + +/** + * Messaging Text Message Viewer + * Possible values are listed in TSlideSetting + */ +const TUint32 KMessagingTextMessageViewer = 0x00001004; + +/** + * Messaging Multimedia Message Viewer + * Possible values are listed in TSlideSetting + */ +const TUint32 KMessagingMultimediaMessageViewer = 0x00001005; + +/** + * Messaging Uni Editor + * Possible values are listed in TSlideSetting + */ +const TUint32 KMessagingUniEditor = 0x00001006; + +/** + * Email Viewer + * Possible values are listed in TSlideSetting + */ +const TUint32 KEmailViewer = 0x00001010; + +/** + * Email Editor + * Possible values are listed in TSlideSetting + */ +const TUint32 KEmailEditor = 0x00001011; + +/** + * Browser Content view + * Possible values are listed in TSlideSetting + */ +const TUint32 KBrowserContentView = 0x00001020; + +/** + * Browser Bookmarks view + * Possible values are listed in TSlideSetting + */ +const TUint32 KBrowserBookmarksView = 0x00001021; + +/** + * Clock Main view + * Possible values are listed in TSlideSetting + */ +const TUint32 KClockMainView = 0x00001030; + +/** + * Clock Alarm editor + * Possible values are listed in TSlideSetting + */ +const TUint32 KClockAlarmEditor = 0x00001031; + +/** + * Clock MultiAlarm view + * Possible values are listed in TSlideSetting + */ +const TUint32 KClockMultiAlarmView = 0x00001032; + +/** + * Clock World clock view + * Possible values are listed in TSlideSetting + */ +const TUint32 KClockWorldClockView = 0x00001033; + +/** + * Clock World clock view + * Possible values are listed in TSlideSetting + */ +const TUint32 KClockCountDownView = 0x00001034; + + +/** + * Notepad Editor + * Possible values are listed in TSlideSetting + */ +const TUint32 KNotepadEditor = 0x00001040; + +/** + * Notepad List view + * Possible values are listed in TSlideSetting + */ +const TUint32 KNotepadListView = 0x00001041; + +/** + * Phone Incoming call + * Possible values are listed in TSlideSetting + */ +const TUint32 KPhoneIncomingCall = 0x00001050; + +/** + * File Manager Folder view + * Possible values are listed in TSlideSetting + */ +const TUint32 KFileManagerFolderView = 0x00001060; + +/** + * Calendar Main(Month/Week/Day/To-Do) view + * Possible values are listed in TSlideSetting + */ +const TUint32 KCalendarMainView = 0x00001070; + +/** + * Calendar Event(Meeting/Memo/Anniversary/To-Do note) view + * Possible values are listed in TSlideSetting + */ +const TUint32 KCalendarEventView = 0x00001071; + +/** + * Calendar Event(Meeting/Memo/Anniversary/To-Do note) editor + * Possible values are listed in TSlideSetting + */ +const TUint32 KCalendarEventEditor = 0x00001072; + +/** + * Contacts Group view + * Possible values are listed in TSlideSetting + */ +const TUint32 KContactsGroupView = 0x00001080; + +/** + * Contacts Details view + * Possible values are listed in TSlideSetting + */ +const TUint32 KContactsDetailsView = 0x00001081; + +/** + * Contacts Editor + * Possible values are listed in TSlideSetting + */ +const TUint32 KContactsEditor = 0x00001082; + +/** + * Contacts Communication Launcher view + * Possible values are listed in TSlideSetting + */ +const TUint32 KContactsCommunicationLauncherView = 0x00001083; + + +/** + * Logs view + * Possible values are listed in TSlideSetting + */ +const TUint32 KLogsView = 0x00001090; + + +/** + * Modifier keys used for global shortcuts + * Possible values of scan codes are listed in e32keys.h + * For example EStdKeyLeftShift=0x12, EStdKeyLeftCtrl=0x16 + */ +const TUint32 KGlobalShortcutModifier1 = 0x00002001; +const TUint32 KGlobalShortcutModifier2 = 0x00002002; + +/** + * Action key scancode + * Possible values of scan codes are listed in e32keys.h + */ +const TUint32 KGlobalShortcutKey00 = 0x00002100; +const TUint32 KGlobalShortcutKey01 = 0x00002101; +const TUint32 KGlobalShortcutKey02 = 0x00002102; +const TUint32 KGlobalShortcutKey03 = 0x00002103; +const TUint32 KGlobalShortcutKey04 = 0x00002104; +const TUint32 KGlobalShortcutKey05 = 0x00002105; +const TUint32 KGlobalShortcutKey06 = 0x00002106; +const TUint32 KGlobalShortcutKey07 = 0x00002107; +const TUint32 KGlobalShortcutKey08 = 0x00002108; +const TUint32 KGlobalShortcutKey09 = 0x00002109; +const TUint32 KGlobalShortcutKey10 = 0x00002110; +const TUint32 KGlobalShortcutKey11 = 0x00002111; +const TUint32 KGlobalShortcutKey12 = 0x00002112; +const TUint32 KGlobalShortcutKey13 = 0x00002113; +const TUint32 KGlobalShortcutKey14 = 0x00002114; +const TUint32 KGlobalShortcutKey15 = 0x00002115; +const TUint32 KGlobalShortcutKey16 = 0x00002116; +const TUint32 KGlobalShortcutKey17 = 0x00002117; +const TUint32 KGlobalShortcutKey18 = 0x00002118; +const TUint32 KGlobalShortcutKey19 = 0x00002119; + +/** + * Application UID that should be brought to foreground/background + * when corresponding action key is pressed + */ +const TUint32 KGlobalShortcutApp00 = 0x00002200; +const TUint32 KGlobalShortcutApp01 = 0x00002201; +const TUint32 KGlobalShortcutApp02 = 0x00002202; +const TUint32 KGlobalShortcutApp03 = 0x00002203; +const TUint32 KGlobalShortcutApp04 = 0x00002204; +const TUint32 KGlobalShortcutApp05 = 0x00002205; +const TUint32 KGlobalShortcutApp06 = 0x00002206; +const TUint32 KGlobalShortcutApp07 = 0x00002207; +const TUint32 KGlobalShortcutApp08 = 0x00002208; +const TUint32 KGlobalShortcutApp09 = 0x00002209; +const TUint32 KGlobalShortcutApp10 = 0x00002210; +const TUint32 KGlobalShortcutApp11 = 0x00002211; +const TUint32 KGlobalShortcutApp12 = 0x00002212; +const TUint32 KGlobalShortcutApp13 = 0x00002213; +const TUint32 KGlobalShortcutApp14 = 0x00002214; +const TUint32 KGlobalShortcutApp15 = 0x00002215; +const TUint32 KGlobalShortcutApp16 = 0x00002216; +const TUint32 KGlobalShortcutApp17 = 0x00002217; +const TUint32 KGlobalShortcutApp18 = 0x00002218; +const TUint32 KGlobalShortcutApp19 = 0x00002219; + #endif // SETTINGSINTERNALCRKEYS_H // End of file \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_pub/profiles_engine_wrapper_api/inc/Profile.hrh --- a/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/Profile.hrh Tue Aug 31 15:29:50 2010 +0300 +++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/inc/Profile.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -57,9 +57,7 @@ EProfileKeypadVolumeOff = 0, EProfileKeypadVolumeLevel1 = 1, EProfileKeypadVolumeLevel2 = 2, - EProfileKeypadVolumeLevel3 = 3, - EProfileKeypadVolumeLevel4 = 4, - EProfileKeypadVolumeLevel5 = 5 + EProfileKeypadVolumeLevel3 = 3 }; /** diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/ProEngWrapAPI.cfg --- a/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/ProEngWrapAPI.cfg Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,426 +0,0 @@ -[Test] -title NewEngineL -create ProEngWrapAPI foobar -foobar NewEngineL pa ra me ters -delete foobar -[Endtest] - -[Test] -title NewEngineLC -create ProEngWrapAPI foobar -foobar NewEngineLC pa ra me ters -delete foobar -[Endtest] - -[Test] -title NewEngineLCWithRFsL -create ProEngWrapAPI foobar -foobar NewEngineLCWithRFsL pa ra me ters -delete foobar -[Endtest] - -[Test] -title NewNotifyHandlerL -create ProEngWrapAPI foobar -foobar NewNotifyHandlerL pa ra me ters -delete foobar -[Endtest] - -[Test] -title ReqProfActNotificationsL -create ProEngWrapAPI foobar -foobar ReqProfActNotificationsL pa ra me ters -delete foobar -[Endtest] - -[Test] -title CanProfActNotificationsL -create ProEngWrapAPI foobar -foobar CanProfActNotificationsL pa ra me ters -delete foobar -[Endtest] - -[Test] -title ReqActProfNotificationsL -create ProEngWrapAPI foobar -foobar ReqActProfNotificationsL pa ra me ters -delete foobar -[Endtest] - -[Test] -title CanActProfNotificationsL -create ProEngWrapAPI foobar -foobar CanActProfNotificationsL pa ra me ters -delete foobar -[Endtest] - -[Test] -title ReqProfNotificationsL -create ProEngWrapAPI foobar -foobar ReqProfNotificationsL pa ra me ters -delete foobar -[Endtest] - -[Test] -title CanProfNotificationsL -create ProEngWrapAPI foobar -foobar CanProfNotificationsL pa ra me ters -delete foobar -[Endtest] - -[Test] -title ReqProfNameArrayNotL -create ProEngWrapAPI foobar -foobar ReqProfNameArrayNotL pa ra me ters -delete foobar -[Endtest] - -[Test] -title CanProfNameArrayNotL -create ProEngWrapAPI foobar -foobar CanProfNameArrayNotL pa ra me ters -delete foobar -[Endtest] - -[Test] -title CancelAllL -create ProEngWrapAPI foobar -foobar CancelAllL pa ra me ters -delete foobar -[Endtest] - -[Test] -title ActiveProfileLC -create ProEngWrapAPI foobar -foobar ActiveProfileLC pa ra me ters -delete foobar -[Endtest] - -[Test] -title ActiveProfileL -create ProEngWrapAPI foobar -foobar ActiveProfileL pa ra me ters -delete foobar -[Endtest] - -[Test] -title ActiveProfileIdL -create ProEngWrapAPI foobar -foobar ActiveProfileIdL pa ra me ters -delete foobar -[Endtest] - -[Test] -title ProfileNameArrayLC -create ProEngWrapAPI foobar -foobar ProfileNameArrayLC pa ra me ters -delete foobar -[Endtest] - -[Test] -title SetActiveProfileL -create ProEngWrapAPI foobar -foobar SetActiveProfileL pa ra me ters -delete foobar -[Endtest] - -[Test] -title ProfileLC -create ProEngWrapAPI foobar -foobar ProfileLC pa ra me ters -delete foobar -[Endtest] - -[Test] -title ProfileL -create ProEngWrapAPI foobar -foobar ProfileL pa ra me ters -delete foobar -[Endtest] - -[Test] -title MdcaCountL -create ProEngWrapAPI foobar -foobar MdcaCountL pa ra me ters -delete foobar -[Endtest] - -[Test] -title MdcaPointL -create ProEngWrapAPI foobar -foobar MdcaPointL pa ra me ters -delete foobar -[Endtest] - -[Test] -title ProfileIdL -create ProEngWrapAPI foobar -foobar ProfileIdL pa ra me ters -delete foobar -[Endtest] - -[Test] -title FindByIdL -create ProEngWrapAPI foobar -foobar FindByIdL pa ra me ters -delete foobar -[Endtest] - -[Test] -title FindByNameL -create ProEngWrapAPI foobar -foobar FindByNameL pa ra me ters -delete foobar -[Endtest] - -[Test] -title ProfileNameL -create ProEngWrapAPI foobar -foobar ProfileNameL pa ra me ters -delete foobar -[Endtest] - -[Test] -title ProfileTonesL -create ProEngWrapAPI foobar -foobar ProfileTonesL pa ra me ters -delete foobar -[Endtest] - -[Test] -title ToneSettingsL -create ProEngWrapAPI foobar -foobar ToneSettingsL pa ra me ters -delete foobar -[Endtest] - -[Test] -title AlertForL -create ProEngWrapAPI foobar -foobar AlertForL pa ra me ters -delete foobar -[Endtest] - -[Test] -title SetAlertForL -create ProEngWrapAPI foobar -foobar SetAlertForL pa ra me ters -delete foobar -[Endtest] - -[Test] -title IsSilentL -create ProEngWrapAPI foobar -foobar IsSilentL pa ra me ters -delete foobar -[Endtest] - -[Test] -title CommitChangeL -create ProEngWrapAPI foobar -foobar CommitChangeL pa ra me ters -delete foobar -[Endtest] - -[Test] -title NameL -create ProEngWrapAPI foobar -foobar NameL pa ra me ters -delete foobar -[Endtest] - -[Test] -title IdL -create ProEngWrapAPI foobar -foobar IdL pa ra me ters -delete foobar -[Endtest] - -[Test] -title SetNameL -create ProEngWrapAPI foobar -foobar SetNameL pa ra me ters -delete foobar -[Endtest] - -[Test] -title RingingTone1L -create ProEngWrapAPI foobar -foobar RingingTone1L pa ra me ters -delete foobar -[Endtest] - -[Test] -title RingingTone2L -create ProEngWrapAPI foobar -foobar RingingTone2L pa ra me ters -delete foobar -[Endtest] - -[Test] -title MessageAlertToneL -create ProEngWrapAPI foobar -foobar MessageAlertToneL pa ra me ters -delete foobar -[Endtest] - -[Test] -title EmailAlertToneL -create ProEngWrapAPI foobar -foobar EmailAlertToneL pa ra me ters -delete foobar -[Endtest] - -[Test] -title VideoCallRingingToneL -create ProEngWrapAPI foobar -foobar VideoCallRingingToneL pa ra me ters -delete foobar -[Endtest] - -[Test] -title SetRingingTone1L -create ProEngWrapAPI foobar -foobar SetRingingTone1L pa ra me ters -delete foobar -[Endtest] - -[Test] -title SetRingingTone2L -create ProEngWrapAPI foobar -foobar SetRingingTone2L pa ra me ters -delete foobar -[Endtest] - -[Test] -title SetMessageAlertToneL -create ProEngWrapAPI foobar -foobar SetMessageAlertToneL pa ra me ters -delete foobar -[Endtest] - -[Test] -title SetEmailAlertToneL -create ProEngWrapAPI foobar -foobar SetEmailAlertToneL pa ra me ters -delete foobar -[Endtest] - -[Test] -title SetVideoCallRingingToneL -create ProEngWrapAPI foobar -foobar SetVideoCallRingingToneL pa ra me ters -delete foobar -[Endtest] - -[Test] -title RingingTypeL -create ProEngWrapAPI foobar -foobar RingingTypeL pa ra me ters -delete foobar -[Endtest] - -[Test] -title KeypadVolumeL -create ProEngWrapAPI foobar -foobar KeypadVolumeL pa ra me ters -delete foobar -[Endtest] - -[Test] -title RingingVolumeL -create ProEngWrapAPI foobar -foobar RingingVolumeL pa ra me ters -delete foobar -[Endtest] - -[Test] -title VibratingAlertL -create ProEngWrapAPI foobar -foobar VibratingAlertL pa ra me ters -delete foobar -[Endtest] - -[Test] -title WarningAndGameTonesL -create ProEngWrapAPI foobar -foobar WarningAndGameTonesL pa ra me ters -delete foobar -[Endtest] - -[Test] -title TextToSpeechL -create ProEngWrapAPI foobar -foobar TextToSpeechL pa ra me ters -delete foobar -[Endtest] - -[Test] -title SetRingingTypeL -create ProEngWrapAPI foobar -foobar SetRingingTypeL pa ra me ters -delete foobar -[Endtest] - -[Test] -title SetKeypadVolumeL -create ProEngWrapAPI foobar -foobar SetKeypadVolumeL pa ra me ters -delete foobar -[Endtest] - -[Test] -title SetRingingVolumeL -create ProEngWrapAPI foobar -foobar SetRingingVolumeL pa ra me ters -delete foobar -[Endtest] - -[Test] -title SetVibratingAlertL -create ProEngWrapAPI foobar -foobar SetVibratingAlertL pa ra me ters -delete foobar -[Endtest] - -[Test] -title SetWarningAndGameTonesL -create ProEngWrapAPI foobar -foobar SetWarningAndGameTonesL pa ra me ters -delete foobar -[Endtest] - -[Test] -title SetTextToSpeechL -create ProEngWrapAPI foobar -foobar SetTextToSpeechL pa ra me ters -delete foobar -[Endtest] - -[Test] -title NewAlertToneSeekerL -create ProEngWrapAPI foobar -foobar NewAlertToneSeekerL pa ra me ters -delete foobar -[Endtest] - -[Test] -title FetchAlertToneListL -create ProEngWrapAPI foobar -foobar FetchAlertToneListL pa ra me ters -delete foobar -[Endtest] - -[Test] -title CancelFetchL -create ProEngWrapAPI foobar -foobar CancelFetchL pa ra me ters -delete foobar -[Endtest] - -[Test] -title NewEngineLWithRFsL -create ProEngWrapAPI foobar -foobar NewEngineL pa ra me ters -delete foobar -[Endtest] diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/ProEngWrapAPI.mmp --- a/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/ProEngWrapAPI.mmp Tue Aug 31 15:29:50 2010 +0300 +++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/ProEngWrapAPI.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -11,13 +11,15 @@ * * Contributors: * -* Description: BC test mmp for profile engine wrapper +* Description: ?Description * */ -// To get the OS_LAYER_SYSTEMINCLUDE-definition -#include +#if defined(__S60_) + // To get the OS_LAYER_SYSTEMINCLUDE-definition + #include +#endif TARGET ProEngWrapAPI.dll TARGETTYPE dll @@ -27,8 +29,28 @@ DEFFILE ProEngWrapAPI.def +#ifdef SBSV2 USERINCLUDE ../inc -MW_LAYER_SYSTEMINCLUDE + + #if defined(__S60_) + MW_LAYER_SYSTEMINCLUDE + #else // __S60_ not defined +SYSTEMINCLUDE /epoc32/include +SYSTEMINCLUDE /epoc32/include/internal + #endif // __S60_ + +#else // SBSV2 not defined +USERINCLUDE ../inc + + #if defined(__S60_) + MW_LAYER_SYSTEMINCLUDE + #else // __S60_ not defined +SYSTEMINCLUDE /epoc32/include +SYSTEMINCLUDE /epoc32/include/internal + #endif // __S60_ + +#endif // SBSV2 +APP_LAYER_SYSTEMINCLUDE SOURCEPATH ../src diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/ProEngWrapAPI_DoxyFile.txt --- a/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/ProEngWrapAPI_DoxyFile.txt Tue Aug 31 15:29:50 2010 +0300 +++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/ProEngWrapAPI_DoxyFile.txt Wed Sep 01 12:20:44 2010 +0100 @@ -1,20 +1,3 @@ -/* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ?Description -* -*/ - # Doxyfile 1.4.1 #--------------------------------------------------------------------------- diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/TestFramework.ini --- a/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/TestFramework.ini Tue Aug 31 15:29:50 2010 +0300 +++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/TestFramework.ini Wed Sep 01 12:20:44 2010 +0100 @@ -93,7 +93,7 @@ [New_Module] ModuleName= testscripter -TestCaseFile= c:\testframework\ProEngWrapAPI.cfg +TestCaseFile= c:\testframework\UI_ProEngWrapAPI.cfg [End_Module] diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/UI_ProEngWrapAPI.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/UI_ProEngWrapAPI.cfg Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,426 @@ +[Test] +title NewEngineL +create ProEngWrapAPI foobar +foobar NewEngineL pa ra me ters +delete foobar +[Endtest] + +[Test] +title NewEngineLC +create ProEngWrapAPI foobar +foobar NewEngineLC pa ra me ters +delete foobar +[Endtest] + +[Test] +title NewEngineLCWithRFsL +create ProEngWrapAPI foobar +foobar NewEngineLCWithRFsL pa ra me ters +delete foobar +[Endtest] + +[Test] +title NewNotifyHandlerL +create ProEngWrapAPI foobar +foobar NewNotifyHandlerL pa ra me ters +delete foobar +[Endtest] + +[Test] +title ReqProfActNotificationsL +create ProEngWrapAPI foobar +foobar ReqProfActNotificationsL pa ra me ters +delete foobar +[Endtest] + +[Test] +title CanProfActNotificationsL +create ProEngWrapAPI foobar +foobar CanProfActNotificationsL pa ra me ters +delete foobar +[Endtest] + +[Test] +title ReqActProfNotificationsL +create ProEngWrapAPI foobar +foobar ReqActProfNotificationsL pa ra me ters +delete foobar +[Endtest] + +[Test] +title CanActProfNotificationsL +create ProEngWrapAPI foobar +foobar CanActProfNotificationsL pa ra me ters +delete foobar +[Endtest] + +[Test] +title ReqProfNotificationsL +create ProEngWrapAPI foobar +foobar ReqProfNotificationsL pa ra me ters +delete foobar +[Endtest] + +[Test] +title CanProfNotificationsL +create ProEngWrapAPI foobar +foobar CanProfNotificationsL pa ra me ters +delete foobar +[Endtest] + +[Test] +title ReqProfNameArrayNotL +create ProEngWrapAPI foobar +foobar ReqProfNameArrayNotL pa ra me ters +delete foobar +[Endtest] + +[Test] +title CanProfNameArrayNotL +create ProEngWrapAPI foobar +foobar CanProfNameArrayNotL pa ra me ters +delete foobar +[Endtest] + +[Test] +title CancelAllL +create ProEngWrapAPI foobar +foobar CancelAllL pa ra me ters +delete foobar +[Endtest] + +[Test] +title ActiveProfileLC +create ProEngWrapAPI foobar +foobar ActiveProfileLC pa ra me ters +delete foobar +[Endtest] + +[Test] +title ActiveProfileL +create ProEngWrapAPI foobar +foobar ActiveProfileL pa ra me ters +delete foobar +[Endtest] + +[Test] +title ActiveProfileIdL +create ProEngWrapAPI foobar +foobar ActiveProfileIdL pa ra me ters +delete foobar +[Endtest] + +[Test] +title ProfileNameArrayLC +create ProEngWrapAPI foobar +foobar ProfileNameArrayLC pa ra me ters +delete foobar +[Endtest] + +[Test] +title SetActiveProfileL +create ProEngWrapAPI foobar +foobar SetActiveProfileL pa ra me ters +delete foobar +[Endtest] + +[Test] +title ProfileLC +create ProEngWrapAPI foobar +foobar ProfileLC pa ra me ters +delete foobar +[Endtest] + +[Test] +title ProfileL +create ProEngWrapAPI foobar +foobar ProfileL pa ra me ters +delete foobar +[Endtest] + +[Test] +title MdcaCountL +create ProEngWrapAPI foobar +foobar MdcaCountL pa ra me ters +delete foobar +[Endtest] + +[Test] +title MdcaPointL +create ProEngWrapAPI foobar +foobar MdcaPointL pa ra me ters +delete foobar +[Endtest] + +[Test] +title ProfileIdL +create ProEngWrapAPI foobar +foobar ProfileIdL pa ra me ters +delete foobar +[Endtest] + +[Test] +title FindByIdL +create ProEngWrapAPI foobar +foobar FindByIdL pa ra me ters +delete foobar +[Endtest] + +[Test] +title FindByNameL +create ProEngWrapAPI foobar +foobar FindByNameL pa ra me ters +delete foobar +[Endtest] + +[Test] +title ProfileNameL +create ProEngWrapAPI foobar +foobar ProfileNameL pa ra me ters +delete foobar +[Endtest] + +[Test] +title ProfileTonesL +create ProEngWrapAPI foobar +foobar ProfileTonesL pa ra me ters +delete foobar +[Endtest] + +[Test] +title ToneSettingsL +create ProEngWrapAPI foobar +foobar ToneSettingsL pa ra me ters +delete foobar +[Endtest] + +[Test] +title AlertForL +create ProEngWrapAPI foobar +foobar AlertForL pa ra me ters +delete foobar +[Endtest] + +[Test] +title SetAlertForL +create ProEngWrapAPI foobar +foobar SetAlertForL pa ra me ters +delete foobar +[Endtest] + +[Test] +title IsSilentL +create ProEngWrapAPI foobar +foobar IsSilentL pa ra me ters +delete foobar +[Endtest] + +[Test] +title CommitChangeL +create ProEngWrapAPI foobar +foobar CommitChangeL pa ra me ters +delete foobar +[Endtest] + +[Test] +title NameL +create ProEngWrapAPI foobar +foobar NameL pa ra me ters +delete foobar +[Endtest] + +[Test] +title IdL +create ProEngWrapAPI foobar +foobar IdL pa ra me ters +delete foobar +[Endtest] + +[Test] +title SetNameL +create ProEngWrapAPI foobar +foobar SetNameL pa ra me ters +delete foobar +[Endtest] + +[Test] +title RingingTone1L +create ProEngWrapAPI foobar +foobar RingingTone1L pa ra me ters +delete foobar +[Endtest] + +[Test] +title RingingTone2L +create ProEngWrapAPI foobar +foobar RingingTone2L pa ra me ters +delete foobar +[Endtest] + +[Test] +title MessageAlertToneL +create ProEngWrapAPI foobar +foobar MessageAlertToneL pa ra me ters +delete foobar +[Endtest] + +[Test] +title EmailAlertToneL +create ProEngWrapAPI foobar +foobar EmailAlertToneL pa ra me ters +delete foobar +[Endtest] + +[Test] +title VideoCallRingingToneL +create ProEngWrapAPI foobar +foobar VideoCallRingingToneL pa ra me ters +delete foobar +[Endtest] + +[Test] +title SetRingingTone1L +create ProEngWrapAPI foobar +foobar SetRingingTone1L pa ra me ters +delete foobar +[Endtest] + +[Test] +title SetRingingTone2L +create ProEngWrapAPI foobar +foobar SetRingingTone2L pa ra me ters +delete foobar +[Endtest] + +[Test] +title SetMessageAlertToneL +create ProEngWrapAPI foobar +foobar SetMessageAlertToneL pa ra me ters +delete foobar +[Endtest] + +[Test] +title SetEmailAlertToneL +create ProEngWrapAPI foobar +foobar SetEmailAlertToneL pa ra me ters +delete foobar +[Endtest] + +[Test] +title SetVideoCallRingingToneL +create ProEngWrapAPI foobar +foobar SetVideoCallRingingToneL pa ra me ters +delete foobar +[Endtest] + +[Test] +title RingingTypeL +create ProEngWrapAPI foobar +foobar RingingTypeL pa ra me ters +delete foobar +[Endtest] + +[Test] +title KeypadVolumeL +create ProEngWrapAPI foobar +foobar KeypadVolumeL pa ra me ters +delete foobar +[Endtest] + +[Test] +title RingingVolumeL +create ProEngWrapAPI foobar +foobar RingingVolumeL pa ra me ters +delete foobar +[Endtest] + +[Test] +title VibratingAlertL +create ProEngWrapAPI foobar +foobar VibratingAlertL pa ra me ters +delete foobar +[Endtest] + +[Test] +title WarningAndGameTonesL +create ProEngWrapAPI foobar +foobar WarningAndGameTonesL pa ra me ters +delete foobar +[Endtest] + +[Test] +title TextToSpeechL +create ProEngWrapAPI foobar +foobar TextToSpeechL pa ra me ters +delete foobar +[Endtest] + +[Test] +title SetRingingTypeL +create ProEngWrapAPI foobar +foobar SetRingingTypeL pa ra me ters +delete foobar +[Endtest] + +[Test] +title SetKeypadVolumeL +create ProEngWrapAPI foobar +foobar SetKeypadVolumeL pa ra me ters +delete foobar +[Endtest] + +[Test] +title SetRingingVolumeL +create ProEngWrapAPI foobar +foobar SetRingingVolumeL pa ra me ters +delete foobar +[Endtest] + +[Test] +title SetVibratingAlertL +create ProEngWrapAPI foobar +foobar SetVibratingAlertL pa ra me ters +delete foobar +[Endtest] + +[Test] +title SetWarningAndGameTonesL +create ProEngWrapAPI foobar +foobar SetWarningAndGameTonesL pa ra me ters +delete foobar +[Endtest] + +[Test] +title SetTextToSpeechL +create ProEngWrapAPI foobar +foobar SetTextToSpeechL pa ra me ters +delete foobar +[Endtest] + +[Test] +title NewAlertToneSeekerL +create ProEngWrapAPI foobar +foobar NewAlertToneSeekerL pa ra me ters +delete foobar +[Endtest] + +[Test] +title FetchAlertToneListL +create ProEngWrapAPI foobar +foobar FetchAlertToneListL pa ra me ters +delete foobar +[Endtest] + +[Test] +title CancelFetchL +create ProEngWrapAPI foobar +foobar CancelFetchL pa ra me ters +delete foobar +[Endtest] + +[Test] +title NewEngineLWithRFsL +create ProEngWrapAPI foobar +foobar NewEngineL pa ra me ters +delete foobar +[Endtest] diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/bld.inf --- a/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/bld.inf Tue Aug 31 15:29:50 2010 +0300 +++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -43,7 +43,7 @@ */ proeng_z.bat /epoc32/winscw/c/proeng_z.bat proeng_c.bat /epoc32/winscw/c/proeng_c.bat -ProEngWrapAPI.cfg /Epoc32/winscw/c/testframework/ProEngWrapAPI.cfg +UI_ProEngWrapAPI.cfg /Epoc32/winscw/c/testframework/UI_ProEngWrapAPI.cfg testframework.ini /Epoc32/winscw/c/testframework/testframework_ProEngWrapAPI.ini PRJ_TESTMMPFILES diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/sis/50_SP_PROENG.SIS Binary file gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/sis/50_SP_PROENG.SIS has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/sis/50_SP_PROENG.pkg --- a/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/sis/50_SP_PROENG.pkg Tue Aug 31 15:29:50 2010 +0300 +++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/sis/50_SP_PROENG.pkg Wed Sep 01 12:20:44 2010 +0100 @@ -32,5 +32,5 @@ "\Epoc32\Release\armv5\urel\ProEngWrapAPI.dll"-"!:\sys\bin\ProEngWrapAPI.dll" "\Epoc32\winscw\c\testframework\testframework_ProEngWrapAPI.ini"-"!:\TestFramework\testframework_ProEngWrapAPI.ini" -"\Epoc32\winscw\c\testframework\ProEngWrapAPI.cfg"-"!:\TestFramework\ProEngWrapAPI.cfg" +"\Epoc32\winscw\c\testframework\UI_ProEngWrapAPI.cfg"-"!:\TestFramework\UI_ProEngWrapAPI.cfg" "\epoc32\winscw\c\proeng_c.bat"-"!:\proeng.bat" \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/src/ProEngWrapAPIBlocks.cpp --- a/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/src/ProEngWrapAPIBlocks.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/src/ProEngWrapAPIBlocks.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -64,7 +64,7 @@ ENTRY( "ReqProfActNotificationsL", CProEngWrapAPI::RequestProfileActivationNotificationsL ), ENTRY( "CanProfActNotificationsL", CProEngWrapAPI::CancelProfileActivationNotificationsL ), ENTRY( "ReqActProfNotificationsL", CProEngWrapAPI::RequestActiveProfileNotificationsL ), - ENTRY( "CanActProfNotificationsL", CProEngWrapAPI::CancelProfileActivationNotificationsL ), + ENTRY( "CanActProfNotificationsL", CProEngWrapAPI::CancelActiveProfileNotificationsL ), ENTRY( "ReqProfNotificationsL", CProEngWrapAPI::RequestProfileNotificationsL ), ENTRY( "CanProfNotificationsL", CProEngWrapAPI::CancelProfileNotificationsL ), ENTRY( "ReqProfNameArrayNotL", CProEngWrapAPI::RequestProfileNameArrayNotificationsL ), @@ -222,8 +222,22 @@ CleanupStack::PushL( observer ); TRAP_IGNORE(nh->RequestProfileActivationNotificationsL ( *observer ) ); - engine->SetActiveProfileL( EProfileMeetingId ); - iSchedulerUtility->Start(); + + TInt previousid( engine->ActiveProfileId() ); + if ( previousid == EProfileMeetingId ) //example for active profile change + { + engine->SetActiveProfileL( EProfileOutdoorId ); + } + else + { + engine->SetActiveProfileL( EProfileMeetingId ); + } + TInt activeid( engine->ActiveProfileId() ); + if ( previousid!=activeid ) + { + iSchedulerUtility->Start(); + } + CleanupStack::PopAndDestroy( observer ); CleanupStack::PopAndDestroy( wrapper ); CleanupStack::PopAndDestroy(); // engine @@ -253,8 +267,21 @@ CleanupStack::PushL( observer ); TRAP_IGNORE(nh->RequestProfileActivationNotificationsL ( *observer ) ); - engine->SetActiveProfileL( EProfileMeetingId ); - iSchedulerUtility->Start(); + TInt previousid( engine->ActiveProfileId() ); + if ( previousid == EProfileMeetingId ) //example for active profile change + { + engine->SetActiveProfileL( EProfileOutdoorId ); + } + else + { + engine->SetActiveProfileL( EProfileMeetingId ); + } + TInt activeid( engine->ActiveProfileId() ); + if ( previousid!=activeid ) + { + iSchedulerUtility->Start(); + } + nh->CancelProfileActivationNotifications(); CleanupStack::PopAndDestroy( observer ); CleanupStack::PopAndDestroy( wrapper ); diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/BWINS/BackgroundImageU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/BWINS/BackgroundImageU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,15 @@ +EXPORTS + ??1CGSBackgroundImage@@UAE@XZ @ 1 NONAME ; CGSBackgroundImage::~CGSBackgroundImage(void) + ?BackgroundImageL@CGSBackgroundImage@@QAEHXZ @ 2 NONAME ; int CGSBackgroundImage::BackgroundImageL(void) + ?DeleteImageL@CGSBackgroundImage@@QAEXABVTDesC16@@@Z @ 3 NONAME ; void CGSBackgroundImage::DeleteImageL(class TDesC16 const &) + ?GetPlnsStatus@CGSBackgroundImage@@QAEHXZ @ 4 NONAME ; int CGSBackgroundImage::GetPlnsStatus(void) + ?IsPersonalisationApplicationL@CGSBackgroundImage@@QAEXXZ @ 5 NONAME ; void CGSBackgroundImage::IsPersonalisationApplicationL(void) + ?NewL@CGSAsyncImageHandling@@SAPAV1@AAVRFs@@PAVMGSAsyncImageHandlingObserver@@ABVTDesC16@@@Z @ 6 NONAME ; class CGSAsyncImageHandling * CGSAsyncImageHandling::NewL(class RFs &, class MGSAsyncImageHandlingObserver *, class TDesC16 const &) + ?NewL@CGSBackgroundImage@@SAPAV1@XZ @ 7 NONAME ; class CGSBackgroundImage * CGSBackgroundImage::NewL(void) + ?SetBackgroundImageL@CGSBackgroundImage@@QAEXH@Z @ 8 NONAME ; void CGSBackgroundImage::SetBackgroundImageL(int) + ?SetBackgroundImagePathL@CGSBackgroundImage@@QAEXABVTDesC16@@@Z @ 9 NONAME ; void CGSBackgroundImage::SetBackgroundImagePathL(class TDesC16 const &) + ?SetBackgroundImagePathL@CGSBackgroundImage@@QAEXABVTDesC16@@AAVTDes16@@@Z @ 10 NONAME ; void CGSBackgroundImage::SetBackgroundImagePathL(class TDesC16 const &, class TDes16 &) + ?SetBackgroundImagePathL@CGSBackgroundImage@@QAEXABVTDesC16@@AAVTDes16@@W4TGSWallpaperType@@@Z @ 11 NONAME ; void CGSBackgroundImage::SetBackgroundImagePathL(class TDesC16 const &, class TDes16 &, enum TGSWallpaperType) + ?SetVTStillImagePathL@CGSBackgroundImage@@QAEXABVTDesC16@@AAVCGSAsyncImageHandling@@@Z @ 12 NONAME ; void CGSBackgroundImage::SetVTStillImagePathL(class TDesC16 const &, class CGSAsyncImageHandling &) + ?SetWelcomeNoteImageL@CGSBackgroundImage@@QAEXABVTDesC16@@AAVCGSAsyncImageHandling@@@Z @ 13 NONAME ; void CGSBackgroundImage::SetWelcomeNoteImageL(class TDesC16 const &, class CGSAsyncImageHandling &) + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/BWINS/GSEcomPluginU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/BWINS/GSEcomPluginU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,16 @@ +EXPORTS + ??0CGSPluginInterface@@IAE@XZ @ 1 NONAME ; CGSPluginInterface::CGSPluginInterface(void) + ??1CGSPluginInterface@@UAE@XZ @ 2 NONAME ; CGSPluginInterface::~CGSPluginInterface(void) + ?CreateIconL@CGSPluginInterface@@UAEPAVCGulIcon@@VTUid@@@Z @ 3 NONAME ; class CGulIcon * CGSPluginInterface::CreateIconL(class TUid) + ?CustomOperationL@CGSPluginInterface@@UAEPAXPAX0@Z @ 4 NONAME ; void * CGSPluginInterface::CustomOperationL(void *, void *) + ?GetValue@CGSPluginInterface@@UAEXW4TGSPluginValueKeys@@AAVTDes16@@@Z @ 5 NONAME ; void CGSPluginInterface::GetValue(enum TGSPluginValueKeys, class TDes16 &) + ?HandleSelection@CGSPluginInterface@@UAEXW4TGSSelectionTypes@@@Z @ 6 NONAME ; void CGSPluginInterface::HandleSelection(enum TGSSelectionTypes) + ?ItemType@CGSPluginInterface@@UAE?AW4TGSListboxItemTypes@@XZ @ 7 NONAME ; enum TGSListboxItemTypes CGSPluginInterface::ItemType(void) + ?NewL@CGSPluginInterface@@SAPAV1@VTUid@@PAX@Z @ 8 NONAME ; class CGSPluginInterface * CGSPluginInterface::NewL(class TUid, void *) + ?PluginProviderCategory@CGSPluginInterface@@UBEHXZ @ 9 NONAME ; int CGSPluginInterface::PluginProviderCategory(void) const + ?Visible@CGSPluginInterface@@UBEHXZ @ 10 NONAME ; int CGSPluginInterface::Visible(void) const + ?ResetSelectedItemIndex@CGSPluginInterface@@UAEXXZ @ 11 NONAME ; void CGSPluginInterface::ResetSelectedItemIndex(void) + ?MenuActivationItem@CGSPluginInterface@@UAE?AW4TGSMenuActivationItems@@XZ @ 12 NONAME ; enum TGSMenuActivationItems CGSPluginInterface::MenuActivationItem(void) + ?SetOrder@CGSPluginInterface@@QAEXH@Z @ 13 NONAME ; void CGSPluginInterface::SetOrder(int) + ?GetEcomDestructorKey@CGSPluginInterface@@QAE?AVTUid@@XZ @ 14 NONAME ; class TUid CGSPluginInterface::GetEcomDestructorKey(void) + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/BWINS/GSFrameworkU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/BWINS/GSFrameworkU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,82 @@ +EXPORTS + ?SetDetails@CGSPluginWrapper@@QAEXVTUid@@@Z @ 1 NONAME ; void CGSPluginWrapper::SetDetails(class TUid) + ?SelectedPlugin@CGSParentPlugin@@QAEPAVCGSPluginInterface@@XZ @ 2 NONAME ; class CGSPluginInterface * CGSParentPlugin::SelectedPlugin(void) + ?SelectedItem@CGSBaseContainer@@UAEHXZ @ 3 NONAME ; int CGSBaseContainer::SelectedItem(void) + ?SetNaviPaneL@CGSBaseView@@MAEXXZ @ 4 NONAME ; void CGSBaseView::SetNaviPaneL(void) + ?Container@CGSBaseView@@QAEPAVCGSBaseContainer@@XZ @ 5 NONAME ; class CGSBaseContainer * CGSBaseView::Container(void) + ?WatchDog@CGSBaseDocument@@QAEPAVMGSWatchDog@@XZ @ 6 NONAME ; class MGSWatchDog * CGSBaseDocument::WatchDog(void) + ?SetSelectedItem@CGSBaseContainer@@UAEXH@Z @ 7 NONAME ; void CGSBaseContainer::SetSelectedItem(int) + ?ComponentControl@CGSBaseContainer@@EBEPAVCCoeControl@@H@Z @ 8 NONAME ; class CCoeControl * CGSBaseContainer::ComponentControl(int) const + ?NewL@CGSPubSubsListener@@SAPAV1@VTUid@@HPAVMGSSettingPSObserver@@@Z @ 9 NONAME ; class CGSPubSubsListener * CGSPubSubsListener::NewL(class TUid, int, class MGSSettingPSObserver *) + ?GetImplInfo@CGSBaseDocument@@QAE?AV?$RPointerArray@VCImplementationInformation@@@@XZ @ 10 NONAME ; class RPointerArray CGSBaseDocument::GetImplInfo(void) + ?LoadNextPluginL@CGSPluginLoader@@AAEXXZ @ 11 NONAME ; void CGSPluginLoader::LoadNextPluginL(void) + ??0CGSParentPlugin@@IAE@XZ @ 12 NONAME ; CGSParentPlugin::CGSParentPlugin(void) + ?NewL@CGSPluginLoader@@SAPAV1@PAVCAknViewAppUi@@@Z @ 13 NONAME ; class CGSPluginLoader * CGSPluginLoader::NewL(class CAknViewAppUi *) + ?GetHelpContext@CGSParentPlugin@@UAEXAAVTCoeHelpContext@@@Z @ 14 NONAME ; void CGSParentPlugin::GetHelpContext(class TCoeHelpContext &) + ?HandleCommandL@CGSParentPlugin@@MAEXH@Z @ 15 NONAME ; void CGSParentPlugin::HandleCommandL(int) + ?Get@CGSPubSubsListener@@QAEHAAVTDes8@@@Z @ 16 NONAME ; int CGSPubSubsListener::Get(class TDes8 &) + ??1CGSBaseContainer@@UAE@XZ @ 17 NONAME ; CGSBaseContainer::~CGSBaseContainer(void) + ?NewL@CGSTabHelper@@SAPAV1@XZ @ 18 NONAME ; class CGSTabHelper * CGSTabHelper::NewL(void) + ?ResetSelectedItemIndex@CGSParentPlugin@@UAEXXZ @ 19 NONAME ; void CGSParentPlugin::ResetSelectedItemIndex(void) + ??1CGSPubSubsListener@@UAE@XZ @ 20 NONAME ; CGSPubSubsListener::~CGSPubSubsListener(void) + ?SetObserver@CGSPluginLoader@@QAEXPAVMGSPluginLoadObserver@@@Z @ 21 NONAME ; void CGSPluginLoader::SetObserver(class MGSPluginLoadObserver *) + ?PrepareForUIDestruction@CGSBaseDocument@@QAEXXZ @ 22 NONAME ; void CGSBaseDocument::PrepareForUIDestruction(void) + ??1CGSPluginLoader@@UAE@XZ @ 23 NONAME ; CGSPluginLoader::~CGSPluginLoader(void) + ?CreateNaviPaneContextL@CGSBaseView@@MAEXH@Z @ 24 NONAME ; void CGSBaseView::CreateNaviPaneContextL(int) + ?CreateTabGroupL@CGSTabHelper@@QAEXVTUid@@PAV?$CArrayPtrFlat@VMGSTabbedView@@@@@Z @ 25 NONAME ; void CGSTabHelper::CreateTabGroupL(class TUid, class CArrayPtrFlat *) + ?SetOptionFlags@CGSParentPlugin@@UAEXAAV?$TBitFlagsT@K@@@Z @ 26 NONAME ; void CGSParentPlugin::SetOptionFlags(class TBitFlagsT &) + ??1CGSBaseDocument@@UAE@XZ @ 27 NONAME ; CGSBaseDocument::~CGSBaseDocument(void) + ?CreateTabGroupL@CGSTabHelper@@QAEXVTUid@@PAVMGSTabbedViewOwner@@@Z @ 28 NONAME ; void CGSTabHelper::CreateTabGroupL(class TUid, class MGSTabbedViewOwner *) + ?DynInitMenuPaneL@CGSParentPlugin@@MAEXHPAVCEikMenuPane@@@Z @ 29 NONAME ; void CGSParentPlugin::DynInitMenuPaneL(int, class CEikMenuPane *) + ?RemoveTabGroup@CGSTabHelper@@QAEXXZ @ 30 NONAME ; void CGSTabHelper::RemoveTabGroup(void) + ?DoDeactivate@CGSBaseView@@UAEXXZ @ 31 NONAME ; void CGSBaseView::DoDeactivate(void) + ?RequestPriority@CGSPluginLoader@@QAEXW4TPriority@CActive@@@Z @ 32 NONAME ; void CGSPluginLoader::RequestPriority(enum CActive::TPriority) + ?ConstructL@CGSPluginLoader@@AAEXPAVCAknViewAppUi@@@Z @ 33 NONAME ; void CGSPluginLoader::ConstructL(class CAknViewAppUi *) + ?AbortAsyncLoad@CGSPluginLoader@@QAEXXZ @ 34 NONAME ; void CGSPluginLoader::AbortAsyncLoad(void) + ?OpenLocalizedResourceFileL@CGSBaseView@@QAEXABVTDesC16@@AAVRConeResourceLoader@@@Z @ 35 NONAME ; void CGSBaseView::OpenLocalizedResourceFileL(class TDesC16 const &, class RConeResourceLoader &) + ?ResetSelectedItemIndex@CGSBaseView@@UAEXXZ @ 36 NONAME ; void CGSBaseView::ResetSelectedItemIndex(void) + ?BaseConstructL@CGSParentPlugin@@QAEXHH@Z @ 37 NONAME ; void CGSParentPlugin::BaseConstructL(int, int) + ??1CGSEComNotifier@@UAE@XZ @ 38 NONAME ; CGSEComNotifier::~CGSEComNotifier(void) + ?DoDeactivate@CGSParentPlugin@@MAEXXZ @ 39 NONAME ; void CGSParentPlugin::DoDeactivate(void) + ?DoActivateL@CGSParentPlugin@@MAEXABVTVwsViewId@@VTUid@@ABVTDesC8@@@Z @ 40 NONAME ; void CGSParentPlugin::DoActivateL(class TVwsViewId const &, class TUid, class TDesC8 const &) + ?OfferKeyEventL@CGSBaseContainer@@EAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 41 NONAME ; enum TKeyResponse CGSBaseContainer::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode) + ?NewL@CGSEComNotifier@@SAPAV1@PAVMGSEComObserver@@V?$RPointerArray@VCImplementationInformation@@@@@Z @ 42 NONAME ; class CGSEComNotifier * CGSEComNotifier::NewL(class MGSEComObserver *, class RPointerArray) + ?Get@CGSPubSubsListener@@QAEHAAH@Z @ 43 NONAME ; int CGSPubSubsListener::Get(int &) + ?SortPluginsL@CGSPluginLoader@@QAEXPAV?$CArrayPtrFlat@VCGSPluginInterface@@@@@Z @ 44 NONAME ; void CGSPluginLoader::SortPluginsL(class CArrayPtrFlat *) + ??1CGSTabHelper@@UAE@XZ @ 45 NONAME ; CGSTabHelper::~CGSTabHelper(void) + ?HandlePluginLoaded@CGSParentPlugin@@UAEXW4KGSPluginLoaderStatus@MGSPluginLoadObserver@@@Z @ 46 NONAME ; void CGSParentPlugin::HandlePluginLoaded(enum MGSPluginLoadObserver::KGSPluginLoaderStatus) + ?ListBoxType@CGSParentPlugin@@UAE?AW4TGSListboxTypes@@XZ @ 47 NONAME ; enum TGSListboxTypes CGSParentPlugin::ListBoxType(void) + ?FocusChanged@CGSBaseContainer@@UAEXW4TDrawNow@@@Z @ 48 NONAME ; void CGSBaseContainer::FocusChanged(enum TDrawNow) + ?UpperLevelViewUid@CGSParentPlugin@@UAE?AVTUid@@XZ @ 49 NONAME ; class TUid CGSParentPlugin::UpperLevelViewUid(void) + ?OptionFlags@CGSParentPlugin@@UBEABV?$TBitFlagsT@K@@XZ @ 50 NONAME ; class TBitFlagsT const & CGSParentPlugin::OptionFlags(void) const + ?BaseConstructL@CGSBaseContainer@@QAEXABVTRect@@HH@Z @ 51 NONAME ; void CGSBaseContainer::BaseConstructL(class TRect const &, int, int) + ?TabChangedL@CGSTabHelper@@UAEXH@Z @ 52 NONAME ; void CGSTabHelper::TabChangedL(int) + ?CountComponentControls@CGSBaseContainer@@EBEHXZ @ 53 NONAME ; int CGSBaseContainer::CountComponentControls(void) const + ?NewLC@CGSTabHelper@@SAPAV1@XZ @ 54 NONAME ; class CGSTabHelper * CGSTabHelper::NewLC(void) + ?SetCurrentItem@CGSBaseView@@UAEXH@Z @ 55 NONAME ; void CGSBaseView::SetCurrentItem(int) + ??1CGSBaseView@@UAE@XZ @ 56 NONAME ; CGSBaseView::~CGSBaseView(void) + ?Get@CGSPubSubsListener@@QAEHAAVTDes16@@@Z @ 57 NONAME ; int CGSPubSubsListener::Get(class TDes16 &) + ?PreparePluginCacheL@CGSBaseDocument@@QAEXAAVCEikAppUi@@@Z @ 58 NONAME ; void CGSBaseDocument::PreparePluginCacheL(class CEikAppUi &) + ?HandleResourceChange@CGSBaseContainer@@UAEXH@Z @ 59 NONAME ; void CGSBaseContainer::HandleResourceChange(int) + ?UpdateView@CGSParentPlugin@@UAEXXZ @ 60 NONAME ; void CGSParentPlugin::UpdateView(void) + ?TransferDynamicPluginL@CGSParentPlugin@@UAEXPAVCGSPluginInterface@@@Z @ 61 NONAME ; void CGSParentPlugin::TransferDynamicPluginL(class CGSPluginInterface *) + ?SizeChanged@CGSBaseContainer@@EAEXXZ @ 62 NONAME ; void CGSBaseContainer::SizeChanged(void) + ??0CGSBaseContainer@@QAE@XZ @ 63 NONAME ; CGSBaseContainer::CGSBaseContainer(void) + ??1CGSParentPlugin@@UAE@XZ @ 64 NONAME ; CGSParentPlugin::~CGSParentPlugin(void) + ?NewPluginUnloadWrapperLC@CGSBaseDocument@@QAEPAVCGSPluginWrapper@@XZ @ 65 NONAME ; class CGSPluginWrapper * CGSBaseDocument::NewPluginUnloadWrapperLC(void) + ?HandleListBoxEventL@CGSBaseView@@MAEXPAVCEikListBox@@W4TListBoxEvent@MEikListBoxObserver@@@Z @ 66 NONAME ; void CGSBaseView::HandleListBoxEventL(class CEikListBox *, enum MEikListBoxObserver::TListBoxEvent) + ?OpenLocalizedResourceFileL@CGSParentPlugin@@QAEXABVTDesC16@@AAVRConeResourceLoader@@@Z @ 67 NONAME ; void CGSParentPlugin::OpenLocalizedResourceFileL(class TDesC16 const &, class RConeResourceLoader &) + ?DoActivateL@CGSBaseView@@UAEXABVTVwsViewId@@VTUid@@ABVTDesC8@@@Z @ 68 NONAME ; void CGSBaseView::DoActivateL(class TVwsViewId const &, class TUid, class TDesC8 const &) + ?CreateTabGroupL@CGSTabHelper@@QAEXVTUid@@PAV?$CArrayPtrFlat@VCGSPluginInterface@@@@@Z @ 69 NONAME ; void CGSTabHelper::CreateTabGroupL(class TUid, class CArrayPtrFlat *) + ??0CGSBaseView@@QAE@XZ @ 70 NONAME ; CGSBaseView::CGSBaseView(void) + ??1CGSPluginWrapper@@UAE@XZ @ 71 NONAME ; CGSPluginWrapper::~CGSPluginWrapper(void) + ?FocusChanged@CGSParentContainer@@UAEXW4TDrawNow@@@Z @ 72 NONAME ; void CGSParentContainer::FocusChanged(enum TDrawNow) + ?LoadAsyncL@CGSPluginLoader@@QAEXVTUid@@0PAV?$CArrayPtrFlat@VCGSPluginInterface@@@@@Z @ 73 NONAME ; void CGSPluginLoader::LoadAsyncL(class TUid, class TUid, class CArrayPtrFlat *) + ?ConstructL@CGSBaseDocument@@IAEXXZ @ 74 NONAME ; void CGSBaseDocument::ConstructL(void) + ?CreateContainerL@CGSBaseView@@MAEXXZ @ 75 NONAME ; void CGSBaseView::CreateContainerL(void) + ??0CGSBaseDocument@@IAE@AAVCEikApplication@@@Z @ 76 NONAME ; CGSBaseDocument::CGSBaseDocument(class CEikApplication &) + ?CreateShimmedViewL@CGSBaseDocument@@QAEXVTUid@@@Z @ 77 NONAME ; void CGSBaseDocument::CreateShimmedViewL(class TUid) + ?NewL@CGsContainerExt@@SAPAV1@XZ @ 78 NONAME ; class CGsContainerExt * CGsContainerExt::NewL(void) + ?NewL@CGsDoubleClickPreventer@@SAPAV1@XZ @ 79 NONAME ; class CGsDoubleClickPreventer * CGsDoubleClickPreventer::NewL(void) + ?Start@CGsDoubleClickPreventer@@QAEXXZ @ 80 NONAME ; void CGsDoubleClickPreventer::Start(void) + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/BWINS/GSListBoxU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/BWINS/GSListBoxU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +EXPORTS + ??1CGSListboxEntry@@UAE@XZ @ 1 NONAME ; CGSListboxEntry::~CGSListboxEntry(void) + ?Caption@CGSListboxEntry@@QBEABVTDesC16@@XZ @ 2 NONAME ; class TDesC16 const & CGSListboxEntry::Caption(void) const + ?CurrentFeature@CGSItemTextArray@@UBEHXZ @ 3 NONAME ; int CGSItemTextArray::CurrentFeature(void) const + ?CurrentFeature@CGSListBoxItemTextArray@@UBEHXZ @ 4 NONAME ; int CGSListBoxItemTextArray::CurrentFeature(void) const + ?CurrentFeature@CGSRadioButtonSettingPageItemTextArray@@UBEHXZ @ 5 NONAME ; int CGSRadioButtonSettingPageItemTextArray::CurrentFeature(void) const + ?FeatureByIdL@CGSItemTextArray@@QBEPBVCGSListboxEntry@@H@Z @ 6 NONAME ; class CGSListboxEntry const * CGSItemTextArray::FeatureByIdL(int) const + ?FeatureId@CGSListboxEntry@@QBEHXZ @ 7 NONAME ; int CGSListboxEntry::FeatureId(void) const + ?FeatureIdByIndex@CGSItemTextArray@@QBEHH@Z @ 8 NONAME ; int CGSItemTextArray::FeatureIdByIndex(int) const + ?GetItemCaptionFromFeatureIdLC@CGSItemTextArray@@SAPAVHBufC16@@KHAAVCCoeEnv@@@Z @ 9 NONAME ; class HBufC16 * CGSItemTextArray::GetItemCaptionFromFeatureIdLC(unsigned long, int, class CCoeEnv &) + ?IndexForFeatureIdL@CGSItemTextArray@@QBEHH@Z @ 10 NONAME ; int CGSItemTextArray::IndexForFeatureIdL(int) const + ?MdcaCount@CGSItemTextArray@@UBEHXZ @ 11 NONAME ; int CGSItemTextArray::MdcaCount(void) const + ?MdcaPoint@CGSItemTextArray@@UBE?AVTPtrC16@@H@Z @ 12 NONAME ; class TPtrC16 CGSItemTextArray::MdcaPoint(int) const + ?NewL@CGSItemTextArray@@SAPAV1@KAAVCCoeEnv@@@Z @ 13 NONAME ; class CGSItemTextArray * CGSItemTextArray::NewL(unsigned long, class CCoeEnv &) + ?NewL@CGSListBoxItemTextArray@@SAPAV1@KAAVCEikListBox@@AAVCCoeEnv@@@Z @ 14 NONAME ; class CGSListBoxItemTextArray * CGSListBoxItemTextArray::NewL(unsigned long, class CEikListBox &, class CCoeEnv &) + ?NewL@CGSRadioButtonSettingPageItemTextArray@@SAPAV1@KAAVCCoeEnv@@PAVCAknRadioButtonSettingPage@@@Z @ 15 NONAME ; class CGSRadioButtonSettingPageItemTextArray * CGSRadioButtonSettingPageItemTextArray::NewL(unsigned long, class CCoeEnv &, class CAknRadioButtonSettingPage *) + ?NewLC@CGSListboxEntry@@SAPAV1@AAVTResourceReader@@@Z @ 16 NONAME ; class CGSListboxEntry * CGSListboxEntry::NewLC(class TResourceReader &) + ?NewLC@CGSListboxEntry@@SAPAV1@H@Z @ 17 NONAME ; class CGSListboxEntry * CGSListboxEntry::NewLC(int) + ?SetDynamicTextL@CGSItemTextArray@@QAEXHABVTDesC16@@@Z @ 18 NONAME ; void CGSItemTextArray::SetDynamicTextL(int, class TDesC16 const &) + ?SetDynamicTextL@CGSListboxEntry@@QAEXABVTDesC16@@@Z @ 19 NONAME ; void CGSListboxEntry::SetDynamicTextL(class TDesC16 const &) + ?SetItemVisibilityL@CGSItemTextArray@@QAEXHW4TVisibility@1@@Z @ 20 NONAME ; void CGSItemTextArray::SetItemVisibilityL(int, enum CGSItemTextArray::TVisibility) + ?SetRadioButtonSettingPage@CGSRadioButtonSettingPageItemTextArray@@QAEXAAVCAknRadioButtonSettingPage@@@Z @ 21 NONAME ; void CGSRadioButtonSettingPageItemTextArray::SetRadioButtonSettingPage(class CAknRadioButtonSettingPage &) + ?Type@CGSListboxEntry@@QBEHXZ @ 22 NONAME ; int CGSListboxEntry::Type(void) const + ?NewL@CGSListBoxItemTextArray@@SAPAV1@KAAVCEikListBox@@AAVCCoeEnv@@H@Z @ 23 NONAME ; class CGSListBoxItemTextArray * CGSListBoxItemTextArray::NewL(unsigned long, class CEikListBox &, class CCoeEnv &, int) + ?NewLC@CGSListboxEntry@@SAPAV1@KAAVCCoeEnv@@H@Z @ 24 NONAME ; class CGSListboxEntry * CGSListboxEntry::NewLC(unsigned long, class CCoeEnv &, int) + ?SetDynamicTextDoublePaneL@CGSItemTextArray@@QAEXHABVTDesC16@@@Z @ 25 NONAME ; void CGSItemTextArray::SetDynamicTextDoublePaneL(int, class TDesC16 const &) + ?SetDynamicTextDoublePaneL@CGSListboxEntry@@QAEXABVTDesC16@@@Z @ 26 NONAME ; void CGSListboxEntry::SetDynamicTextDoublePaneL(class TDesC16 const &) + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/BWINS/GSServerEngineU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/BWINS/GSServerEngineU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,17 @@ +EXPORTS + ??0RGSServerClient@@QAE@XZ @ 1 NONAME ; RGSServerClient::RGSServerClient(void) + ??1CGSServerEngine@@UAE@XZ @ 2 NONAME ; CGSServerEngine::~CGSServerEngine(void) + ?AspectRatioL@CGSServerEngine@@QAEHXZ @ 3 NONAME ; int CGSServerEngine::AspectRatioL(void) + ?BootConfigL@CGSServerEngine@@QAEXH@Z @ 4 NONAME ; void CGSServerEngine::BootConfigL(int) + ?Close@RGSServerClient@@QAEXXZ @ 5 NONAME ; void RGSServerClient::Close(void) + ?Connect@RGSServerClient@@QAEHXZ @ 6 NONAME ; int RGSServerClient::Connect(void) + ?DisableDriver@CGSServerEngine@@QAEXXZ @ 7 NONAME ; void CGSServerEngine::DisableDriver(void) + ?FlickerFilterL@CGSServerEngine@@QAEHXZ @ 8 NONAME ; int CGSServerEngine::FlickerFilterL(void) + ?NewL@CGSServerEngine@@SAPAV1@XZ @ 9 NONAME ; class CGSServerEngine * CGSServerEngine::NewL(void) + ?NewLC@CGSServerEngine@@SAPAV1@XZ @ 10 NONAME ; class CGSServerEngine * CGSServerEngine::NewLC(void) + ?SetAspectRatioL@CGSServerEngine@@QAEXH@Z @ 11 NONAME ; void CGSServerEngine::SetAspectRatioL(int) + ?SetFlickerFilterL@CGSServerEngine@@QAEXH@Z @ 12 NONAME ; void CGSServerEngine::SetFlickerFilterL(int) + ?SetTvSystemL@CGSServerEngine@@QAEXH@Z @ 13 NONAME ; void CGSServerEngine::SetTvSystemL(int) + ?TvSystemL@CGSServerEngine@@QAEHXZ @ 14 NONAME ; int CGSServerEngine::TvSystemL(void) + ?ListenForTvCableEventsL@CGSServerEngine@@QAEXH@Z @ 15 NONAME ; void CGSServerEngine::ListenForTvCableEventsL(int) + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/Cenrep/SettingsPrivateCRKeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/Cenrep/SettingsPrivateCRKeys.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,175 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Settings UIs private Central Repository keys. +* +*/ + + +#ifndef SETTINGSPRIVATECRKEYS_H +#define SETTINGSPRIVATECRKEYS_H + +// INCLUDES +#include + +// CONSTANTS + +// --------------------------------------------------------------------------- +/** Following keys belong to category KCRUidMiscSettings */ + +/** +* +* String value. +*/ +const TUint32 KWatchDogQuarantine = 0x00000001; + +/** +* +* String value. +*/ +const TUint32 KWatchDogBlackList = 0x00000002; +const TUint32 KWatchDogGSRunning = 0x00000003; +const TUint32 KWatchDogCrashCounter = 0x00000004; +const TUint32 KWatchdogActivationLimit = 0x00000005; +const TUint32 KWatchdogMaxPluginBlackListedRuns = 0x00000006; + + +// --------------------------------------------------------------------------- +/** Following keys belong to category KCRUidNetworkSettings */ + +/** +* This key is required for the programs to control if the "network mode" +* item should be available in the UI. +* +* Possible integer values: +* 0 = "network mode" item hidden +* 1 = "network mode" item visible in GS +*/ +const TUint32 KSettingsNetworkMode = 0x00000001; + +/** +* This key is required for the programs to list the supported +* network mode UI list items that will be visible from GS setting page. +*/ +const TUint32 KSettingsNetworkModeList = 0x00000002; + +/** +* This key is required for the programs to set a default value to the +* network mode UI list item visible from GS. +* This value is used to display the selected item from associated setting page. +* +* Possible integer values: +* 0 = Dual mode +* 1 = UMTS +* 2 = GSM +*/ +const TUint32 KSettingsNetworkModeValue = 0x00000003; + +/** +* HSDPA Visibility +* +* Possible values: +* 0 = Hide +* 1 = Show +*/ +const TUint32 KSettingsHSDPAVisbility = 0x00000007; + +/** +* HSDPA Value +* +* Possible values: +* 0 = Disable +* 1 = Enable +*/ +const TUint32 KSettingsHSDPAValue = 0x00000008; + + +// --------------------------------------------------------------------------- +/** Following keys belong to category KCRUidPersonalizationSettings */ + +/** +* Background image. +* Possible values are: +* 0 = No image +* 1 = Image used +*/ +const TUint32 KSettingsBackgroundImage = 0x00000001; + +/** +* Background image path. +* The value is a string which length can vary from 0 to maximum length. +*/ +const TUint32 KSettingsBackgroundImagePath = 0x00000002; + +/** +* Hide/Unhide user welcome note item in UI. +* 0 = Hide +* 1 = Show +*/ +const TUint32 KSettingsWelcomeNoteSupported = 0x00000005; + + +// --------------------------------------------------------------------------- +/** Following keys belong to category KCRUidCdmaTelephonySettings */ + +/** +* This key indicates whether the call guard is activated +* for MO and MT calls. +* +* 0 = Disabled +* 1 = Enabled +*/ +const TUint32 KSettingsCallGuard = 0x00000001; + + +/** +* This key indicates whether voice privacy settings +* needs to be included and voice privacy status. +* +* Possible integer values: +* 0 = Option 1 - {VP Menu excluded, VP Off} +* 1 = Option 2 - {VP Menu excluded, VP On} +* 2 = Option 3 - {VP Menu included, VP Off} +* 3 = Option 4 - {VP Menu included, VP On} +*/ +const TUint32 KSettingsVoicePrivacy = 0x00000002; + + +/** +* This key indicates whether the distinctive ring tone +* is enabled while roaming. +* +* 0 = Disabled +* 1 = Enabled +*/ +const TUint32 KSettingsRoamingRingingTone = 0x00000003; + + +// --------------------------------------------------------------------------- +/** Following keys belong to category KCRUidSettingsVariation */ + +/** +* Settings Variation API +* Keys under this category are used in defining settings variation. +*/ +const TUid KCRUidSettingsVariation = {0x1020720A}; + +/** +* Settings Local Variation Flags. Values are defined in GeneralSettingsVariant.hrh. +*/ +const TUint32 KSettingsVariationFlags = 0x00000001; + + +#endif // SETTINGSPRIVATECRKEYS_H + +// End of file \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/Cenrep/keys_s60settingsuis.xls Binary file gssettingsuis/Gs/Cenrep/keys_s60settingsuis.xls has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/Data/GSCommonResources.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/Data/GSCommonResources.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,189 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Common resources for internal GS plugins. This .rss is +* included by other .rss files. This should not be compiled + alone. +* +*/ + +// RESOURCE IDENTIFIER +//NAME GSCR // 4 letter ID + +// INCLUDES +#include // Common localized GS strings +#include // Common GS resource structures + +#include +#include +#include +#include +#include + +// CONSTANTS + +// ----------------------------------------------------------------------------- +// +// r_gs_menubar_change_exit +// GS menu with 'change' and 'exit' items. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_BAR r_gs_menubar_change_exit + { + titles = + { + MENU_TITLE + { + menu_pane = r_gs_menu_item_exit; + }, + MENU_TITLE + { + menu_pane = r_gs_menu_item_help; + }, + MENU_TITLE + { + menu_pane = r_gs_menu_item_change; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_gs_menubar_open_exit +// GS menu with 'Open' and 'Exit' items. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_BAR r_gs_menubar_open_exit + { + titles = + { + MENU_TITLE + { + menu_pane = r_gs_menu_item_exit; + }, + MENU_TITLE + { + menu_pane = r_gs_menu_item_help; + }, + MENU_TITLE + { + menu_pane = r_gs_menu_item_open; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_menu_item_open +// Open item. +// +//---------------------------------------------------- + +RESOURCE MENU_PANE r_gs_menu_item_open + { + items = + { + MENU_ITEM + { + command = EAknSoftkeyOpen; + txt = qtn_set_options_open; + flags = EEikMenuItemAction; // action command + } + }; + } + + +// ----------------------------------------------------------------------------- +// +// r_gs_menu_item_exit +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_menu_item_exit + { + items = + { + MENU_ITEM + { + command = EAknCmdExit; + txt = qtn_options_exit; + } + }; + } + + +// ----------------------------------------------------------------------------- +// +// r_gs_menu_item_change +// Change item. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_menu_item_change + { + items = + { + MENU_ITEM + { + command = EGSCmdAppChange; + txt = qtn_set_options_change; + flags = EEikMenuItemAction; // action command + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_gs_menu_item_help +// Change item. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_menu_item_help + { + items = + { + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + } + }; + } + + +// ----------------------------------------------------------------------------- +// +// r_setting_listbox +// Common listbox editor resource for setting pages. +// +// ----------------------------------------------------------------------------- +// +RESOURCE LISTBOX r_setting_listbox + { + flags = EEikListBoxMultipleSelection; + } + + +// ----------------------------------------------------------------------------- +// +// r_gs_cba_exit +// Exit text for RSK +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_gs_cba_exit { buf = text_softkey_exit; } + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/Data/SoftReject.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/Data/SoftReject.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,193 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Resource file for Soft Reject +* +*/ + +// RESOURCE IDENTIFIER +NAME PHSR // 4 letter ID + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include "SoftReject.loc" +//#include "Phone.hrh" + +// RESOURCE DEFINITIONS + +RESOURCE RSS_SIGNATURE + { + } + +//----------------------------------------------------------------------------- +// +// r_soft_reject_on +// Soft reject: "On" +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_soft_reject_on + { + buf = qtn_gs_soft_on; + } + +//----------------------------------------------------------------------------- +// +// r_soft_reject_off +// Soft reject: "Off" +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_soft_reject_off + { + buf = qtn_gs_soft_off; + } + +//---------------------------------------------------- +// +// qtn_gs_soft_reject_text_title +// Soft Reject Text setting page resources +// "Soft Reject" +//---------------------------------------------------- +// +RESOURCE TBUF r_soft_reject_text + { + buf = qtn_gs_soft_reject_text_title; + } + +//----------------------------------------------------------------------------- +// +// r_soft_reject_default_txt +// Default text for Soft reject. +// "Hi, I’m busy at the moment, but I contact you a bit later." +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_soft_reject_default_txt + { + buf = qtn_gs_soft_default_text; + } + +//----------------------------------------------------------------------------- +// +// r_soft_reject_txt_title +// Default text title. +// "Text for Soft reject" +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_soft_reject_txt_title + { + buf = qtn_gs_soft_reject_text; + } + +//---------------------------------------------------- +// +// r_setting_app_edwin +// Text editor for Soft Reject text. +// +//---------------------------------------------------- +// +RESOURCE EDWIN r_setting_app_edwin + { + flags = 0; + width = 9; + lines = 5; + maxlength = 160; + numeric_keymap = EAknEditorStandardNumberModeKeymap; + allowed_input_modes = EAknEditorAllInputModes; + default_input_mode = EAknEditorTextInputMode; + } + +//---------------------------------------------------- +// +// r_text_setting_page +// Setting page for Soft Reject text. +// "Text for Soft reject" +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_text_setting_page + { + label= qtn_gs_soft_reject_text_title; + type = EEikCtEdwin; + editor_resource_id = r_setting_app_edwin; + } + +//---------------------------------------------------- +// +// qtn_mocal_sett_softrej_title +// Soft Reject setting page resources +// "Soft reject" +//---------------------------------------------------- +// +RESOURCE TBUF r_soft_reject + { + buf = qtn_mocal_sett_softrej_title; + } + +/* +// ----------------------------------------------------------------------------- +// +// r_phone_softkeys_options_softreject +// It is softkeys for soft reject. +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_phone_softkeys_options_softreject + { + buttons = + { + CBA_BUTTON + { + id = EPhoneCmdOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id = EPhoneCallComingCmdSoftReject; + txt = qtn_softkey_soft_reject; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_phone_softkeys_options_softreject_slider +// It is softkeys for soft reject with slider devices. +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_phone_softkeys_options_softreject_slider + { + buttons = + { + CBA_BUTTON + { + id = EPhoneCallComingCmdAnswer; + txt = text_softkey_answer; + }, + CBA_BUTTON + { + id = EPhoneCallComingCmdSoftReject; + txt = qtn_softkey_soft_reject; + } + }; + } +*/ + +//End of File \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/Data/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/Data/backup_registration.xml Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/EABI/BackgroundImageU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/EABI/BackgroundImageU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,18 @@ +EXPORTS + _ZN18CGSBackgroundImage12DeleteImageLERK7TDesC16 @ 1 NONAME + _ZN18CGSBackgroundImage13GetPlnsStatusEv @ 2 NONAME + _ZN18CGSBackgroundImage16BackgroundImageLEv @ 3 NONAME + _ZN18CGSBackgroundImage19SetBackgroundImageLEi @ 4 NONAME + _ZN18CGSBackgroundImage20SetVTStillImagePathLERK7TDesC16R21CGSAsyncImageHandling @ 5 NONAME + _ZN18CGSBackgroundImage20SetWelcomeNoteImageLERK7TDesC16R21CGSAsyncImageHandling @ 6 NONAME + _ZN18CGSBackgroundImage23SetBackgroundImagePathLERK7TDesC16 @ 7 NONAME + _ZN18CGSBackgroundImage23SetBackgroundImagePathLERK7TDesC16R6TDes16 @ 8 NONAME + _ZN18CGSBackgroundImage23SetBackgroundImagePathLERK7TDesC16R6TDes1616TGSWallpaperType @ 9 NONAME + _ZN18CGSBackgroundImage29IsPersonalisationApplicationLEv @ 10 NONAME + _ZN18CGSBackgroundImage4NewLEv @ 11 NONAME + _ZN21CGSAsyncImageHandling4NewLER3RFsP29MGSAsyncImageHandlingObserverRK7TDesC16 @ 12 NONAME + _ZTI18CGSBackgroundImage @ 13 NONAME ; ## + _ZTI21CGSAsyncImageHandling @ 14 NONAME ; ## + _ZTV18CGSBackgroundImage @ 15 NONAME ; ## + _ZTV21CGSAsyncImageHandling @ 16 NONAME ; ## + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/EABI/GSEcomPluginU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/EABI/GSEcomPluginU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,20 @@ +EXPORTS + _ZN18CGSPluginInterface11CreateIconLE4TUid @ 1 NONAME + _ZN18CGSPluginInterface15HandleSelectionE17TGSSelectionTypes @ 2 NONAME + _ZN18CGSPluginInterface16CustomOperationLEPvS0_ @ 3 NONAME + _ZN18CGSPluginInterface4NewLE4TUidPv @ 4 NONAME + _ZN18CGSPluginInterface8GetValueE18TGSPluginValueKeysR6TDes16 @ 5 NONAME + _ZN18CGSPluginInterface8ItemTypeEv @ 6 NONAME + _ZN18CGSPluginInterfaceC2Ev @ 7 NONAME + _ZN18CGSPluginInterfaceD0Ev @ 8 NONAME + _ZN18CGSPluginInterfaceD1Ev @ 9 NONAME + _ZN18CGSPluginInterfaceD2Ev @ 10 NONAME + _ZNK18CGSPluginInterface22PluginProviderCategoryEv @ 11 NONAME + _ZNK18CGSPluginInterface7VisibleEv @ 12 NONAME + _ZTI18CGSPluginInterface @ 13 NONAME ; ## + _ZTV18CGSPluginInterface @ 14 NONAME ; ## + _ZN18CGSPluginInterface22ResetSelectedItemIndexEv @ 15 NONAME + _ZN18CGSPluginInterface18MenuActivationItemEv @ 16 NONAME + _ZN18CGSPluginInterface8SetOrderEi @ 17 NONAME + _ZN18CGSPluginInterface20GetEcomDestructorKeyEv @ 18 NONAME + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/EABI/GSFrameworkU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/EABI/GSFrameworkU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,125 @@ +EXPORTS + _ZN11CGSBaseView11DoActivateLERK10TVwsViewId4TUidRK6TDesC8 @ 1 NONAME + _ZN11CGSBaseView12DoDeactivateEv @ 2 NONAME + _ZN11CGSBaseView12SetNaviPaneLEv @ 3 NONAME + _ZN11CGSBaseView14SetCurrentItemEi @ 4 NONAME + _ZN11CGSBaseView16CreateContainerLEv @ 5 NONAME + _ZN11CGSBaseView19HandleListBoxEventLEP11CEikListBoxN19MEikListBoxObserver13TListBoxEventE @ 6 NONAME + _ZN11CGSBaseView22CreateNaviPaneContextLEi @ 7 NONAME + _ZN11CGSBaseView26OpenLocalizedResourceFileLERK7TDesC16R19RConeResourceLoader @ 8 NONAME + _ZN11CGSBaseView9ContainerEv @ 9 NONAME + _ZN11CGSBaseViewC2Ev @ 10 NONAME + _ZN11CGSBaseViewD0Ev @ 11 NONAME + _ZN11CGSBaseViewD1Ev @ 12 NONAME + _ZN11CGSBaseViewD2Ev @ 13 NONAME + _ZN12CGSTabHelper11TabChangedLEi @ 14 NONAME + _ZN12CGSTabHelper14RemoveTabGroupEv @ 15 NONAME + _ZN12CGSTabHelper15CreateTabGroupLE4TUidP13CArrayPtrFlatI13MGSTabbedViewE @ 16 NONAME + _ZN12CGSTabHelper15CreateTabGroupLE4TUidP13CArrayPtrFlatI18CGSPluginInterfaceE @ 17 NONAME + _ZN12CGSTabHelper15CreateTabGroupLE4TUidP18MGSTabbedViewOwner @ 18 NONAME + _ZN12CGSTabHelper4NewLEv @ 19 NONAME + _ZN12CGSTabHelper5NewLCEv @ 20 NONAME + _ZN12CGSTabHelperD0Ev @ 21 NONAME + _ZN12CGSTabHelperD1Ev @ 22 NONAME + _ZN12CGSTabHelperD2Ev @ 23 NONAME + _ZN15CGSParentPlugin10UpdateViewEv @ 24 NONAME + _ZN15CGSParentPlugin11DoActivateLERK10TVwsViewId4TUidRK6TDesC8 @ 25 NONAME + _ZN15CGSParentPlugin11ListBoxTypeEv @ 26 NONAME + _ZN15CGSParentPlugin12DoDeactivateEv @ 27 NONAME + _ZN15CGSParentPlugin14BaseConstructLEii @ 28 NONAME + _ZN15CGSParentPlugin14HandleCommandLEi @ 29 NONAME + _ZN15CGSParentPlugin17UpperLevelViewUidEv @ 30 NONAME + _ZN15CGSParentPlugin18HandlePluginLoadedEN21MGSPluginLoadObserver21KGSPluginLoaderStatusE @ 31 NONAME + _ZN15CGSParentPlugin22ResetSelectedItemIndexEv @ 32 NONAME + _ZN15CGSParentPlugin26OpenLocalizedResourceFileLERK7TDesC16R19RConeResourceLoader @ 33 NONAME + _ZN15CGSParentPluginC2Ev @ 34 NONAME + _ZN15CGSParentPluginD0Ev @ 35 NONAME + _ZN15CGSParentPluginD1Ev @ 36 NONAME + _ZN15CGSParentPluginD2Ev @ 37 NONAME + _ZN15CGSPluginLoader10ConstructLEP13CAknViewAppUi @ 38 NONAME + _ZN15CGSPluginLoader10LoadAsyncLE4TUidS0_P13CArrayPtrFlatI18CGSPluginInterfaceE @ 39 NONAME + _ZN15CGSPluginLoader11SetObserverEP21MGSPluginLoadObserver @ 40 NONAME + _ZN15CGSPluginLoader14AbortAsyncLoadEv @ 41 NONAME + _ZN15CGSPluginLoader15LoadNextPluginLEv @ 42 NONAME + _ZN15CGSPluginLoader4NewLEP13CAknViewAppUi @ 43 NONAME + _ZN15CGSPluginLoaderD0Ev @ 44 NONAME + _ZN15CGSPluginLoaderD1Ev @ 45 NONAME + _ZN15CGSPluginLoaderD2Ev @ 46 NONAME + _ZN16CGSBaseContainer11SizeChangedEv @ 47 NONAME + _ZN16CGSBaseContainer14BaseConstructLERK5TRectii @ 48 NONAME + _ZN16CGSBaseContainer14OfferKeyEventLERK9TKeyEvent10TEventCode @ 49 NONAME + _ZN16CGSBaseContainer20HandleResourceChangeEi @ 50 NONAME + _ZN16CGSBaseContainerC2Ev @ 51 NONAME + _ZN16CGSBaseContainerD0Ev @ 52 NONAME + _ZN16CGSBaseContainerD1Ev @ 53 NONAME + _ZN16CGSBaseContainerD2Ev @ 54 NONAME + _ZNK16CGSBaseContainer16ComponentControlEi @ 55 NONAME + _ZNK16CGSBaseContainer22CountComponentControlsEv @ 56 NONAME + _ZTI11CGSBaseView @ 57 NONAME ; ## + _ZTI12CGSTabHelper @ 58 NONAME ; ## + _ZTI15CGSParentPlugin @ 59 NONAME ; ## + _ZTI15CGSPluginLoader @ 60 NONAME ; ## + _ZTI16CGSBaseContainer @ 61 NONAME ; ## + _ZTI18CGSParentContainer @ 62 NONAME ; ## + _ZTV11CGSBaseView @ 63 NONAME ; ## + _ZTV12CGSTabHelper @ 64 NONAME ; ## + _ZTV15CGSParentPlugin @ 65 NONAME ; ## + _ZTV15CGSPluginLoader @ 66 NONAME ; ## + _ZTV16CGSBaseContainer @ 67 NONAME ; ## + _ZTV18CGSParentContainer @ 68 NONAME ; ## + _ZThn4_N12CGSTabHelper11TabChangedLEi @ 69 NONAME ; ## + _ZThn88_N11CGSBaseView19HandleListBoxEventLEP11CEikListBoxN19MEikListBoxObserver13TListBoxEventE @ 70 NONAME ; ## + _ZThn88_N15CGSParentPlugin18HandlePluginLoadedEN21MGSPluginLoadObserver21KGSPluginLoaderStatusE @ 71 NONAME ; ## + _ZN11CGSBaseView22ResetSelectedItemIndexEv @ 72 NONAME + _ZN16CGSBaseContainer12SelectedItemEv @ 73 NONAME + _ZN16CGSBaseContainer15SetSelectedItemEi @ 74 NONAME + _ZN15CGSParentPlugin14GetHelpContextER15TCoeHelpContext @ 75 NONAME + _ZN15CGSParentPlugin14SetOptionFlagsER10TBitFlagsTImE @ 76 NONAME + _ZN15CGSParentPlugin16DynInitMenuPaneLEiP12CEikMenuPane @ 77 NONAME + _ZNK15CGSParentPlugin11OptionFlagsEv @ 78 NONAME + _ZThn12_N15CGSParentPlugin16DynInitMenuPaneLEiP12CEikMenuPane @ 79 NONAME ; ## + _ZN16CGSBaseContainer12FocusChangedE8TDrawNow @ 80 NONAME + _ZN18CGSParentContainer12FocusChangedE8TDrawNow @ 81 NONAME + _ZN15CGSBaseDocument10ConstructLEv @ 82 NONAME + _ZN15CGSBaseDocument24NewPluginUnloadWrapperLCEv @ 83 NONAME + _ZN15CGSBaseDocumentC2ER15CEikApplication @ 84 NONAME + _ZN15CGSBaseDocumentD0Ev @ 85 NONAME + _ZN15CGSBaseDocumentD1Ev @ 86 NONAME + _ZN15CGSBaseDocumentD2Ev @ 87 NONAME + _ZN16CGSPluginWrapper10SetDetailsE4TUid @ 88 NONAME + _ZN16CGSPluginWrapperD0Ev @ 89 NONAME + _ZN16CGSPluginWrapperD1Ev @ 90 NONAME + _ZN16CGSPluginWrapperD2Ev @ 91 NONAME + _ZTI15CGSBaseDocument @ 92 NONAME ; ## + _ZTV15CGSBaseDocument @ 93 NONAME ; ## + _ZN15CGSParentPlugin22TransferDynamicPluginLEP18CGSPluginInterface @ 94 NONAME + _ZN15CGSPluginLoader12SortPluginsLEP13CArrayPtrFlatI18CGSPluginInterfaceE @ 95 NONAME + _ZThn92_N15CGSParentPlugin22TransferDynamicPluginLEP18CGSPluginInterface @ 96 NONAME ; ## + _ZN18CGSPubSubsListener3GetER5TDes8 @ 97 NONAME + _ZN18CGSPubSubsListener3GetER6TDes16 @ 98 NONAME + _ZN18CGSPubSubsListener3GetERi @ 99 NONAME + _ZN18CGSPubSubsListener4NewLE4TUidiP20MGSSettingPSObserver @ 100 NONAME + _ZN18CGSPubSubsListenerD0Ev @ 101 NONAME + _ZN18CGSPubSubsListenerD1Ev @ 102 NONAME + _ZN18CGSPubSubsListenerD2Ev @ 103 NONAME + _ZN15CGSBaseDocument19PreparePluginCacheLER9CEikAppUi @ 104 NONAME + _ZN15CGSBaseDocument23PrepareForUIDestructionEv @ 105 NONAME + _ZTI14CGSShimmedView @ 106 NONAME ; ## + _ZTI18CGSPlaceholderView @ 107 NONAME ; ## + _ZTI23CGSPluginAndViewIdCache @ 108 NONAME ; ## + _ZTV14CGSShimmedView @ 109 NONAME ; ## + _ZTV18CGSPlaceholderView @ 110 NONAME ; ## + _ZTV23CGSPluginAndViewIdCache @ 111 NONAME ; ## + _ZN15CGSParentPlugin14SelectedPluginEv @ 112 NONAME + _ZN15CGSBaseDocument8WatchDogEv @ 113 NONAME + _ZN15CGSBaseDocument11GetImplInfoEv @ 114 NONAME + _ZN15CGSEComNotifier4NewLEP15MGSEComObserver13RPointerArrayI26CImplementationInformationE @ 115 NONAME + _ZN15CGSEComNotifierD0Ev @ 116 NONAME + _ZN15CGSEComNotifierD1Ev @ 117 NONAME + _ZN15CGSEComNotifierD2Ev @ 118 NONAME + _ZN15CGSPluginLoader15RequestPriorityEN7CActive9TPriorityE @ 119 NONAME + _ZN15CGSBaseDocument18CreateShimmedViewLE4TUid @ 120 NONAME + _ZN15CGsContainerExt4NewLEv @ 121 NONAME + _ZN23CGsDoubleClickPreventer4NewLEv @ 122 NONAME + _ZN23CGsDoubleClickPreventer5StartEv @ 123 NONAME + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/EABI/GSListBoxU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/EABI/GSListBoxU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,40 @@ +EXPORTS + _ZN15CGSListboxEntry15SetDynamicTextLERK7TDesC16 @ 1 NONAME + _ZN15CGSListboxEntry5NewLCER15TResourceReader @ 2 NONAME + _ZN15CGSListboxEntry5NewLCEi @ 3 NONAME + _ZN15CGSListboxEntryD0Ev @ 4 NONAME + _ZN15CGSListboxEntryD1Ev @ 5 NONAME + _ZN15CGSListboxEntryD2Ev @ 6 NONAME + _ZN16CGSItemTextArray15SetDynamicTextLEiRK7TDesC16 @ 7 NONAME + _ZN16CGSItemTextArray18SetItemVisibilityLEiNS_11TVisibilityE @ 8 NONAME + _ZN16CGSItemTextArray29GetItemCaptionFromFeatureIdLCEmiR7CCoeEnv @ 9 NONAME + _ZN16CGSItemTextArray4NewLEmR7CCoeEnv @ 10 NONAME + _ZN23CGSListBoxItemTextArray4NewLEmR11CEikListBoxR7CCoeEnv @ 11 NONAME + _ZN38CGSRadioButtonSettingPageItemTextArray25SetRadioButtonSettingPageER26CAknRadioButtonSettingPage @ 12 NONAME + _ZN38CGSRadioButtonSettingPageItemTextArray4NewLEmR7CCoeEnvP26CAknRadioButtonSettingPage @ 13 NONAME + _ZNK15CGSListboxEntry4TypeEv @ 14 NONAME + _ZNK15CGSListboxEntry7CaptionEv @ 15 NONAME + _ZNK15CGSListboxEntry9FeatureIdEv @ 16 NONAME + _ZNK16CGSItemTextArray12FeatureByIdLEi @ 17 NONAME + _ZNK16CGSItemTextArray14CurrentFeatureEv @ 18 NONAME + _ZNK16CGSItemTextArray16FeatureIdByIndexEi @ 19 NONAME + _ZNK16CGSItemTextArray18IndexForFeatureIdLEi @ 20 NONAME + _ZNK16CGSItemTextArray9MdcaCountEv @ 21 NONAME + _ZNK16CGSItemTextArray9MdcaPointEi @ 22 NONAME + _ZNK23CGSListBoxItemTextArray14CurrentFeatureEv @ 23 NONAME + _ZNK38CGSRadioButtonSettingPageItemTextArray14CurrentFeatureEv @ 24 NONAME + _ZTI15CGSListboxEntry @ 25 NONAME ; ## + _ZTI16CGSItemTextArray @ 26 NONAME ; ## + _ZTI23CGSListBoxItemTextArray @ 27 NONAME ; ## + _ZTI38CGSRadioButtonSettingPageItemTextArray @ 28 NONAME ; ## + _ZTV15CGSListboxEntry @ 29 NONAME ; ## + _ZTV16CGSItemTextArray @ 30 NONAME ; ## + _ZTV23CGSListBoxItemTextArray @ 31 NONAME ; ## + _ZTV38CGSRadioButtonSettingPageItemTextArray @ 32 NONAME ; ## + _ZThn4_NK16CGSItemTextArray9MdcaCountEv @ 33 NONAME ; ## + _ZThn4_NK16CGSItemTextArray9MdcaPointEi @ 34 NONAME ; ## + _ZN15CGSListboxEntry5NewLCEmR7CCoeEnvi @ 35 NONAME + _ZN23CGSListBoxItemTextArray4NewLEmR11CEikListBoxR7CCoeEnvi @ 36 NONAME + _ZN15CGSListboxEntry25SetDynamicTextDoublePaneLERK7TDesC16 @ 37 NONAME + _ZN16CGSItemTextArray25SetDynamicTextDoublePaneLEiRK7TDesC16 @ 38 NONAME + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/EABI/GSServerEngineU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/EABI/GSServerEngineU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,24 @@ +EXPORTS + 0 @ 1 ABSENT + _ZN15CGSServerEngine12AspectRatioLEv @ 2 NONAME + _ZN15CGSServerEngine12SetTvSystemLEi @ 3 NONAME + 0 @ 4 ABSENT + _ZN15CGSServerEngine14FlickerFilterLEv @ 5 NONAME + _ZN15CGSServerEngine15SetAspectRatioLEi @ 6 NONAME + _ZN15CGSServerEngine17SetFlickerFilterLEi @ 7 NONAME + _ZN15CGSServerEngine4NewLEv @ 8 NONAME + _ZN15CGSServerEngine5NewLCEv @ 9 NONAME + _ZN15CGSServerEngine9TvSystemLEv @ 10 NONAME + _ZN15CGSServerEngineD0Ev @ 11 NONAME + _ZN15CGSServerEngineD1Ev @ 12 NONAME + _ZN15CGSServerEngineD2Ev @ 13 NONAME + _ZN15RGSServerClient5CloseEv @ 14 NONAME + _ZN15RGSServerClient7ConnectEv @ 15 NONAME + _ZN15RGSServerClientC1Ev @ 16 NONAME + _ZN15RGSServerClientC2Ev @ 17 NONAME + 0 @ 18 ABSENT + 0 @ 19 ABSENT + 0 @ 20 ABSENT + 0 @ 21 ABSENT + 0 @ 22 ABSENT + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAdminPlugin/GSAdminPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAdminPlugin/GSAdminPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for plugin. +* +*/ + + +#include // For RESOURCE_FILES_DIR + +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gsadminplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10283340 +VENDORID VID_DEFAULT + +SOURCEPATH src +SOURCE GSAdminPluginImplementationTable.cpp +SOURCE GSAdminPlugin.cpp + +USERINCLUDE inc +USERINCLUDE data +USERINCLUDE loc +USERINCLUDE ../Logger +USERINCLUDE ../Data + +SYSTEMINCLUDE /epoc32/include/ecom +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH data + +START RESOURCE 10283340.rss +TARGET gsadminplugin.rsc +END + +// View resources +START RESOURCE GSAdminPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // View resources + + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY commonengine.lib// For RConeResourceLoader +LIBRARY gsecomplugin.lib +LIBRARY gsframework.lib +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY flogger.lib // For GSLogger + +//Documents. Defining these is optional. Used only by IDE's file browser. +SOURCEPATH data +DOCUMENT 10283340.rss +DOCUMENT GSAdminPluginRsc.rss + +SOURCEPATH inc + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAdminPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAdminPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSAdminPlugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSAdminPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsadminplugin.iby ) +../rom/GSAdminPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsadminpluginresources.iby ) + +loc/GSAdminPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsadminplugin.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gsadminplugin.mif + OPTION HEADERFILE gsadminplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_cp_conn_admin +END + + +PRJ_MMPFILES +GSAdminPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAdminPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAdminPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSAdminPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAdminPlugin/data/10283340.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAdminPlugin/data/10283340.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM resource file for plugin. +* +*/ + +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x10283340; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10283341; + version_no = 1; + display_name = "Admininstration Settings Plugin"; // Debug name + default_data = "0x10207250";// Parent UID + opaque_data = "110";// Order number + } + }; + } + }; + } + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAdminPlugin/data/GSAdminPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAdminPlugin/data/GSAdminPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for plugin. +* +*/ + + +// RESOURCE IDENTIFIER +NAME ADMN // 4 letter ID + +// INCLUDES +#include +#include +#include +#include // Avkon localized strings +#include +#include +#include +#include +#include + +// CONSTANTS + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// +// +// Needed or loading the resource fails! +// +//---------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +//---------------------------------------------------- +// +// r_gs_Admin_view +// Personalisation Settings view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_admin_view + { + menubar = r_gs_menubar_open_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN; + } + + +//---------------------------------------------------- +// +// r_gs_Admin_view_title +// Personalisation Settings view title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_admin_view_title + { + txt = qtn_cp_title_adminstrative_settings; + } + + +//---------------------------------------------------- +// +// r_gs_Admin_view_caption +// Personalisation View caption for plugin +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_admin_view_caption + { + buf = qtn_cp_folder_administrative_settings; + } + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAdminPlugin/inc/GSAdminPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAdminPlugin/inc/GSAdminPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for plugin. +* +*/ + + +#ifndef GSADMINPLUGIN_H +#define GSADMINPLUGIN_H + +// Includes +#include +#include + +#include +#include + + +// Classes referenced +class CAknViewAppUi; +class RConeResourceLoader; + +// Constants +_LIT( KGSAdminPluginResourceFileName, "z:GSAdminPluginRsc.rsc" ); +_LIT( KGSAdminPluginIconDirAndName, "z:gsadminplugin.mbm"); // Use KDC_BITMAP_DIR + +// CLASS DECLARATION + +/** +* CGSAdminPlugin view class. +* +* @since Series60_3.1 +*/ +class CGSAdminPlugin : public CGSParentPlugin + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return + */ + static CGSAdminPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSAdminPlugin(); + + public: // From CAknView + + /** + * See base class. + */ + TUid Id() const; + + /** + * See base class. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + /** + * See base class. + */ + void DoDeactivate(); + + public: // From CGSParentPlugin + + /** + * See base class. + */ + TUid UpperLevelViewUid(); + + /** + * See base class. + */ + TGSListboxTypes ListBoxType(); + + /** + * See base class. + */ + void GetHelpContext( TCoeHelpContext& aContext ); + + public: // From CGSPluginInterface + + /** + * See base class. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * See base class. + */ + TInt PluginProviderCategory() const; + + protected: // New + /** + * C++ default constructor. + */ + CGSAdminPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + private: // Data + + // Resource loader. + RConeResourceLoader iResourceLoader; + }; + + +#endif // GSADMINPLUGIN_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAdminPlugin/loc/GSAdminPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAdminPlugin/loc/GSAdminPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSAdminPlugin. +* +*/ + + +// LOCALISATION STRINGS + +// **CAPTIONS + +//d:Plugin title. +//d:Long string. +//l:title_pane_t2/opt9 +//w: +//r:5.0 +// +#define qtn_cp_title_adminstrative_settings "Administrative settings" + +//d:Plugin caption. +//d:Used by GS FW. +//l:list_single_large_graphic_pane_t1 +//w: +//r:5.0 +// +#define qtn_cp_folder_administrative_settings "Administrative settings" + +// **OPTIONS MENU + +//d:Command in Options list. +//d:Opens the highlighted item. +//l:list_single_pane_t1_cp2 +//w: +//r:3.1 +// +#define qtn_set_options_open "Open" + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAdminPlugin/src/GSAdminPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAdminPlugin/src/GSAdminPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,258 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Cpp file for plugin. +* +*/ + + +// Includes +#include "GSAdminPlugin.h" +#include "GsLogger.h" + +#include +#include + +// Includes from GS framework: +#include +#include +#include +#include +#include + +#include +#include +#include // For TResourceReader +#include + +// Constants + + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CGSAdminPlugin::CGSAdminPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSAdminPlugin::CGSAdminPlugin() + : CGSParentPlugin(), iResourceLoader( *iCoeEnv ) + { + __GSLOGSTRING( "[CGSAdminPlugin] CGSAdminPlugin()" ); + + } + + +// --------------------------------------------------------------------------- +// CGSAdminPlugin::~CGSAdminPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSAdminPlugin::~CGSAdminPlugin() + { + iResourceLoader.Close(); + __GSLOGSTRING( "[CGSAdminPlugin] ~CGSAdminPlugin()" ); + } + + +// --------------------------------------------------------------------------- +// CGSAdminPlugin::ConstructL() +// +// +// --------------------------------------------------------------------------- +// +void CGSAdminPlugin::ConstructL() + { + __GSLOGSTRING( "[CGSAdminPlugin] ConstructL()" ); + OpenLocalizedResourceFileL( KGSAdminPluginResourceFileName, + iResourceLoader ); + + // Do not load content of this view untill/unless this view is activated. + // This will save memory as well as optimize loading performance for other + // plugins. + TBitFlags flags; + flags.Set( EGSLoadChildrenOnActivation ); + SetOptionFlags( flags ); + + BaseConstructL( R_GS_ADMIN_VIEW, R_GS_ADMIN_VIEW_TITLE ); + } + + +// --------------------------------------------------------------------------- +// CGSAdminPlugin::NewL() +// +// +// --------------------------------------------------------------------------- +// +CGSAdminPlugin* CGSAdminPlugin::NewL( TAny* /*aInitParams*/ ) + { + __GSLOGSTRING( "[CGSAdminPlugin] NewL()" ); + CGSAdminPlugin* self = new(ELeave) CGSAdminPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::Id() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSAdminPlugin::Id() const + { + __GSLOGSTRING1( "[CGSAdminPlugin] Id():0x%X", KGSAdminPluginUid.iUid ); + return KGSAdminPluginUid; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoActivateL() +// +// +// --------------------------------------------------------------------------- +// +void CGSAdminPlugin::DoActivateL + ( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + CGSParentPlugin::DoActivateL( aPrevViewId, + aCustomMessageId, + aCustomMessage ); + CGSMainView* parent = + static_cast ( AppUi()->View( KGSMainViewUid ) ); + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoDeactivate() +// +// +// --------------------------------------------------------------------------- +// +void CGSAdminPlugin::DoDeactivate() + { + CGSParentPlugin::DoDeactivate(); + } + + +// ========================= From CGSParentPlugin ===================== + + +// --------------------------------------------------------------------------- +// CGSAdminPlugin::UpperLevelViewUid() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSAdminPlugin::UpperLevelViewUid() + { + return KGSConPluginUid; + } + + +// ----------------------------------------------------------------------------- +// CGSAdminPlugin::GetHelpContext() +// +// +// ----------------------------------------------------------------------------- +// +void CGSAdminPlugin::GetHelpContext( TCoeHelpContext& aContext ) + { + aContext.iMajor = KUidGS; + aContext.iContext = KCP_HLP_ADMINISTRATIVE_SETTINGS; + } + + +// ========================= From CGSPluginInterface ================== + + +// --------------------------------------------------------------------------- +// CGSAdminPlugin::GetCaptionL() +// +// +// --------------------------------------------------------------------------- +// +void CGSAdminPlugin::GetCaptionL( TDes& aCaption ) const + { + // The resource file is already opened by iResourceLoader. + HBufC* result = StringLoader::LoadL( R_GS_ADMIN_VIEW_CAPTION ); + aCaption.Copy( *result ); + delete result; + } + + +// --------------------------------------------------------------------------- +// CGSAdminPlugin::CreateIconL +// +// Return the icon, if has one. +// --------------------------------------------------------------------------- +// +CGulIcon* CGSAdminPlugin::CreateIconL( const TUid aIconType ) + { + //EMbm + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSAdminPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropCpConnAdmin, + fp->FullName(), + EMbmGsadminpluginQgn_prop_cp_conn_admin, + EMbmGsadminpluginQgn_prop_cp_conn_admin_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + CleanupStack::PopAndDestroy( fp ); + + return icon; + } + +// --------------------------------------------------------------------------- +// CGSAdminPlugin::PluginProviderCategory() +// +// +// --------------------------------------------------------------------------- +// +TInt CGSAdminPlugin::PluginProviderCategory() const + { + return KGSPluginProviderInternal; + } + + +// --------------------------------------------------------------------------- +// CGSAdminPlugin::ListBoxType() +// +// +// --------------------------------------------------------------------------- +// +TGSListboxTypes CGSAdminPlugin::ListBoxType() + { + return EGSListBoxTypeSettings; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAdminPlugin/src/GSAdminPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAdminPlugin/src/GSAdminPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM prxy table for plugin. +* +*/ + + +// System includes +#include +#include + +// User includes +#include "GSAdminPlugin.h" + +// Constants +const TImplementationProxy KGSAdminPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x10283341, CGSAdminPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSAdminPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSAdminPluginImplementationTable; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSApplication/Data/GSApp.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/Data/GSApp.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,461 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Resource file for main view. +* +*/ + + +// RESOURCE IDENTIFIER +NAME GSMV // 4 letter ID + +// INCLUDES +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +// Common resources among GS +#include + +// CONSTANTS + +RESOURCE RSS_SIGNATURE + { + } + + +RESOURCE TBUF + { + buf="GSApp"; + } + +//---------------------------------------------------- +// +// EIK_APP_INFO +// It contains application information. +// +//---------------------------------------------------- +// +RESOURCE EIK_APP_INFO + { + } + + +//---------------------------------------------------- +// +// r_gs_main_view +// Main view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_main_view + { + menubar = r_gs_menubar_open_exit; + cba = r_gs_softkeys_options_exit_open; + } + +//---------------------------------------------------- +// +// r_gs_main_view_title +// Main view's title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_main_view_title + { +#ifdef RD_CONTROL_PANEL + txt = qtn_cp_title_control_panel; +#else + txt = qtn_set_title_settings; +#endif //RD_CONTROL_PANEL + } + + +RESOURCE LISTBOX r_mainview_lbx + { + flags = EEikListBoxMultipleSelection; + } + + +// ----------------------------------------------------------------------------- +// +// r_gs_menubar_open_exit +// GS menu with 'Open' and 'Exit' items. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_BAR r_gs_menubar_open_exit + { + titles = + { + MENU_TITLE + { + menu_pane = r_gs_menu_item_exit; + }, + MENU_TITLE + { + menu_pane = r_gs_menu_item_help; + }, + MENU_TITLE + { + menu_pane = r_gs_menu_item_open; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_menu_item_open +// Open item. +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_menu_item_open + { + items = + { + MENU_ITEM + { + command = EAknSoftkeyOpen; + txt = qtn_set_options_open; + flags = EEikMenuItemAction; // action command + } + }; + } + + +// ----------------------------------------------------------------------------- +// +// r_gs_menu_item_exit +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_menu_item_exit + { + items = + { + MENU_ITEM + { + command = EAknCmdExit; + txt = qtn_options_exit; + } + }; + } + + +// ----------------------------------------------------------------------------- +// +// r_gs_menu_item_help +// Help item. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_menu_item_help + { + items = + { + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + } + }; + } + + + +// SVG changes +RESOURCE LOCALISABLE_APP_INFO r_gsapp_localisable_app_info + { +#ifdef RD_CONTROL_PANEL + short_caption = qtn_apps_controlpanel_grid; +#else + short_caption = qtn_apps_settings_grid; +#endif //RD_CONTROL_PANEL + caption_and_icon = + CAPTION_AND_ICON_INFO + { +#ifdef RD_CONTROL_PANEL + caption = qtn_apps_controlpanel_list; +#else + caption = qtn_apps_settings_list; +#endif //RD_CONTROL_PANEL + number_of_icons = 1; + icon_file = "Z:"APP_BITMAP_DIR"\\GSApp_aif.mif"; + + }; + } + +//---------------------------------------------------- +// +// String for GS Cannot be opened during backup restore +// r_confirm_note_gs_exit_backup_restore_string +// +//---------------------------------------------------- +// +RESOURCE TBUF r_confirm_note_gs_exit_backup_restore_string + { buf = qtn_cp_error_open_during_backuprestore; } + +// MSK Handling + +// ----------------------------------------------------------------------------- +// +// r_gs_msk_open +// Middle softkey label: open. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_gs_msk_open + { + buf = qtn_msk_open; + } + +// ----------------------------------------------------------------------------- +// +// r_gs_msk_activate +// Middle softkey label: activate. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_gs_msk_activate + { + buf = qtn_msk_activate; + } + +// ----------------------------------------------------------------------------- +// +// r_gs_msk_select +// Middle softkey label: select. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_gs_msk_select + { + buf = qtn_msk_select; + } + +// ----------------------------------------------------------------------------- +// +// r_gs_msk_change +// Middle softkey label: change. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_gs_msk_change + { + buf = qtn_msk_change; + } + +// ----------------------------------------------------------------------------- +// +// r_gs_softkey_option +// Middle softkey label: Options. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_gs_softkey_option + { + buf = text_softkey_option; + } + +//---------------------------------------------------- +// +// r_gs_softkeys_options_back_contextoptions +// MSK activates Context Menu +// +//---------------------------------------------------- +// +RESOURCE CBA r_gs_softkeys_options_back_contextoptions + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id=EAknSoftkeyContextOptions; + txt = text_softkey_option; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_softkeys_options_back_open +// Text association with MSK ( OPEN ) +// +//---------------------------------------------------- +// +RESOURCE CBA r_gs_softkeys_options_back_open + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id=EGSCmdAppOpen; + txt = qtn_msk_open; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_softkeys_options_exit_open +// Text association with MSK ( OPEN ) +// +//---------------------------------------------------- +// +RESOURCE CBA r_gs_softkeys_options_exit_open + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyExit; + txt = text_softkey_exit; + }, + CBA_BUTTON + { + id=EGSCmdAppOpen; + txt = qtn_msk_open; + } + }; + } + + +//---------------------------------------------------- +// +// r_gs_softkeys_options_back_change +// Text association with MSK ( CHANGE ) +// +//---------------------------------------------------- +// +RESOURCE CBA r_gs_softkeys_options_back_change + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id=EGSMSKCmdAppChange; + txt = qtn_msk_change; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_softkeys_options_exit_change +// Text association with MSK ( CHANGE ) +// +//---------------------------------------------------- +// +RESOURCE CBA r_gs_softkeys_options_exit_change + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyExit; + txt = text_softkey_exit; + }, + CBA_BUTTON + { + id=EGSMSKCmdAppChange; + txt = qtn_msk_change; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_softkeys_options_exit_change +// Text association with MSK ( CHANGE ) +// +//---------------------------------------------------- +// +RESOURCE CBA r_gs_softkeys_options_back_empty + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id=EAknSoftkeyOk; + txt = ""; + } + }; + } + +//End of File + + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSApplication/Data/GSApp_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/Data/GSApp_reg.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include +#include +#include + + +UID2 KUidAppRegistrationResourceFile +UID3 0x100058EC + +RESOURCE APP_REGISTRATION_INFO + { + app_file = "GSApp"; + localisable_resource_file = APP_RESOURCE_DIR"\\GSApp"; + localisable_resource_id = R_GSAPP_LOCALISABLE_APP_INFO; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSApplication/GSApplication.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/GSApplication.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This is project specification file for General Settings. +* +*/ + +#include "../Logger/GsLoggingConfiguration.h" +#include + +#include + +// Default system include paths for middleware layer modules. +APP_LAYER_SYSTEMINCLUDE + +CAPABILITY ALL -TCB +VENDORID VID_DEFAULT +TARGET gsapp.exe +EPOCSTACKSIZE 0x10000 +EPOCHEAPSIZE 0x1000 0x1000000 +TARGETTYPE exe +UID 0x100039CE 0x100058EC + +SYSTEMINCLUDE /epoc32/include/connect + +// Source files +SOURCEPATH Src +SOURCE GSApp.cpp +SOURCE GSUi.cpp +SOURCE GSMainView.cpp +SOURCE GSMainContainer.cpp +SOURCE GSDocument.cpp + +SOURCEPATH Data + +START RESOURCE GSApp.rss +HEADER +TARGETPATH APP_RESOURCE_DIR +LANGUAGE_IDS +END // GSApp.rss + +START RESOURCE GSApp_reg.rss +DEPENDS gsapp.rsg +TARGETPATH /private/10003a3f/apps +LANGUAGE_IDS +END + +// User include paths +USERINCLUDE Inc +USERINCLUDE loc +USERINCLUDE ../Logger +USERINCLUDE ../GSFramework/inc + +// Libraries required by framework +LIBRARY apparc.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY eikctl.lib // CEikColumnListBox +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY commonengine.lib // Shareddata +LIBRARY egul.lib // CGulIcon +LIBRARY ws32.lib +LIBRARY apgrfx.lib // For RApaLsSession +LIBRARY efsrv.lib +LIBRARY aknskinsrv.lib // For enhanced skinning +LIBRARY aknskins.lib // For enhanced skinning +LIBRARY featmgr.lib // Feature manager +LIBRARY hlplch.lib // For "Help" options menu +LIBRARY flogger.lib // Logging +LIBRARY gslistbox.lib +LIBRARY charconv.lib // For CnvUtfConverter used in CGSPluginLoader +LIBRARY gsframework.lib +LIBRARY fbscli.lib // For CFbsBitmap +LIBRARY gsecomplugin.lib +LIBRARY estor.lib +LIBRARY gfxtrans.lib +LIBRARY CdlEngine.lib +//End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSApplication/Inc/GSApp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/Inc/GSApp.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CGSApp is an application class required by Symbian OS architecture. +* +*/ + + +#ifndef GSAPP_H +#define GSAPP_H + +// INCLUDES +#include +#include + + +// CONSTANTS + +// CLASS DECLARATION + +/** +* CGSApp application class. +* @since Series60_3.1 +*/ +class CGSApp : public CAknApplication +{ + private: // from CApaApplication + + /** + * Create CGSDocument document object. + */ + CApaDocument* CreateDocumentL(); + + /** + * Returns application UID. + * @return KUidGS. + */ + TUid AppDllUid() const; +}; + + +#endif // GSAPP_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSApplication/Inc/GSDocument.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/Inc/GSDocument.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Document class required by Symbian OS architecture. +* +*/ + + +#ifndef GSDOCUMENT_H +#define GSDOCUMENT_H + +// INCLUDES +#include +#include "GSBaseDocument.h" + +// CONSTANTS + +// FORWARD DECLARATIONS +class CEikAppUi; +class CGSModelCdma; + +// CLASS DECLARATION + +/** +* CGSDocument application class. +* @since Series60_3.1 +*/ +class CGSDocument : public CGSBaseDocument + { + public: // Constructor and destructor + /** + * Two-phased constructor + * @param aApp Application. + * @return GS document. + */ + static CGSDocument* NewL(CEikApplication& aApp); + + ~CGSDocument(); + + public: // New + + /** + * Returns pointer to GS's CDMA model which is owned by the document. + * @return GS CDMA model. + */ + CGSModelCdma* ModelCdma(); + + private: + + /** + * C++ constructor + */ + inline CGSDocument( CEikApplication& aApp ) : CGSBaseDocument( aApp ) { } + + /** + * Symbian OS default constructor. + * + */ + void ConstructL(); + + private: // From CEikDocument + + /** + * Create CGSUi "App UI" object. + * @return Eikon application UI. + */ + CEikAppUi* CreateAppUiL(); + + private: // Data + + // CDMA model + CGSModelCdma* iModelCdma; + }; + +#endif // GSDOCUMENT_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSApplication/Inc/GSEngineInterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/Inc/GSEngineInterface.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GS engine interface. +* +*/ + + +#ifndef GS_ENGINE_INTERFACE_H +#define GS_ENGINE_INTERFACE_H + +// INCLUDES +#include + +/** +* Interface to GS engine. Provides functions for creating, deleting, getting +* and setting settings data. Supported data types are Tint, Treal, TDesC8 and +* TDesC16. +*/ +class MGSEngine + { +public: + + virtual void MGSEngine() = 0; + + /** + * Adds an observer. Does not take the ownership of the observer. The + * observer will get notification whenever the observed data is changed. + */ + virtual void AddObserverL(MGSEngineObserver* aObserver, TUnt32 aObservedId) = 0; + + /** + * Removes an observer. + */ + virtual void RemoveObserver(MGSEngineObserver* aObserver) = 0; + + virtual TInt Create(TUint32 aId, TInt aVal) = 0; + virtual TInt Create(TUint32 aId, const TReal& aVal) = 0; + virtual TInt Create(TUint32 aId, const TDesC8& aVal) = 0; + virtual TInt Create(TUint32 aId, const TDesC16& aVal) = 0; + + virtual TInt Delete(TUint32 aId) = 0; + + virtual TInt Get(TUint32 aId, TInt& aVal) = 0; + virtual TInt Set(TUint32 aId, TInt aVal) = 0; + + virtual TInt Get(TUint32 aId, TReal& aVal) = 0; + virtual TInt Set(TUint32 aId, const TReal& aVal) = 0; + + virtual TInt Get(TUint32 aId, TDes8& aVal) = 0; + virtual TInt Set(TUint32 aId, const TDesC8& aVal) = 0; + + virtual TInt Get(TUint32 aId, TDes16& aVal) = 0; + virtual TInt Set(TUint32 aId, const TDesC16& aVal) = 0; + + + }; + +/** +* Observer for GS engine. +*/ +class MGSEngineObserver + { + virtual void ValueChanged(TUint32 aId) = 0; + }; + +#endif //GS_ENGINE_INTERFACE_H + +// End of File \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSApplication/Inc/GSMainContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/Inc/GSMainContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,195 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container class for main view. +* +*/ + +#ifndef GSCONTAINER_H +#define GSCONTAINER_H + +#include "gsbasecontainer.h" +#include +#include +#include // For loading icons +#include +// CLASS DECLARATION +class CAknViewAppUi; +class CAknSingleLargeStyleListBox; +class CGSPluginInterface; +class CGsContainerExt; + +/** +* Container class for the GS Main view. +* @since Series60_3.1 +*/ +class CGSMainContainer : public CCoeControl, public MEikListBoxObserver +{ + public: // Constructors and destructor + + /** + * Symbian OS constructor. + * Required by the base class. + * + */ + void ConstructL( + const TRect& aRect, + CAknViewAppUi* aAppUi, + CArrayPtrFlat* aPluginArray ); + + /** + * Destructor. + */ + ~CGSMainContainer(); + + public: // New + + /** + * Updates listbox. + */ + void UpdateListBoxL(); + + /** + * @return pointer to owned listbox. + */ + CAknSingleLargeStyleListBox* ListBox(); + + /** + * @return Plugin which is selected in the lbx. + */ + CGSPluginInterface* SelectedPlugin(); + + /** + * Sets selected lbx item using the UID of the item. If the item is not + * existing or visible anymore, selected item is the first item in the + * lbx. + */ + void SetSelectedItem( TUid aSelectedItemUid ); + + /** + * Set the empty text of list box. + */ + void SetListBoxEmptyTextL(const TDes& aEmpty); + + /** + * Store listbox's exact position. + * @param aPosition includes the exact position of the listbox. + */ + void StoreListBoxPositionL( CGSMainView::TListBoxPosition& aPosition ); + + /** + * Restore listbox's exact position. + * @param aPosition includes the exact position of the listbox. + * @param aScreenModeChanged indicates whether the screen mode is changed. + */ + void RestoreListBoxPositionL( const CGSMainView::TListBoxPosition& aPosition, TBool aScreenModeChanged ); + + + public: // From CCoeControl + + /** + * See base class. + */ + void HandleResourceChange( TInt aType ); + + /** + * Set focus on the selected listbox. For animated skins feature. + */ + void FocusChanged( TDrawNow aDrawNow ); + + protected: // New + + /** + * Required for help. + */ + void GetHelpContext( TCoeHelpContext& aContext ) const; + + protected: // From MEikListBoxObserver + /** + * Handles listbox events. + * @param aListBox Listbox where the event occurred. + * @param aEventType Event type. + */ + void HandleListBoxEventL( CEikListBox* aListBox, + TListBoxEvent aEventType ); + private: // New + + /** + * Adds plugin data to listbox. + * @param aPlugin A plugin whose data is to be used. + * @param aIndex Index of the plugin in the listbox. + * @param aItemTextArray Array for plugin texts and format strings used + * by lbx. + * @param aIconArray Array for icons used in lbx. + */ + void AddPluginDataToLbxL( CGSPluginInterface* aPlugin, + TInt aIndex, + CDesCArray* aItemTextArray, + CAknIconArray* aIconArray ); + + private: // From CCoeControl + + /** + * See base class. + */ + void SizeChanged(); + + /** + * See base class. + */ + TInt CountComponentControls() const; + + /** + * See base class. + */ + CCoeControl* ComponentControl( TInt /*aIndex*/ ) const; + + /** + * See base class. + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + private: // Data + + // Owned listbox. + CAknSingleLargeStyleListBox* iListBox; + + // Pointer to Application UI. Not owned. + CAknViewAppUi* iAppUi; + + /** + * Pointer to listbox model's item texts. Note that the indexes of + * listbox items are mapped directly to the indexes in plugin array. + * Plugin which maps to selected listbox item index in plugin array is + * activated when item is selected in listbox. + * + * Owned by iListBox. + */ + CDesCArray* iItemTextArray; + + // Given from CGSMainView - not owned + CArrayPtrFlat* iPluginArray; + + // Array of pointers to iPluginArray plugins which are visible. + // This is the actual array which is displayed by the listbox. + // It is needed because iPluginArray also contains non-visible plugins + // and therefore the indexes do not match to lbx items. + CArrayPtrFlat* iVisiblePlugins; + // Extension for main container. + CGsContainerExt* iExt; +}; + + +#endif // GSCONTAINER_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSApplication/Inc/GSUi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/Inc/GSUi.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,166 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GS Application UI. +* +*/ + + +#ifndef GSUI_H +#define GSUI_H + +// INCLUDES +#include +#include +//#include +#include +#include "GSEComNotifier.h" +#include + + +// CLASS DECLARATION +class CAknWaitDialog; +class CGSDocument; + +//For embedding CC in CS +class TAppInfo + { + public: + TAppInfo( TUid aUid, const TDesC& aFile ) + : iUid( aUid ), iFile( aFile ) + {} + TUid iUid; + TFileName iFile; + }; + + +/** +* UI class for General Settings application. +* @since Series60_3.1 +*/ +class CGSUi : public CAknViewAppUi, MGSEComObserver + { + + public: // Constructors and destructor + + /** + * C++ default constructor + */ + CGSUi(); + + /** + * Symbian OS default constructor. + * + */ + void ConstructL(); + + /** + * Destructor. + */ + ~CGSUi(); + + public: // New + + /** + * After successfully selecting a manual network, Phone is activated in + * Idle state. + */ + void PhoneIdle(); + + /** + * For embedding CC in CS + */ + virtual void EmbedAppL( const TAppInfo& aApp ); + + /** + * Get document object + */ + CGSDocument& GSDocument() const; + + public: // From CEikAppUi + /** + * Takes care of command handling. + * @param aCommand command to be handled + */ + void HandleCommandL( TInt aCommand ); + + + protected: // From CEikAppUi + + /** + * Message handling from CEikAppUi. See CEikAppUi. + */ + MCoeMessageObserver::TMessageResponse HandleMessageL( + TUint32 aClientHandleOfTargetWindowGroup, + TUid aMessageUid, + const TDesC8 &aMessageParameters ); + + protected: // From MGSEComObserver + + /** + * See Base class. + */ + void HandleEComEvent( TEComEvent aEvent ); + + private: // From CEikAppUi + + /** + * handles key events + * @param aKeyEvent + * @param aType type of the key event + * @return TKeyResponse + */ + virtual TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + private: // New + + /** + * Construct views. + */ + void ConstructViewsL(); + + /** + * @return void + */ + void ShowNoteGsNotOpenedDuringBackupRestoreL(); + + /** + * Closes embedded application if any exist. + * @return KErrNone if succeeds. + */ + TInt FindAndKillEmbeddedAppL(); + + private: // From CEikAppUi + + /** + * Handles resource change. + */ + void HandleResourceChangeL( TInt aType ); + + protected: // Data + + // Pointer to wait dialog. + CAknWaitDialog* iWaitDialog; + + // Embedding. + CApaDocument* iEmbedded; + CAknView* iMainView; + + // Notifies if plugins are installed/uninstalled. + CGSEComNotifier* iEComNotifier; + + }; + +#endif // GSUI_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSApplication/Src/GSApp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/Src/GSApp.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: General Settings Application +* +*/ + + +// INCLUDE FILES +#include +#include "GSApp.h" +#include "GSDocument.h" +#include + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CGSApp::AppDllUid() +// Returns application UID +// +// --------------------------------------------------------------------------- +TUid CGSApp::AppDllUid() const + { + return KUidGS; + } + + +// --------------------------------------------------------------------------- +// CGSApp::CreateDocumentL() +// Creates CGSDocument object +// +// --------------------------------------------------------------------------- +CApaDocument* CGSApp::CreateDocumentL() + { + return CGSDocument::NewL(*this); + } + + +// ===================== OTHER EXPORTED FUNCTIONS ============================ +// + + +// --------------------------------------------------------------------------- +// NewApplication() +// constructs CGSApp +// Returns: CApaDocument*: created application object +// +// --------------------------------------------------------------------------- +LOCAL_C CApaApplication* NewApplication() + { + return new CGSApp; + } + + +// --------------------------------------------------------------------------- +// E32Main() +// +// --------------------------------------------------------------------------- +GLDEF_C TInt E32Main() + { + return EikStart::RunApplication( NewApplication ); + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSApplication/Src/GSDocument.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/Src/GSDocument.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Document for the General Settings Application +* +*/ + + +// INCLUDE FILES +#include + +#include "GSDocument.h" +#include "GSUi.h" +#include "gsplugininterface.h" +#include "gspluginloader.h" + + +// ================= MEMBER FUNCTIONS ======================= + +// ---------------------------------------------------- +// CGSDocument::ConstructL() +// Symbian OS default constructor can leave. +// +// ---------------------------------------------------- +// +void CGSDocument::ConstructL() + { + CGSBaseDocument::ConstructL(); + } + + +// ---------------------------------------------------- +// CGSDocument::~CGSDocument +// Symbian OS destructor +// +// ---------------------------------------------------- +// +CGSDocument::~CGSDocument() + { + } + + +// ---------------------------------------------------- +// CGSDocument::NewL() +// Two-phased constructor. +// +// ---------------------------------------------------- +// +CGSDocument* CGSDocument::NewL( CEikApplication& aApp ) + { + CGSDocument* self = new( ELeave ) CGSDocument( aApp ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------- +// CGSDocument::ModelCdma() +// Returns the CDMA model. +// +// ---------------------------------------------------- +// +CGSModelCdma* CGSDocument::ModelCdma() + { + // CDMA engine is not supported by this variant. + return NULL; + } + + +// ---------------------------------------------------- +// CGSDocument::CreateAppUiL() +// constructs CGSUi +// +// ---------------------------------------------------- +// +CEikAppUi* CGSDocument::CreateAppUiL() + { + CGSUi* appUi = new(ELeave) CGSUi(); + return appUi; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSApplication/Src/GSMainContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/Src/GSMainContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,538 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for the main view of General Settings +* +*/ + + +// INCLUDE FILES +#include + +#include "GSUi.h" +#include "gsmainview.h" +#include "GSMainContainer.h" +#include "gsplugininterface.h" +#include "GsLogger.h" +#include // Resources for mainview + +#include +#include +#include +#include // For loading icons +#include // For loading icons +#include +#include +#include +#include // For CGulIcon +#include +#include // for KUidGS +#include "GsContainerExt.h" //For CGsContainerExt + +//CONSTANTS + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CGSMainContainer::ConstructL(const TRect& aRect) +// Symbian OS two phased constructor +// +// --------------------------------------------------------------------------- +// +void CGSMainContainer::ConstructL( + const TRect& aRect, + CAknViewAppUi* aAppUi, + CArrayPtrFlat* aPluginArray ) + { + iAppUi = aAppUi; + iPluginArray = aPluginArray; + + // Initialize the array containing pointers to plugins that are actually + // displayed in lbx. + iVisiblePlugins = new CArrayPtrFlat( 10 ); + + CEikStatusPane* sp = iAppUi->StatusPane(); + CAknTitlePane* title = static_cast + ( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); + + // Set view title from resource: + TResourceReader rReader; + iCoeEnv->CreateResourceReaderLC( rReader, R_GS_MAIN_VIEW_TITLE ); + title->SetFromResourceL( rReader ); + CleanupStack::PopAndDestroy(); //rReader + + CreateWindowL(); // Makes this control a window-owning control + + // Create listbox: + iListBox = new( ELeave ) CAknSingleLargeStyleListBox; + iListBox->ConstructL( this ); + iListBox->SetContainerWindowL( *this ); + iListBox->SetListBoxObserver( this ); + iListBox->CreateScrollBarFrameL(ETrue); + iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); + + // Obtain reference to listbox's item text array: + iItemTextArray + = STATIC_CAST( CDesCArray*, iListBox->Model()->ItemTextArray() ); + iExt = CGsContainerExt::NewL(); + + SetRect( aRect ); + ActivateL(); + __GSLOGSTRING( "[CGSMainContainer] ConstructL()" ); + } + + +// --------------------------------------------------------------------------- +// CGSMainContainer::~CGSMainContainer() +// Destructor +// +// --------------------------------------------------------------------------- +// +CGSMainContainer::~CGSMainContainer() + { + if ( iVisiblePlugins ) + { + iVisiblePlugins->Reset(); + } + delete iVisiblePlugins; + + if ( iItemTextArray ) + { + iItemTextArray->Reset(); + } + + if ( iListBox ) + { + delete iListBox; + } + delete iExt; + __GSLOGSTRING( "[CGSMainContainer] ~CGSMainContainer" ); + } + +// --------------------------------------------------------------------------- +// CGSMainContainer::UpdateListbox +// +// Updates listbox from iPluginArray. +// --------------------------------------------------------------------------- +// +void CGSMainContainer::UpdateListBoxL() + { + + if( iPluginArray->Count() == 0 ) + { + return; + } + + __GSLOGSTRING( "[CGSMainContainer::UpdateListBoxL]" ); + + // Empty item array because it will be reoccupied. + iItemTextArray->Reset(); + + // Empty the array because it will be updated. + iVisiblePlugins->Reset(); + + // Array for icons in the listbox. Owns the icons. + CAknIconArray* icons = new (ELeave) CAknIconArray( 10 ); + CleanupStack::PushL( icons ); + + // Index of the plugin inserted into lbx item array. + TInt pluginIndex = 0; + + // 1) Add each plugin's data to listbox if the plugin is visible. + for( TInt i = 0; i < iPluginArray->Count(); i++ ) + { + CGSPluginInterface* plugin = iPluginArray->operator[]( i ); + if( plugin->Visible() ) + { + AddPluginDataToLbxL( plugin, pluginIndex, iItemTextArray, icons ); + pluginIndex++; + } + } + + // Destroy the old icons because SetIconArray() does not destroy them. + CArrayPtr* oldIcons + = iListBox->ItemDrawer()->ColumnData()->IconArray(); + if( oldIcons ) + { + oldIcons->ResetAndDestroy(); + delete oldIcons; + } + + // Transfer ownership of icon array to the lbx. + // SetIconArray() does not delete the old icon array + iListBox->ItemDrawer()->ColumnData()->SetIconArray( icons ); + CleanupStack::Pop( icons ); + + // Draws listbox again + iListBox->HandleItemAdditionL(); + } + + +//Disabling warning caused by err variable used inside macros +#pragma diag_suppress 550 +// ----------------------------------------------------------------------------- +// CGSMainContainer::AddPluginDataToLbxL() +// +// +// ----------------------------------------------------------------------------- +// +void CGSMainContainer::AddPluginDataToLbxL( CGSPluginInterface* aPlugin, + TInt aIndex, + CDesCArray* aItemTextArray, + CAknIconArray* aIconArray ) + { + // Add the plugin to visible plugins array: + iVisiblePlugins->AppendL( aPlugin ); + + // 1.1) Read item descriptor from plugin: + TBuf<256> buf; + _LIT( KTab, "\t" ); + + TRAPD + ( + captionErr, + aPlugin->GetCaptionL( buf ); + ) + + // If plugin caption fails, set caption to error string. + if( captionErr != KErrNone ) + { + _LIT( KGSParentPluginCaptionErrorTxt, "Error" ); + buf.Append( KGSParentPluginCaptionErrorTxt ); + } + else + { + __GSLOGSTRING2( "[CGSMainContainer] 0x%X::GetCaptionL Error: %d", + aPlugin->Id().iUid, captionErr ); + } + + /** + * 1.2) Create formatted item string. + * list_single_large_pane: + * list item string format: "1\tTextLabel\t0\t0" + * where 0 is an index to icon array + */ + TBuf<256> item; + item.AppendNum( aIndex ); + item.Append( KTab ); + item.Append( buf ); + + aItemTextArray->AppendL( item ); + + // 1.3) Add icons if listbox uses them: + CGulIcon* icon; + TRAPD + ( + iconErr, + icon = aPlugin->CreateIconL( KGSIconTypeLbxItem ); + ) + + __GSLOGSTRING2( + "[CGSMainContainer] CreateIconL result for 0x%X: %d", + aPlugin->Id().iUid, iconErr ); + TSize size = icon->Bitmap()->SizeInPixels(); + CleanupStack::PushL( icon ); + aIconArray->AppendL( icon ); + CleanupStack::Pop( icon ); + + } +//Enabling warnings +#pragma diag_default 550 + + +// --------------------------------------------------------------------------- +// CGSMainContainer::GetHelpContext(TCoeHelpContext& aContext) const +// Gets Help +// +// --------------------------------------------------------------------------- +// +void CGSMainContainer::GetHelpContext( TCoeHelpContext& aContext ) const + { + aContext.iMajor = KUidGS; + aContext.iContext = KCP_HLP_MAIN_VIEW; + } + + +// --------------------------------------------------------------------------- +// CGSMainContainer::SizeChanged +// called by framwork when the view size is changed +// +// --------------------------------------------------------------------------- +// +void CGSMainContainer::SizeChanged() + { + if ( iListBox ) + { + iListBox->SetRect( Rect() ); + } + } + + +// --------------------------------------------------------------------------- +// CGSMainContainer::CountComponentControls +// +// +// --------------------------------------------------------------------------- +// +TInt CGSMainContainer::CountComponentControls() const + { + return 1; + } + + +// --------------------------------------------------------------------------- +// CGSMainContainer::ComponentControl +// +// +// --------------------------------------------------------------------------- +// +CCoeControl* CGSMainContainer::ComponentControl(TInt /*aIndex*/) const + { + return iListBox; + } + + +// --------------------------------------------------------------------------- +// CGSMainContainer::TKeyResponse OfferKeyEventL +// Called when a key is pressed. +// +// --------------------------------------------------------------------------- +// +TKeyResponse CGSMainContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, + TEventCode aType) + { + switch ( aKeyEvent.iCode ) + { + case EKeyLeftArrow: + case EKeyRightArrow: + // Listbox takes all event even if it doesn't use them + return EKeyWasNotConsumed; + default: + break; + } + // now it's iListBox's job to process the key event + return iListBox->OfferKeyEventL(aKeyEvent, aType); + } + + +// --------------------------------------------------------------------------- +// CGSMainContainer::HandleListBoxEventL +// +// +// --------------------------------------------------------------------------- +void CGSMainContainer::HandleListBoxEventL( + CEikListBox* aListBox, + TListBoxEvent aEventType ) + { + __GSLOGSTRING1( + "[CGSMainContainer] HandleListBoxEventL aEventType:%d", + aEventType); + switch ( aEventType ) + { + case EEventEnterKeyPressed: + case EEventItemSingleClicked: + { + if (aListBox->CurrentItemIndex() < 0) + { + // Negative listbox value -> no item selected? + break; + } + if ( iExt->iDblClickPreventer->IsActive() ) + { + break; + } + iExt->iDblClickPreventer->Start(); + CGSPluginInterface* selectedPlugin = iVisiblePlugins->operator[]( + aListBox->CurrentItemIndex()); + + // Different command is used depending on the plugin type. + switch (selectedPlugin->ItemType()) + { + // In these cases the plugin is a view: + case EGSItemTypeSingleLarge: + case EGSItemTypeSetting: + case EGSItemTypeSettingIcon: + iAppUi->ActivateLocalViewL(selectedPlugin->Id()); + break; + // In these cases the plugin is a dialog: + case EGSItemTypeSettingDialog: + case EGSItemTypeSingleLargeDialog: + selectedPlugin->HandleSelection( + EGSSelectionBySelectionKey); + UpdateListBoxL(); // Refrest the listbox if value changed. + break; + } + } + break; + default: + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSMainContainer::ListBox() +// +// +// --------------------------------------------------------------------------- +// +CAknSingleLargeStyleListBox* CGSMainContainer::ListBox() + { + return iListBox; + } + + +// --------------------------------------------------------------------------- +// CGSMainContainer::HandleResourceChange() +// +// +// --------------------------------------------------------------------------- +// +void CGSMainContainer::HandleResourceChange( TInt aType ) + { + //Handle layout orientation or skin change + CCoeControl::HandleResourceChange( aType ); + if ( aType == KAknsMessageSkinChange ) + { + TRAP_IGNORE( UpdateListBoxL() ); + } + else if ( aType == KEikDynamicLayoutVariantSwitch ) + { + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + mainPaneRect); + SetRect( mainPaneRect ); + } + } + + +// ----------------------------------------------------------------------------- +// CGSMainContainer::SelectedPlugin() +// +// +// ----------------------------------------------------------------------------- +// +CGSPluginInterface* CGSMainContainer::SelectedPlugin() + { + CGSPluginInterface* plugin = NULL; + const TInt index = iListBox->CurrentItemIndex(); + if ( index >= 0 && index <= iVisiblePlugins->Count() ) + { + plugin = iVisiblePlugins->operator[]( index ); + __GSLOGSTRING2( "[CGSMainContainer] SelectedPlugin 0x%X in index %d", + plugin->Id().iUid, index ); + } + return plugin; + } + + +// ----------------------------------------------------------------------------- +// CGSMainContainer::SetSelectedItem() +// +// +// ----------------------------------------------------------------------------- +// +void CGSMainContainer::SetSelectedItem( TUid aSelectedItemUid ) + { + __GSLOGSTRING1( "[CGSMainContainer] SetSelectedItem(0x%X)", + aSelectedItemUid.iUid ); + + TInt selectedItemIndex = 0; + for( TInt i = 0; i < iVisiblePlugins->Count(); i++ ) + { + CGSPluginInterface* plugin = iVisiblePlugins->operator[]( i ); + + __GSLOGSTRING2( "[CGSMainContainer] Checking [%d] 0x%X)", + i, plugin->Id().iUid ); + + // If plugin is found, select it: + if( plugin->Id() == aSelectedItemUid ) + { + __GSLOGSTRING2( "[CGSMainContainer] Match 0x%X in index %d", + plugin->Id().iUid, i ); + selectedItemIndex = i; + break; + } + } + iListBox->SetCurrentItemIndexAndDraw( selectedItemIndex ); + } + + +// --------------------------------------------------------------------------- +// CGSMainContainer::FocusChanged +// +// Set focus on the selected listbox. For animated skins feature. +// --------------------------------------------------------------------------- +void CGSMainContainer::FocusChanged( TDrawNow /*aDrawNow*/ ) + { + if( iListBox ) + { + iListBox->SetFocus( IsFocused() ); + } + } + + +// ----------------------------------------------------------------------------- +// CGSMainContainer::SetListBoxEmptyTextL() +// +//Set the empty text of list box. +// ----------------------------------------------------------------------------- +// +void CGSMainContainer::SetListBoxEmptyTextL(const TDes& aEmpty ) + { + if( iListBox ) + { + iListBox->View()->SetListEmptyTextL( aEmpty ); + } + } + +// ----------------------------------------------------------------------------- +// CGSMainContainer::StoreListBoxPositionL +// +//Store the exact position of listbox. +// ----------------------------------------------------------------------------- +// +void CGSMainContainer::StoreListBoxPositionL( CGSMainView::TListBoxPosition& aPosition ) + { + aPosition.iCurrentItemIndex = iListBox->CurrentItemIndex(); + aPosition.iItemOffsetInPixels = iListBox->View()->ItemOffsetInPixels(); + aPosition.iTopItemIndex = iListBox->View()->TopItemIndex(); + } + +// ----------------------------------------------------------------------------- +// CGSMainContainer::RestoreListBoxPositionL +// +//Restore the exact position of listbox. +// ----------------------------------------------------------------------------- +// +void CGSMainContainer::RestoreListBoxPositionL( const CGSMainView::TListBoxPosition& aPosition, TBool aScreenModeChanged ) + { + if ( aPosition.iCurrentItemIndex >= 0 ) + { + iListBox->SetCurrentItemIndex( aPosition.iCurrentItemIndex ); + } + + if ( aScreenModeChanged ) + { + iListBox->View()->VerticalMoveToItemL( aPosition.iCurrentItemIndex, + CListBoxView::ESingleSelection ); + } + else + { + iListBox->View()->SetItemOffsetInPixels( aPosition.iItemOffsetInPixels ); + iListBox->View()->SetTopItemIndex( aPosition.iTopItemIndex ); + } + } +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSApplication/Src/GSMainView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/Src/GSMainView.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,449 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Main View. +* +*/ + + +// INCLUDE FILES +#include +#include "GSMainContainer.h" +#include "GsLogger.h" +#include "gsplugininterface.h" +#include "GSDocument.h" +#include "GSUi.h" +#include +#include + +#include +#include +#include +#include +#include // Localization +#include +#include +#include +#include + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSMainView::CGSMainView +// C++ constructor. +// +// --------------------------------------------------------------------------- +// +CGSMainView::CGSMainView() + : iResourceLoader( *iCoeEnv ) + { + } + + +// --------------------------------------------------------------------------- +// CGSMainView::NewL() +// Symbian OS two-phased constructor. +// +// --------------------------------------------------------------------------- +// +CGSMainView* CGSMainView::NewL() + { + CGSMainView* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSMainView::NewLC() +// Symbian OS two-phased constructor. +// +// --------------------------------------------------------------------------- +// +CGSMainView* CGSMainView::NewLC() + { + CGSMainView* self = new( ELeave ) CGSMainView(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSMainView::ConstructL(const TRect& aRect) +// Symbian OS default constuctor. +// +// --------------------------------------------------------------------------- +// +void CGSMainView::ConstructL() + { + __GSLOGSTRING( "[CGSMainView] ConstructL()" ); + iAppUi = AppUi(); + + OpenLocalizedResourceFileL( KGSMainViewResourceFileName ); + BaseConstructL( R_GS_MAIN_VIEW ); + + iPluginArray = new CArrayPtrFlat( 10 ); + + iPluginLoader = CGSPluginLoader::NewL( iAppUi ); + iPluginLoader->SetObserver( this ); + iPluginLoader->LoadAsyncL( KGSPluginInterfaceUid, KGSMainViewUid, + iPluginArray ); + iPosition.Reset(); + } + + +// --------------------------------------------------------------------------- +// CGSMainView::~CGSMainView() +// Destructor +// +// --------------------------------------------------------------------------- +// +CGSMainView::~CGSMainView() + { + __GSLOGSTRING( "[CGSMainView] ~CGSMainView" ); + if ( iPluginLoader ) + { + delete iPluginLoader; + } + + if ( iPluginArray ) + { + // Since the plugins are actually avkon views, avkon is responsible + // for owning the plugins. This means we do not reset and destroy + // the contents of the array in which the plugins reside. We have to + // leave it up to avkon to tidy up. + delete iPluginArray; + } + + iResourceLoader.Close(); + + if( iContainer && iAppUi ) + { + iAppUi->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + } + } + + +// --------------------------------------------------------------------------- +// TUid CGSMainView::OpenLocalizedResourceFileL() +// +// +// --------------------------------------------------------------------------- +// +void CGSMainView::OpenLocalizedResourceFileL( const TDesC& aResourceFileName ) + { + RFs &fsSession = CCoeEnv::Static()->FsSession(); + + // Find the resource file + TParse parse; + parse.Set( aResourceFileName, &KDC_APP_RESOURCE_DIR, NULL ); + TFileName fileName( parse.FullName() ); + + // Get language of resource file + BaflUtils::NearestLanguageFile( fsSession, fileName ); + + // Open resource file + iResourceLoader.OpenL( fileName ); + } + + +// --------------------------------------------------------------------------- +// TUid CGSMainView::Id() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSMainView::Id() const + { + return KGSMainViewUid; + } + + +// --------------------------------------------------------------------------- +// CGSMainView::DoActivateL() +// +// +// --------------------------------------------------------------------------- +// +void CGSMainView::DoActivateL( const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + __GSLOGSTRING( "[CGSMainView] DoActivateL()" ); + + iPluginLoader->RequestPriority( CActive::EPriorityHigh ); + + if( iContainer ) + { + iAppUi->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + iContainer = NULL; + } + NewContainerL(); + + // Set the empty text of list box + _LIT( KEmptyText, "" ); + TBuf<1> empty( KEmptyText ); + iContainer->SetListBoxEmptyTextL( empty ); + + // Do this to update listbox from already existing iPluginArray. + iContainer->UpdateListBoxL(); + if ( iPosition.iCurrentItemIndex != -1 ) + { + if ( iIsLandscapeOrientation == Layout_Meta_Data::IsLandscapeOrientation() ) + { + iContainer->RestoreListBoxPositionL( iPosition, EFalse ); + } + else + { + iContainer->RestoreListBoxPositionL( iPosition, ETrue ); + } + } + iAppUi->AddToViewStackL( *this, iContainer ); + // Navigating to main view will reset all child plugin selected indexes: + for( TInt i = 0; i < iPluginArray->Count(); i++ ) + { + CGSPluginInterface* plugin = iPluginArray->operator[]( i ); + plugin->ResetSelectedItemIndex(); + } + GfxTransEffect::EndFullScreen(); + } + + +// --------------------------------------------------------------------------- +// CGSMainView::DoDeactivate() +// +// +// --------------------------------------------------------------------------- +// +void CGSMainView::DoDeactivate() + { + __GSLOGSTRING( "[CGSMainView] DoDeactivate()" ); + + iPluginLoader->RequestPriority( CActive::EPriorityLow ); + + if ( iContainer ) + { + + iPosition.Reset(); + TRAPD( err, iContainer->StoreListBoxPositionL( iPosition ) ); + iIsLandscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation(); + iAppUi->RemoveFromViewStack(*this, iContainer); + delete iContainer; + iContainer = NULL; + } + } + + +// --------------------------------------------------------------------------- +// CGSMainView::NewContainerL() +// +// +// --------------------------------------------------------------------------- +// +void CGSMainView::NewContainerL() + { + iContainer = new( ELeave ) CGSMainContainer; + iContainer->SetMopParent( this ); + + TRAPD( + error, + iContainer->ConstructL( ClientRect() , AppUi(), iPluginArray ) ); + + if ( error ) + { + delete iContainer; + iContainer = NULL; + User::Leave( error ); + } + } + + +// --------------------------------------------------------------------------- +// TUid CGSMainView::HandleCommandL() +// +// +// --------------------------------------------------------------------------- +// +void CGSMainView::HandleCommandL( TInt aCommand ) + { + __GSLOGSTRING1( "[CGSMainView] HandleCommandL(%d)", aCommand ); + + switch ( aCommand ) + { + case EGSCmdAppOpen: + case EAknSoftkeyOpen: + if( iContainer ) + { + CGSPluginInterface* plugin = iContainer->SelectedPlugin(); + if ( plugin ) + { + switch (plugin->ItemType()) + { + // In these cases the plugin is a view: + case EGSItemTypeSingleLarge: + case EGSItemTypeSetting: + case EGSItemTypeSettingIcon: + iAppUi->ActivateLocalViewL(plugin->Id()); + break; + // In these cases the plugin is a dialog: + case EGSItemTypeSettingDialog: + case EGSItemTypeSingleLargeDialog: + plugin->HandleSelection(EGSSelectionByMenu); + break; + } + } + } + break; + case EAknCmdHelp: + { + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), iAppUi->AppHelpContextL() ); + } + break; + } + default: + iAppUi->HandleCommandL( aCommand ); + break; + } + } + + +// --------------------------------------------------------------------------- +// TUid CGSMainView::HandlePluginLoaded() +// +// +// --------------------------------------------------------------------------- +// +void CGSMainView::HandlePluginLoaded( KGSPluginLoaderStatus aStatus ) + { + __GSLOGSTRING1( "[CGSMainView::HandlePluginLoaded] aStatus:%d", aStatus ); + + switch( aStatus ) + { + case MGSPluginLoadObserver::EGSSuccess: + // Should not update each time when plugin is loaded, only when + // finished loading spesific view plugins? + break; + case MGSPluginLoadObserver::EGSFinished: + if( iContainer ) + { + TRAPD( err, + iContainer->UpdateListBoxL(); ) + if( err != KErrNone ) + { + __GSLOGSTRING1( + "[CGSMainView] Error updating listbox: %d", + err ); + } + } + break; + default: + break; + } + + } + + +// --------------------------------------------------------------------------- +// CGSMainView::TransferDynamicPluginL() +// +// +// --------------------------------------------------------------------------- +// +void CGSMainView::TransferDynamicPluginL( CGSPluginInterface* aPlugin ) + { + __GSLOGSTRING1( "[CGSMainView] CGSMainView::TransferDynamicPluginL() - plugin id: 0x%x added to appUi.", aPlugin->Id() ); + + CleanupStack::PushL( aPlugin ); + iAppUi->AddViewL( aPlugin ); + CleanupStack::Pop( aPlugin ); + + // Add to the overall plugin array for this parent plugin + iPluginArray->AppendL( aPlugin ); + + // Resort the plugins so that they are in order + iPluginLoader->SortPluginsL( iPluginArray ); + + // Update the listbox with the new information + HandlePluginLoaded( MGSPluginLoadObserver::EGSSuccess ); + } + + +// ------------------------------------------------- -------------------------- +// TUid CGSMainView::TabbedViews() +// +// +// --------------------------------------------------------------------------- +// +CArrayPtrFlat* CGSMainView::TabbedViews() + { + return iPluginArray; + } + + +// ----------------------------------------------------------------------------- +// CGSMainView::TabChangedL() +// +// +// ----------------------------------------------------------------------------- +// +void CGSMainView::TabChangedL( TUid selectedTabUid ) + { + // Update selected item because changing tab in main view's children + // affects also main view's selected item: + iSelectedPluginUid = selectedTabUid; + } + + +// ----------------------------------------------------------------------------- +// CGSMainView::UpdateView() +// +// +// ----------------------------------------------------------------------------- +// +void CGSMainView::UpdateView() + { + TRAP_IGNORE( iContainer->UpdateListBoxL() ); + } + + +// ----------------------------------------------------------------------------- +// CGSMainView::DynInitMenuPaneL() +// +// dynamically handle help item if not supported +// ----------------------------------------------------------------------------- +// +void CGSMainView::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + if( aResourceId == R_GS_MENU_ITEM_HELP ) + { + User::LeaveIfNull( aMenuPane ); + + if ( FeatureManager::FeatureSupported( KFeatureIdHelp )) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + } + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSApplication/Src/GSUi.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/Src/GSUi.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,438 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: General Settings User Interface +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // For determining skin change +#include +#include +#include +#include +#include +#include +#include +#include // For HlpLauncher +#include +#include // Embedding CC in GS +#include // Embedding CC in GS +#include // Embedding CC in GS +#include +#include // The USER class +#include +#include + +#include +#include +#include + +#include +#include "GsLogger.h" +#include "GSUi.h" +#include +#include "GSDocument.h" +#include "gssettingid.h" +#include + +// System Includes +#include +#include +using namespace conn; + +//CONSTANTS + +const TInt KGSPhoneAppID = 0x100058b3; + + +// ================= MEMBER FUNCTIONS ======================= + + +// ---------------------------------------------------- +// CGSUi::CGSUi() +// +// Default constructor. +// ---------------------------------------------------- +CGSUi::CGSUi() + { + } + + +// ---------------------------------------------------- +// CGSUi::~CGSUi() +// destructor +// +// ---------------------------------------------------- +CGSUi::~CGSUi() + { + GSDocument().PrepareForUIDestruction(); + + FeatureManager::UnInitializeLib(); + + //Embedding - removing created document + if ( iEmbedded ) + { + iEikonEnv->Process()->DestroyDocument( iEmbedded ); + } + if( iEComNotifier ) + { + delete iEComNotifier; + } + } + + +// ---------------------------------------------------- +// CGSUi::ConstructL() +// +// Symbian OS two-phased constructor +// ---------------------------------------------------- +void CGSUi::ConstructL() + { + __GSLOGSTRING( "[CGSUi] ConstructL()" ); + FeatureManager::InitializeLibL(); + BaseConstructL( EAknEnableSkin | EAknEnableMSK |EAknSingleClickCompatible ); + TInt backupInfo = 0; + const TInt error = RProperty::Get( TUid::Uid( KUidSystemCategoryValue ), + KUidBackupRestoreKey, + backupInfo ); + // We check if the backup/restore process is underway + if ( error == KErrNone ) + { + // Work out what kind of operation is underway: + if ( ( backupInfo & KBURPartTypeMask ) == EBURNormal || + ( backupInfo & KBURPartTypeMask ) == EBURUnset ) + { + ConstructViewsL(); + //Activate the main view to be the first view when + // application is opened. + SetDefaultViewL( *iMainView ); + } + else + { + if ( ( backupInfo & KBURPartTypeMask) == EBURBackupFull || + ( backupInfo & KBURPartTypeMask) == EBURBackupPartial ) + { + // Backup In Progress.. show a Note and Dont Launch GS + ShowNoteGsNotOpenedDuringBackupRestoreL(); + } + else if ( ( backupInfo & KBURPartTypeMask) == EBURRestoreFull || + ( backupInfo & KBURPartTypeMask) == EBURRestorePartial ) + { + // Restore In Progress.. show a Note and Dont Launch GS + ShowNoteGsNotOpenedDuringBackupRestoreL(); + } + } + } + + GSDocument().PreparePluginCacheL( *this ); + + // This will observe plugin install events. + iEComNotifier = CGSEComNotifier::NewL( this, GSDocument().GetImplInfo() ); + } + + +// ---------------------------------------------------- +// CGSUi::ConstructViewsL() +// +// ---------------------------------------------------- +void CGSUi::ConstructViewsL() + { + __GSLOGSTRING( "[CGSUi] Constructing views..." ); + + iMainView = CGSMainView::NewL(); + AddViewL( iMainView ); // transfer ownership to CAknViewAppUi + + __GSLOGSTRING( "[CGSUi] Constructing views done." ); + } + + +// ---------------------------------------------------- +// CGSUi::HandleCommandL(TInt aCommand) +// +// +// ---------------------------------------------------- +void CGSUi::HandleCommandL( TInt aCommand ) + { + __GSLOGSTRING1( "[CGSUi] HandleCommandL(%d)", aCommand ); + switch ( aCommand ) + { + case EEikCmdExit: + case EAknCmdExit: + case EAknSoftkeyExit: + #ifdef GS_ENABLE_WATCH_DOG + GSDocument().WatchDog()->ReportCleanExitL(); + #endif + Exit(); + break; + default: + break; + } + } + + +// ---------------------------------------------------- +// CGSUi::HandleResourceChangeL() +// +// +// ---------------------------------------------------- +// +void CGSUi::HandleResourceChangeL( TInt aType ) + { + CAknViewAppUi::HandleResourceChangeL( aType ); + } + + +// ---------------------------------------------------- +// CGSUi::HandleKeyEventL() +// +// +// ---------------------------------------------------- +TKeyResponse CGSUi::HandleKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + __GSLOGSTRING1( "[CGSUi] HandleKeyEventL(code:%d)", aKeyEvent.iCode ); + + CAknNavigationControlContainer* naviContainer = + static_cast + ( StatusPane()->ControlL( TUid::Uid(EEikStatusPaneUidNavi ) ) ); + + TKeyResponse response = EKeyWasNotConsumed; + + if( naviContainer ) + { + CAknNavigationDecorator* naviDec = naviContainer->Top(); + if( naviDec ) + { + CCoeControl* decControl = naviDec->DecoratedControl(); + if( decControl) + { + response = decControl->OfferKeyEventL( aKeyEvent, aType ); + } + } + } + + return response; + } + + +// ---------------------------------------------------- +// CGSUi::PhoneIdle() +// +// +// ---------------------------------------------------- +// +void CGSUi::PhoneIdle() + { + TRAP_IGNORE( CreateActivateViewEventL( TVwsViewId( TUid::Uid( KGSPhoneAppID ), + TUid::Uid( KGSPhoneAppID ) ), KNullUid, KNullDesC8() ) ); + } + + +// --------------------------------------------------------------------------- +// CGSUi::EmbedAppL() +// +// Launches application as embedded. +// --------------------------------------------------------------------------- +// +void CGSUi::EmbedAppL( const TAppInfo& aApp ) + { + if ( iEmbedded ) + { + iEikonEnv->Process()->DestroyDocument( iEmbedded ); + iEmbedded = NULL; + } + CAknLocalScreenClearer* clearer = CAknLocalScreenClearer::NewLC(); + CEikProcess* process = iEikonEnv->Process(); + TApaApplicationFactory apaAppFactory( aApp.iUid ); + iEmbedded = process->AddNewDocumentL( apaAppFactory ); + TApaDocCleanupItem cleanup( process, iEmbedded ); + CleanupStack::PushL( cleanup ); + iEmbedded->NewDocumentL(); + CleanupStack::Pop(); + iEmbedded->EditL( NULL ); + CleanupStack::PopAndDestroy( clearer ); + } + + +// --------------------------------------------------------------------------- +// CGSUi::Document() +// +// +// --------------------------------------------------------------------------- +// +CGSDocument& CGSUi::GSDocument() const + { + CGSDocument* doc = static_cast< CGSDocument* >( Document() ); + return *doc; + } + + +// --------------------------------------------------------------------------- +// CGSUi::ShowNoteGsNotOpenedDuringBackupRestoreL() +// +// +// --------------------------------------------------------------------------- +// +void CGSUi::ShowNoteGsNotOpenedDuringBackupRestoreL() + { + HBufC* prompt = + StringLoader::LoadL( R_CONFIRM_NOTE_GS_EXIT_BACKUP_RESTORE_STRING ); + CleanupStack::PushL( prompt ); + CAknInformationNote* note = + new( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *prompt ); + CleanupStack::PopAndDestroy( prompt ); +#ifdef GS_ENABLE_WATCH_DOG + GSDocument().WatchDog()->ReportCleanExitL(); +#endif + Exit(); + } + + +// --------------------------------------------------------------------------- +// CGSUi::HandleMessageL +// Handles messages sent from gslauncher +// +// --------------------------------------------------------------------------- +// +MCoeMessageObserver::TMessageResponse CGSUi::HandleMessageL( + TUint32 /*aClientHandleOfTargetWindowGroup*/, + TUid /*aMessageUid*/, + const TDesC8 &aMessageParameters ) + { + const TUint8* ptr = aMessageParameters.Ptr(); + __GSLOGSTRING1( "[CGSUi::HandleMessageL] aMessageParameters: %S", &aMessageParameters ); + + FindAndKillEmbeddedAppL(); + + TUid viewUid; + TUid uid2; + + RDesReadStream str; + str.Open(aMessageParameters); + str >> viewUid; + str >> uid2; + HBufC8* msg8 = HBufC8::NewLC(str, 1024); + str.Close(); + + __GSLOGSTRING1( "[CGSUi::HandleMessageL] Launching view 0x%x ", viewUid.iUid ); + TVwsViewId id( KUidGS , viewUid ); + if ( !View(viewUid) ) + { + GSDocument().CreateShimmedViewL(viewUid); + } + ActivateViewL( id, uid2, *msg8 ); + CleanupStack::PopAndDestroy( msg8 ); + return MCoeMessageObserver::EMessageNotHandled; + } + + +// --------------------------------------------------------------------------- +// CGSUi::FindAndKillEmbeddedAppL() +// Find possiple child app of GS, and kill it. +// +// --------------------------------------------------------------------------- +// +TInt CGSUi::FindAndKillEmbeddedAppL() + { + RWsSession ws = CEikonEnv::Static()->WsSession(); + TApaTaskList taskList( ws ); + TApaTask gstask = taskList.FindApp( KUidGS ); // Find GS + + if ( gstask.Exists() ) // Task should exist + { + TInt gswgid = gstask.WgId(); + RArray wgrp; + ws.WindowGroupList( &wgrp ); + TInt i = 0; + + // Loop window groups, find GS's child app + for ( i=0; i < wgrp.Count() ; ++i ) + { + TBuf<100> name; + ws.GetWindowGroupNameFromIdentifier( wgrp[i].iId , name ); + RWsSession::TWindowGroupChainInfo wginfo = wgrp[i]; + __GSLOGSTRING3( "[CGSUi] wginfo %d (%d) '%S'", wginfo.iId, wginfo.iParentId, &( name.Left( 20 ) ) ); + if ( wginfo.iParentId == gswgid ) // Child of GS found + { + CApaWindowGroupName* windowName1 = CApaWindowGroupName::NewLC( ws, wginfo.iId ); + TUid embeddeeuid; + embeddeeuid = windowName1->AppUid(); + TApaTask embeddee = taskList.FindApp( embeddeeuid ); + + // Kill the child app + if ( embeddee.Exists() ) + { + __GSLOGSTRING2( "[CGSUi] Embeddee: 0x%x Embeddee thread=0x%x", + embeddeeuid.iUid, + embeddee.ThreadId() ); + embeddee.KillTask(); + } + CleanupStack::PopAndDestroy( windowName1 ); //windowName1 + } + } + wgrp.Close(); + } + return KErrNone; + } + + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CGSUi::HandleEComEvent( TEComEvent aEvent ) + { + /** + * Quietly close GS if GS-plugin is uninstalled. This is a precaution for + * scenario where GS-plugin is uninstalled and GS tries to access the + * plugin even though plugin's resources do not exist anymore. + * + * More sophisticated solution would have been to update whole GS plugin + * structure but this would have been overkill for this very rare use + * scenario and rather impossible due to BC requirements. + */ + __GSLOGSTRING1( "[CGSUi::HandleEComEvent] aEvent:%d", aEvent ); + + switch( aEvent ) + { + case MGSEComObserver::EPluginRemoved: + __GSLOGSTRING( "[CGSUi::HandleAppListEvent] Closing GS..." ); + #ifdef GS_ENABLE_WATCH_DOG + TRAP_IGNORE( GSDocument().WatchDog()->ReportCleanExitL() ); + #endif + Exit(); + break; + default: + break; + } + + } + + + + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSApplication/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Information required for building GSApplication. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../rom/GSApp.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsapp.iby ) +../rom/GSAppResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsappresources.iby ) +../Data/backup_registration.xml z:/private/100058ec/backup_registration.xml +../rom/GsResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsresources.iby ) +loc/GSApp.loc MW_LAYER_LOC_EXPORT_PATH( gsapp.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gsapp_aif.mif + OPTION SOURCES -c8,8 qgn_menu_set +END + +PRJ_MMPFILES + +GSApplication.mmp + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSApplication/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSApplication_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSApplication/loc/GSApp.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/loc/GSApp.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Localization strings for GS Application +* +*/ + + +// LOCALISATION STRINGS + + +//d:Text in title pane +//d:Main view +//l:title_pane_t2/opt9 +// +#define qtn_set_title_settings "General settings" + +//d:Text in title pane +//d:Main view +//l:title_pane_t2/opt9 +// +#define qtn_cp_title_control_panel "Control Panel" + +//d:Command in Options list +//d:Opens the highlighted item +//l:list_single_pane_t1_cp2 +// +#define qtn_set_options_open "Open" + +//d:Application title for aif caption file +//d:Long string +//l:list_single_large_graphic_pane_t1 +// +#define qtn_apps_settings_list "General settings" + +//d:Application title for aif caption file +//d:Short string +//l:cell_app_pane_t1 +// +#define qtn_apps_settings_grid "Settings" + +//d:Application title for aif caption file +//d:Long string +//l:list_single_large_graphic_pane_t1 +// +#define qtn_apps_controlpanel_list "Control Panel" + +//d:Application title for aif caption file +//d:Short string +//l:cell_app_pane_t1 +// +#define qtn_apps_controlpanel_grid "Control Panel" + +//d:Text of a list item in Network setting list view's list +//d: Confirmation for Network mode selection operation. +//l: popup_note_window +//w: +//r: 3.1 +#define qtn_set_error_open_during_backuprestore "General Settings cannot be opened during backup/restore" + +//d:Text of a list item in Network setting list view's list +//d: Confirmation for Network mode selection operation. +//l: popup_note_window +//w: +//r: 5.0 +#define qtn_cp_error_open_during_backuprestore "Control Panel cannot be opened during backup/restore" + +// End of File + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAppsPlugin/GSAppsPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAppsPlugin/GSAppsPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This is project specification file for GS AppsPlugin. +* +*/ + +#include //this is needed for RESOURCE_FILES_DIR +#include "../Logger/GsLoggingConfiguration.h" + +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gsappsplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x1020723A +VENDORID VID_DEFAULT + +SOURCEPATH src +SOURCE GSAppsPluginImplementationTable.cpp +SOURCE GSAppsPlugin.cpp + +USERINCLUDE inc +USERINCLUDE data +USERINCLUDE loc +USERINCLUDE ../Logger +USERINCLUDE ../Data + +SYSTEMINCLUDE /epoc32/include/ecom + +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH data + +//ECOM resource definition +START RESOURCE 1020723A.rss +TARGET gsappsplugin.rsc +END // ECOM resource definition + +//View resources +START RESOURCE GSAppsPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // AppsPlugin resources + + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY commonengine.lib//For RConeResourceLoader +LIBRARY gsframework.lib +LIBRARY egul.lib // CGulIcon +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY flogger.lib +LIBRARY gsecomplugin.lib +LIBRARY featmgr.lib // feature manager + +//Documents. Defining these is optional. Used only by IDE's file browser. +DOCUMENT 1020723A.rss +DOCUMENT GSAppsPluginRsc.rss + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAppsPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAppsPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSAppsPlugin. +* +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSAppsPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsappsplugin.iby ) +../rom/GSAppsPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsappspluginresources.iby ) +loc/GSAppsPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsappsplugin.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gsappsplugin.mif + OPTION HEADERFILE gsappsplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_set_apps_sub -c8,8 qgn_prop_set_apps_tab4 +END + + +PRJ_MMPFILES +GSAppsPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAppsPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAppsPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,23 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GS_Data /s /q +rd GSAppsPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAppsPlugin/data/1020723A.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAppsPlugin/data/1020723A.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* ECOM plugin resource file for Applications plugin. +* +*/ + +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x1020723A; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10207239; + version_no = 1; + display_name = "Applications Plugin"; + #ifdef RD_CONTROL_PANEL + default_data = "0x1020723B";//Parent UID + opaque_data = "60";//Order number + #else //RD_CONTROL_PANEL + default_data = "0x1020723B";//Parent UID + opaque_data = "3";//Order number + #endif //RD_CONTROL_PANEL + } + }; + } + }; + } + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAppsPlugin/data/GSAppsPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAppsPlugin/data/GSAppsPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource GSAppsPlugin. +* +*/ + + +// RESOURCE IDENTIFIER +NAME GSAP // 4 letter ID + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// CONSTANTS + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// +// +// Needed or loading the resource fails! +// +//---------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +//---------------------------------------------------- +// +// r_gs_applications_view +// Applications view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_applications_view + { + menubar = r_gs_menubar_open_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN; + } + + +//---------------------------------------------------- +// +// r_gs_apps_view_title +// Application view's title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_apps_view_title + { + #ifdef RD_CONTROL_PANEL + txt = qtn_cp_title_application_settings; + #else //RD_CONTROL_PANEL + txt = qtn_set_title_settings_applications; + #endif //RD_CONTROL_PANEL + } + + +//---------------------------------------------------- +// r_gs_apps_view_caption +// +// Applications view caption for plugin +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_apps_view_caption + { + #ifdef RD_CONTROL_PANEL + buf = qtn_cp_folder_application_settings; + #else //RD_CONTROL_PANEL + buf = qtn_set_folder_applications; + #endif //RD_CONTROL_PANEL + } + +// ****** PDATA RESOURCES END ****** +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAppsPlugin/inc/GSAppsPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAppsPlugin/inc/GSAppsPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,136 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSAppsPlugin header file. +* +*/ + + +#ifndef GSAPPSPLUGIN_H +#define GSAPPSPLUGIN_H + +// Includes +#include +#include + +#include +#include +#include + +// Classes referenced +class CAknViewAppUi; +class RConeResourceLoader; +class CGSTabHelper; + +// Constants +_LIT( KGSAppsPluginResourceFileName, "z:GSAppsPluginRsc.rsc" ); +_LIT( KGSAppsPluginIconDirAndName, "z:gsappsplugin.mbm"); // Use KDC_BITMAP_DIR + +// CLASS DECLARATION + +/** +* Applications Plugin. Displays plugins owned by applications view. +* +* @since Series60_3.1 +*/ +class CGSAppsPlugin : public CGSParentPlugin + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return + */ + static CGSAppsPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSAppsPlugin(); + + public: // From CAknView + + /** + * See base class. + */ + TUid Id() const; + + /** + * See base class. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * See base class. + */ + void DoDeactivate(); + + public: // From CGSParentPlugin + + /** + * See base class. + */ + TUid UpperLevelViewUid(); + + /** + * See base class. + */ + void GetHelpContext( TCoeHelpContext& aContext ); + + public: // From CGSPluginInterface + + /** + * See base class. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * See base class. + */ + TInt PluginProviderCategory() const; + + protected: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + protected: // New + + /** + * C++ default constructor. + */ + CGSAppsPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + private: // Data + + // Resource loader. + RConeResourceLoader iResources; + + // Tab helper. + CGSTabHelper* iTabHelper; + }; + + +#endif // GSAPPSPLUGIN_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAppsPlugin/loc/GSAppsPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAppsPlugin/loc/GSAppsPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSAppsPlugin. +* +*/ + + +// LOCALISATION STRINGS + + +//d:Text in title pane +//d:Application plugin +//l:title_pane_t2/opt9 +//w: +//r:3.1 +// +#define qtn_set_title_settings_applications "Applications" + +//d:Command in Options list +//d:Opens the highlighted item +//l:list_single_pane_t1_cp2 +//w: +//r:3.1 +// +#define qtn_set_options_open "Open" + + +//d:Text of a list item in main view list +//d:Item opens Applications folder +//l:list_single_large_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_set_folder_applications "Applications" + + +//CONTROL PANEL + +//d:Text in title pane +//d:Application plugin +//l:title_pane_t2/opt9 +//w: +//r:5.0 +// +#define qtn_cp_title_application_settings "Application settings" + +//d:Text of a list item in main view list +//d:Item opens Applications folder +//l:list_single_large_graphic_pane_t1 +//w: +//r: 5.0 +#define qtn_cp_folder_application_settings "Application settings" + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAppsPlugin/src/GSAppsPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAppsPlugin/src/GSAppsPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,297 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSAppsPlugin source code. +* +*/ + + +// Includes +#include "GSAppsPlugin.h" +#include "GsLogger.h" +#include +#include +#include +#include +#include +#include +#include +#include // For TResourceReader +#include // Icons +#include +#include + +#ifndef RD_CONTROL_PANEL + #include + #include +#endif //RD_CONTROL_PANEL + +// Constants + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CGSAppsPlugin::CGSAppsPlugin() +// Constructor +// +// --------------------------------------------------------------------------- +// +CGSAppsPlugin::CGSAppsPlugin() + : CGSParentPlugin(), iResources( *iCoeEnv ) + { + __GSLOGSTRING( "[CGSAppsPlugin] CGSAppsPlugin()" ); + } + + +// --------------------------------------------------------------------------- +// CGSAppsPlugin::~CGSAppsPlugin() +// Destructor +// +// --------------------------------------------------------------------------- +// +CGSAppsPlugin::~CGSAppsPlugin() + { + FeatureManager::UnInitializeLib(); + iResources.Close(); + + #ifndef RD_CONTROL_PANEL + delete iTabHelper; + #endif //RD_CONTROL_PANEL + + __GSLOGSTRING( "[CGSAppsPlugin] ~CGSAppsPlugin()" ); + } + + +// --------------------------------------------------------------------------- +// CGSAppsPlugin::ConstructL(const TRect& aRect) +// Symbian OS two-phased constructor +// +// --------------------------------------------------------------------------- +// +void CGSAppsPlugin::ConstructL() + { + FeatureManager::InitializeLibL(); + OpenLocalizedResourceFileL( KGSAppsPluginResourceFileName, iResources ); + + // Do not load content of this view untill/unless this view is activated. + // This will save memory as well as optimize loading performance for other + // plugins. + TBitFlags flags; + flags.Set( EGSLoadChildrenOnActivation ); + SetOptionFlags( flags ); + + BaseConstructL( R_GS_APPLICATIONS_VIEW, R_GS_APPS_VIEW_TITLE ); + + #ifndef RD_CONTROL_PANEL + iTabHelper = CGSTabHelper::NewL(); + #endif //RD_CONTROL_PANEL + } + + +// --------------------------------------------------------------------------- +// CGSAppsPlugin::NewL() +// Static constructor +// +// --------------------------------------------------------------------------- +// +CGSAppsPlugin* CGSAppsPlugin::NewL( TAny* /*aInitParams*/ ) + { + CGSAppsPlugin* self = new(ELeave) CGSAppsPlugin(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CGSAppsPlugin::Id() +// +// +// ----------------------------------------------------------------------------- +// +TUid CGSAppsPlugin::Id() const + { + return KGSAppsPluginUid; + } + + +// ----------------------------------------------------------------------------- +// CGSAppsPlugin::DoActivateL() +// +// +// ----------------------------------------------------------------------------- +// +void CGSAppsPlugin::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + CGSParentPlugin::DoActivateL( aPrevViewId, + aCustomMessageId, + aCustomMessage ); + CGSMainView* parent = + static_cast ( AppUi()->View( KGSMainViewUid ) ); + + // Create tab group for this view (do only if casting succeeds): + #ifndef RD_CONTROL_PANEL + if( parent ) + { + iTabHelper->CreateTabGroupL( Id(), parent ); + } + #endif //RD_CONTROL_PANEL + } + + +// ----------------------------------------------------------------------------- +// CGSAppsPlugin::DoDeactivate() +// +// +// ----------------------------------------------------------------------------- +// +void CGSAppsPlugin::DoDeactivate() + { + CGSParentPlugin::DoDeactivate(); + + #ifndef RD_CONTROL_PANEL + iTabHelper->RemoveTabGroup(); + #endif //RD_CONTROL_PANEL + } + + +// ========================= From CGSParentPlugin ===================== + + +// ----------------------------------------------------------------------------- +// CGSAppsPlugin::UpperLevelViewUid() +// +// +// ----------------------------------------------------------------------------- +// +TUid CGSAppsPlugin::UpperLevelViewUid() + { + return KGSMainViewUid; + } + + +// ========================= From CGSPluginInterface ================== + + +// ----------------------------------------------------------------------------- +// CGSAppsPlugin::GetCaptionL() +// +// +// ----------------------------------------------------------------------------- +// +void CGSAppsPlugin::GetCaptionL( TDes& aCaption ) const + { + // The resource file is already opened. + HBufC* result = StringLoader::LoadL( R_GS_APPS_VIEW_CAPTION ); + aCaption.Copy( *result ); + delete result; + } + + +// ----------------------------------------------------------------------------- +// CGSAppsPlugin::PluginProviderCategory() +// +// +// ----------------------------------------------------------------------------- +// +TInt CGSAppsPlugin::PluginProviderCategory() const + { + return KGSPluginProviderInternal; + } + + +// ----------------------------------------------------------------------------- +// CGSAppsPlugin::GetHelpContext() +// +// +// ----------------------------------------------------------------------------- +// +void CGSAppsPlugin::GetHelpContext( TCoeHelpContext& aContext ) + { + aContext.iMajor = KUidGS; + aContext.iContext = KCP_HLP_APPILICATION_SETTINGS; + } + + +// ----------------------------------------------------------------------------- +// CGSAppsPlugin::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CGSAppsPlugin::CreateIconL( const TUid aIconType ) + { + //EMbm + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSAppsPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropSetAppsSub, + fp->FullName(), + EMbmGsappspluginQgn_prop_set_apps_sub, + EMbmGsappspluginQgn_prop_set_apps_sub_mask ); + } + else if( aIconType == KGSIconTypeTab ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropSetAppsTab4, + fp->FullName(), + EMbmGsappspluginQgn_prop_set_apps_tab4, + EMbmGsappspluginQgn_prop_set_apps_tab4_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + CleanupStack::PopAndDestroy( fp ); + + return icon; + } + + +// ---------------------------------------------------------------------------- +// CGSAppsPlugin::DynInitMenuPaneL() +// +// Display the dynamic menu +// ---------------------------------------------------------------------------- +void CGSAppsPlugin::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + // show or hide the 'help' menu item when supported + if( aResourceId == R_GS_MENU_ITEM_HELP ) + { + User::LeaveIfNull( aMenuPane ); + + if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAppsPlugin/src/GSAppsPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAppsPlugin/src/GSAppsPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for this plugin +* +*/ + + +// System includes +#include +#include + +// User includes +#include "GSAppsPlugin.h" + +// Constants +const TImplementationProxy KAppsPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x10207239, CGSAppsPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KAppsPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KAppsPluginImplementationTable; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Data/200110f0.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Data/200110f0.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for Automatic Keyguard plugin. +* +*/ + +// INCLUDES +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x200110f0; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x20011143; + version_no = 1; + display_name = "Automatic Keyguard Plugin"; //Debug name + default_data = "0x10283317"; //Parent plugin Implementation UID (Device Management) + opaque_data = "5";//Order number + } + }; + } + }; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Data/GSAutoKeyguardPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Data/GSAutoKeyguardPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,392 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for General Settings +* +*/ + + + +// RESOURCE IDENTIFIER +NAME AKGP // 4 letter ID + +// INCLUDES +#include +#include "GSAutoKeyguardPlugin.hrh" + +#include // Avkon localized strings +#include +#include +#include +#include + +// CONSTANTS + +// RESOURCE DEFINITIONS + +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +//---------------------------------------------------- +// r_gs_auto_keyguard_view_caption +// +// Autokeyguard view caption for plugin +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_auto_keyguard_view_caption + { + buf = qtn_set_auto_keyguard_title; + } + + +//---------------------------------------------------- +// +// r_gs_sim_security_view_title +// Security view title +// +//---------------------------------------------------- +// + +RESOURCE TITLE_PANE r_gs_auto_keyguard_view_title + { + txt = qtn_set_auto_keyguard_title; + } + +//---------------------------------------------------- +// +// r_gs_sim_security_softkeys_options_back__change +// SIM security view's CBA resource +// +//---------------------------------------------------- +// +RESOURCE CBA r_gs_auto_keyguard_softkeys_options_back__change + { + buttons = + { + CBA_BUTTON {id=EAknSoftkeyOptions; txt = text_softkey_option;}, + CBA_BUTTON {id=EAknSoftkeyBack; txt = text_softkey_back; }, + CBA_BUTTON {id=EAknSoftkeyChange; txt= qtn_msk_change; } + }; + } + +//---------------------------------------------------- +// +// r_gs_sim_security_view +// SIM security view's menu +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_auto_keyguard_view + { + menubar = r_gs_auto_keyguard_menubar_change_exit; + cba = r_gs_auto_keyguard_softkeys_options_back__change; + } + +// ----------------------------------------------------------------------------- +// +// r_gs_menubar_change_exit +// GS menu with 'change' and 'exit' items. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_BAR r_gs_auto_keyguard_menubar_change_exit + { + titles = + { + MENU_TITLE + { + menu_pane = r_gs_auto_keyguard_menu_item_exit; + }, + MENU_TITLE + { + menu_pane = r_gs_auto_keyguard_menu_item_help; + }, + MENU_TITLE + { + menu_pane = r_gs_auto_keyguard_menu_item_change; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_gs_menu_item_exit +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_auto_keyguard_menu_item_exit + { + items = + { + MENU_ITEM + { + command = EAknCmdExit; + txt = qtn_options_exit; + } + }; + } + + +// ----------------------------------------------------------------------------- +// +// r_gs_menu_item_change +// Change item. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_auto_keyguard_menu_item_change + { + items = + { + MENU_ITEM + { + command = EGSCmdAppChange; + txt = qtn_options_change; + flags = EEikMenuItemAction; // action command + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_gs_menu_item_help +// Change item. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_auto_keyguard_menu_item_help + { + items = + { + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + } + }; + } + +//---------------------------------------------------- +// +// r_auto_keyguard_lbx +// SIM security view's list box items +// +//---------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_auto_keyguard_lbx + { + items = + { + GS_FEATURE + { + txt = " \t"qtn_set_auto_keyguard"\t\t"; + item = EGSSettIdAutoKeyguard; + type = EGSListBoxItemTypeIsDynamic; + } + }; + } + +//---------------------------------------------------- +// +// r_auto_keyguard_lbx +// Autokeyguard's listbox item when Touch UI supported +// +//---------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_touch_auto_keyguard_lbx + { + items = + { + GS_FEATURE + { + txt = " \t"qtn_set_auto_display_lock"\t\t"; + item = EGSSettIdAutoKeyguard; + type = EGSListBoxItemTypeIsDynamic; + } + }; + } + +//---------------------------------------------------- +// +// r_autokeyguard_array +// Autokeyguard array items +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_autokeyguard_array + { + items = + { + LBUF + { + txt = qtn_set_auto_keyguard_none; + }, + LBUF + { + txt = qtn_set_auto_keyguard_sec; + }, + LBUF + { + txt = qtn_set_auto_keyguard_one_min; + }, + LBUF + { + txt = qtn_set_auto_keyguard_min; + } + + }; + } +//---------------------------------------------------- +// +// r_autokeyguard_setting_page +// Autokeyguard setting page for the radio button dialog +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_autokeyguard_setting_page + { + label= qtn_set_auto_keyguard; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id= r_autokeyguard_listbox; + } + +//---------------------------------------------------- +// +// r_autokeyguard_listbox +// Autokeyguard listbox +// +//---------------------------------------------------- +// +RESOURCE LISTBOX r_autokeyguard_listbox + { + array_id = r_autokeyguard_lbx; + flags = EEikListBoxMultipleSelection; + } + +//---------------------------------------------------- +// +// r_autokeyguard_lbx +// Autolock array items +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_autokeyguard_lbx + { + items = + { + LBUF + {//autokeyguard off + txt = qtn_set_auto_keyguard_none; + }, + LBUF + {//user defined + txt = qtn_set_auto_keyguard_userdefined; + } + }; + } + +//---------------------------------------------------- +// r_auto_keyguard_minsec +// +// Autokeyguard resource string for minutes and seconds +//---------------------------------------------------- +// +RESOURCE TBUF r_auto_keyguard_minsec + { + buf = qtn_set_auto_keyguard_minsec; + } + +//---------------------------------------------------- +// r_auto_keyguard_one_min_sec +// +// Autokeyguard resource string for minutes and seconds +//---------------------------------------------------- +// +RESOURCE TBUF r_auto_keyguard_one_min_sec + { + buf = qtn_set_auto_keyguard_one_min_sec; + } + +//---------------------------------------------------- +// +// r_autokeyguard_time_setting_query +// Autokeyguard period query +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_autokeyguard_time_setting_query + { + flags=EGeneralQueryFlags; + buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK; + items= + { + DLG_LINE + { + type=EAknCtQuery; + id=EGeneralQuery; + control = AVKON_DATA_QUERY + { + layout = ETimeLayout; + label = qtn_set_auto_keyguard_query; + control = TIME_EDITOR + { + minTime= TIME {second=5;minute=0;hour=0;}; + maxTime= TIME {second=59;minute=59;}; + flags= EEikTimeWithoutHoursField | EEikTimeForce24HourFormat; + }; + }; + } + }; + + } + + +//---------------------------------------------------- +// +// r_autokeyguard_touch_time_setting_query +// Autokeyguard period query +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_autokeyguard_touch_time_setting_query + { + flags=EGeneralQueryFlags; + buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK; + items= + { + DLG_LINE + { + type=EAknCtQuery; + id=EGeneralQuery; + control = AVKON_DATA_QUERY + { + layout = ETimeLayout; + label = qtn_set_auto_display_lock_query; + control = TIME_EDITOR + { + minTime= TIME {second=5;minute=0;hour=0;}; + maxTime= TIME {second=59;minute=59;}; + flags= EEikTimeWithoutHoursField | EEikTimeForce24HourFormat; + }; + }; + } + }; + + } + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/GSAutoKeyguardPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/GSAutoKeyguardPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification file. +* +*/ + +#include + +#include // For RESOURCE_FILES_DIR + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gsautokeyguardplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x200110f0 +VENDORID VID_DEFAULT + + +SOURCEPATH Src +SOURCE GSAutoKeyguardPluginImplementationTable.cpp +SOURCE GSAutoKeyguardPlugin.cpp +SOURCE GSAutoKeyguardPluginContainer.cpp +SOURCE GSAutoKeyguardPluginModel.cpp +SOURCE GSPubSubsListener.cpp +SOURCE GSAutoKeyguardPluginAutoKeyguardSettingPage.cpp +SOURCE GSAutoKeyguardPluginAutoKeyguardTimeQuery.cpp + + +//User include paths +USERINCLUDE Inc +USERINCLUDE Data // For *.rh + +USERINCLUDE ../Data + +//System include paths +APP_LAYER_SYSTEMINCLUDE + + +SOURCEPATH Data + +START RESOURCE 200110f0.rss +TARGET gsautokeyguardplugin.rsc +END + +START RESOURCE GSAutoKeyguardPluginRsc.rss +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + + + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY egul.lib +LIBRARY eikdlg.lib // eikon dialogs +LIBRARY flogger.lib // File logging +LIBRARY commonengine.lib // For RConeResourceLoader +LIBRARY featmgr.lib // Feature manager +LIBRARY centralrepository.lib +LIBRARY aknskinsrv.lib // for enhanced skinning +LIBRARY aknskins.lib // for enhanced skinning +LIBRARY secui.lib // security +LIBRARY etelmm.lib // security +LIBRARY sssettings.lib // ss settings +LIBRARY hlplch.lib // for "Help" options menu +LIBRARY gsecomplugin.lib +LIBRARY gsframework.lib // For base classes +LIBRARY gslistbox.lib // For CGSListBoxItemTextArray + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,187 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View for Device & SIM security plug-in. +* +*/ + + +#ifndef GSAUTOKEYGUARDPLUGIN_H +#define GSAUTOKEYGUARDPLUGIN_H + +// INCLUDES +#include "GSAutoKeyguardPluginContainer.h" +#include "GSAutoKeyguardPluginModel.h" +#include "MGSSettingPSObserver.h" +#include "GSPubSubsListener.h" + +#include +#include +#include +#include +#include +#include +#include + +// CONSTANTS +const TInt KMaxStringLength = 80; +const TUid KGSAutoKeyguardPluginUid = { 0x200110f0 }; + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CAknViewAppUi; +class CGSAutoKeyguardPluginContainer; + + +// CLASS DECLARATION + +/** +* CGSAutoKeyguardPlugin view class +* +* View class for Sim Security sub-folder +*/ +class CGSAutoKeyguardPlugin : public CGSBaseView, + private MGSSettingPSObserver + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return GS sim & device security view. + */ + static CGSAutoKeyguardPlugin* NewL( TAny* aInitParams ); + + /** + * C++ default constructor. + */ + CGSAutoKeyguardPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + /** + * Destructor. + */ + ~CGSAutoKeyguardPlugin(); + + public: // Functions from base classes + + /** + * Returns view id. + * @return TUid. + */ + TUid Id() const; + + /** + * Handles commands. + * @param aCommand Command to be handled. + * + */ + void HandleCommandL( TInt aCommand ); + + public: //new + + /** + * Updates listbox's item's value. + * @param aItemId An item which is updated. + * + */ + void UpdateListBoxL( TInt aItemId ); + + //From CGSBaseView + void HandleResourceChangeL( TInt aType ); + + public: // From CGSPluginInterface + + /** + * @see CGSPluginInterface header file. + */ + void GetCaptionL( TDes& aCaption ) const; + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + /** + * @see CGSPluginInterface header file. + */ + TInt PluginProviderCategory() const; + + /** + * @see CGSPluginInterface header file. + */ + TBool Visible() const; + + protected: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + private: // from CAknView + /** + * Activates the view. + * @param aPrevViewId ID of previous view + * @param aCustomMessageId customized message ID + * @param aCustomMessage sutomized message payload + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + private: // from CGSBaseView + + void NewContainerL(); + + /** + * From CGSBaseView, handles list box selections. + * + */ + void HandleListBoxSelectionL(); + + private: + /** + * Callback from MGSSettingPSObserver + */ + void HandleNotifyPSL( const TUid aUid, const TInt& aKey, + const TRequestStatus& aStatus ); + + private: //new + /** + * Sets Autokeyguard period + * + */ + void SetAutoKeyguardTimeL( TInt aPeriod, TInt aMaxPeriod ); + + /** + * Get CGSAutoKeyguardPlugin's ccontainer. + */ + CGSAutoKeyguardPluginContainer* Container(); + + private: // Data + //plugin model. + CGSAutoKeyguardPluginModel* iModel; + //resource loader + RConeResourceLoader iResourceLoader; + //PubSub object for BT SAP state + CGSPubSubsListener* iBtSapListener; + + }; + +#endif //GSAUTOKEYGUARDPLUGIN_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPlugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPlugin.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2002 - 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: contains common definitions for menu id:s +* +*/ + + +#ifndef GSAUTOKEYGUARDPLUGIN_HRH +#define GSAUTOKEYGUARDPLUGIN_HRH + +// Data query max length +#define KGSMaxDataLength 21 + +enum TAutoKeyguardMenuCommands + { + EGSCmdAppOpen = 1, + EGSCmdAppHelp, + EGSCmdAppChange, + EAppCmdChange + }; + + +// Automatic Keyguard +enum + { + EGSSettIdAutoKeyguard + }; + +enum TGSListBoxItemVisibility + { + EGSListBoxItemTypeIsAlwaysVisible = 0, + EGSListBoxItemTypeIsDynamic + }; +#endif //GSAUTOKEYGUARDPLUGIN_HRH + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginAutoKeyguardSettingPage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginAutoKeyguardSettingPage.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Autokeyguard period settingpage +* +* +*/ + + +#ifndef __CAUTOKEYGUARDSETTINGPAGE_H +#define __CAUTOKEYGUARDSETTINGPAGE_H + +#include +#include + +class CAutoKeyguardSettingPage : public CAknRadioButtonSettingPage + { + public: + /** + * C++ default constructor. + */ + CAutoKeyguardSettingPage(TInt aResourceId, TInt& aCurrentSelectionItem, CDesCArrayFlat* aItemArray, TTime* aAutoKeyguardValue, TTime aMaxPeriod); + /** + * Symbian OS constructor. + */ + void ConstructL(); + protected: + /** + * Process ui commands + * from CAknRadioButtonSettingPage + * @param aCommandId TInt + */ + void ProcessCommandL(TInt aCommandId); + + /** + * From CAknRadioButtonSettingPage + * @param listbox generating the event + * @param type of listbox event + */ + void HandleListBoxEventL(CEikListBox* aListBox, + MEikListBoxObserver::TListBoxEvent aEventType); + private: + /** + * Handle GSAutoKeyguard settings + */ + void ExecuteAutoKeyguardSettingsL(); + + private: // data + CEikButtonGroupContainer* iPopoutCba; + //Not owned! + TTime* iAutoKeyguardValue; + TTime iMaxPeriod; + }; + +#endif // CAUTOKEYGUARDSETTINGPAGE_H + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginAutoKeyguardTimeQuery.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginAutoKeyguardTimeQuery.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,91 @@ +/* +* 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: Time query for setting Autokeyguard period. +* +* +* +* +*/ + + +#ifndef AUTOKEYGUARDTIMEQUERYDIALOG_H +#define AUTOKEYGUARDTIMEQUERYDIALOG_H + +// INCLUDES +#include //used for Time and Date query + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +// CONSTANTS + +// CLASS DECLARATION + +/** +* CAutoKeyguardTimeQuery class. +*/ +class CAutoKeyguardTimeQuery : public CAknTimeQueryDialog + { + public://construction and destruction + /** + * C++ Constructor. + */ + CAutoKeyguardTimeQuery(TTime& aTime,const TTone aTone = ENoTone); + + /** + * C++ Destructor. + */ + virtual ~CAutoKeyguardTimeQuery(); + + public:// from CCoeControl + + /** + * From CCoeControl Handle key events. When a key event occurs, + * CONE calls this function for each control on the control stack, + * until one of them returns EKeyWasConsumed to indicate that it processed the key event. + * @param aKeyEvent The key event. + * @param aType The type of the event: EEventKey, EEventKeyUp or EEventKeyDown. + * @return Indicates whether or not the key event was used by this control. + */ + TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); + + public://from MAknQueryControlObeserver + + /** + * Called by OfferkeyEventL(), gives a change to dismiss the query with + * send/answer key. + */ + virtual TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent); + + /** + * Called by NeedToDismissQueryL(), gives a change to either accept or reject + * the query. Default implementation is to accept the query if the Left soft + * key is displayed and reject it otherwise. Left softkey is only displayed if + * the query has valid data into it. + */ + virtual void DismissQueryL(); + + /** + * Returns whether the left softkey is visible + * @return ETrue is the left softkey is visible + */ + TBool IsLeftSoftkeyVisible(); + private: //data + TInt iMaximumValue; + }; + +#endif // AUTOKEYGUARDTIMEQUERYDIALOG_H + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for the Display sub-folder +* +*/ + + + +#ifndef GSAUTOKEYGUARDCONTAINER_H +#define GSAUTOKEYGUARDCONTAINER_H + +// INCLUDES +#include +#include + +#include + + +// FORWARD DECLARATION +class CGSListBoxItemTextArray; +class CGSAutoKeyguardPluginModel; + +// CLASS DECLARATION + +/** +* CGSAutoKeyguardPluginContainer container class +* +* Container class for SIM security view +* @lib GSAutoKeyguardPlugin.lib +* @since Series 60_3.1 +*/ +class CGSAutoKeyguardPluginContainer : public CGSBaseContainer + { + public: // Constructors and destructor + + /** + * Symbian OS constructor. + * @param aRect Listbox's rect. + * + */ + void ConstructL( const TRect& aRect ); + + /** + * Destructor. + */ + ~CGSAutoKeyguardPluginContainer(); + + /** + * Constructor + */ + CGSAutoKeyguardPluginContainer( CGSAutoKeyguardPluginModel* aModel ); + + public: // new + /** + * Updates the listbox items + * @param aFeatureId: selected listbox item ID + */ + void UpdateListBoxL( TInt aFeatureId ); + + /** + * Retrieves the feature id for the selected item in the listbox + * @return listbox item array's current feature. + */ + TInt CurrentFeatureId() const; + + void HandleResourceChangeL( TInt aType ); + + protected: // from CGSBaseContainer + /** + * Constructs listbox. + * @param aResLbxId Resource id for listbox. + * + */ + void ConstructListBoxL( TInt aResLbxId ); + + private: //new + /** + * Creates list box items + */ + void CreateListBoxItemsL(); + /** + * Creates autokeyguard list box item + */ + void MakeAutoKeyguardItemL(); + private: + /** + * Required for help. + * + */ + void GetHelpContext( TCoeHelpContext& aContext ) const; + + private: //data + //items from resource + CDesCArray* iItemArray; + //GS listbox model + CGSListBoxItemTextArray* iListboxItemArray; + //Model pointer. Does not own it, so do not delete this pointer. + CGSAutoKeyguardPluginModel* iModel; + //Automatic Keyguard item's text + CDesCArrayFlat* iAutoKeyguardItems; + + }; + +#endif //GSAUTOKEYGUARDCONTAINER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginModel.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Model for Device & SIM security plug-in. +* +*/ + + +#ifndef GSAUTOKEYGUARDPLUGINMODEL_H +#define GSAUTOKEYGUARDPLUGINMODEL_H + +// INCLUDES +#include +#include + +// CONSTANTS +const TInt KGSBufSize128 = 128; + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DEFINITION +/** +* CGSAutoKeyguardPluginModel is the model class of device & sim security plugin. +* It provides functions to get and set setting values. +* @lib GSAutoKeyguardPlugin.lib +* @since Series 60_5.0 + +*/ +class CGSAutoKeyguardPluginModel : public CBase + { + public: // Constructor and destructor + /** + * Two-phased constructor + */ + static CGSAutoKeyguardPluginModel* NewL(); + + /** + * Destructor + */ + ~CGSAutoKeyguardPluginModel(); + + public: + /** + * Returns the autokeyguard period time (minutes). + * + * @return TInt: period + */ + TInt AutoKeyguardPeriod(); + /** + * Returns the autokeyguard maximum period time (minutes). + * + * @return TInt: period + */ + TInt AutoKeyguardMaxPeriod(); + /** + * Sets the autokeyguard period. After this period the keyguard is activated. + * @param aNewPeriod TInt (minutes) + * + * @return ETrue: no errors + * EFalse: an error has occurred + */ + TBool SetAutoKeyguardPeriod(const TInt newPeriod); + + private: // Private constructors + /** + * Default C++ contructor + */ + CGSAutoKeyguardPluginModel(); + + /** + * Symbian OS default constructor + * @return void + */ + void ConstructL(); + + private: // data + CRepository* iSecurityRepository; + + }; + + +#endif //GSAUTOKEYGUARDPLUGINMODEL_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSPubSubsListener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSPubSubsListener.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,129 @@ +/* +* 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: Listener for Publish and subscribe data. +* +*/ + + +#ifndef GSPUBSUBSLISTENER_H +#define GSPUBSUBSLISTENER_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class MGSSettingPSObserver; + +// CLASS DECLARATION + +/** +* RProperty poller. +* +* @lib gs.lib +* @since Series 60 3.0 +*/ +NONSHARABLE_CLASS( CGSPubSubsListener ) : public CActive + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aUid the Uid to use + * @param aKey item's key + * @param aObserver callback interface for notification + * @return instance of CGSPubSubsListener + */ + static CGSPubSubsListener* NewL( const TUid aUid, const TInt aKey, + MGSSettingPSObserver* aObserver ); + + /** + * Destructor. + */ + virtual ~CGSPubSubsListener(); + + public: // New functions. + + /** + * Gets integer value from P & S. + * @param aVal a value in return + * @return error code + */ + TInt Get( TInt& aVal ); + + /** + * Gets 8 bit string value from P&S. + * @param aVal a value in return + * @return error code + */ + TInt Get( TDes8& aVal ); + + /** + * Gets 16 bit descriptor value from P&S. + * @param aVal a value in return + * @return error code + */ + TInt Get( TDes16& aVal ); + + private: // From CActive. + + /** @see CActive::RunL */ + virtual void RunL(); + + /** @see CActive::Cancel */ + virtual void DoCancel(); + + /** @see CActive::RunError */ + virtual TInt RunError( TInt aError ); + + /** + * Starts the listening (RunL). + */ + void StartListening(); + + private: + + /** + * C++ default constructor. + * @param aUid the Uid to use + * @param aKey item's key + * @param aObserver callback interface for notification + */ + CGSPubSubsListener( const TUid aUid, TInt aKey, + MGSSettingPSObserver* aObserver ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + + // UID of the monitored item. + TUid iUid; + + // ID of the monitored item. + TInt iId; + + // Property to subscribe to. + RProperty iProperty; + + // The notification interface. + MGSSettingPSObserver* iCallback; + }; + +#endif // GSPUBSUBSLISTENER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/MGSSettingPSObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/MGSSettingPSObserver.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Observer interface for indicating publish and subscribe +* setting changes +* +*/ + + + +#ifndef MGSSETTINGPSOBSERVER_H +#define MGSSETTINGPSOBSERVER_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* Observer interface for indicating setting changes +* +* @lib GSSimSecPlugin +* @since 3.1 +*/ +class MGSSettingPSObserver + { + public: // New functions + + /** + * Handler for setting changed event + * @param aUid uid of setting + * @param aId id of setting + * @param aStatus status of completed AO operation + */ + virtual void HandleNotifyPSL( const TUid aUid, const TInt& aKey, + const TRequestStatus& aStatus ) = 0; + }; + +#endif // MGSSETTINGPSOBSERVER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,471 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View for Autokeyguard sub-folder +* +*/ + + +// INCLUDE FILES +#include +#include // For HlpLauncher +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GSAutoKeyguardPlugin.h" +#include "GSAutoKeyguardPluginContainer.h" +#include "GSAutoKeyguardPlugin.hrh" +#include +#include "GSAutoKeyguardPluginAutoKeyguardSettingPage.h" +#include "GSAutoKeyguardPluginAutoKeyguardTimeQuery.h" + + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +_LIT( KGSAutoKeyguardPluginResourceFileName, "z:GSAutoKeyguardPluginRsc.rsc" ); +_LIT( KGSAutoKeyguardPluginIconDirAndName, "z:GSAutoKeyguardPlugin.mbm"); +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +/** +* CCugQuery +* It defines CCugQuery used in closed user group settings +*/ +class CCugQuery + : public CAknNumberQueryDialog + { + public: // Constructors and destructors + /** + * C++ constructor. + */ + CCugQuery( TInt& aNumber,const TTone aTone = ENoTone ); + protected: // From base classes + /** + * From CCAknNumberQueryDialog Left softkey is allways OK. + */ + void UpdateLeftSoftKeyL(); + }; + +// ============================= LOCAL FUNCTIONS ============================== + +// ========================= MEMBER FUNCTIONS ================================= + +// --------------------------------------------------------------------------- +// GSAutoKeyguardPlugin::NewL() +// +// --------------------------------------------------------------------------- +CGSAutoKeyguardPlugin* CGSAutoKeyguardPlugin::NewL( TAny* /*aInitParams*/ ) + { + CGSAutoKeyguardPlugin* self = new( ELeave ) CGSAutoKeyguardPlugin(); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// --------------------------------------------------------------------------- +// GSAutoKeyguardPlugin::CGSAutoKeyguardPlugin() +// +// --------------------------------------------------------------------------- +CGSAutoKeyguardPlugin::CGSAutoKeyguardPlugin() + : iResourceLoader( *iCoeEnv ) + { + } + + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPlugin::ConstructL() +// +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +void CGSAutoKeyguardPlugin::ConstructL() + { + FeatureManager::InitializeLibL(); + + iModel = CGSAutoKeyguardPluginModel::NewL(); + //PS listener initialization + iBtSapListener = CGSPubSubsListener::NewL( + KPSUidBluetoothSapConnectionState, + KBTSapConnectionState, this ); + + // Find the resource file + TParse parse; + parse.Set( KGSAutoKeyguardPluginResourceFileName, + &KDC_RESOURCE_FILES_DIR, NULL ); + TFileName fileName( parse.FullName() ); + + // Get language of resource file + BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName ); + + // Open resource file + iResourceLoader.OpenL( fileName ); + + BaseConstructL( R_GS_AUTO_KEYGUARD_VIEW ); + + } + + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPlugin::~CGSAutoKeyguardPlugin() +// +// +// --------------------------------------------------------------------------- +CGSAutoKeyguardPlugin::~CGSAutoKeyguardPlugin() + { + FeatureManager::UnInitializeLib(); + // close resource loader + iResourceLoader.Close(); + + if ( iModel ) + { + delete iModel; + } + + if(iBtSapListener) + { + delete iBtSapListener; + } + + } + + +// --------------------------------------------------------------------------- +// TUid CGSAutoKeyguardPlugin::Id() +// +// +// --------------------------------------------------------------------------- +TUid CGSAutoKeyguardPlugin::Id() const + { + return KGSAutoKeyguardPluginUid; + } + + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPlugin::HandleCommandL() +// +// +// --------------------------------------------------------------------------- +void CGSAutoKeyguardPlugin::HandleCommandL( TInt aCommand ) + { + switch ( aCommand ) + { + case EGSCmdAppChange: + case EAknSoftkeyChange: + { + HandleListBoxSelectionL(); + } + break; + case EAknSoftkeyBack: + iAppUi->ActivateLocalViewL( KGSDeviceManagementPluginUid ); + break; + case EAknCmdHelp: + { + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), iAppUi->AppHelpContextL() ); + } + } + break; + default: + iAppUi->HandleCommandL( aCommand ); + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPlugin::UpdateListBoxL +// +// Update the current item in the listbox. +// --------------------------------------------------------------------------- +void CGSAutoKeyguardPlugin::UpdateListBoxL( TInt aItemId ) + { + Container()->UpdateListBoxL( aItemId ); + } + + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPlugin::DoActivateL(...) +// +// +// --------------------------------------------------------------------------- +void CGSAutoKeyguardPlugin::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + } + + +// ---------------------------------------------------------------------------- +// CGSAutoKeyguardPlugin::Container +// +// Return handle to container class. +// ---------------------------------------------------------------------------- +// +CGSAutoKeyguardPluginContainer* CGSAutoKeyguardPlugin::Container() + { + return static_cast( iContainer ); + } + + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPlugin::NewContainerL() +// +// Creates new iContainer. +// --------------------------------------------------------------------------- +// +void CGSAutoKeyguardPlugin::NewContainerL() + { + iContainer = new( ELeave ) CGSAutoKeyguardPluginContainer( iModel ); + } + + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPlugin::HandleListBoxSelectionL() +// +// +// --------------------------------------------------------------------------- +void CGSAutoKeyguardPlugin::HandleListBoxSelectionL() + { + const TInt currentFeatureId = Container()->CurrentFeatureId(); + TInt maxPeriod(0); + switch ( currentFeatureId ) + { + case EGSSettIdAutoKeyguard: + maxPeriod = iModel->AutoKeyguardMaxPeriod(); + SetAutoKeyguardTimeL(iModel->AutoKeyguardPeriod(), maxPeriod); + break; + default: + break; + } + + } + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPlugin::SetAutoKeyguardTimeL() +// +// +// --------------------------------------------------------------------------- +void CGSAutoKeyguardPlugin::SetAutoKeyguardTimeL(TInt aPeriod, TInt aMaxPeriod) + { + TInt currentItem = 0; + CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( R_AUTOKEYGUARD_LBX ); + CleanupStack::PushL(items); + if (aPeriod == 0) + { + currentItem = 0; // autokeyguard off + } + else + { + currentItem = 1; // user defined + } + TInt64 periodInMicroseconds(aPeriod); + periodInMicroseconds *= 1000000; + TTime period(periodInMicroseconds); + + TInt64 maxPeriodInMicroseconds(aMaxPeriod); + maxPeriodInMicroseconds *= 1000000; + TTime maximum(maxPeriodInMicroseconds); + + CAutoKeyguardSettingPage* dlg = new (ELeave)CAutoKeyguardSettingPage(R_AUTOKEYGUARD_SETTING_PAGE, + currentItem, items, &period, maxPeriodInMicroseconds); + if (!dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged)) + { + CleanupStack::PopAndDestroy(); // items + return; + } + CleanupStack::PopAndDestroy(); // items + TDateTime keyGuardTime = period.DateTime(); + //convert the period to seconds + TInt newPeriod = (keyGuardTime.Minute() * 60) + keyGuardTime.Second(); + iModel->SetAutoKeyguardPeriod(newPeriod); + UpdateListBoxL( EGSSettIdAutoKeyguard ); + } + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPlugin::HandleResourceChangeL( TInt aType ) +// Updates view layout +// +// --------------------------------------------------------------------------- +// +void CGSAutoKeyguardPlugin::HandleResourceChangeL( TInt aType ) + { + if( aType == KAknsMessageSkinChange || + aType == KEikDynamicLayoutVariantSwitch ) + { + //iContainer->HandleResourceChangeL( aType ); + } + } + + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPlugin::HandleNotifyPSL +// +// Handling PS keys change +// --------------------------------------------------------------------------- +// +void CGSAutoKeyguardPlugin::HandleNotifyPSL( const TUid aUid, const TInt& aKey, + const TRequestStatus& /* aStatus */ ) + { + if ( aUid == KPSUidBluetoothSapConnectionState && + aKey == KBTSapConnectionState ) + { + Visible(); + } + } + + +// ========================= From CGSPluginInterface ================== + +// ---------------------------------------------------------------------------- +// CGSAutoKeyguardPlugin::GetCaption +// +// Return application/view caption. +// ---------------------------------------------------------------------------- +// +void CGSAutoKeyguardPlugin::GetCaptionL( TDes& aCaption ) const + { + // the resource file is already opened. + HBufC* result = StringLoader::LoadL( R_GS_AUTO_KEYGUARD_VIEW_CAPTION ); + + aCaption.Copy( *result ); + delete result; + } + + +// ---------------------------------------------------------------------------- +// CGSAutoKeyguardPlugin::PluginProviderCategory +// +// A means to identify the location of this plug-in in the framework. +// ---------------------------------------------------------------------------- +// +TInt CGSAutoKeyguardPlugin::PluginProviderCategory() const + { + //To identify internal plug-ins. + return KGSPluginProviderInternal; + } + + +// ---------------------------------------------------------------------------- +// CGSAutoKeyguardPlugin::Visible +// +// Provides the visibility status of self to framework. +// ---------------------------------------------------------------------------- +// +TBool CGSAutoKeyguardPlugin::Visible() const + { + TInt btSapConnectionState; + TBool visible = ETrue; + + iBtSapListener->Get( btSapConnectionState ); + + if ( btSapConnectionState == EBTSapConnected ) + { + visible = EFalse; + } + + return visible; + } + +// ---------------------------------------------------------------------------- +// CGSAutoKeyguardPlugin::DynInitMenuPaneL() +// +// Display the dynamic menu +// ---------------------------------------------------------------------------- +void CGSAutoKeyguardPlugin::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + + // show or hide the 'help' menu item when supported + if( aResourceId == R_GS_AUTO_KEYGUARD_MENU_ITEM_HELP ) + { + User::LeaveIfNull( aMenuPane ); + if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + + } +// ----------------------------------------------------------------------------- +// CGSCallDivertPlugin::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CGSAutoKeyguardPlugin::CreateIconL( const TUid aIconType ) + { + //EMbm + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSAutoKeyguardPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropCpDevKeyguard, + fp->FullName(), + EMbmGsautokeyguardpluginQgn_prop_cp_dev_keyguard, + EMbmGsautokeyguardpluginQgn_prop_cp_dev_keyguard_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + CleanupStack::PopAndDestroy( fp ); + + return icon; + } +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginAutoKeyguardSettingPage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginAutoKeyguardSettingPage.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2006 - 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Autokeyguard period settingpage +* +* +*/ + +#include +#include +#include +#include +#include "GSAutoKeyguardPluginAutoKeyguardTimeQuery.h" +#include "GSAutoKeyguardPluginAutoKeyguardSettingPage.h" + +const TInt64 minPeriodInMicroseconds(5000000); + +// +// ---------------------------------------------------------- +// CAutoKeyguardSettingPage::CAutoKeyguardSettingPage() +// C++ default constructor +// ---------------------------------------------------------- +// +CAutoKeyguardSettingPage::CAutoKeyguardSettingPage(TInt aResourceId, + TInt& aCurrentSelectionItem, + CDesCArrayFlat* aItemArray, + TTime* aAutoKeyguardValue, + TTime aMaxPeriod) : CAknRadioButtonSettingPage(aResourceId, aCurrentSelectionItem, aItemArray) + + { //c++ constructor may not contain any code which might leave + iAutoKeyguardValue = aAutoKeyguardValue; + iMaxPeriod = aMaxPeriod; + } + +// +// ---------------------------------------------------------- +// CAutoKeyguardSettingPage::ConstructL() +// Symbian OS default constructor +// ---------------------------------------------------------- +// +void CAutoKeyguardSettingPage::ConstructL() + { + CAknRadioButtonSettingPage::ConstructL(); + const TSize screenSize = iCoeEnv->ScreenDevice()->SizeInPixels(); + } + + +// +// ---------------------------------------------------------- +// CAutoKeyguardSettingPage::ProcessCommandL() +// +// ---------------------------------------------------------- +// +void CAutoKeyguardSettingPage::ProcessCommandL(TInt aCommandId) + { + // Respond to softkey events + + switch (aCommandId) + { + case EAknSoftkeySelect: + case EAknSoftkeyOk: + ExecuteAutoKeyguardSettingsL(); + break; + + default: + CAknSettingPage::ProcessCommandL(aCommandId); + break; + } + + } + +//--------------------------------------------------------------------------------------- +// CAutoKeyguardSettingPage::HandleListBoxEventL() +// +//--------------------------------------------------------------------------------------- +// +void CAutoKeyguardSettingPage::HandleListBoxEventL(CEikListBox* aListBox, + MEikListBoxObserver::TListBoxEvent aEventType) + { + // Respond to double click events + if ( aEventType == EEventEnterKeyPressed || aEventType == EEventItemSingleClicked ) + { + ExecuteAutoKeyguardSettingsL(); + } + } + +//--------------------------------------------------------------------------------------- +// CAutoKeyguardSettingPage::ExecuteAutoKeyguardSettingsL() +// +//--------------------------------------------------------------------------------------- +// +void CAutoKeyguardSettingPage::ExecuteAutoKeyguardSettingsL() + { + TInt cur = ListBoxControl()->CurrentItemIndex(); + + // autoKeyguard off + if (cur == 0) + { + *iAutoKeyguardValue = 0; + AttemptExitL(ETrue); + } + // user defined + if (cur == 1) + { + + CAutoKeyguardTimeQuery* dlg = new (ELeave) CAutoKeyguardTimeQuery(*iAutoKeyguardValue, CAknQueryDialog::ENoTone); + + if(AknLayoutUtils::PenEnabled()) + { + dlg->PrepareLC(R_AUTOKEYGUARD_TOUCH_TIME_SETTING_QUERY); + } + else + { + dlg->PrepareLC(R_AUTOKEYGUARD_TIME_SETTING_QUERY); + } + + if(iMaxPeriod > 0) + { + TTime minimum(minPeriodInMicroseconds); + dlg->SetMinimumAndMaximum(minimum, iMaxPeriod); + } + + if(dlg->RunLD()) + { + AttemptExitL(ETrue); + } + else + AttemptExitL(EFalse); + } + } +// End of file + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginAutoKeyguardTimeQuery.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginAutoKeyguardTimeQuery.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Time query for setting Autokeyguard period. +* +* +* +* +*/ + + + +// INCLUDE FILES +#include "GSAutoKeyguardPluginAutoKeyguardTimeQuery.h" + +// ========================= MEMBER FUNCTIONS ================================ + +// ----------------------------------------------------------------------------- +// CAutoKeyguardTimeQuery::CAutoKeyguardTimeQuery +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CAutoKeyguardTimeQuery::CAutoKeyguardTimeQuery( TTime& aTime, const TTone aTone ) : + CAknTimeQueryDialog( aTime, aTone ) + { + } + +// Destructor +CAutoKeyguardTimeQuery::~CAutoKeyguardTimeQuery() + { + } + +// ----------------------------------------------------------------------------- +// CAutoKeyguardTimeQuery::OfferKeyEventL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TKeyResponse CAutoKeyguardTimeQuery::OfferKeyEventL(const TKeyEvent& aKeyEvent, + TEventCode aType) + { + if( aType != EEventKey ) + return EKeyWasNotConsumed; + + if( NeedToDismissQueryL( aKeyEvent ) ) + return EKeyWasConsumed; + return CAknDialog::OfferKeyEventL(aKeyEvent,aType); + } + +// ----------------------------------------------------------------------------- +// CAutoKeyguardTimeQuery::NeedToDismissQueryL +// Allows user to acknowledge time and date queries with the send key. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CAutoKeyguardTimeQuery::NeedToDismissQueryL(const TKeyEvent& aKeyEvent) + { + if (aKeyEvent.iCode == EKeyPhoneSend) + { + DismissQueryL(); + return ETrue; + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CAutoKeyguardTimeQuery::DismissQueryL +// Query is accepted if the left softkey is displayed +// (left softkey is displayed only if there is valid data in the query). +// Query is discarded if the left softkey is not displayed. +// Clients can override this and implement something different. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CAutoKeyguardTimeQuery::DismissQueryL() + { + if (IsLeftSoftkeyVisible()) + { + TryExitL(EEikBidOk); + } + } + +// ----------------------------------------------------------------------------- +// CAutoKeyguardTimeQuery::IsLeftSoftkeyVisible +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CAutoKeyguardTimeQuery::IsLeftSoftkeyVisible() + { + return ButtonGroupContainer().ButtonGroup()->IsCommandVisible( + ButtonGroupContainer().ButtonGroup()->CommandId(0)); + } + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,297 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for the Device & SIM security sub-folder +* +*/ + + +#include "GSAutoKeyguardPluginContainer.h" +#include "GSAutoKeyguardPluginModel.h" +#include "GSAutoKeyguardPlugin.hrh" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS ============================== + + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPluginContainer::ConstructL() +// +// Symbian OS two phased constructor +// --------------------------------------------------------------------------- +// +void CGSAutoKeyguardPluginContainer::ConstructL( const TRect& aRect ) + { + iListBox = new( ELeave ) CAknSettingStyleListBox; + if(AknLayoutUtils::PenEnabled()) + { + BaseConstructL( aRect, R_GS_AUTO_KEYGUARD_VIEW_TITLE, R_TOUCH_AUTO_KEYGUARD_LBX ); + } + else + { + BaseConstructL( aRect, R_GS_AUTO_KEYGUARD_VIEW_TITLE, R_AUTO_KEYGUARD_LBX ); + } + + } + + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPluginContainer::~CGSSettListSecurityContainer() +// +// Destructor +// --------------------------------------------------------------------------- +// + +CGSAutoKeyguardPluginContainer::~CGSAutoKeyguardPluginContainer() + { + if(iAutoKeyguardItems) + { + delete iAutoKeyguardItems; + } + + if(iListboxItemArray) + { + delete iListboxItemArray; + } + + } + + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPluginContainer::CGSAutoKeyguardPluginContainer() +// +// Constructor +// --------------------------------------------------------------------------- +// +CGSAutoKeyguardPluginContainer::CGSAutoKeyguardPluginContainer( + CGSAutoKeyguardPluginModel* aModel ) + : iModel ( aModel ) + { + } + + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPluginContainer::ConstructListBoxL() +// +// +// --------------------------------------------------------------------------- +// +void CGSAutoKeyguardPluginContainer::ConstructListBoxL( TInt aResLbxId ) + { + + iListBox->ConstructL( this, EAknListBoxSelectionList ); + iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, + *iListBox, *iCoeEnv ); + iListBox->Model()->SetItemTextArray( iListboxItemArray ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + iAutoKeyguardItems = iCoeEnv->ReadDesC16ArrayResourceL( R_AUTOKEYGUARD_ARRAY ); + CreateListBoxItemsL(); + } + + +// --------------------------------------------------------------------------- +// CGSSettListIdleContainer::CreateListBoxItemsL() +// +// +// --------------------------------------------------------------------------- +// +void CGSAutoKeyguardPluginContainer::CreateListBoxItemsL() + { + MakeAutoKeyguardItemL(); + } + +// --------------------------------------------------------------------------- +// CGSSettListIdleContainer::UpdateListBoxL( TInt aFeatureId ) +// +// +// --------------------------------------------------------------------------- +// +void CGSAutoKeyguardPluginContainer::UpdateListBoxL( TInt aFeatureId ) + { + switch( aFeatureId ) + { + case EGSSettIdAutoKeyguard: + MakeAutoKeyguardItemL(); + break; + default: + return; + } + + iListBox->HandleItemAdditionL(); + } + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPluginContainer::MakeAutoKeyguardItemL() +// +// +// --------------------------------------------------------------------------- +// +void CGSAutoKeyguardPluginContainer::MakeAutoKeyguardItemL() + { + #ifdef RD_AUTO_KEYGUARD + + HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 ); + TPtr ptrBuffer ( dynamicText->Des() ); + + TInt period = iModel->AutoKeyguardPeriod(); + + //calculate minutes and seconds + TInt minutes = 0; + TInt sec = 0; + if(period >= 60) + { + minutes = period / 60; + } + sec = period - minutes * 60; + + if((minutes > 1 ) && (sec > 0)) + { + CArrayFixFlat *minSec=new(ELeave)CArrayFixFlat( 2 ); + CleanupStack::PushL(minSec); + minSec->AppendL(minutes); + minSec->AppendL(sec); + + //Load the resource string; this function replaces the %0N and %1N in the + //localisation string with numbers from the array having the same index as the number preceding the N. + HBufC* tempDynamicText = StringLoader::LoadL( R_AUTO_KEYGUARD_MINSEC, *minSec, iCoeEnv); + ptrBuffer = tempDynamicText->Des(); + delete tempDynamicText; + CleanupStack::PopAndDestroy( minSec ); + } + else if ((minutes == 1 ) && (sec > 0)) + { + CArrayFixFlat *minSec=new(ELeave)CArrayFixFlat( 2 ); + CleanupStack::PushL(minSec); + minSec->AppendL(minutes); + minSec->AppendL(sec); + + //Load the resource string; this function replaces the %0N and %1N in the + //localisation string with numbers from the array having the same index as the number preceding the N. + HBufC* tempDynamicText = StringLoader::LoadL( R_AUTO_KEYGUARD_ONE_MIN_SEC, *minSec, iCoeEnv); + ptrBuffer = tempDynamicText->Des(); + delete tempDynamicText; + CleanupStack::PopAndDestroy( minSec ); + } + else if ((minutes > 1 ) && (sec == 0)) + { + TBuf tempString; + StringLoader::Format( tempString, + ( ( *iAutoKeyguardItems )[3] ), + -1, // no index in the key string + minutes ); + ptrBuffer = tempString; + } + else if ((minutes == 1 ) && (sec == 0)) + { + TBuf tempString; + StringLoader::Format( tempString, + ( ( *iAutoKeyguardItems )[2] ), + -1, // no index in the key string + minutes ); + ptrBuffer = tempString; + } + else if ((minutes == 0 ) && (sec > 0)) + { + TBuf tempString; + StringLoader::Format( tempString, + ( ( *iAutoKeyguardItems )[1] ), + -1, // no index in the key string + sec ); + ptrBuffer = tempString; + } + else //both are 0, period is not user defined + { + ptrBuffer = ( *iAutoKeyguardItems )[0]; + } + + + iListboxItemArray->SetDynamicTextL( EGSSettIdAutoKeyguard, ptrBuffer ); + CleanupStack::PopAndDestroy( dynamicText ); + iListboxItemArray->SetItemVisibilityL( EGSSettIdAutoKeyguard, + CGSListBoxItemTextArray::EVisible ); + #endif //RD_AUTO_KEYGUARD + } + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPluginContainer::CurrentFeatureId() +// +// --------------------------------------------------------------------------- +// +TInt CGSAutoKeyguardPluginContainer::CurrentFeatureId() const + { + return iListboxItemArray->CurrentFeature( ); + } + + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPluginContainer::GetHelpContext() const +// Gets Help +// +// --------------------------------------------------------------------------- +// +void CGSAutoKeyguardPluginContainer::GetHelpContext( TCoeHelpContext& aContext ) const + { + aContext.iMajor = KUidGS; + // aContext.iContext = KCP_HLP_DEVICE_LOCKING; // This was used before, when keylock and keguard had the same help file + _LIT(KCP_HLP_AUTOKEYGUARD_LOCAL, "CP_HLP_AUTOKEYGUARD"); // the global KCP_HLP_AUTOKEYGUARD is defined only on some products but not all. + aContext.iContext = KCP_HLP_AUTOKEYGUARD_LOCAL; + } + +// --------------------------------------------------------------------------- +// CGSAutoKeyguardPluginContainer::HandleResourceChangeL() +// +// Updates view layout +// --------------------------------------------------------------------------- +// +void CGSAutoKeyguardPluginContainer::HandleResourceChangeL( TInt aType ) + { + if( aType == KAknsMessageSkinChange || + aType == KEikDynamicLayoutVariantSwitch ) + { + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + mainPaneRect ); + SetRect( mainPaneRect ); + DrawNow(); + } + } + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for this plugin +* +*/ + + +// System includes +#include +#include + +// User includes +#include "GSAutoKeyguardPlugin.h" + +// Constants +const TImplementationProxy KGSAutoKeyguardPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x20011143, CGSAutoKeyguardPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSAutoKeyguardPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSAutoKeyguardPluginImplementationTable; + } + + +// --------------------------------------------------------------------------- +// E32Dll +// EKA1 entry point +// +// --------------------------------------------------------------------------- +// +#ifndef EKA2 +GLDEF_C TInt E32Dll( TDllReason /*aReason*/ ) + { + return( KErrNone ); + } +#endif // EKA2 + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginModel.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Model for Device & SIM security plug-in. +* +*/ + + +// INCLUDES +#include "GSAutoKeyguardPluginModel.h" + +#include + +#include +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS +const TInt KGSSettingOff = 0; +const TInt KGSDefaultAutoKeyguardTime = 60; +const TInt KGSUseDefaultMaxAutoKeyguardTime = 0; + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// ============================= LOCAL FUNCTIONS ============================== + +// ========================= MEMBER FUNCTIONS ================================= + +// ---------------------------------------------------------------------------- +// CGSAutoKeyguardPluginModel::NewL +// +// Symbian OS two-phased constructor +// ---------------------------------------------------------------------------- +// +CGSAutoKeyguardPluginModel* CGSAutoKeyguardPluginModel::NewL() + { + CGSAutoKeyguardPluginModel* self = new( ELeave ) CGSAutoKeyguardPluginModel; + CleanupStack::PushL( self ); + self->ConstructL(); + + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CGSAutoKeyguardPluginModel::CGSAutoKeyguardPluginModel +// +// +// C++ default constructor can NOT contain any code, that might leave. +// ---------------------------------------------------------------------------- +// +CGSAutoKeyguardPluginModel::CGSAutoKeyguardPluginModel() + { + + } + + +// ---------------------------------------------------------------------------- +// CGSAutoKeyguardPluginModel::ConstructL +// +// Symbian OS default constructor can leave. +// ---------------------------------------------------------------------------- +// +void CGSAutoKeyguardPluginModel::ConstructL() + { + iSecurityRepository = CRepository::NewL( KCRUidSecuritySettings ); + } + + +// ---------------------------------------------------------------------------- +// CGSAutoKeyguardPluginModel::~CGSAutoKeyguardPluginModel +// +// Destructor +// ---------------------------------------------------------------------------- +// +CGSAutoKeyguardPluginModel::~CGSAutoKeyguardPluginModel() + { + if(iSecurityRepository) + { + delete iSecurityRepository; + iSecurityRepository = NULL; + } + + } + +// ---------------------------------------------------------------------------- +// CGSAutoKeyguardPluginModel::AutoKeyguardPeriod(); +// +// Reads Autolock period from .ini file and returns it +// ---------------------------------------------------------------------------- +// +TInt CGSAutoKeyguardPluginModel::AutoKeyguardPeriod() + { + TInt period = KGSSettingOff; + + if ( iSecurityRepository-> + Get( KSettingsAutomaticKeyguardTime, period ) != KErrNone ) + { + period = KGSDefaultAutoKeyguardTime; + iSecurityRepository->Set( KSettingsAutomaticKeyguardTime, period ); + } + + return period; + } + +// ---------------------------------------------------------------------------- +// CGSAutoKeyguardPluginModel::AutoKeyguardMaxPeriod(); +// +// Reads Autokeyguard period maximum allowed value from .ini file and returns it +// ---------------------------------------------------------------------------- +// +TInt CGSAutoKeyguardPluginModel::AutoKeyguardMaxPeriod() + { + TInt maxPeriod(600); + + if ( iSecurityRepository-> + Get( KSettingsMaxAutomaticKeyguardTime, maxPeriod ) != KErrNone ) + { + maxPeriod = KGSUseDefaultMaxAutoKeyguardTime; + } + return maxPeriod; + } + + +// ---------------------------------------------------------------------------- +// CGSAutoKeyguardPluginModel::SetAutoKeyguardPeriod +// +// Writes Autokeyguard period time to Cenrep +// ---------------------------------------------------------------------------- +// +TBool CGSAutoKeyguardPluginModel::SetAutoKeyguardPeriod( TInt aLockTime ) + { + TInt ret = iSecurityRepository->Set( KSettingsAutomaticKeyguardTime, aLockTime ); + return ret; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSPubSubsListener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSPubSubsListener.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Publish and subscribe settings listener. +* +*/ + + +// INCLUDE FILES +#include "GSPubSubsListener.h" +#include "MGSSettingPSObserver.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::CGSPubSubsListener +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CGSPubSubsListener::CGSPubSubsListener( const TUid aUid, const TInt aKey, + MGSSettingPSObserver* aObserver ) + : CActive( CActive::EPriorityStandard ) + { + iUid = aUid; + iId = aKey; + iCallback = aObserver; + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::~CGSPubSubsListener +// Destructor. +// ----------------------------------------------------------------------------- +// +CGSPubSubsListener::~CGSPubSubsListener() + { + Cancel(); + iProperty.Close(); + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::RunL +// From CActive. +// ----------------------------------------------------------------------------- +// +void CGSPubSubsListener::RunL() + { + const TRequestStatus status( iStatus ); + StartListening(); + iCallback->HandleNotifyPSL( iUid, iId, status ); + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::DoCancel +// From CActive. +// ----------------------------------------------------------------------------- +// +void CGSPubSubsListener::DoCancel() + { + iProperty.Cancel(); + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::RunError +// From CActive. +// ----------------------------------------------------------------------------- +// +TInt CGSPubSubsListener::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::NewL +// +// Symbian OS two phased constructor +// ----------------------------------------------------------------------------- +// +CGSPubSubsListener* CGSPubSubsListener::NewL( const TUid aUid, const TInt aKey, + MGSSettingPSObserver* aObserver ) + { + CGSPubSubsListener* self = new( ELeave ) + CGSPubSubsListener( aUid, aKey, aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::StartListening +// ----------------------------------------------------------------------------- +// +void CGSPubSubsListener::StartListening() + { + iProperty.Subscribe( iStatus ); + SetActive(); + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::ConstructL +// +// Symbian OS default constructor +// ----------------------------------------------------------------------------- +// +void CGSPubSubsListener::ConstructL() + { + CActiveScheduler::Add( this ); + + User::LeaveIfError ( iProperty.Attach( iUid, iId, EOwnerThread ) ); + StartListening(); + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::Get +// Read integer value. +// ----------------------------------------------------------------------------- +// +TInt CGSPubSubsListener::Get( TInt& aVal ) + { + return iProperty.Get( iUid, iId, aVal ); + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::Get +// Read binary value. +// ----------------------------------------------------------------------------- +// +TInt CGSPubSubsListener::Get( TDes8& aVal ) + { + return iProperty.Get( iUid, iId, aVal ); + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::Get +// Read string value. +// ----------------------------------------------------------------------------- +// +TInt CGSPubSubsListener::Get( TDes16& aVal ) + { + return iProperty.Get( iUid, iId, aVal ); + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSAutoKeyguardPlugin. +* +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSAutoKeyguardPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsautokeyguardplugin.iby ) +../rom/GSAutoKeyguardPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsautokeyguardpluginresources.iby ) +loc/gsautokeyguardplugin.loc MW_LAYER_LOC_EXPORT_PATH( gsautokeyguardplugin.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gsautokeyguardplugin.mif + OPTION HEADERFILE gsautokeyguardplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_cp_dev_keyguard +END + + +PRJ_MMPFILES +GSAutoKeyguardPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSAutoKeyguardPlugin/loc/gsautokeyguardplugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSAutoKeyguardPlugin/loc/gsautokeyguardplugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,94 @@ +/* +* 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: Localization strings for Automatic keyguard view +* +*/ + + +//d:Text of a list item in Connection view's folder list +//d:Item opens Data Call folder +//l:list_single_large_graphic_pane_t1 +//w: +//r: 5.0 +// +#define qtn_set_auto_keyguard_title "Automatic keyguard" + +//d: Automatic keyguard setting item in device & sim security settings folder +//l: list_setting_pane_t1 +//w: +//r:3.1 +#define qtn_set_auto_keyguard "Autokeyguard period" + +//d:List item in automatic keyguard setting page +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +#define qtn_set_auto_keyguard_none "None" + +//d:List item in automatic keyguard setting page +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +#define qtn_set_auto_keyguard_userdefined "User defined" + +//d:Number query: automatic keyguard period time. +//l:popup_query_data_window +//w: +//r:3.1 +#define qtn_set_auto_keyguard_query "Lock keypad after (minutes:seconds) " + +//d:Automatic keyguard period setting item edit - setting selection data +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +#define qtn_set_auto_keyguard_one_min "%N min" + +//d:Automatic keyguard period setting item edit - setting selection data, %N is number 0-60 +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +#define qtn_set_auto_keyguard_min "%N min" + +//d:Automatic keyguard period setting item edit - setting selection data. %1N is a number 0-59. +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +#define qtn_set_auto_keyguard_one_min_sec "%0N min %1N sec" + +//d:Automatic keyguard period setting item edit - setting selection data, %0N is number 0-59, %1N is number 0-59 +//l:list_set_graphic_pane_t1 +//w: +//r:3.0 +#define qtn_set_auto_keyguard_minsec "%0N min %1N sec" + +//d:Automatic keyguard period setting item edit - setting selection data, %N is number 0-59 +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +#define qtn_set_auto_keyguard_sec "%N sec" + +//d: Name of the autokeyguard setting +//l: list_setting_pane_t1 +//w: +//r:5.0 +#define qtn_set_auto_display_lock "Display autolock period" + +//d:Number query: automatic keyguard period time. +//l:popup_query_data_window +//w: +//r:5.0 +#define qtn_set_auto_display_lock_query "Lock display and keys after (minutes:seconds)" + + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSBackgroundImage/GSBackgroundImage.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSBackgroundImage/GSBackgroundImage.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This is project specification for GS Background Image DLL +* +*/ + + + +#include + +// Capability assignment. +CAPABILITY CAP_GENERAL_DLL DRM + +TARGET backgroundimage.dll +TARGETTYPE DLL +UID 0x1000008d 0x101FD68C + +// This defines that the CGSModel uses IETD to enhance +// background and welcome note image while loading/processing. +MACRO __USE_IETD__ + +SOURCEPATH Src +SOURCE BackgroundImage.cpp +SOURCE GsAsyncImageHandling.cpp + +USERINCLUDE . +USERINCLUDE .. +USERINCLUDE Inc +USERINCLUDE ../Logger +USERINCLUDE ../Cenrep + +//System include paths +// Default system include paths for middleware layer modules. +APP_LAYER_SYSTEMINCLUDE + +// Libraries required by framework +LIBRARY bafl.lib +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY apparc.lib + +// Libraries for model +LIBRARY commonengine.lib // shareddata +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY mediaclientimage.lib // media server +LIBRARY sysutil.lib // memory CL check +LIBRARY fbscli.lib +LIBRARY apgrfx.lib // for Personalization app +LIBRARY drmcommon.lib +LIBRARY bitgdi.lib +LIBRARY cdlengine.lib //Scalable UI +LIBRARY imageconversion.lib //for image handling +LIBRARY avkon.lib +LIBRARY eikcore.lib +LIBRARY centralrepository.lib +LIBRARY phoneclient.lib +LIBRARY aknlayout2.lib +LIBRARY flogger.lib //tracing +LIBRARY drmparsers.lib +LIBRARY bitmaptransforms.lib //bitmap scaling + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSBackgroundImage/Src/BackgroundImage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSBackgroundImage/Src/BackgroundImage.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,542 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +// INCLUDE FILES +#include "backgroundimage.h" +#include "GsLogger.h" +#include "settingsinternalcrkeys.h" +#include "SettingsPrivateCRKeys.h" + +#include +#include +#include +#include +#include +#include +#include //DRM v2 migration +#include +#include +#include +#include + + + +// CONSTANTS +// Setting values for Background and Welcome note image +const TInt KGSBackgroundModeImage = 1; +// estimated image max size in bytes +const TInt KGSMaxBackgroundImgSize = 520000; +// estimated image max size in bytes +const TInt KGSMaxWelcomeNoteImgSize = 100000; +const TInt KGSVTStillImageWidth = 176; +const TInt KGSVTStillImageHeight = 144; + +//Personalisation application is availble on ROM (1) or not (0) +const TInt KGSPlsnOnRom = 1; +const TInt KGSPlsnNotOnRom = 0; + +// other constants +_LIT( KGSBackgroundImgPath, "c:\\resource\\apps\\backgroundimage.mbm"); +_LIT( KGSVTStillImgPath, "c:\\resource\\apps\\vtstillimage.mbm"); + + + + +// FORWARD DECLARATIONS + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CGSBackgroundImage::CGSBackgroundImage +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CGSBackgroundImage::CGSBackgroundImage() + { + } + +// ----------------------------------------------------------------------------- +// CGSBackgroundImage::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CGSBackgroundImage::ConstructL() + { + iPersonalizationRepository = + CRepository::NewL( KCRUidPersonalizationSettings ); + iStartupConfRepository = CRepository::NewL( KCRUidStartupConf ); + iTelephonyRepository = CRepository::NewL( KCRUidTelephonySettings ); + + iDisplayMode = CEikonEnv::Static()->ScreenDevice()->DisplayMode(); + } + + +// ----------------------------------------------------------------------------- +// CGSBackgroundImage::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CGSBackgroundImage* CGSBackgroundImage::NewL() + { + CGSBackgroundImage* self = new( ELeave ) CGSBackgroundImage; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// ---------------------------------------------------------------------------- +// Destructor +// +//----------------------------------------------------------------------------- +// +CGSBackgroundImage::~CGSBackgroundImage() + { + delete iPersonalizationRepository; + delete iStartupConfRepository; + delete iTelephonyRepository; + } + +// ---------------------------------------------------------------------------- +// CGSBackgroundImage::BackgroundImageL +// +// Returns background image mode. +// DEPRECATED +// ---------------------------------------------------------------------------- +// +EXPORT_C TInt CGSBackgroundImage::BackgroundImageL() + { + TInt image; + User::LeaveIfError( iPersonalizationRepository-> + Get( KSettingsBackgroundImage, image ) ); + return image; + } + +// ---------------------------------------------------------------------------- +// CGSBackgroundImage::SetBackgroundImageL +// +// Sets background image mode. +// DEPRECATED +// ---------------------------------------------------------------------------- +// +EXPORT_C void CGSBackgroundImage::SetBackgroundImageL(const TInt aImage) + { + User::LeaveIfError( iPersonalizationRepository-> + Set( KSettingsBackgroundImage, aImage ) ); + if (aImage != KGSBackgroundModeImage) + { + // It doesn't matter much if the image deletion fails, + // so no need to handle the error. + TRAP_IGNORE( DeleteImageL( KGSBackgroundImgPath ) ); + } + + } + +// ---------------------------------------------------------------------------- +// CGSBackgroundImage::SetBackgroundImagePathL +// +// Sets background image. +// DEPRECATED +// ---------------------------------------------------------------------------- +// +EXPORT_C void CGSBackgroundImage::SetBackgroundImagePathL( + const TDesC& aImagePath ) + { + // Check if there is enough space in disk to store background image + if (SysUtil::FFSSpaceBelowCriticalLevelL(NULL, KGSMaxBackgroundImgSize)) + { + // don't show any own notes here + User::Leave(KErrDiskFull); + } + + // make sure there is no memory leaks because of iBitmap and iDimmedBmp + if (iBitmap) + { + delete iBitmap; + iBitmap = NULL; + } + + iBitmap = new(ELeave) CFbsBitmap; + + TRect appRect = iAvkonAppUi->ApplicationRect(); + TAknLayoutRect layout; + + layout.LayoutRect(appRect, AknLayout::wallpaper_pane()); + LoadImageL(aImagePath, layout.Rect().Width(), layout.Rect().Height(), + ETrue, EGSWallpaperIdle); + TBuf<1> KGSNullParam; + SaveBitmapsL( KGSNullParam, KGSNullParam ); + + delete iBitmap; + iBitmap = NULL; + User::LeaveIfError( iPersonalizationRepository-> + Set( KSettingsBackgroundImagePath, KGSBackgroundImgPath ) ); + } + +// ---------------------------------------------------------------------------- +// CGSBackgroundImage::SetBackgroundImagePathL +// Sets background image. Does not store image to SD +// Overloaded function, takes 2 parameters +// DEPRECATED +// ---------------------------------------------------------------------------- +// +EXPORT_C void CGSBackgroundImage::SetBackgroundImagePathL( + const TDesC& aImagePath, + TDes& aBmpFileName ) + { + SetBackgroundImagePathL( aImagePath, aBmpFileName, EGSWallpaperIdle ); + } + +// ---------------------------------------------------------------------------- +// CGSBackgroundImage::SetBackgroundImagePathL +// Sets background image. Does not store image to SD +// Overloaded function, takes 3 parameters +// DEPRECATED +// ---------------------------------------------------------------------------- +// +EXPORT_C void CGSBackgroundImage::SetBackgroundImagePathL( + const TDesC& aImagePath, + TDes& aBmpFileName, + TGSWallpaperType aWallpaperType ) + { + // Check if there is enough space in disk to store background image + if (SysUtil::FFSSpaceBelowCriticalLevelL(NULL, KGSMaxBackgroundImgSize)) + { + // don't show any own notes here + User::Leave(KErrDiskFull); + } + + // Make sure there is no memory leaks because of iBitmap and iDimmedBmp + if (iBitmap) + { + delete iBitmap; + iBitmap = NULL; + } + + iBitmap = new(ELeave) CFbsBitmap; + + if( aWallpaperType == EGSWallpaperIdle ) + { + //Reading wallpaper size + __GSLOGSTRING( + "[CGSBackgroundImage] SetBackgroundImagePathL |->"); + TRect screenRect( CEikonEnv::Static()->ScreenDevice()->SizeInPixels() ); + TAknLayoutRect appRect; + appRect.LayoutRect( + screenRect, + AknLayout::application_window( screenRect ) ); + TAknLayoutRect mainRectSmall; + mainRectSmall.LayoutRect( + appRect.Rect(), + AknLayout::main_pane( appRect.Rect(), 0, 1, 1 ) ); + TAknLayoutRect layout; + layout.LayoutRect( mainRectSmall.Rect(), AknLayout::wallpaper_pane() ); + + __GSLOGSTRING("[CGSBackgroundImage] SetBackgroundImagePathL"); + LoadImageL(aImagePath, layout.Rect().Width(), layout.Rect().Height(), + ETrue, EGSWallpaperIdle); + } + else if( aWallpaperType == EGSWallpaperPinboard ) + { + //Reading wallpaper size + __GSLOGSTRING("[CGSBackgroundImage] SetBackgroundImagePathL 1"); + + TRect screenRect( CEikonEnv::Static()->ScreenDevice()->SizeInPixels() ); + TAknLayoutRect appRect; + appRect.LayoutRect( + screenRect, + AknLayout::application_window( screenRect ) ); + TAknLayoutRect mainRectSmall; + mainRectSmall.LayoutRect( + appRect.Rect(), + AknLayout::main_pane( appRect.Rect(), 0, 0, 1 ) ); + TAknLayoutRect layout; + + layout.LayoutRect( + mainRectSmall.Rect(), AknLayoutScalable_Apps::bg_pinb_pane(0) ); + + __GSLOGSTRING("[CGSBackgroundImage] SetBackgroundImagePathL 2"); + LoadImageL(aImagePath, layout.Rect().Width(), layout.Rect().Height(), + ETrue, EGSWallpaperPinboard); + __GSLOGSTRING("[CGSBackgroundImage] SetBackgroundImagePathL -|"); + } + + SaveBitmapsL( aBmpFileName, aImagePath ); + + delete iBitmap; + iBitmap = NULL; + } + +// ---------------------------------------------------------------------------- +// CGSBackgroundImage::SetWelcomeNoteImageL +// +// Sets welcome note image's path +// ---------------------------------------------------------------------------- +// +EXPORT_C void CGSBackgroundImage::SetWelcomeNoteImageL(const TDesC& aImagePath, + CGSAsyncImageHandling& aImgHandler ) + { + // Check if there is enough space in disk to store welcome note image + if ( SysUtil::FFSSpaceBelowCriticalLevelL( NULL, KGSMaxWelcomeNoteImgSize ) ) + { + // don't show any own notes here + User::Leave( KErrDiskFull ); + } + + + + TRect screen = iAvkonAppUi->ApplicationRect(); + TInt screenWidth = screen.Width() - 2; + TInt screenHeight = screen.Height() - 2; + + //rescale + aImgHandler.ProcessImageL( aImagePath, screenWidth, screenHeight, + EGSWelcomeNoteImage ); + } + +// ---------------------------------------------------------------------------- +// CGSBackgroundImage::LoadImageL +// Loads an image to bitmap and scales it if it's too large. +// Deprecated +// ---------------------------------------------------------------------------- +// +void CGSBackgroundImage::LoadImageL(const TDesC& /*aImagePath*/, + TInt /*aWidth*/, TInt /*aHeight*/, + TBool /*aBgImage*/, TGSWallpaperType /*aWallpaperType*/) + { + } + + +// ---------------------------------------------------------------------------- +// CGSBackgroundImage::SaveBitmapsL +// Stores background image and dimmed image to the same mbm file. +// ---------------------------------------------------------------------------- +// +void CGSBackgroundImage::SaveBitmapsL( TDes& aBmpFileName, + const TDesC& aOriginalFullname ) + { + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + CDirectFileStore* fileStore; + if( aBmpFileName != KNullDesC ) + { + fileStore = CDirectFileStore::ReplaceLC( + fs, aBmpFileName, EFileWrite ); + } + else + { + fileStore = CDirectFileStore::ReplaceLC( + fs, KGSBackgroundImgPath, EFileWrite ); + } + + TUidType uidType( KDirectFileStoreLayoutUid, KMultiBitmapFileImageUid ); + fileStore->SetTypeL( uidType ); + + RStoreWriteStream bmpStream; + TStreamId imgId = bmpStream.CreateLC( *fileStore ); + iBitmap->ExternalizeL( bmpStream ); + + CleanupStack::PopAndDestroy(); //bmpStream + + RStoreWriteStream rootStream; + // create root stream + TStreamId rootStreamId = rootStream.CreateLC( *fileStore ); + rootStream.WriteInt32L( 1 ); // number of bitmaps + + rootStream << imgId; // stream id of bitmap + + CleanupStack::PopAndDestroy(); //rootStream + + fileStore->SetRootL( rootStreamId ); + CleanupStack::PopAndDestroy(); // filestore; + + TBool isprotected( EFalse ); + + DRMCommon* drmclient = DRMCommon::NewL(); + + CleanupStack::PushL( drmclient ); + TInt error = drmclient->Connect(); + if ( error != DRMCommon::EOk ) + { + User::Leave( KErrCorrupt ); + } + + if ( aOriginalFullname != KNullDesC ) + { + error = drmclient->IsProtectedFile( aOriginalFullname, isprotected ); + if ( error != DRMCommon::EOk ) + { + User::Leave( KErrCorrupt ); + } + } + + + if ( isprotected ) + { + HBufC8* contenturi = NULL; + HBufC8* mimetype = NULL; + DRMCommon::TContentProtection contentProtection; + TUint datalen( 0 ); + CDRMRights* rights = NULL; + + + error = drmclient->GetFileInfo( + aOriginalFullname, contentProtection, + mimetype, contenturi, datalen ); + CleanupStack::PushL( mimetype ); + CleanupStack::PushL( contenturi ); + if ( error != DRMCommon::EOk ) + { + User::Leave( KErrCorrupt ); + } + + drmclient->GetActiveRights( + *contenturi, DRMCommon::EDisplay, rights ); + CleanupStack::PushL( rights ); + + RFile file; + User::LeaveIfError( file.Open( fs, aBmpFileName, + EFileWrite|EFileShareAny ) ); + CleanupClosePushL( file ); + + TInt filesize( 0 ); + User::LeaveIfError( file.Size( filesize ) ); + HBufC8* content = HBufC8::NewL( filesize ); // use actual filesize + + CleanupStack::PushL( content ); + + TPtr8 readPtr( content->Des() ); + User::LeaveIfError( file.Read( readPtr ) ); + + CleanupStack::Pop(); // content + COma1DcfCreator* dcfCreator = COma1DcfCreator::NewL(); + dcfCreator->EncryptContentL( content, *mimetype, rights ); + CleanupStack::PushL( content ); + + TInt offset = 0; + User::LeaveIfError( file.Seek( ESeekStart,offset ) ); + TPtr8 writePtr( content->Des() ); + User::LeaveIfError( file.Write( writePtr ) ); + User::LeaveIfError( file.Flush() ); + // mimetype, contenturi, rights, file, content + CleanupStack::PopAndDestroy(5); + delete dcfCreator; + } + + drmclient->Disconnect(); + CleanupStack::PopAndDestroy(2); // fs & drmclient + } + + +// ---------------------------------------------------------------------------- +// CGSBackgroundImage::DeleteImageL +// Deletes file specified in the parameter. +// ---------------------------------------------------------------------------- +// +EXPORT_C void CGSBackgroundImage::DeleteImageL(const TDesC& aImagePath) + { + RFs fs; + User::LeaveIfError(fs.Connect()); + CleanupClosePushL(fs); + + User::LeaveIfError(fs.Delete(aImagePath)); + + CleanupStack::PopAndDestroy(); // fs + } + +// ---------------------------------------------------------------------------- +// CGSBackgroundImage::SetVTStillImagePathL +// +// Sets VT still image. +// ---------------------------------------------------------------------------- +// +EXPORT_C void CGSBackgroundImage::SetVTStillImagePathL( + const TDesC& aImagePath, + CGSAsyncImageHandling& aImgHandler ) + { + // Check if there is enough space in disk to store still image + if (SysUtil::FFSSpaceBelowCriticalLevelL(NULL, KGSMaxBackgroundImgSize)) + { + // don't show any own notes here + User::Leave(KErrDiskFull); + } + aImgHandler.ProcessImageL( aImagePath, KGSVTStillImageWidth, + KGSVTStillImageHeight, EGSVtStillImage ); + User::LeaveIfError( iTelephonyRepository-> + Set( KSettingsVTStillImagePath, KGSVTStillImgPath ) ); + } + +// ---------------------------------------------------------------------------- +// CGSBackgroundImage::GetPlnsStatus +// +// Check if Personalisation application is on the device +// ---------------------------------------------------------------------------- +// +EXPORT_C TInt CGSBackgroundImage::GetPlnsStatus() + { + TRAP_IGNORE( IsPersonalisationApplicationL() ); + return iPlnsInDevice; + } + +// ---------------------------------------------------------------------------- +// CGSBackgroundImage::IsPersonalisationApplication +// +// +// ---------------------------------------------------------------------------- +// +EXPORT_C void CGSBackgroundImage::IsPersonalisationApplicationL() + { + RApaLsSession session; + User::LeaveIfError( session.Connect() ); + + const TUid KUidPsln = { 0x10005A32 }; + TApaAppInfo appInfo; + TInt search = session.GetAppInfo( appInfo, KUidPsln ); + session.Close(); + + if ( search == KErrNone ) + { + TParse fileInfo; + fileInfo.Set( appInfo.iFullName, NULL, NULL ); + TPtrC drive = fileInfo.Drive(); + _LIT( KZDrive, "Z:" ); + if ( drive == KZDrive ) + { + iPlnsInDevice = KGSPlsnOnRom; + } + else + { + iPlnsInDevice = KGSPlsnNotOnRom; + } + } + else + { + iPlnsInDevice = KErrNotFound; + } + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSBackgroundImage/Src/GsAsyncImageHandling.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSBackgroundImage/Src/GsAsyncImageHandling.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,445 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// INCLUDE FILES +#include "gsasyncimagehandling.h" +#include +#include +#include +#include +#include + +#include "mgsasyncimagehandlingobserver.h" +#include "GsLogger.h" + +#include +#include +#include + +//_LIT( KGSWelcomeNoteImgPath, "c:\\private\\100058ec\\welcomeimage.mbm"); + +const TInt KGSVTStillImageWidth = 176; +const TInt KGSVTStillImageHeight = 144; + + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CGSAsyncImageHandling::CGSAsyncImageHandling +// C++ constructor. +// +// --------------------------------------------------------------------------- +// +CGSAsyncImageHandling::CGSAsyncImageHandling( RFs& aFs, + MGSAsyncImageHandlingObserver* aObserver, + const TDesC& aDestinationPath ) + : CActive( EPriorityNormal ), + iObserver( aObserver ), + iFs( aFs ), + iDestinationPath( aDestinationPath ) + + { + CActiveScheduler::Add( this ); + } + + +// --------------------------------------------------------------------------- +// CGSAsyncImageHandling::NewL() +// C++ constructor. +// +// --------------------------------------------------------------------------- +// +EXPORT_C CGSAsyncImageHandling* CGSAsyncImageHandling::NewL( RFs& aFs, + MGSAsyncImageHandlingObserver* aObserver, + const TDesC& aDestinationPath ) + { + CGSAsyncImageHandling* self = + new( ELeave ) CGSAsyncImageHandling( aFs, aObserver, + aDestinationPath ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// ----------------------------------------------------------------------------- +// CGSAsyncImageHandling::ConstructL +// Symbian 2nd phase constructor can leave. +// +// ----------------------------------------------------------------------------- +// +void CGSAsyncImageHandling::ConstructL() + { + iStartupRepository = CRepository::NewL( KCRUidStartupConf ); + iBitmapScaler = CBitmapScaler::NewL(); + } + + +// --------------------------------------------------------------------------- +// CGSAsyncImageHandling::~CGSAsyncImageHandling +// destructor. +// +// --------------------------------------------------------------------------- +// +CGSAsyncImageHandling::~CGSAsyncImageHandling() + { + Cancel(); + + if ( iStartupRepository ) + { + delete iStartupRepository; + } + + if( iDecoder ) + { + delete iDecoder; + } + + if ( iBitmapScaler ) + { + delete iBitmapScaler; + } + + if ( iBitmap ) + { + delete iBitmap; + } + } + +// --------------------------------------------------------------------------- +// CGSAsyncImageHandling::ProcessImageL +// +// Processing the image asynchronously +// --------------------------------------------------------------------------- +// +void CGSAsyncImageHandling::ProcessImageL( const TDesC& aFileName, + TInt aScreenWidth, + TInt aScreenHeight, + TGSBgImageType aBgImageType ) + { +__GSLOGSTRING1( "[CGSAsyncImageHandling] process image %S", &aFileName ); + + TInt frameNumber = 0; //for JPEG & bmp images + iBgImageType = aBgImageType; + + // make sure there is no memory leaks because of iBitmap and iDimmedBmp + if (iBitmap) + { + delete iBitmap; + iBitmap = NULL; + } + iBitmap = new(ELeave) CFbsBitmap; + + // Loading image from file into CFbsBitmap + CImageDecoder::GetMimeTypeFileL( iFs, aFileName, iMimeString ); + iDecoder = CImageDecoder::FileNewL( iFs, aFileName, + CImageDecoder::EOptionNone ); + + TFrameInfo frameInfo = iDecoder->FrameInfo(); + TSize imgSize = frameInfo.iOverallSizeInPixels; + + + TDisplayMode displayMode = GetDisplayMode( frameInfo ); + + TSize screenSize( aScreenWidth, aScreenHeight ); + TSize loadSize( CalculateLoadSize( frameInfo, screenSize ) ); + iScaleSize = loadSize; + + iBitmap->Reset(); + User::LeaveIfError( iBitmap->Create( imgSize, displayMode ) ); + iDecoder->Convert( &iStatus, *iBitmap, frameNumber ); + + if ( aBgImageType == EGSWelcomeNoteImage ) + { + iState = EGSWelcomeConversion; + } + else if ( aBgImageType == EGSVtStillImage ) + { + iState = EGSVTConversion; + } + + SetActive(); + } + +// --------------------------------------------------------------------------- +// CGSAsyncImageHandling::GetDisplayMode +// +// Dithers the image to attain the required dithering according to the display +// mode settings +// --------------------------------------------------------------------------- +// +TDisplayMode CGSAsyncImageHandling::GetDisplayMode( const TFrameInfo& aFrameInfo ) + { + if( aFrameInfo.iFlags & TFrameInfo::ECanDither ) + { + if( aFrameInfo.iFrameDisplayMode < EColor64K ) + { + return aFrameInfo.iFrameDisplayMode; + } + else + { + return EColor64K; + } + } + else + { + return aFrameInfo.iFrameDisplayMode; + } + } + + +// ----------------------------------------------------------------------------- +// CGSAsyncImageHandling::RunL +// +// +// --------------------------------------------------------------------------- +// +void CGSAsyncImageHandling::RunL() + { + if( iStatus.Int() == KErrNone ) + { + switch( iState ) + { + case EGSWelcomeConversion: + iBitmapScaler->Scale(&iStatus, *iBitmap, iScaleSize, ETrue ); + iState = EGSWelcomeScaling; + SetActive(); + break; + + case EGSWelcomeScaling: + { + TInt err = iBitmap->Save( iDestinationPath ); + iStartupRepository->Set( KStartupWelcomeNoteImage, + iDestinationPath ); + + //raising completion event + iObserver->ImageHandlingCompleteL( iStatus.Int() ); + Cancel(); + } + break; + + case EGSVTConversion: + iBitmapScaler->Scale(&iStatus, *iBitmap, iScaleSize, ETrue ); + iState = EGSVTScaling; + SetActive(); + break; + + case EGSVTScaling: + SaveVTStillImageL(); + iObserver->ImageHandlingCompleteL( iStatus.Int() ); + Cancel(); + break; + + default: + break; + } + } + else + { + iObserver->ImageHandlingCompleteL( iStatus.Int() ); + Cancel(); + } + } + +// ----------------------------------------------------------------------------- +// CGSAsyncImageHandling::DoCancel +// +// +// --------------------------------------------------------------------------- +// +void CGSAsyncImageHandling::DoCancel() + { + if ( iDecoder ) + { + iDecoder->Cancel(); + } + + if ( iBitmapScaler ) + { + iBitmapScaler->Cancel(); + } + + delete iDecoder; + iDecoder = NULL; + } + +// ----------------------------------------------------------------------------- +// CGSAsyncImageHandling::RunError +// +// +// --------------------------------------------------------------------------- +// +TInt CGSAsyncImageHandling::RunError( TInt aError ) + { + TRAP_IGNORE( iObserver->ImageHandlingCompleteL( aError ) ); + DoCancel(); + return aError; + } + +// ---------------------------------------------------------------------------- +// TSize CGSAsyncImageHandling::CalculateLoadSize +// +// Calculates the load size +// ---------------------------------------------------------------------------- +// +TSize CGSAsyncImageHandling::CalculateLoadSize( TFrameInfo& aFrameInfo, + const TSize aScreenSize ) + { + TReal perfectAspect = ( TReal )( + ( TReal )aScreenSize.iWidth/ + ( TReal )aScreenSize.iHeight ); + TReal aspect = ( TReal )( + ( TReal )aFrameInfo.iFrameCoordsInPixels.Width()/ + ( TReal )aFrameInfo.iFrameCoordsInPixels.Height() ); + TSize size( aScreenSize.iWidth, aScreenSize.iHeight ); + TSize cropsize( aScreenSize.iWidth, aScreenSize.iHeight ); + + TAknWindowLineLayout layout = AknLayout::wallpaper_pane(); + if( aFrameInfo.iFrameCoordsInPixels.Width() > aScreenSize.iWidth || + aFrameInfo.iFrameCoordsInPixels.Height() > aScreenSize.iHeight ) + { + //calculating dynamically range for image aspect ratio close to screen + TReal maxAspect = ((TReal)aScreenSize.iWidth/(TReal)aScreenSize.iHeight) + 0.12; + TReal minAspect = ((TReal)aScreenSize.iWidth/(TReal)aScreenSize.iHeight) - 0.12; + + if (aspect >= minAspect && aspect <= maxAspect ) + { + if( aspect < perfectAspect ) + { + size.iWidth = aScreenSize.iWidth; + size.iHeight = (TInt)((TReal)aScreenSize.iWidth/ + (TReal)aFrameInfo.iFrameCoordsInPixels.Width()* + (TReal)aFrameInfo.iFrameCoordsInPixels.Height()); + } + else + { + size.iWidth = (TInt)((TReal)aScreenSize.iHeight/ + (TReal)aFrameInfo.iFrameCoordsInPixels.Height()* + (TReal)aFrameInfo.iFrameCoordsInPixels.Width()); + size.iHeight = aScreenSize.iHeight; + } + if (size.iWidth > aScreenSize.iWidth) + { + cropsize.iWidth = aScreenSize.iWidth; + } + else + { + cropsize.iWidth = size.iWidth; + } + if (size.iHeight > aScreenSize.iHeight) + { + cropsize.iHeight = aScreenSize.iHeight; + } + else + { + cropsize.iHeight = size.iHeight; + } + } + else + { + // Scale and maintain aspect ratio + if( aspect < perfectAspect ) + { + if (aFrameInfo.iFrameCoordsInPixels.Height() > aScreenSize.iHeight) + { + size.iWidth = (TInt)((TReal)aScreenSize.iHeight/ + (TReal)aFrameInfo.iFrameCoordsInPixels.Height()* + (TReal)aFrameInfo.iFrameCoordsInPixels.Width()); + size.iHeight = aScreenSize.iHeight; + } + } + else + { + if (aFrameInfo.iFrameCoordsInPixels.Width() > aScreenSize.iWidth) + { + size.iWidth = aScreenSize.iWidth; + size.iHeight = (TInt)((TReal)aScreenSize.iWidth/ + (TReal)aFrameInfo.iFrameCoordsInPixels.Width()* + (TReal)aFrameInfo.iFrameCoordsInPixels.Height()); + } + } + } + } + + return size; + } + +// ----------------------------------------------------------------------------- +// CGSAsyncImageHandling::SaveVTStillImageL +// +// +// --------------------------------------------------------------------------- +// +void CGSAsyncImageHandling::SaveVTStillImageL() + { + //creating new and merging + const TSize KStillImageSize( KGSVTStillImageWidth, KGSVTStillImageHeight ); + + CFbsBitmap* newBitmap = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( newBitmap ); + + User::LeaveIfError( + newBitmap->Create( KStillImageSize, iBitmap->DisplayMode() ) ); + + CFbsBitmapDevice* device = CFbsBitmapDevice::NewL( newBitmap ); + CleanupStack::PushL( device ); + + CFbsBitGc* context = NULL; + User::LeaveIfError( device->CreateContext( context ) ); + User::LeaveIfNull( context ); + + context->SetPenStyle( CGraphicsContext::ENullPen ); + context->SetBrushColor( TRgb( 0, 0, 0 ) ); // black color + context->SetBrushStyle( CGraphicsContext::ESolidBrush ); + context->Clear(); + + const TSize scaledImageSize( iBitmap->SizeInPixels() ); + + TInt xPos = ( KStillImageSize.iWidth - scaledImageSize.iWidth ) / 2; + TInt yPos = ( KStillImageSize.iHeight - scaledImageSize.iHeight ) / 2; + + context->BitBlt( TPoint( xPos, yPos ), iBitmap ); + + delete context; + CleanupStack::PopAndDestroy( device ); + + //saving bitmap + CPhCltImageHandler* phCltImageHandler = CPhCltImageHandler::NewL(); + CleanupStack::PushL( phCltImageHandler ); + + // Acquires ownership of *imageParams + // Bad naming for create-function CPhCltBaseImageParamsL(). + CPhCltImageParams* imageParams = phCltImageHandler-> + CPhCltBaseImageParamsL( EPhCltTypeVTStill ); + CleanupStack::PushL( imageParams ); + TInt ret = newBitmap->Handle(); + imageParams->AddImageL( ret ); + phCltImageHandler->SaveImages( *imageParams ); + CleanupStack::PopAndDestroy( imageParams ); + CleanupStack::PopAndDestroy( phCltImageHandler ); + + delete iBitmap; + iBitmap = NULL; + + CleanupStack::PopAndDestroy( newBitmap ); + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSBackgroundImage/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSBackgroundImage/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building + GSBackgroundImage. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../rom/GSBackgroundImage.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsbackgroundimage.iby ) + +PRJ_MMPFILES +GSBackgroundImage.mmp + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSBackgroundImage/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSBackgroundImage/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSBackgroundImage_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Data/102824A5.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Data/102824A5.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for Call Divert settings plugin. +* +*/ + + +// INCLUDES +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x102824A5; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x102824A6; + version_no = 1; + display_name = "Call Barring Plugin"; + default_data = "0x1020723D";//Parent UID + #ifdef RD_CONTROL_PANEL + opaque_data = "50";//Order number + #else + opaque_data = "30";//Order number + #endif //RD_CONTROL_PANEL + } + }; + } + }; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Data/GSCallBarringPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Data/GSCallBarringPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,610 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for GSCallBarringPlugin +* +*/ + +// RESOURCE IDENTIFIER +NAME CBAR // 4 letter ID + +// INCLUDES +#include + +#include "CallBarringPlugin.hrh" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// CONSTANTS + + +// RESOURCE DEFINITIONS + +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +RESOURCE TBUF + { + buf="CBAR"; + } + +//---------------------------------------------------- +// +// EIK_APP_INFO +// It contains application information. +// +//---------------------------------------------------- +// +RESOURCE EIK_APP_INFO + { + } + + +//---------------------------------------------------- +// r_gs_call_barring_caption +// +// call barring caption for plugin +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_call_barring_caption + { + buf = qtn_set_folder_barring; + } + +//---------------------------------------------------- +// +// r_gs_barring_view +// Barring sub-menu view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_barring_view + { + menubar=r_gs_menubar_barring_view; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_CONTEXTOPTIONS; + } + +//---------------------------------------------------- +// +// r_gs_menubar_barring_view +// Barring menubar +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_gs_menubar_barring_view + { + titles = + { + MENU_TITLE + { + menu_pane = r_gs_menu_item_exit; + }, + MENU_TITLE + { + menu_pane = r_gs_menu_item_help; + }, + MENU_TITLE + { + menu_pane = r_gs_barring_view_menu; + } + }; + } + +//---------------------------------------------------- +// +// r_call_barring_msk_contextmenubar +// Barring menubar +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_call_barring_msk_contextmenubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_gs_barring_view_menu; + } + }; + } +//---------------------------------------------------- +// +// r_gs_barring_view_menu +// Barring menu items +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_barring_view_menu + { + items = + { + MENU_ITEM + { + command = EGSCmdBarringActivate; + txt = text_activate_barring; + }, + MENU_ITEM + { + command = EGSCmdBarringCancel; + txt = text_cancel_barring; + }, + MENU_ITEM + { + command = EGSCmdBarringInquiry; + txt = text_status_barring; +#ifndef __RESTRICTED_CALL_BARRING + }, + MENU_ITEM + { + command = EGSCmdBarringCancelAll; + txt = text_cancel_all_barrings; + }, + MENU_ITEM + { + command = EGSCmdBarringChangePwd; + txt = qtn_barr_list_password; +#endif // __RESTRICTED_CALL_BARRING + } + }; + } + + +//---------------------------------------------------- +// +// r_gs_barring_view_title +// Barring sub-menu title +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_barring_view_title + { + txt = qtn_set_title_restrictions; + } + +//---------------------------------------------------- +// +// r_gs_barring_view_title_voip +// Barring sub-menu title +// +//---------------------------------------------------- +RESOURCE TITLE_PANE r_gs_barring_view_title_voip + { + txt = qtn_title_cell_call_barring; + } + +//----------------------------------------------------------------------------- +// +// r_barring_lbx_resource +// Barring list box +// +//----------------------------------------------------------------------------- +// +RESOURCE LISTBOX r_barring_lbx_resource + { + array_id = r_barring_lbx; + flags = EEikListBoxMultipleSelection; + } + +//----------------------------------------------------------------------------- +// +// r_barring_lbx +// Barring list box items +// +//----------------------------------------------------------------------------- +// +RESOURCE ARRAY r_barring_lbx + { + items = + { +#ifndef __RESTRICTED_CALL_BARRING + LBUF + { + txt = " \t"text_no_outgoing"\t\t"; + }, + LBUF + { + txt = " \t"text_no_international"\t\t"; + }, + LBUF + { + txt = " \t"text_no_inter_but_home"\t\t"; + }, + LBUF + { + txt = " \t"text_no_incoming"\t\t"; + }, +#endif // __RESTRICTED_CALL_BARRING + LBUF + { + txt = " \t"text_no_incom_if_roam"\t\t"; + } + }; + } + + +//----------------------------------------------------------------------------- +// +// r_activate_barring +// Popup-menu item for Barring operations +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_activate_barring + { + buf = text_activate_barring; + } + +//----------------------------------------------------------------------------- +// +// r_cancel_barring +// Popup-menu item for Barring operations +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cancel_barring + { + buf = text_cancel_barring; + } + +//----------------------------------------------------------------------------- +// +// r_status_barring +// Popup-menu item for Barring operations +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_status_barring + { + buf = text_status_barring; + } + +//----------------------------------------------------------------------------- +// +// r_barring_password +// Prompt item for Barring dialog when barring pwd required. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_barring_password + { + buf = text_password; + } + +//----------------------------------------------------------------------------- +// +// r_current_barring_password +// Prompt item for Barring dialog when barring pwd required. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_current_barring_password + { + buf = text_old_pass; + } + +//----------------------------------------------------------------------------- +// +// r_new_barring_password +// Prompt item for Barring dialog when barring pwd required. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_new_barring_password + { + buf = text_new_pass; + } + +//----------------------------------------------------------------------------- +// +// r_verify_new_barring_password +// Prompt item for Barring dialog when barring pwd required. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_verify_new_barring_password + { + buf = text_verify_pass; + } + +//---------------------------------------------------- +// +// r_barring_password +// Dialog for querying Barring password +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_barring_password_dlg + { + flags = EEikDialogFlagVirtualInput | EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + items= + { + DLG_LINE + { + type=EAknCtQuery; + id=EGeneralQuery; + control= AVKON_DATA_QUERY + { + layout = EPinLayout; + label = text_password; + control = SECRETED {num_letters = 4;}; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_gs_barring_main_view +// Barring sub-main-menu view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_barring_main_view + { + menubar=r_gs_menubar_open_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN; + } + + +//---------------------------------------------------- +// +// r_gs_barring_main_view_title +// Barring sub-menu title +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_barring_main_view_title + { + txt = qtn_set_title_restrictions; + } + +//----------------------------------------------------------------------------- +// +// r_barring_main_lbx_resource +// Barring list box +// +//----------------------------------------------------------------------------- +// +RESOURCE LISTBOX r_barring_main_lbx_resource + { + array_id = r_barring_main_lbx; + flags = EEikListBoxMultipleSelection; + } + +//----------------------------------------------------------------------------- +// +// r_barring_main_lbx +// Barring list box items +// +//----------------------------------------------------------------------------- +// + +RESOURCE ARRAY r_barring_main_lbx + { + items = + { + GS_FEATURE + { + txt = " \t"qtn_cell_call_barring"\t\t"; + item = EGSCBCellular; + }, + GS_FEATURE + { + txt = " \t"qtn_voip_call_barring"\t\t"; + item = EGSCBInternet; + type = EGSListBoxItemTypeIsDynamic; + } + }; + } + +// BARRING sub-menu for internet call + +//---------------------------------------------------- +// +// r_gs_internet_barring_view +// Barring sub-menu view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_internet_barring_view + { + menubar=r_gs_menubar_change_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE; + } + +//---------------------------------------------------- +// +// r_gs_internet_barring_view_title +// Internet Barring sub-menu title +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_internet_barring_view_title + { + txt = qtn_title_voip_call_barring; + } + +//----------------------------------------------------------------------------- +// +// r_internet_barring_lbx_resource +// Internet Barring list box +// +//----------------------------------------------------------------------------- +// +RESOURCE LISTBOX r_internet_barring_lbx_resource + { + array_id = r_internet_barring_lbx; + flags = EEikListBoxMultipleSelection; + } + +//----------------------------------------------------------------------------- +// +// r_internet_barring_lbx +// Internet Barring list box items +// +//----------------------------------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_internet_barring_lbx + { + items = + { + GS_FEATURE + { + txt = " \t"qtn_voip_barring_anonymous"\t\t"; + item = EGSCBAnonymous; + type = EGSListBoxItemTypeIsDynamic; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_internet_barring_setting_page +// Internet barring setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_gs_internet_barring_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_set_title_restrictions_int; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +//---------------------------------------------------- +// +// r_gs_internet_barring_setting_page_lbx +// for internet barring popup +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_gs_internet_barring_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_voip_barring_active; + }, + LBUF + { + txt = qtn_voip_barring_not_active; + } + }; + } + +//---------------------------------------------------- +// +// r_internet_barring_on +// anonymous setting value to internet barring setting page +// +//---------------------------------------------------- +// +RESOURCE TBUF r_internet_barring_on + { + buf = qtn_voip_barring_active; + } + +//---------------------------------------------------- +// +// r_internet_barring_off +// anonymous setting value to internet barring setting page +// +//---------------------------------------------------- +// +RESOURCE TBUF r_internet_barring_off + { + buf = qtn_voip_barring_not_active; + } + +//---------------------------------------------------- +// +// r_qtn_voip_sccp_call_barring_note +// Note for anonymous call barring +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_voip_sccp_call_barring_note + { + buf = qtn_voip_sccp_call_barring_note; + } + +// ----------------------------------------------------------------------------- +// +// r_barr_msk_change +// Middle softkey label: change. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_barr_msk_change + { + buf = qtn_msk_change; + } + +// ----------------------------------------------------------------------------- +// +// r_barr_msk_open +// Middle softkey label: open +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_barr_msk_open + { + buf = qtn_msk_open; + } + +// ----------------------------------------------------------------------------- +// +// r_call_softkey_option +// Middle softkey label: Options. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_call_softkey_option + { + buf = text_softkey_option; + } + +//---------------------------------------------------- +// r_gs_tel_view_title +// +// Telephony view title +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_barr_view_title + { + txt = ""; + } +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/GSCallBarringPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/GSCallBarringPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSCallBarringPlugin project file. +* +*/ + +#include // For RESOURCE_FILES_DIR + +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gscallbarringplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x102824A5 +VENDORID VID_DEFAULT + +SOURCEPATH Src // /GSCallBarringPlugin +SOURCE GSCallBarringPluginImplementationTable.cpp +SOURCE GSLocalBaseView.cpp +SOURCE GSCallBarringPluginContainer.cpp +SOURCE GSCallBarringPlugin.cpp +SOURCE GSCellularCallBarringContainer.cpp +SOURCE GSCellularCallBarringView.cpp +SOURCE GSMainBarringContainer.cpp +SOURCE GSMainBarringView.cpp +SOURCE GSInternetBarringContainer.cpp +SOURCE GSInternetBarringView.cpp + +//User include paths +USERINCLUDE Inc +USERINCLUDE Data // For *.rh +USERINCLUDE loc +USERINCLUDE ../Data +USERINCLUDE ../Logger +USERINCLUDE ../GSTelPlugin/Inc + +//System include paths +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/cshelp +// Default system include paths for middleware layer modules. +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH Data + +START RESOURCE 102824A5.rss +TARGET gscallbarringplugin.rsc +END + +START RESOURCE GSCallBarringPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +LIBRARY aknskins.lib // for enhanced skinning +LIBRARY aknskinsrv.lib // for enhanced skinning +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY centralrepository.lib +LIBRARY cenrepnotifhandler.lib +LIBRARY commonengine.lib // For RConeResourceLoader +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY eikctl.lib +LIBRARY etelmm.lib // security, network, call +LIBRARY euser.lib +LIBRARY featmgr.lib // Feature manager +LIBRARY gsecomplugin.lib +LIBRARY gsframework.lib // For base classes +LIBRARY gslistbox.lib // For CGSListBoxItemTextArray +LIBRARY phonesettings.lib +LIBRARY psui.lib // phone settings notes UI +LIBRARY sssettings.lib // Supplementary settings +LIBRARY numbergrouping.lib +LIBRARY flogger.lib // For GSLogger + +LIBRARY secui.lib // for CodeQueryDialog + +LIBRARY aknnotify.lib // for CAknGlobalNote.h +LIBRARY hlplch.lib // for "Help" options menu +LIBRARY eikdlg.lib // eikon dialogs +LIBRARY apgrfx.lib + + +#if defined(__VOIP) && defined(RD_VOIP_REL_2_2) +LIBRARY serviceprovidersettings.lib +#endif // __VOIP && RD_VOIP_REL_2_2 + +SOURCEPATH Data +DOCUMENT 102824A5.rss +DOCUMENT GSCallBarringPluginRsc.rss + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Inc/CallBarringPlugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/CallBarringPlugin.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains definition of constants used in CallBarringPlugin. +* +*/ + +#ifndef GSCALLBARRINGPLUGIN_HRH +#define GSCALLBARRINGPLUGIN_HRH + +enum TGSCallBarringNotes + { + ECBActiveNote, + EPasswordErrorNote, + EPasswordChangedNote, + ECBNotActiveNote + }; + +enum TGSCBMenuCommands + { + EGSCmdBarringActivate = 6, + EGSCmdBarringCancel, + EGSCmdBarringInquiry, + EGSCmdBarringChangePwd, + EGSCmdBarringCancelAll + }; + +enum TGSMainBarringSetting + { + EGSCBCellular = 0, + EGSCBInternet + }; + +enum TGSBarringSetting + { + EGSCBOutgoing = 0, + EGSCBInternational, + EGSCBInternationalExceptHome, + EGSCBIncoming, + EGSCBAbroad + }; + +enum TGSInternetBarringSetting + { + EGSCBAnonymous + }; + +enum TGSBarringSettingActions + { + EGSCBActive = 0, + EGSCBInactive = 1, + EGSCBStatus = 2, + EGSCBCancelAll = 3, + EGSCBChangePwd = 4 + }; + +enum TGSCBPasswordType + { + EGSCBNormalPw, + EGSCBCurrentPw, + EGSCBNewPw, + EGSCBVerifyPw + }; + +// Internet call barring +enum TGSVoIPCallBarring + { + EGSCSCallBarringOn = 0, // Default + EGSCSCallBarringOff + }; + +// VoIP specific setting id's +enum TGSVoIPSetting + { + EGSVoIPSendIntCallId = 0, + EGSVoIPCW, + EGSVoIPPreType, + EGSVoIPDnd, + EGSVoIPBarring + }; + +#endif // GSCALLBARRINGPLUGIN_HRH + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCallBarringPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCallBarringPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,213 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Barrings sub-menu in General Settings. +* +*/ + + +#ifndef GSCALLBARRINGPLUGIN_H +#define GSCALLBARRINGPLUGIN_H + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GSLocalBaseView.h" +#include "CallBarringPlugin.hrh" + + +// FORWARD DECLARATIONS +class CGSBaseContainer; +class CGSCallBarringPluginContainer; +class CPsetCustomerServiceProfile; +class CAknNavigationDecorator; +class CPsetContainer; +class CPsuiContainer; +class CPsuiBarringObs; +class CAknStaticNoteDialog; +class CAknNoteDialog; + +// CONSTANTS +_LIT( KGSCallBarringPluginIconDirAndName, "z:GSCallBarringPlugin.mbm"); + + +// CLASS DECLARATION +/*************************************************** +* CGSCallBarringPlugin class * +****************************************************/ +class CGSCallBarringPlugin : public CGSBaseView, + public MGSSettingPSObserver + { + public: // Constructors and destructor + + /* C++ Constructor */ + CGSCallBarringPlugin(); + + /* Symbian OS two phase constructor - puts self into stack. + * + * @return CGSCallBarringPlugin object + */ + static CGSCallBarringPlugin* NewLC(); + + /** + * Destructor. + */ + ~CGSCallBarringPlugin(); + + /** + * Symbian OS two-phased constructor + * @return GS call barring view. + */ + static CGSCallBarringPlugin* NewL( TAny* aInitParams ); + + /** + * + */ + void HandleClientRectChange(); + + public: // Functions from base classes + + /** + * From CAknView, returns the views id. + * + * @return Returns TUid, which is the id of the view. + */ + TUid Id() const; + + /** + * From MEikCommandObserver, handles the commands given through menu. + * + * @param aCommand is the given command. + */ + void HandleCommandL( TInt aCommand ); + + public: // From CGSPluginInterface + + /** + * @see CGSPluginInterface header file. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * @see CGSPluginInterface header file. + */ + TInt PluginProviderCategory() const; + + /** + * @see CGSPluginInterface header file. + */ + TBool Visible() const; + + /** + * @see CGSPluginInterface header file. + */ + TGSListboxItemTypes ItemType(); + + void HandleSelection( + const TGSSelectionTypes aSelectionType ); + public: //new + + /** + * This is a locally owned method used to activate + * other local views seen from GSTelPlugin + * @param aFeatureId feature ID of the folder + */ + void ActivateInternalViewL(); + + /** + * This is a locally owned method used to initialize + * other local views seen from GSTelPlugin + * @param aLocalViewId view ID of local views to this plugin + */ + void CreateLocalViewL( TUid aLocalViewId ); + + /** + * Removes sub-views owned by this plugin to make sure sub-view UIDs do + * not clash. + */ + void RemoveLocalViews(); + + /** + *Is VoIP feature supported + */ + TBool VoipSupported() const; + + protected: // from CAknView + + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + void DoDeactivate(); + + private: // from base class + + /** + * Symbian OS default constructor. + * + */ + void ConstructL(); + + /** + * From CGSBaseView, handles selection of list box. + */ + void HandleListBoxSelectionL(); + + void NewContainerL(); + + private: // From MGSSettingPSObserver + /** + * Callback from MGSSettingPSObserver + */ + void HandleNotifyPSL( const TUid aUid, const TInt& aKey, + const TRequestStatus& aStatus ); + + private: //new + /** + * Retrieves container pointer. + */ + CGSCallBarringPluginContainer* Container(); + + /** + * Customer Service Profile status setting + */ + void SetCSPActiveL( TBool aValue ); + + private: // Member variables + //Navi pane + CAknNavigationDecorator* iNaviPaneContext; + //PubSub object for BT SAP state + CGSPubSubsListener* iBtSapListener; + //check if CSP is active + CPsetCustomerServiceProfile* iCSP; + // Call barring view. Not owned by this - owned by iAppUi. + CGSLocalBaseView* iBarringView; + // check if voip supported + TBool iVoipSupported; + }; + +#endif //GSCALLBARRINGPLUGIN_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCallBarringPluginContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCallBarringPluginContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for Barrings sub-menu in General Settings. +* +*/ + + +#ifndef GSCALLBARRINGPLUGINCONTAINER_H +#define GSCALLBARRINGPLUGINCONTAINER_H + +// INCLUDES +#include "gsbasecontainer.h" +#include "GSPhoneSettingConstants.h" + +// FORWARD DECLARATIOIN +class CGSListBoxItemTextArray; + +// CLASS DECLARATION + +/** +* CGSCallBarringPluginContainer container class +*/ +class CGSCallBarringPluginContainer : public CGSBaseContainer + { + public: // Constructors and destructor + + /** + * Symbian OS default constructor. + * + * @param aRect gives the correct TRect for construction. + */ + void ConstructL( const TRect& aRect ); + + /* Destructor */ + ~CGSCallBarringPluginContainer(); + + public: //from CGSBaseContainer + + /* + * Creates list box object. + * @param aResLbxId resource list id to create list box. + */ + void ConstructListBoxL( TInt aResLbxId ); + + private: //new + + /** + * Required for help. + */ + void GetHelpContext( TCoeHelpContext& aContext ) const; + + private: //member variables + //listbox array + CGSListBoxItemTextArray* iListboxItemArray; + //Is VoIP supported (feature on, dynamic voip setting on) + TBool iVoIPSupported; + }; + +#endif //GSCALLBARRINGPLUGINCONTAINER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCellularCallBarringContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCellularCallBarringContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for Barrings sub-menu in General Settings. +* +*/ + + +#ifndef GSSETTLISTBARRINGCONTAINER_H +#define GSSETTLISTBARRINGCONTAINER_H + +// INCLUDES +#include "gsbasecontainer.h" +#include "GSPhoneSettingConstants.h" + +// CLASS DECLARATION + +/** +* CGSSettListBarringContainer container class +*/ +class CGSSettListBarringContainer : public CGSBaseContainer + { + public: // Constructors and destructor + + /** + * Symbian OS default constructor. + * + * @param aRect gives the correct TRect for construction. + */ + void ConstructL( const TRect& aRect ); + + /* Destructor */ + ~CGSSettListBarringContainer(); + + public: //from CGSBaseContainer + + /* + * Creates list box object. + * @param aResLbxId resource list id to create list box. + */ + void ConstructListBoxL( TInt aResLbxId ); + + private: //new + + /* + * Creates items for the list box. + */ + void CreateListBoxItemsL(); + + /** + * Required for help. + */ + void GetHelpContext( TCoeHelpContext& aContext ) const; + + private: //member variables + //Resource texts for setting items + CDesCArrayFlat* iItems; + //Setting items + CDesCArray* iItemArray; + }; + +#endif //GSSETTLISTBARRINGCONTAINER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCellularCallBarringView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCellularCallBarringView.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,189 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Barrings sub-menu in General Settings. +* +*/ + + +#ifndef GSSETTLISTBARRINGVIEW_H +#define GSSETTLISTBARRINGVIEW_H + +// INCLUDES +#include +#include +#include +#include + +#include "GSLocalBaseView.h" +#include "CallBarringPlugin.hrh" + +// FORWARD DECLARATIONS +class CGSBaseContainer; +class CGSSettListBarringContainer; +class CAknNavigationDecorator; +class CPsetContainer; +class CPsuiContainer; +class CPsuiBarringObs; +class CAknStaticNoteDialog; +class CAknNoteDialog; + +// CLASS DECLARATION +/*************************************************** +* CGSSettListBarringView view class * +***************************************************/ +class CGSSettListBarringView : public CGSLocalBaseView + { + public: // Constructors and destructor + + /* C++ Constructor */ + CGSSettListBarringView(); + + /** + * Symbian OS two phased constructor. + */ + static CGSSettListBarringView* NewL(); + + /* Symbian OS two phase constructor - puts self into stack. + * + * @return CGSSettListBarringView object + */ + static CGSSettListBarringView* NewLC(); + + /** + * Destructor. + */ + ~CGSSettListBarringView(); + + public: // Functions from base classes + + /** + * From CAknView, returns the views id. + * + * @return Returns TUid, which is the id of the view. + */ + TUid Id() const; + + /** + * From MEikCommandObserver, handles the commands given through menu. + * + * @param aCommand is the given command. + */ + void HandleCommandL( TInt aCommand ); + /** + * From MEikCommandObserver, handles the commands. + * + * @param aCommand identifies the command given. + */ + void ProcessCommandL( TInt aCommand ); + + public: //new + + /** + * Creates the barring password query. + * + * @param aBarringPassword is user inputed password + * @param aTitleID is type of password query + * @return softkey pressed in pwd query + */ + TInt BarringPasswordQueryL( TBarringPassword& aBarringPassword, + const TInt& aTitleID ); + + protected: // from CAknView + + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + void DoDeactivate(); + + + private: + + /** + * Adds item to a list + * @param aList pointer to a list + * @param aItem resource ID of the item text + */ + void AppendItemL( CDesCArrayFlat& aList, const TInt aItem ); + + /** + * Selects barring type + * @param aCommand user action + * @param aBarringSetting barring type is set into this + * @param aType value used for mapping the current type + */ + void SetBarringType( TInt& aCommand, + TCallBarringSetting& aBarringSetting, + TGSBarringSetting aType ); + + /** + * Handles barring operation requests + * @param aBarringSetting barring settings (e.g. pwd) passed to TSY + * @param aBsc basic service groups + */ + void HandleBarringOperationL( TCallBarringSetting aBarringSetting, + TBasicServiceGroups aBsc ); + + /** + * Creates a request to cancel all barrings. + * + */ + void CancelAllBarringsL(); + + /** + * Handles changing of barring password. + * + */ + void ChangeBarringPwdL(); + + private: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + private: // from base class + + /** + * Symbian OS default constructor. + * + */ + void ConstructL(); + + /** + * From CGSBaseView, handles selection of list box. + */ + void HandleListBoxSelectionL(); + + void NewContainerL(); + + private: // Member variables + //Navi pane + CAknNavigationDecorator* iNaviPaneContext; + //Pointer to PhoneSetting's barring object + CPsetCallBarring* iBarring; + //Pointer to PhoneSetting's container + CPsetContainer* iSettings; + //Pointer to PSUI's container + CPsuiContainer* iObsContainer; + //Pointer to PSUI's barring object + CPsuiBarringObs* iCbObserver; + //Has selection key been pressed + TBool iRockerPress; + //Has context menu initialized + TBool iContextMenuInitialized; + }; + +#endif //GSSETTLISTBARRINGVIEW_H + +// End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSInternetBarringContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSInternetBarringContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for Int. Barrings sub-menu in General Settings. +* +*/ + + +#ifndef __GSSETTLISTINTERNETBARRINGCONTAINER_H__ +#define __GSSETTLISTINTERNETBARRINGCONTAINER_H__ + +// INCLUDES +#include "gsbasecontainer.h" +#include "GSPhoneSettingConstants.h" +#include "CallBarringPlugin.hrh" +#include +// CLASS DECLARATION +class CGSListBoxItemTextArray; + +/** +* CGSSettListInternetBarringContainer container class +* @since 3.0 +*/ +class CGSSettListInternetBarringContainer : public CGSBaseContainer + { + public: // Constructors and destructor + + /** + * Symbian OS default constructor. + * + * @param aRect gives the correct TRect for construction. + */ + void ConstructL( const TRect& aRect ); + + /* Destructor */ + ~CGSSettListInternetBarringContainer(); + + public: //from CGSBaseContainer + + /* + * Creates list box object. + * @param aResLbxId resource list id to create list box. + */ + void ConstructListBoxL( TInt aResLbxId ); + + void UpdateListBoxL(); + + public: // New + + /** + * Returns one of the VoIP call related values from Cent. Repository + * @param aVoipSettingId name of the Cent. Repository key to fetch + * @param aVoipId value of Cent. Repository key + * @return KErrNone if successful + */ + TInt GetVoIPCallSettingValue( + const TGSVoIPSetting aVoipSettingId, + TInt& aVoipId ); + + /** + * Sets one of the VoIP call related values from Cent. Repository + * @param aVoipSettingId name of the Cent. Repository key to set + * @param aVoipId value of Cent. Repository key + * @return KErrNone if successful + */ + TInt SetVoIPCallSettingValue( + const TGSVoIPSetting aVoipSettingId, + TInt aVoipId ); + + /** + * Gets SCCP status from Central Repository + * @param aStatus value of Cent. Repository key + * @return KErrNone if successful + */ + TInt GetSCCPStatus( TInt& aStatus ); + + private: //new + + /* + * Creates items for the list box. + */ + void CreateListBoxItemsL(); + + /** + * Required for help. + */ + void GetHelpContext(TCoeHelpContext& aContext) const; + + /* + * Creates anonymous item. + */ + void MakeAnonymousItemL(); + + /* + * Converting value + */ + void SwitchValue( TInt& aValue ); + + + private: // member variables + + //Resource texts for setting items + CDesCArrayFlat* iItems; + // Listbox item array. + CGSListBoxItemTextArray* iListboxItemArray; + //CenRep handle + CRepository* iRichCallRepository; + CRepository* iTelephonyRepository; + }; + +#endif //GSINTERNETBARRINGCONTAINER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSInternetBarringView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSInternetBarringView.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Internet Barrings sub-menu in General Settings. +* +*/ + + +#ifndef __GSSETTLISTINTERNETBARRINGVIEW_H +#define __GSSETTLISTINTERNETBARRINGVIEW_H + +// INCLUDES +#include "GSLocalBaseView.h" + +// FORWARD DECLARATIONS +class CGSSettListInternetBarringContainer; +class CAknRadioButtonSettingPage; +class CAknNoteDialog; +class CAknPopupList; +class CGSTelPluginModel; + +// CLASS DECLARATION + +/** +* CGSSettListInternetBarringView view class +* @since 3.0 +*/ + +class CGSSettListInternetBarringView : public CGSLocalBaseView + { + public: // Constructors and destructor + + /* C++ Constructor */ + CGSSettListInternetBarringView(); + + /** + * Symbian OS two phased constructor. + */ + static CGSSettListInternetBarringView* NewL(); + + /* Symbian OS two phase constructor - puts self into stack. + * + * @return CGSSettListInternetBarringView object + */ + static CGSSettListInternetBarringView* NewLC(); + + /** + * Destructor. + */ + ~CGSSettListInternetBarringView(); + + public: // Functions from base classes + + /** + * From CAknView, returns the views id. + * + * @return Returns TUid, which is the id of the view. + */ + TUid Id() const; + + /** + * From MEikCommandObserver, handles the commands given through menu. + * + * @param aCommand is the given command. + */ + void HandleCommandL( TInt aCommand ); + + private: + /** + * Symbian OS default constructor. + * + */ + void ConstructL(); + + /** + * From CGSBaseView, handles selection of list box. + */ + void HandleListBoxSelectionL(); + + /** + * Show Internet barring setting page. + */ + void ShowSettingPageL(); + + /** + * Adds item to a list + * @param aList reference to a list + * @param aItem resource ID of the item to be added + */ + void AppendItemL( CDesCArrayFlat& aList, TInt aItem ); + + private: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + private: // from CGSBaseView + + void NewContainerL(); + + + private: // from CAknView + + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + void DoDeactivate(); + + private: // Member variables + + //GSTelPluginModel for settings from Central Repository + CGSTelPluginModel* iModel; + }; + +#endif // GSINTERNETBARRINGVIEW_H + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSLocalBaseView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSLocalBaseView.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base vew in GSCallBarringPlugin. +* +*/ + + +#ifndef GSLOCALBASEVIEW_H +#define GSLOCALBASEVIEW_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class CGSBaseContainer; +class CAknNavigationDecorator; +class CAknViewAppUi; + +// CLASS DECLARATION +/*************************************************** +* CGSLocalBaseView view class * +***************************************************/ +class CGSLocalBaseView : public CAknView, + public MEikListBoxObserver + { + public: + // Panic code used in this class + enum KGSViewPanicCodes + { + EGSViewPanicNullPtr = 1 + }; + + public: // Constructors and destructor + + /** + * Symbian OS default constructor. + * + */ + virtual void ConstructL()=0; + + /* C++ Constructor */ + CGSLocalBaseView(); + + /** + * Destructor. + */ + ~CGSLocalBaseView(); + + public: + + /** + * This function is used to set the current item in the listbox. + * @param aIndex Current item. Default value is 0 i.e. the first item of the list. + * + */ + virtual void SetCurrentItem( TInt aIndex = 0 ); + + protected: // from CAknView + + /** + * Handles client rect change. + * + */ + void HandleClientRectChange(); + + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + void DoDeactivate(); + + protected: // from MEikListBoxObserver + + /** + * Handles listbox events. + * @param aListBox Listbox where the event occurred. + * @param aEventType Event type. + * + */ + void HandleListBoxEventL( CEikListBox* aListBox, + TListBoxEvent aEventType ); + + protected: //new + + /** + * Sets the correct navi pane for the view (eg. tabs, empty, string etc.) + * + */ + virtual void SetNaviPaneL(); + + /** + * Creates context for view's navi pane. + * @param aResourceId Resource id for navi pane context's resource. + * + */ + virtual void CreateNaviPaneContextL( TInt aResourceId ); + + protected: + // Called by DoActivateL + virtual void NewContainerL() = 0; + virtual void CreateContainerL(); + + private: + + /** + * Handles selection of list box. + * Called by HandleListBoxEventL + */ + virtual void HandleListBoxSelectionL() = 0; + + protected: // Member variables + //Navi pane + CAknNavigationDecorator* iNaviPaneContext; + //Handle to get the view + CAknViewAppUi* iAppUi; + // currently selected listbox item + TInt iCurrentItem; + // first item in the listbox + TInt iTopItemIndex; + // pointer to the container + CGSBaseContainer* iContainer; + }; +//end of file +#endif //GSLOCALBASEVIEW_H diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSMainBarringContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSMainBarringContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for Main Barrings sub-menu in General Settings. +* +*/ + + +#ifndef GSSETTLISTMAINBARRINGCONTAINER_H +#define GSSETTLISTMAINBARRINGCONTAINER_H + +// INCLUDES +#include "gsbasecontainer.h" +#include "GSPhoneSettingConstants.h" + +// CLASS DECLARATION +class CGSListBoxItemTextArray; + +/** +* CGSSettListMainBarringContainer container class +* @since 3.0 +*/ +class CGSSettListMainBarringContainer : public CGSBaseContainer + { + public: // Constructors and destructor + + /** + * Symbian OS default constructor. + * + * @param aRect gives the correct TRect for construction. + */ + void ConstructL( const TRect& aRect ); + + /* Destructor */ + ~CGSSettListMainBarringContainer(); + + public: //from CGSBaseContainer + + /* + * Creates list box object. + * @param aResLbxId resource list id to create list box. + */ + void ConstructListBoxL( TInt aResLbxId ); + /** + * Retrieves the feature id for the selected item in the listbox + * @return listbox item array's current feature. + */ + TInt CurrentFeatureId() const; + + private: //new + + /* + * Creates items for the list box. + */ + void CreateListBoxItemsL(); + + /** + * Required for help. + */ + void GetHelpContext(TCoeHelpContext& aContext) const; + + private: //member variables + + //Resource texts for setting items + CDesCArrayFlat* iItems; + + //Setting items + CDesCArray* iItemArray; + CGSListBoxItemTextArray* iListboxItemArray; + + //BtSapConnectionState + TInt iBtSapConnectionState; + }; + +#endif //GSSETTLISTMAINBARRINGCONTAINER_H + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSMainBarringView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSMainBarringView.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Main Barrings sub-menu in General Settings. +* +*/ + + +#ifndef GSSETTLISTMAINBARRINGVIEW_H +#define GSSETTLISTMAINBARRINGVIEW_H + +// INCLUDES +#include "GSLocalBaseView.h" +#include + +// FORWARD DECLARATIONS +class CGSSettListMainBarringContainer; +class CAknView; + +// CLASS DECLARATION + +/** +* CGSSettListMainBarringView view class +* @since 3.0 +*/ +class CGSSettListMainBarringView : public CGSLocalBaseView + { + public: // Constructors and destructor + + /* C++ Constructor */ + CGSSettListMainBarringView(); + + /* Symbian OS two phase constructor - puts self into stack. + * + * @return CGSSettListMainBarringView object + */ + static CGSSettListMainBarringView* NewLC(); + + /** + * Destructor. + */ + ~CGSSettListMainBarringView(); + + public: // Functions from base classes + + /** + * From CAknView, returns the views id. + * + * @return Returns TUid, which is the id of the view. + */ + TUid Id() const; + + /** + * From MEikCommandObserver, handles the commands given through menu. + * + * @param aCommand is the given command. + */ + void HandleCommandL( TInt aCommand ); + + /** + * From MEikCommandObserver, handles the commands. + * + * @param aCommand identifies the command given. + */ + + void ProcessCommandL( TInt aCommand ); + + private: + + /** + * Symbian OS default constructor. + * + */ + void ConstructL(); + + /** + * From CGSLocalBaseView, handles selection of list box. + */ + void HandleListBoxSelectionL(); + + /** + * Retrieves container pointer. + */ + CGSSettListMainBarringContainer* Container(); + + + private: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + private: // from CGSLocalBaseView + + void NewContainerL(); + + private: // from CAknView + + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + void DoDeactivate(); + + private: // Member variables + + // Call barring view. Not owned by this - owned by iAppUi. + CAknView* iBarringView; + + // Internet call barring view. Not owned by this - owned by iAppUi. + CAknView* iInternetBarringView; + + }; + +#endif //GSSETTLISTMAINBARRINGVIEW_H + +//End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Inc/LocalViewIds.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Inc/LocalViewIds.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View ID's for Call Barring views. +* +*/ + + +#ifndef CBLOCALVIEWID_H +#define CBLOCALVIEWID_H + +const TUid KCallBarringPluginId = {0x102824A5}; +const TUid KCallBarringViewId = {83}; +const TUid KCallMainBarringViewId = {86}; +const TUid KCallInternetBarringViewId = {87}; + +#endif //CBLOCALVIEWID_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,543 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View for the Barring folder +* +*/ + + +// INCLUDE FILES +#include "GSCallBarringPlugin.h" +#include "GSCallBarringPluginContainer.h" +#include "GSPhoneSettingConstants.h" +#include "GSInternetBarringView.h" +#include "GSCellularCallBarringView.h" +#include "GSMainBarringView.h" +#include "CallBarringPlugin.hrh" +#include "LocalViewIds.h" +#include "GsLogger.h" + +#include +#include // For HlpLauncher +#include +#include +#include //for extended error codes +#include //for StringLoader +#include //for CPsetContainer +#include //for CPsuiContainer +#include //for menu bar +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(__VOIP) && defined(RD_VOIP_REL_2_2) +#include +#endif // __VOIP && RD_VOIP_REL_2_2 +// LOCAL CONSTANTS +_LIT( KGSCallBarringPluginResourceFileName, "z:GSCallBarringPluginRsc.rsc" ); +_LIT( KGSNameOfClass, "CGSCallBarringPlugin" ); + +enum + { + EGSCallBarringPluginPanicNullPtr + }; + + +// ========================= MEMBER FUNCTIONS ================================ +// --------------------------------------------------------------------------- +// +// C++ constructor. +// +// --------------------------------------------------------------------------- +CGSCallBarringPlugin::CGSCallBarringPlugin() + { + } + +// --------------------------------------------------------------------------- +// +// Symbian OS two-phased constructor (second phase) +// +// --------------------------------------------------------------------------- +void CGSCallBarringPlugin::ConstructL() + { + __GSLOGSTRING("[GS]--> CGSCallBarringPlugin::ConstructL"); + FeatureManager::InitializeLibL(); + OpenLocalizedResourceFileL( KGSCallBarringPluginResourceFileName, + iResourceLoader ); + //PS listener initialization + iBtSapListener = CGSPubSubsListener::NewL( + KPSUidBluetoothSapConnectionState, + KBTSapConnectionState, this ); + SetCSPActiveL( ETrue ); + iBarringView = NULL; +#if defined(__VOIP) && defined(RD_VOIP_REL_2_2) + iVoipSupported = EFalse; + CSPSettings* spSettings = CSPSettings::NewL(); + if ( spSettings->IsFeatureSupported( ESupportVoIPFeature ) && + spSettings->IsFeatureSupported( ESupportVoIPSSFeature ) ) + { + iVoipSupported = ETrue; + } + delete spSettings; +#else // __VOIP && RD_VOIP_REL_2_2 + if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) ) + { + TInt supported( KGSSettingOff ); + CRepository* telephonyrep = + CRepository::NewL( KCRUidTelephonySettings ); + telephonyrep->Get( KDynamicVoIP, supported ); + iVoipSupported = KGSSettingOff != supported; + delete telephonyrep; + } +#endif // __VOIP && RD_VOIP_REL_2_2 + BaseConstructL( R_GS_BARRING_MAIN_VIEW ); + // VoIP feature supported + __GSLOGSTRING("[GS] <--CGSCallBarringPlugin::ConstructL"); + } + + +// --------------------------------------------------------------------------- +// CGSCallBarringPlugin::NewL() +// +// Symbian OS default constructor +// --------------------------------------------------------------------------- +CGSCallBarringPlugin* CGSCallBarringPlugin::NewL( TAny* /*aInitParams*/ ) + { + CGSCallBarringPlugin* self = new( ELeave ) CGSCallBarringPlugin(); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// --------------------------------------------------------------------------- +// +// Symbian OS two-phased constructor (first phase) +// +// --------------------------------------------------------------------------- +CGSCallBarringPlugin* CGSCallBarringPlugin::NewLC() + { + __GSLOGSTRING("[GS]--> CGSCallBarringPlugin::NewLC"); + CGSCallBarringPlugin* self = new ( ELeave ) CGSCallBarringPlugin; + CleanupStack::PushL( self ); + self->ConstructL(); + + __GSLOGSTRING("[GS] <--CGSCallBarringPlugin::NewLC"); + return self; + } + +// --------------------------------------------------------------------------- +// +// C++ destructor +// +// --------------------------------------------------------------------------- +CGSCallBarringPlugin::~CGSCallBarringPlugin() + { + FeatureManager::UnInitializeLib(); + TRAP_IGNORE( SetCSPActiveL( EFalse ) ); + if ( iBtSapListener ) + { + delete iBtSapListener; + } + } + +// --------------------------------------------------------------------------- +// +// Returns Id of the Barring view. +// +// --------------------------------------------------------------------------- +TUid CGSCallBarringPlugin::Id() const + { + return KCallBarringPluginId; + } + +// --------------------------------------------------------------------------- +// +// Handles other than list box events. +// +// --------------------------------------------------------------------------- +void CGSCallBarringPlugin::HandleCommandL( TInt aCommand ) + { + __GSLOGSTRING("[GS]--> CGSCallBarringPlugin::HandleCommandL"); + switch ( aCommand ) + { + case EAknSoftkeyBack: + RemoveLocalViews(); + iAppUi->ActivateLocalViewL( KGSMainViewUid ); + break; + case EAknCmdHelp: + { + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), iAppUi->AppHelpContextL() ); + } + break; + } + default: + iAppUi->HandleCommandL( aCommand ); + break; + } + __GSLOGSTRING("[GS] <--CGSCallBarringPlugin::HandleCommandL"); + } + +// --------------------------------------------------------------------------- +// +// Activates view. +// +// --------------------------------------------------------------------------- +void CGSCallBarringPlugin::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + __GSLOGSTRING("[GS]--> CGSCallBarringPlugin::DoActivateL"); + CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + ActivateInternalViewL(); + __GSLOGSTRING("[GS] <--CGSCallBarringPlugin::DoActivateL"); + } + +// --------------------------------------------------------------------------- +// +// Deactivates view. +// +// --------------------------------------------------------------------------- +void CGSCallBarringPlugin::DoDeactivate() + { + __GSLOGSTRING("[GS]--> CGSCallBarringPlugin::DoDeactivate"); + CGSBaseView::DoDeactivate(); + __GSLOGSTRING("[GS] <--CGSCallBarringPlugin::DoDeactivate"); + } + + +// --------------------------------------------------------------------------- +// +// Creates new iContainer. +// +// --------------------------------------------------------------------------- +void CGSCallBarringPlugin::NewContainerL() + { + iContainer = new (ELeave) CGSCallBarringPluginContainer(); + } + +// --------------------------------------------------------------------------- +// CGSCallBarringPlugin::Container +// +// Returns call container item +// --------------------------------------------------------------------------- +// +CGSCallBarringPluginContainer* CGSCallBarringPlugin::Container() + { + return static_cast ( iContainer ); + } + +// ========================= from CGSPluginInterface ================== + +// ---------------------------------------------------------------------------- +// CGSCallBarringPlugin::GetCaption +// +// Return application/view caption. +// ---------------------------------------------------------------------------- +// +void CGSCallBarringPlugin::GetCaptionL( TDes& aCaption ) const + { + // the resource file is already opened. + HBufC* result = StringLoader::LoadL( R_GS_CALL_BARRING_CAPTION ); + + aCaption.Copy( *result ); + delete result; + } + + +// ---------------------------------------------------------------------------- +// CGSCallBarringPlugin::PluginProviderCategory +// +// A means to identify the location of this plug-in in the framework. +// ---------------------------------------------------------------------------- +// +TInt CGSCallBarringPlugin::PluginProviderCategory() const + { + //To identify internal plug-ins. + return KGSPluginProviderInternal; + } + + +// ---------------------------------------------------------------------------- +// CGSCallBarringPlugin::Visible +// +// Provides the visibility status of self to framework. +// ---------------------------------------------------------------------------- +// +TBool CGSCallBarringPlugin::Visible() const + { + TBool result( ETrue ); + TInt value = 0; + RProperty::Get( KPSUidBluetoothSapConnectionState, + KBTSapConnectionState, value ); + if ( value == EBTSapNotConnected || value == EBTSapConnecting ) + { + //Now checking also for CSP support + __ASSERT_ALWAYS( iCSP != NULL, User::Panic( KGSNameOfClass, + EGSCallBarringPluginPanicNullPtr ) ); + TInt err = KErrNone; + err = iCSP->IsCBSupported( result ); + //CSP modifies result value even if something goes wrong + //CSP will return KErrNotSupported (-5) in cases when + //it is not possible to read CSP values from SIM card + //Call Barring should be still displayed in this case + if ( err != KErrNone ) + { + result = ETrue; + } + } + else + { + result = EFalse; + } + return result; + } + +// ----------------------------------------------------------------------------- +// CGSCallBarringPlugin::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CGSCallBarringPlugin::CreateIconL( const TUid aIconType ) + { + //EMbm + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSCallBarringPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropSetBarrSub, + fp->FullName(), + EMbmGscallbarringpluginQgn_prop_set_barr_sub, + EMbmGscallbarringpluginQgn_prop_set_barr_sub_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + CleanupStack::PopAndDestroy( fp ); + + return icon; + } + + +// --------------------------------------------------------------------------- +// CGSCallBarringPlugin::HandleNotifyPSL +// +// Handling PS keys change +// --------------------------------------------------------------------------- +// +void CGSCallBarringPlugin::HandleNotifyPSL( const TUid aUid, const TInt& aKey, + const TRequestStatus& /* aStatus */ ) + { + if ( aUid == KPSUidBluetoothSapConnectionState && + aKey == KBTSapConnectionState ) + { + Visible(); + } + } + +// ---------------------------------------------------------------------------- +// CGSCallBarringPlugin::SetCSPActiveL +// +// Set Customer Service Profile active +// ---------------------------------------------------------------------------- +// +void CGSCallBarringPlugin::SetCSPActiveL( TBool aValue ) + { + if ( aValue ) + { + iCSP = CPsetCustomerServiceProfile::NewL(); + User::LeaveIfError( iCSP->OpenCSProfileL() ); + } + else + { + delete iCSP; + iCSP = NULL; + } + } + +// --------------------------------------------------------------------------- +// CGSCallBarringPlugin::HandleClientRectChange +// +// Handle changes to rect(). +// --------------------------------------------------------------------------- +// +void CGSCallBarringPlugin::HandleClientRectChange() + { + if ( iContainer ) + { + iContainer->SetRect( ClientRect() ); + } + } + +// --------------------------------------------------------------------------- +// CGSCallBarringPlugin::ActivateInternalViewL +// +// Activate local views within this plug-in. +// --------------------------------------------------------------------------- +void CGSCallBarringPlugin::ActivateInternalViewL() + { + TInt btSapState = 0; + RProperty::Get( KPSUidBluetoothSapConnectionState, + KBTSapConnectionState, + btSapState ); + + if ( iVoipSupported ) + { + CreateLocalViewL( KCallMainBarringViewId ); + } + else + { + if ( btSapState == EBTSapNotConnected ) + { + CreateLocalViewL( KCallBarringViewId ); + } + } + + } + +// --------------------------------------------------------------------------- +// CGSCallBarringPlugin::CreateLocalViewL +// +// Initializes local views within this plug-in based on the view ID. +// --------------------------------------------------------------------------- +void CGSCallBarringPlugin::CreateLocalViewL( TUid aLocalViewId ) + { + CGSLocalBaseView* view; + + // Check if the view exists. If view does not exist: + // 1. Create the view + // 2. Add view to cleanupstack (NewLC) + // 3. Add view to iAppUi -> iAppUi takes the view ownership. + // 4. Remove view from cleanupstack + // 5. Assign pointer of created view to member variable + // + if ( aLocalViewId == KCallBarringViewId ) + { + //Check if BarringView already exists + if ( !iBarringView ) + { + view = CGSSettListBarringView::NewLC(); + iAppUi->AddViewL( view ); + CleanupStack::Pop( view ); + iBarringView = view; + } + iAppUi->ActivateLocalViewL( aLocalViewId ); + } + else if ( aLocalViewId == KCallMainBarringViewId ) + { + TUid viewId = aLocalViewId; + if ( !iBarringView ) + { + if ( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallBarring ) ) + { + // create the barring view directly if it's in restricted + // call barring + view = CGSSettListBarringView::NewLC(); + viewId = view->Id(); + } + else + { + view = CGSSettListMainBarringView::NewLC(); + } + iAppUi->AddViewL( view ); + CleanupStack::Pop( view ); + iBarringView = view; + } + // Activate the correct view in case restricted call barring is + // active + iAppUi->ActivateLocalViewL( viewId ); + } + + } + + +// --------------------------------------------------------------------------- +// CGSCallBarringPlugin::RemoveLocalViews +// +// +// --------------------------------------------------------------------------- +// +void CGSCallBarringPlugin::RemoveLocalViews() + { + // Remove view from iAppUi -> View is deleted by iAppUi automatically. + if ( iBarringView ) + { + if ( iVoipSupported ) + { + iAppUi->RemoveView( KCallMainBarringViewId );// Also deletes view. + } + else + { + iAppUi->RemoveView( KCallBarringViewId );// Also deletes view. + } + iBarringView = NULL; + } + } + +// --------------------------------------------------------------------------- +// CGSCallBarringPlugin::HandleListBoxSelectionL +// +// Handle any user actions while in the list view. +// --------------------------------------------------------------------------- +void CGSCallBarringPlugin::HandleListBoxSelectionL() + { + } + +// --------------------------------------------------------------------------- +// CGSCallBarringPlugin::VoIPSupported +// +// Is VoIP feature supported. +// --------------------------------------------------------------------------- + +TBool CGSCallBarringPlugin::VoipSupported() const + { + return iVoipSupported; + } + +TGSListboxItemTypes CGSCallBarringPlugin::ItemType() + { + __GSLOGSTRING1( "[CGSCallBarringPlugin::ItemType] type %d", EGSItemTypeSettingDialog ); + return EGSItemTypeSettingDialog; + } + +void CGSCallBarringPlugin::HandleSelection( + const TGSSelectionTypes /*aSelectionType*/ ) + { + __GSLOGSTRING( "[CGSCallBarringPlugin::HandleSelection] Start" ); + ActivateInternalViewL(); + __GSLOGSTRING( "[CGSCallBarringPlugin::HandleSelection] End" ); + } + // End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPluginContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPluginContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for the Barring folder +* +*/ + + +// INCLUDE FILES +#include "GSCallBarringPluginContainer.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#if defined(__VOIP) && defined(RD_VOIP_REL_2_2) +#include +#endif // __VOIP && RD_VOIP_REL_2_2 +// ========================= MEMBER FUNCTIONS ================================ +// --------------------------------------------------------------------------- +// +// Symbian OS two phased constructor +// +// --------------------------------------------------------------------------- +void CGSCallBarringPluginContainer::ConstructL( const TRect& aRect ) + { + iListBox = new ( ELeave ) CAknSingleLargeStyleListBox; + BaseConstructL( aRect, R_GS_BARR_VIEW_TITLE, R_INTERNET_BARRING_LBX ); + +#if defined(__VOIP) && defined(RD_VOIP_REL_2_2) + iVoIPSupported = EFalse; + CSPSettings* spSettings = CSPSettings::NewL(); + if ( spSettings->IsFeatureSupported( ESupportVoIPFeature ) && + spSettings->IsFeatureSupported( ESupportVoIPSSFeature ) ) + { + iVoIPSupported = ETrue; + } +#else // __VOIP && RD_VOIP_REL_2_2 + if ( FeatureManager::FeatureSupported ( KFeatureIdCommonVoip ) ) + { + TInt supported( KGSSettingOff ); + CRepository* telephonyrep = + CRepository::NewL( KCRUidTelephonySettings ); + telephonyrep->Get( KDynamicVoIP, supported ); + iVoIPSupported = KGSSettingOff != supported; + delete telephonyrep; + } +#endif // __VOIP && RD_VOIP_REL_2_2 + } + +// --------------------------------------------------------------------------- +// +// Destructor +// +// --------------------------------------------------------------------------- +CGSCallBarringPluginContainer::~CGSCallBarringPluginContainer() + { + if ( iListboxItemArray ) + { + delete iListboxItemArray; + } + } +// --------------------------------------------------------------------------- +// +// Creates list box +// +// --------------------------------------------------------------------------- +void CGSCallBarringPluginContainer::ConstructListBoxL( TInt aResLbxId ) + { + iListBox->ConstructL( this ); + iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, + *iListBox, *iCoeEnv ); + iListBox->Model()->SetItemTextArray( iListboxItemArray ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + } + +// --------------------------------------------------------------------------- +// CGSCallBarringPluginContainer::GetHelpContext +// Gets Help Context +// +// --------------------------------------------------------------------------- +// +void CGSCallBarringPluginContainer::GetHelpContext( + TCoeHelpContext& aContext ) const + { + if ( iVoIPSupported ) + { + aContext.iMajor = KUidGS; + aContext.iContext = KDIV_HLP_BARRING_MAIN; + } + else + { + aContext.iMajor = KUidGS; + aContext.iContext = KSET_HLP_BARRING_SETTINGS; + } + } +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for this plugin +* +*/ + + +// System includes +#include +#include + +// User includes +#include "GSCallBarringPlugin.h" + +// Constants +const TImplementationProxy KGSCallBarringPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x102824A6, CGSCallBarringPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// +// Gate/factory function +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSCallBarringPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSCallBarringPluginImplementationTable; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCellularCallBarringContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCellularCallBarringContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for the Barring folder +* +*/ + + +// INCLUDE FILES +#include "GSCellularCallBarringContainer.h" + +#include +#include +#include +#include +#include +#include "LocalViewIds.h" +#include "GSCallBarringPlugin.h" + +// ========================= MEMBER FUNCTIONS ================================ +// --------------------------------------------------------------------------- +// +// Symbian OS two phased constructor +// +// --------------------------------------------------------------------------- +void CGSSettListBarringContainer::ConstructL( const TRect& aRect ) + { + iListBox = new ( ELeave ) CAknSettingStyleListBox; + + TInt resTitleId = R_GS_BARRING_VIEW_TITLE; + + CGSCallBarringPlugin* plugin = static_cast + ( ( static_cast( iCoeEnv->AppUi() ) ) + ->View( KCallBarringPluginId ) ); + + if ( plugin && plugin->VoipSupported() ) + { + resTitleId = R_GS_BARRING_VIEW_TITLE_VOIP; + } + + BaseConstructL( aRect, + resTitleId, + R_BARRING_LBX_RESOURCE ); + } + +// --------------------------------------------------------------------------- +// +// Destructor +// +// --------------------------------------------------------------------------- +CGSSettListBarringContainer::~CGSSettListBarringContainer() + { + if ( iItems ) + { + delete iItems; + } + } + +// --------------------------------------------------------------------------- +// +// Creates list box +// +// --------------------------------------------------------------------------- +void CGSSettListBarringContainer::ConstructListBoxL( TInt /*aResLbxId*/ ) + { + iListBox->ConstructL( this, EAknListBoxSelectionList); + iItemArray = static_cast + ( iListBox->Model()->ItemTextArray() ); + iItems = iCoeEnv->ReadDesC16ArrayResourceL( R_BARRING_LBX ); + + CreateListBoxItemsL(); + } + +// --------------------------------------------------------------------------- +// +// Creates List box items +// +// --------------------------------------------------------------------------- +void CGSSettListBarringContainer::CreateListBoxItemsL() + { + TInt placeInArray = 0; + TSettingItem readItem; + for ( TInt i = 0; i < iItems->Count(); i++ ) + { + readItem = ( *iItems ) [ i ]; + iItemArray->InsertL( placeInArray++, readItem ); + } + iListBox->HandleItemAdditionL(); + } + +// --------------------------------------------------------------------------- +// CGSSettListBarringContainer::GetHelpContext +// Gets Help Context +// +// --------------------------------------------------------------------------- +// +void CGSSettListBarringContainer::GetHelpContext( + TCoeHelpContext& aContext ) const + { + aContext.iMajor = KUidGS; + aContext.iContext = KSET_HLP_BARRING_SETTINGS; + } + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCellularCallBarringView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCellularCallBarringView.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,575 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View for the Barring folder +* +*/ + + +// INCLUDE FILES +#include "GSCellularCallBarringView.h" //for CGSSettListBarringView +#include "GSCellularCallBarringContainer.h"//for CGSBaseContainer +#include "GSPhoneSettingConstants.h" //for constant values +#include "GSCallBarringPlugin.h" //for plugin UID +#include "GsLogger.h" +#include "LocalViewIds.h" //for KTellBarringViewId + +#include +#include +#include // For HlpLauncher +#include +#include +#include //for resource IDs +#include //for extended error codes +#include //for StringLoader +#include //for CPsetContainer +#include //for CPsuiContainer +#include //for menu bar +#include +#include +#include +#include +#if defined(__VOIP) && defined(RD_VOIP_REL_2_2) +#include +#endif // __VOIP && RD_VOIP_REL_2_2 + +// ========================= MEMBER FUNCTIONS ================================ +// --------------------------------------------------------------------------- +// +// C++ constructor. +// +// --------------------------------------------------------------------------- +CGSSettListBarringView::CGSSettListBarringView() + { + } + +// --------------------------------------------------------------------------- +// +// Symbian OS two-phased constructor (second phase) +// +// --------------------------------------------------------------------------- +void CGSSettListBarringView::ConstructL() + { + __GSLOGSTRING("[GS]--> CGSSettListBarringView::ConstructL"); + BaseConstructL( R_GS_BARRING_VIEW ); + + iSettings = CPsetContainer::NewL(); + iObsContainer = CPsuiContainer::NewL(); + iCbObserver = iObsContainer->CreateCBObsL(); + iBarring = iSettings->CreateCBObjectL( *iCbObserver ); + iRockerPress = EFalse; + iContextMenuInitialized = EFalse; + __GSLOGSTRING("[GS] <--CGSSettListBarringView::ConstructL"); + } + + +// --------------------------------------------------------------------------- +// CGSSettListBarringView::NewL() +// Symbian OS two-phased constructor +// +// --------------------------------------------------------------------------- +CGSSettListBarringView* CGSSettListBarringView::NewL() + { + CGSSettListBarringView* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// +// Symbian OS two-phased constructor (first phase) +// +// --------------------------------------------------------------------------- +CGSSettListBarringView* CGSSettListBarringView::NewLC() + { + __GSLOGSTRING("[GS]--> CGSSettListBarringView::NewLC"); + CGSSettListBarringView* self = new ( ELeave ) CGSSettListBarringView; + CleanupStack::PushL( self ); + self->ConstructL(); + + __GSLOGSTRING("[GS] <--CGSSettListBarringView::NewLC"); + return self; + } + +// --------------------------------------------------------------------------- +// +// C++ destructor +// +// --------------------------------------------------------------------------- +CGSSettListBarringView::~CGSSettListBarringView() + { + delete iBarring; + delete iSettings; + delete iObsContainer; + delete iCbObserver; + iRockerPress = EFalse; + + } + +// --------------------------------------------------------------------------- +// +// Returns Id of the Barring view. +// +// --------------------------------------------------------------------------- +TUid CGSSettListBarringView::Id() const + { + return KCallBarringViewId; + } + +// --------------------------------------------------------------------------- +// +// Handles other than list box events. +// +// --------------------------------------------------------------------------- +void CGSSettListBarringView::HandleCommandL( TInt aCommand ) + { + __GSLOGSTRING("[GS]--> CGSSettListBarringView::HandleCommandL"); + iRockerPress = EFalse; + + TCallBarringSetting barringSetting; + iCurrentItem = iContainer->iListBox->CurrentItemIndex(); + SetBarringType( + aCommand, + barringSetting, + static_cast (iCurrentItem) ); +#if defined(__VOIP) && defined(RD_VOIP_REL_2_2) + CSPSettings* spSettings = CSPSettings::NewL(); + TBool showVoipFeatures( EFalse ); + if ( spSettings->IsFeatureSupported( ESupportVoIPFeature ) && + spSettings->IsFeatureSupported( ESupportVoIPSSFeature ) ) + { + showVoipFeatures = ETrue; + } +#endif // __VOIP && RD_VOIP_REL_2_2 + + switch ( aCommand ) + { + case EGSCmdAppChange: + iRockerPress = EFalse; + HandleListBoxEventL( iContainer->iListBox, EEventEnterKeyPressed ); + break; + case EAknSoftkeyBack: +#if defined(__VOIP) && defined(RD_VOIP_REL_2_2) + if ( showVoipFeatures ) + { + iAppUi->ActivateLocalViewL( KCallMainBarringViewId ); + } + else + { + iAppUi->ActivateLocalViewL( KGSTelPluginUid ); + } +#else // __VOIP && RD_VOIP_REL_2_2 + if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) ) + { + iAppUi->ActivateLocalViewL( KCallMainBarringViewId ); + } + else + { + iAppUi->ActivateLocalViewL( KGSTelPluginUid ); + } +#endif // __VOIP && RD_VOIP_REL_2_2 + break; + case EGSCmdBarringActivate: + barringSetting.iSetting = EActivateBarring; + HandleBarringOperationL( barringSetting, EAllTeleAndBearer ); + break; + case EGSCmdBarringCancel: + barringSetting.iSetting = ECancelBarring; + HandleBarringOperationL( barringSetting, EAllTeleAndBearer ); + break; + case EGSCmdBarringInquiry: + iBarring->GetBarringStatusL( EServiceGroupVoice, + barringSetting.iType ); + break; + case EGSCmdBarringChangePwd: + ChangeBarringPwdL(); + break; + case EGSCmdBarringCancelAll: + CancelAllBarringsL(); + break; + case EAknCmdHelp: + { + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), iAppUi->AppHelpContextL() ); + } + break; + } + default: + iAppUi->HandleCommandL( aCommand ); + break; + } + __GSLOGSTRING("[GS] <--CGSSettListBarringView::HandleCommandL"); + } + +// --------------------------------------------------------------------------- +// +// Activates view. +// +// --------------------------------------------------------------------------- +void CGSSettListBarringView::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + __GSLOGSTRING("[GS]--> CGSSettListBarringView::DoActivateL"); + CGSLocalBaseView::DoActivateL( aPrevViewId, aCustomMessageId, + aCustomMessage ); + + iContainer->iListBox->SetTopItemIndex(iTopItemIndex); + + if (iCurrentItem >= 0 && + iCurrentItem < iContainer->iListBox->Model()->NumberOfItems()) + { + iContainer->iListBox->SetCurrentItemIndexAndDraw(iCurrentItem); + } + __GSLOGSTRING("[GS] <--CGSSettListBarringView::DoActivateL"); + } + +// --------------------------------------------------------------------------- +// +// Deactivates view. +// +// --------------------------------------------------------------------------- +void CGSSettListBarringView::DoDeactivate() + { + __GSLOGSTRING("[GS]--> CGSSettListBarringView::DoDeactivate"); + if ( iContainer ) + { + iCurrentItem = iContainer->iListBox->CurrentItemIndex(); + iTopItemIndex = iContainer->iListBox->TopItemIndex(); + + iAppUi->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + iContainer = NULL; + } + __GSLOGSTRING("[GS] <--CGSSettListBarringView::DoDeactivate"); + } + + + // ----------------------------------------------------------------------------- +// CGSSettListBarringView::ProcessCommandL +// ----------------------------------------------------------------------------- +void CGSSettListBarringView::ProcessCommandL( TInt aCommand ) + { + // Context menu is needed to be initialized only if selection key + // is pressed. Initialization need to be performed only once. + if( aCommand == EAknSoftkeyContextOptions && + !iContextMenuInitialized ) + { + MenuBar()->SetContextMenuTitleResourceId( + R_CALL_BARRING_MSK_CONTEXTMENUBAR ); + iContextMenuInitialized = ETrue; + } + + // Call base class + CAknView::ProcessCommandL( aCommand ); + } +// --------------------------------------------------------------------------- +// +// Before showing a options menu, delete options key specific settings if +// rocker key has been pressed. +// --------------------------------------------------------------------------- +// +void CGSSettListBarringView::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + __GSLOGSTRING("[GS]--> CGSSettListBarringView::DynInitMenuPaneL"); + CEikMenuBar* menuBar = MenuBar(); + // show or hide the 'help' menu item when supported + if( aResourceId == R_GS_MENU_ITEM_HELP ) + { + if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + + if ( iRockerPress ) + { + // always hide 'help' & 'exit' menu items when rocker key is pressed + if( aResourceId == R_GS_MENU_ITEM_EXIT ) + { + aMenuPane->SetItemDimmed( EAknCmdExit, ETrue ); + } + else if ( aResourceId == R_GS_MENU_ITEM_HELP ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + else if ( aResourceId == R_GS_BARRING_VIEW_MENU ) + { + // these options are not initialized in restricted call barring + if ( !FeatureManager::FeatureSupported( KFeatureIdRestrictedCallBarring ) ) + { + aMenuPane->SetItemDimmed( EGSCmdBarringCancelAll, ETrue ); + aMenuPane->SetItemDimmed( EGSCmdBarringChangePwd, ETrue ); + } + } + } + else if (aResourceId == R_GS_BARRING_VIEW_MENU) + { + if (!menuBar->ItemSpecificCommandsEnabled() && menuBar->GetMenuType() + == CEikMenuBar::EMenuOptions) + { + aMenuPane->SetItemDimmed(EGSCmdBarringActivate, ETrue); + aMenuPane->SetItemDimmed(EGSCmdBarringCancel, ETrue); + aMenuPane->SetItemDimmed(EGSCmdBarringInquiry, ETrue); + } + } + __GSLOGSTRING("[GS] <--CGSSettListBarringView::DynInitMenuPaneL"); + } + +// --------------------------------------------------------------------------- +// +// Queries password from the user. +// +// --------------------------------------------------------------------------- +// +TInt CGSSettListBarringView::BarringPasswordQueryL( + TBarringPassword& aBarringPassword, + const TInt& aTitleID ) + { + __GSLOGSTRING("[GS]--> CGSSettListBarringView::BarringPasswordQueryL"); + TBool continueLoop = ETrue; + + while ( continueLoop ) + { + aBarringPassword = KNullDesC; + CCodeQueryDialog* dlg = new (ELeave) + CCodeQueryDialog( aBarringPassword, KGSBarringPasswordLength, + KGSBarringPasswordLength, ESecUiNone ); + dlg->PrepareLC( R_BARRING_PASSWORD_DLG ); + + HBufC* string = NULL; + string = StringLoader::LoadLC( aTitleID ); + dlg->SetPromptL( *string ); + CleanupStack::PopAndDestroy( string ); + + TInt res = dlg->RunLD(); + dlg = NULL; + + if ( res ) + { + if ( aBarringPassword.Length() == KGSBarringPasswordLength ) + { + continueLoop = EFalse; + } + } + else + { + __GSLOGSTRING("[GS] BarringPasswordQueryL: EAknSoftkeyCancel returned"); + __GSLOGSTRING("[GS] <--CGSSettListBarringView::BarringPasswordQueryL"); + return EAknSoftkeyCancel; + } + } + __GSLOGSTRING("[GS] BarringPasswordQueryL: EAknSoftkeyOk returned"); + __GSLOGSTRING("[GS] <--CGSSettListBarringView::BarringPasswordQueryL"); + return EAknSoftkeyOk; + } + +// --------------------------------------------------------------------------- +// +// Adds given item to a given list +// +// --------------------------------------------------------------------------- +void CGSSettListBarringView::AppendItemL( + CDesCArrayFlat& aList, const TInt aItem ) + { + HBufC* string = NULL; + string = StringLoader::LoadLC( aItem ); + aList.AppendL( *string ); + CleanupStack::PopAndDestroy( string ); + } + +// --------------------------------------------------------------------------- +// +// Handles barring operation requests. +// +// --------------------------------------------------------------------------- +void CGSSettListBarringView::HandleBarringOperationL( + TCallBarringSetting aBarringSetting, TBasicServiceGroups aBsc ) + { + __GSLOGSTRING("[GS]--> CGSSettListBarringView::HandleBarringOperationL"); + TInt ret = KErrNone; + ret = BarringPasswordQueryL( + aBarringSetting.iPassword, R_BARRING_PASSWORD ); + if ( ret == EAknSoftkeyOk ) + { + iBarring->SetBarringL( aBarringSetting, aBsc ); + } + __GSLOGSTRING("[GS] <--CGSSettListBarringView::HandleBarringOperationL"); + } + +// --------------------------------------------------------------------------- +// +// Sets barring type. Switches from GS internal values, to values +// shared by phone/phonesettings. +// --------------------------------------------------------------------------- +void CGSSettListBarringView::SetBarringType( TInt& aCommand, + TCallBarringSetting& aBarringSetting, + TGSBarringSetting aType ) + { + __GSLOGSTRING("[GS]--> CGSSettListBarringView::SetBarringType"); + if ( aCommand != EGSCmdBarringActivate && + aCommand != EGSCmdBarringCancel && + aCommand != EGSCmdBarringInquiry && + aCommand != EGSCmdBarringChangePwd && + aCommand != EGSCmdBarringCancelAll ) + { + __GSLOGSTRING("[GS] SetBarringType: No barring variables set"); + return; //in case of exit do not set barring variables. + } + + aBarringSetting.iServiceGroup = EServiceGroupVoice; + + switch ( aType ) + { + case EGSCBOutgoing: + aBarringSetting.iType = EBarringTypeAllOutgoing; + break; + case EGSCBInternational: + aBarringSetting.iType = EBarringTypeOutgoingInternational; + break; + case EGSCBInternationalExceptHome: + aBarringSetting.iType = + EBarringTypeOutgoingInternationalExceptToHomeCountry; + break; + case EGSCBIncoming: + aBarringSetting.iType = EBarringTypeAllIncoming; + break; + case EGSCBAbroad: + aBarringSetting.iType = EBarringTypeIncomingWhenRoaming; + break; + default: + aBarringSetting.iType = EBarringTypeAllBarrings; + break; + } + + if ( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallBarring ) ) + { + // Restricted call barring only support EBarringTypeIncomingWhenRoaming + aBarringSetting.iType = EBarringTypeIncomingWhenRoaming; + } + + __GSLOGSTRING("[GS] <--CGSSettListBarringView::SetBarringType"); + } + +// --------------------------------------------------------------------------- +// +// Creates a request to cancel all barrings. +// +// --------------------------------------------------------------------------- +void CGSSettListBarringView::CancelAllBarringsL() + { + __GSLOGSTRING("[GS]--> CGSSettListBarringView::CancelAllBarringsL"); + TCallBarringSetting cancelAllCB; + + TInt retValue = KErrNone; + retValue = BarringPasswordQueryL( cancelAllCB.iPassword, + R_BARRING_PASSWORD ); + if ( retValue == EAknSoftkeyOk ) + { + cancelAllCB.iSetting = ECancelBarring; + cancelAllCB.iType = EBarringTypeAllBarrings; + cancelAllCB.iServiceGroup = EServiceGroupVoice; + iBarring->SetBarringL( cancelAllCB, EAllTeleAndBearer ); + } + __GSLOGSTRING("[GS] <--CGSSettListBarringView::CancelAllBarringsL"); + } + +// --------------------------------------------------------------------------- +// +// Handles changing of barring password. +// +// --------------------------------------------------------------------------- +void CGSSettListBarringView::ChangeBarringPwdL() + { + __GSLOGSTRING("[GS]--> CGSSettListBarringView::ChangeBarringPwdL"); + TInt returnValue = KErrNone; + RMobilePhone::TMobilePhonePasswordChangeV2 pwd; + + returnValue = BarringPasswordQueryL( + pwd.iOldPassword, R_CURRENT_BARRING_PASSWORD ); + + if ( returnValue != EAknSoftkeyOk ) //cancelled or error + { + __GSLOGSTRING("[GS] ChangeBarringPwdL: Current PW cancelled/error"); + return; + } + returnValue = BarringPasswordQueryL( pwd.iNewPassword, + R_NEW_BARRING_PASSWORD ); + if ( returnValue != EAknSoftkeyOk ) //cancelled or error + { + __GSLOGSTRING("[GS] ChangeBarringPwdL: New PW cancelled/error"); + return; + } + returnValue = BarringPasswordQueryL( pwd.iVerifiedPassword , + R_VERIFY_NEW_BARRING_PASSWORD ); + if ( returnValue != EAknSoftkeyOk ) + { + __GSLOGSTRING("[GS] ChangeBarringPwdL: Verify PW1 cancelled/error"); + return; + } + // check if newpw and verifypw do not + // match->password error->return to query + while ( pwd.iNewPassword.Compare( pwd.iVerifiedPassword ) != 0 ) + { + iCbObserver->HandleBarringErrorL( KErrGsmSSNegativePasswordCheck ); + + returnValue = BarringPasswordQueryL( pwd.iVerifiedPassword, + R_VERIFY_NEW_BARRING_PASSWORD ); + if ( returnValue != EAknSoftkeyOk ) //cancelled or error + { + __GSLOGSTRING("[GS] ChangeBarringPwdL: Verify PW2 cancelled/error"); + return; + } + } + iBarring->ChangePasswordL( pwd, ETrue ); + __GSLOGSTRING("[GS] <--CGSSettListBarringView::ChangeBarringPwdL"); + } + +// --------------------------------------------------------------------------- +// +// Creates new iContainer. +// +// --------------------------------------------------------------------------- +void CGSSettListBarringView::NewContainerL() + { + iContainer = new (ELeave) CGSSettListBarringContainer; + } + +// --------------------------------------------------------------------------- +// +// Handles listbox selection +// +// --------------------------------------------------------------------------- +void CGSSettListBarringView::HandleListBoxSelectionL() + { + iRockerPress = ETrue; + CEikMenuBar* menuBar = this->MenuBar(); + menuBar->SetMenuType( CEikMenuBar::EMenuContext ); + menuBar->SetContextMenuTitleResourceId(R_CALL_BARRING_MSK_CONTEXTMENUBAR); + // Display menu bar. + menuBar->TryDisplayContextMenuBarL(); + iRockerPress = EFalse; + menuBar->SetMenuType( CEikMenuBar::EMenuOptions ); + iContextMenuInitialized = ETrue; + } + + + // End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Src/GSInternetBarringContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSInternetBarringContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,262 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for the Internet Barring folder +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include //PubSub +#include +#include +#include "GSInternetBarringContainer.h" +#include "gslistbox.h" //for listbox clases + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// +// Symbian OS two phased constructor +// +// --------------------------------------------------------------------------- +void CGSSettListInternetBarringContainer::ConstructL( const TRect& aRect ) + { + iListBox = new ( ELeave ) CAknSettingStyleListBox; + iRichCallRepository = CRepository::NewL( KCRUidRichCallSettings ); + iTelephonyRepository = CRepository::NewL( KCRUidTelephonySettings ); + BaseConstructL( aRect, + R_GS_INTERNET_BARRING_VIEW_TITLE, + R_INTERNET_BARRING_LBX ); + } + +// --------------------------------------------------------------------------- +// +// Destructor +// +// --------------------------------------------------------------------------- +CGSSettListInternetBarringContainer::~CGSSettListInternetBarringContainer() + { + if ( iItems ) + { + delete iItems; + } + if ( iListboxItemArray ) + { + delete iListboxItemArray; + } + if ( iTelephonyRepository ) + { + delete iTelephonyRepository; + iTelephonyRepository = NULL; + } + if ( iRichCallRepository ) + { + delete iRichCallRepository; + iRichCallRepository = NULL; + } + } + +// --------------------------------------------------------------------------- +// +// Creates list box +// +// --------------------------------------------------------------------------- +void CGSSettListInternetBarringContainer::ConstructListBoxL( TInt aResLbxId ) + { + iListBox->ConstructL( this, EAknListBoxSelectionList); + + iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, + *iListBox, *iCoeEnv ); + iListBox->Model()->SetItemTextArray( iListboxItemArray ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + // Create items + iItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_GS_INTERNET_BARRING_SETTING_PAGE_LBX ); + + CreateListBoxItemsL(); + } + +// --------------------------------------------------------------------------- +// +// Creates List box items +// +// --------------------------------------------------------------------------- +void CGSSettListInternetBarringContainer::CreateListBoxItemsL() + { + MakeAnonymousItemL(); + } + +// --------------------------------------------------------------------------- +// CGSSettListInternetBarringContainer::GetHelpContext +// Gets Help Context +// +// --------------------------------------------------------------------------- +// +void CGSSettListInternetBarringContainer::GetHelpContext( + TCoeHelpContext& aContext ) const + { + aContext.iMajor = KUidGS; + aContext.iContext = KDIV_HLP_CALL_FORW_VOIP; + } + +// --------------------------------------------------------------------------- +// CGSSettListInternetBarringContainer::MakeAnonymousItemL +// +// --------------------------------------------------------------------------- +// +void CGSSettListInternetBarringContainer::MakeAnonymousItemL() + { + TInt value( KErrNone ); + GetVoIPCallSettingValue( EGSVoIPBarring, value ); + + HBufC* dynamicText = HBufC::NewLC( KGSSettingItemLength ); + TPtr ptrBuffer ( dynamicText->Des() ); + + ptrBuffer = ( *iItems )[ value ]; + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSCBAnonymous, ptrBuffer ); + iListboxItemArray->SetItemVisibilityL( EGSCBAnonymous, + CGSListBoxItemTextArray::EVisible ); + + CleanupStack::PopAndDestroy( dynamicText ); + } + +// --------------------------------------------------------------------------- +// CGSSettListInternetBarringContainer::UpdateListBoxL +// +// --------------------------------------------------------------------------- +// +void CGSSettListInternetBarringContainer::UpdateListBoxL() + { + MakeAnonymousItemL(); + iListBox->HandleItemAdditionL(); + } + + +// ---------------------------------------------------------------------------- +// CGSSettListInternetBarringContainer::GetVoIPCallSettingValue +// Gets one of the VoIP call related values (send my Int. call id, +// Internet call waiting, preferred call type, do not disturb or +// Internet call barring) from Central Repository +// ---------------------------------------------------------------------------- +// +TInt CGSSettListInternetBarringContainer::GetVoIPCallSettingValue( + const TGSVoIPSetting aVoipSettingId, TInt& aVoipId ) + { + TInt ret( KErrNone ); + + switch ( aVoipSettingId ) + { + case EGSVoIPSendIntCallId: + ret = iRichCallRepository->Get( KRCSEClir, aVoipId ); + break; + case EGSVoIPCW: + ret = iRichCallRepository->Get( KRCSPSCallWaiting, aVoipId ); + break; + case EGSVoIPPreType: + ret = iRichCallRepository->Get( KRCSEPreferredTelephony, aVoipId ); + break; + case EGSVoIPDnd: + ret = iRichCallRepository->Get( KRCSEDoNotDisturb, aVoipId ); + break; + case EGSVoIPBarring: + ret = iRichCallRepository->Get( KRCSEAnonymousCallBlockRule, aVoipId ); + SwitchValue( aVoipId ); + break; + default: + break; + } + + return ret; + } + +// ---------------------------------------------------------------------------- +// CGSSettListInternetBarringContainer::SetVoIPCallSettingValue +// Sets one of the VoIP call related values (send my Int. call id, +// Internet call waiting, preferred call type, do not disturb or +// Internet call barring) from Central Repository +// ---------------------------------------------------------------------------- +// +TInt CGSSettListInternetBarringContainer::SetVoIPCallSettingValue( + const TGSVoIPSetting aVoipSettingId, TInt aVoipId ) + { + TInt ret( KErrNone ); + + switch( aVoipSettingId ) + { + case EGSVoIPSendIntCallId: + ret = iRichCallRepository->Set( KRCSEClir, aVoipId ); + break; + case EGSVoIPCW: + ret = iRichCallRepository->Set( KRCSPSCallWaiting, aVoipId ); + break; + case EGSVoIPPreType: + ret = iRichCallRepository->Set( KRCSEPreferredTelephony, aVoipId ); + break; + case EGSVoIPDnd: + ret = iRichCallRepository->Set( KRCSEDoNotDisturb, aVoipId ); + break; + case EGSVoIPBarring: + SwitchValue( aVoipId ); + ret = iRichCallRepository->Set( KRCSEAnonymousCallBlockRule, aVoipId ); + break; + default: + break; + } + + return ret; + } + +// ---------------------------------------------------------------------------- +// CGSSettListInternetBarringContainer::GetSCCPStatus +// Gets SCCP status from Central Repository +// ---------------------------------------------------------------------------- +// +TInt CGSSettListInternetBarringContainer::GetSCCPStatus( TInt& aStatus ) + { + TInt ret( KErrNone ); + ret = iTelephonyRepository->Get( KSCCPinstallUpgrade, aStatus ); + return ret; + } + +// ---------------------------------------------------------------------------- +// CGSSettListInternetBarringContainer::SwitchValue +// +// Switching value from 1 to 0 and back +// ---------------------------------------------------------------------------- +// +void CGSSettListInternetBarringContainer::SwitchValue( TInt& aValue ) + { + switch( aValue ) + { + case KGSSettingOff: //0 + aValue = KGSIndexOff; //1 + break; + case KGSSettingOn: //1 + aValue = KGSIndexOn; //0 + break; + default: + break; + } + } +// End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Src/GSInternetBarringView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSInternetBarringView.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,313 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View for the Internet Barring folder +* +*/ + + +// INCLUDE FILES +#include "CallBarringPlugin.hrh" //for enumerations (e.g.TGSInternetBarringSetting) +#include "GSInternetBarringView.h"//for CGSSettListInternetBarringView +#include "GSInternetBarringContainer.h" //for CGSBaseContainer +#include "LocalViewIds.h" //for KSettListBarringViewId, KGSMainViewId +#include "GsLogger.h" + + +#include +#include +#include //for resource IDs +#include +#include //for StringLoader +#include +#include +#include +#include // For HlpLauncher + +// CONSTANS +const TInt KGSBarringGranularity = 2; + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// +// C++ constructor. +// +// --------------------------------------------------------------------------- +CGSSettListInternetBarringView::CGSSettListInternetBarringView() + { + } + +// --------------------------------------------------------------------------- +// +// Symbian OS two-phased constructor (second phase) +// +// --------------------------------------------------------------------------- +void CGSSettListInternetBarringView::ConstructL() + { + BaseConstructL( R_GS_INTERNET_BARRING_VIEW ); + } + +// --------------------------------------------------------------------------- +// CGSSettListInternetBarringView::NewL() +// Symbian OS two-phased constructor +// +// --------------------------------------------------------------------------- +CGSSettListInternetBarringView* CGSSettListInternetBarringView::NewL() + { + CGSSettListInternetBarringView* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// Symbian OS two-phased constructor (first phase) +// +// --------------------------------------------------------------------------- +CGSSettListInternetBarringView* CGSSettListInternetBarringView::NewLC() + { + CGSSettListInternetBarringView* self = + new ( ELeave ) CGSSettListInternetBarringView(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// C++ destructor +// +// --------------------------------------------------------------------------- +CGSSettListInternetBarringView::~CGSSettListInternetBarringView() + { + } + +// --------------------------------------------------------------------------- +// +// Returns Id of the Barring view. +// +// --------------------------------------------------------------------------- +TUid CGSSettListInternetBarringView::Id() const + { + return KCallInternetBarringViewId; + } + +// --------------------------------------------------------------------------- +// +// Handles other than list box events. +// +// --------------------------------------------------------------------------- +void CGSSettListInternetBarringView::HandleCommandL( TInt aCommand ) + { + switch ( aCommand ) + { + case EGSMSKCmdAppChange: + HandleListBoxSelectionL(); + break; + case EGSCmdAppChange: + ShowSettingPageL(); + break; + case EAknSoftkeyBack: + iAppUi->ActivateLocalViewL( KCallMainBarringViewId ); + break; + case EAknCmdHelp: + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), iAppUi->AppHelpContextL() ); + } + break; + default: + iAppUi->HandleCommandL( aCommand ); + break; + } + } + +// --------------------------------------------------------------------------- +// +// Activates view. +// +// --------------------------------------------------------------------------- +void CGSSettListInternetBarringView::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + __GSLOGSTRING("[GS]--> CGSSettListInternetBarringView::DoActivateL"); + CGSLocalBaseView::DoActivateL( aPrevViewId, aCustomMessageId, + aCustomMessage ); + + iContainer->iListBox->SetTopItemIndex( iTopItemIndex ); + + if ( iCurrentItem >= 0 && + iCurrentItem < iContainer->iListBox->Model()->NumberOfItems() ) + { + iContainer->iListBox->SetCurrentItemIndexAndDraw( iCurrentItem ); + } + __GSLOGSTRING("[GS]<-- CGSSettListInternetBarringView::DoActivateL"); + } + +// --------------------------------------------------------------------------- +// +// Deactivates view. +// +// --------------------------------------------------------------------------- +void CGSSettListInternetBarringView::DoDeactivate() + { + if ( iContainer ) + { + if ( iContainer->iListBox && iContainer->iListBox->View() ) + { + iCurrentItem = iContainer->iListBox->CurrentItemIndex(); + iTopItemIndex = iContainer->iListBox->TopItemIndex(); + } + iAppUi->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + iContainer = NULL; + } + } + +// --------------------------------------------------------------------------- +// +// Before showing a options menu, delete options key specific settings if +// rocker key has been pressed. +// --------------------------------------------------------------------------- +// +void CGSSettListInternetBarringView::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + // show or hide the 'help' menu item when supported + if( aResourceId == R_GS_MENU_ITEM_HELP ) + { + User::LeaveIfNull( aMenuPane ); + + if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + } + +// --------------------------------------------------------------------------- +// +// Creates new iContainer. +// +// --------------------------------------------------------------------------- +void CGSSettListInternetBarringView::NewContainerL() + { + iContainer = new (ELeave) CGSSettListInternetBarringContainer; + } + +// --------------------------------------------------------------------------- +// +// Handles changing of barring password. +// +// --------------------------------------------------------------------------- +void CGSSettListInternetBarringView::HandleListBoxSelectionL() + { + CGSSettListInternetBarringContainer& container = + *static_cast( iContainer ); + + TInt value( KErrNone ); + container.GetVoIPCallSettingValue( EGSVoIPBarring, value ); + + if ( value == EGSCSCallBarringOff ) + { + container.SetVoIPCallSettingValue( EGSVoIPBarring, EGSCSCallBarringOn ); + } + else + { + container.SetVoIPCallSettingValue( EGSVoIPBarring, EGSCSCallBarringOff ); + } + + if ( iContainer->iListBox ) + { + container.UpdateListBoxL(); + } + + // Show SCCP note if needed. + TInt status( KErrNone ); + container.GetSCCPStatus( status ); + + if ( value == EGSCSCallBarringOff && status == 1 ) + { + HBufC* prompt = + StringLoader::LoadLC( R_QTN_VOIP_SCCP_CALL_BARRING_NOTE ); + CAknInformationNote* note = new(ELeave) CAknInformationNote( ETrue ); + note->ExecuteLD( *prompt ); + CleanupStack::PopAndDestroy( prompt ); + } + } + +// --------------------------------------------------------------------------- +// +// Shows setting page - for ON/OFF setting items +// +// --------------------------------------------------------------------------- +void CGSSettListInternetBarringView::ShowSettingPageL() + { + CGSSettListInternetBarringContainer& container = + *static_cast( iContainer ); + + CDesCArrayFlat* items = + new ( ELeave ) CDesCArrayFlat( KGSBarringGranularity ); + CleanupStack::PushL( items ); + + AppendItemL( *items, R_INTERNET_BARRING_ON ); + AppendItemL( *items, R_INTERNET_BARRING_OFF ); + + TInt value( KErrNone ); + container.GetVoIPCallSettingValue( EGSVoIPBarring, value ); + + CAknRadioButtonSettingPage* dlg = new( ELeave ) + CAknRadioButtonSettingPage( + R_GS_INTERNET_BARRING_SETTING_PAGE, + value, items ); + + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { + if ( value == EGSCSCallBarringOff ) + { + container.SetVoIPCallSettingValue( + EGSVoIPBarring, EGSCSCallBarringOff ); + } + else + { + container.SetVoIPCallSettingValue( + EGSVoIPBarring, EGSCSCallBarringOn ); + } + } + + CleanupStack::PopAndDestroy( items ); + + container.UpdateListBoxL(); + } + +// --------------------------------------------------------------------------- +// +// Appends given item to given list +// +// --------------------------------------------------------------------------- +void CGSSettListInternetBarringView::AppendItemL( + CDesCArrayFlat& aList, TInt aItem ) + { + HBufC* string = StringLoader::LoadLC( aItem ); + aList.AppendL( *string ); + CleanupStack::PopAndDestroy( string ); + } + + // End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Src/GSLocalBaseView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSLocalBaseView.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,210 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base view for all the views in General Settings +* +*/ + + +// INCLUDE FILES +#include "GSLocalBaseView.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// CONSTANTS +#ifdef _DEBUG +_LIT( KGSDoActivateError, "DoActivateL" ); +#endif + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::CGSLocalBaseView +// +// C++ constructor +// --------------------------------------------------------------------------- +// +CGSLocalBaseView::CGSLocalBaseView() + { + iAppUi = iAvkonViewAppUi; + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::~CGSLocalBaseView +// +// Destructor +// --------------------------------------------------------------------------- +// +CGSLocalBaseView::~CGSLocalBaseView() + { + if ( iContainer && iAppUi ) + { + iAppUi->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + } + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::SetCurrentItem +// +// +// --------------------------------------------------------------------------- +// +void CGSLocalBaseView::SetCurrentItem( TInt aIndex ) + { + iCurrentItem = aIndex; + if( iContainer ) + { + iContainer->SetSelectedItem( aIndex ); + } + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::HandleListBoxEventL +// +// +// --------------------------------------------------------------------------- +// +void CGSLocalBaseView::HandleListBoxEventL( CEikListBox* /*aListBox*/, + TListBoxEvent aEventType ) + { + switch ( aEventType ) + { + case EEventEnterKeyPressed: + case EEventItemSingleClicked: + HandleListBoxSelectionL(); + break; + default: + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::SetNaviPaneL +// +// +// --------------------------------------------------------------------------- +// +void CGSLocalBaseView::SetNaviPaneL() + { + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::CreateNaviPaneContextL +// +// +// --------------------------------------------------------------------------- +// +void CGSLocalBaseView::CreateNaviPaneContextL( TInt /*aResourceId*/ ) + { + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::HandleClientRectChange +// +// +// --------------------------------------------------------------------------- +// +void CGSLocalBaseView::HandleClientRectChange() + { + if ( iContainer && iContainer->iListBox ) + { + iContainer->SetRect( ClientRect() ); + } + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::DoActivateL +// Activates the view. +// +// --------------------------------------------------------------------------- +// +void CGSLocalBaseView::DoActivateL(const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/) + { + if( iContainer ) + { + iAppUi->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + iContainer = NULL; + } + + CreateContainerL(); + + iAppUi->AddToViewStackL( *this, iContainer ); + iContainer->iListBox->SetListBoxObserver( this ); + + SetNaviPaneL(); + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::DoDeactivate() +// +// +// --------------------------------------------------------------------------- +// +void CGSLocalBaseView::DoDeactivate() + { + if ( iContainer ) + { + iAppUi->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + iContainer = NULL; + } + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::CreateContainerL() +// +// +// --------------------------------------------------------------------------- +// +void CGSLocalBaseView::CreateContainerL() + { + NewContainerL(); + __ASSERT_DEBUG( iContainer, + User::Panic( KGSDoActivateError, EGSViewPanicNullPtr ) ); + iContainer->SetMopParent( this ); + + TRAPD( error, iContainer->ConstructL( ClientRect() ) ); + + if ( error ) + { + delete iContainer; + iContainer = NULL; + User::Leave( error ); + } + } + + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Src/GSMainBarringContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSMainBarringContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for the Main Barring folder +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include "GSMainBarringContainer.h" + +#include "gslistbox.h" +#include "CallBarringPlugin.hrh" +#include +#include //P&S + + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// +// Symbian OS two phased constructor +// +// --------------------------------------------------------------------------- +void CGSSettListMainBarringContainer::ConstructL( const TRect& aRect ) + { + iListBox = new ( ELeave ) CAknSettingStyleListBox; + + BaseConstructL( aRect, + R_GS_BARRING_MAIN_VIEW_TITLE, + R_BARRING_MAIN_LBX ); + + RProperty::Get( KPSUidBluetoothSapConnectionState, + KBTSapConnectionState, + iBtSapConnectionState ); + } + +// --------------------------------------------------------------------------- +// +// Destructor +// +// --------------------------------------------------------------------------- +CGSSettListMainBarringContainer::~CGSSettListMainBarringContainer() + { + if ( iItems ) + { + delete iItems; + } + if ( iListboxItemArray ) + { + delete iListboxItemArray; + } + } + +// --------------------------------------------------------------------------- +// +// Creates list box +// +// --------------------------------------------------------------------------- +void CGSSettListMainBarringContainer::ConstructListBoxL( TInt aResLbxId ) + { + iListBox->ConstructL( this, EAknListBoxSelectionList); + iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, + *iListBox, *iCoeEnv ); + iListBox->Model()->SetItemTextArray( iListboxItemArray ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + CreateListBoxItemsL(); + } + +// --------------------------------------------------------------------------- +// +// Creates List box items +// +// --------------------------------------------------------------------------- +void CGSSettListMainBarringContainer::CreateListBoxItemsL() + { + if ( iBtSapConnectionState != EBTSapConnected ) + { + iListboxItemArray->SetItemVisibilityL( EGSCBCellular, + CGSListBoxItemTextArray::EVisible ); + } + + iListboxItemArray->SetItemVisibilityL( EGSCBInternet, + CGSListBoxItemTextArray::EVisible ); + } + +// --------------------------------------------------------------------------- +// CGSSettListMainBarringContainer::GetHelpContext +// Gets Help Context +// +// --------------------------------------------------------------------------- +// +void CGSSettListMainBarringContainer::GetHelpContext( + TCoeHelpContext& aContext ) const + { + aContext.iMajor = KUidGS; + aContext.iContext = KDIV_HLP_BARRING_MAIN; + } + +// --------------------------------------------------------------------------- +// CGSSettListMainBarringContainer::CurrentFeatureId() +// +// --------------------------------------------------------------------------- +// +TInt CGSSettListMainBarringContainer::CurrentFeatureId() const + { + return iListboxItemArray->CurrentFeature(); + } + +//End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/Src/GSMainBarringView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSMainBarringView.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,249 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View for the Main Barring folder +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include "CallBarringPlugin.hrh" //for enumerations (e.g.TGSBarringSetting) +#include "GSMainBarringView.h" //for CGSSettListMainBarringView +#include "GSMainBarringContainer.h" //for CGSBaseContainer +#include "GSCellularCallBarringView.h" //for CGSSettListBarringView +#include "GSInternetBarringView.h" //for CGSSettListInternetBarringView +#include "GSPhoneSettingConstants.h"//for constant values +#include "LocalViewIds.h" //for KSettListBarringViewId, KGSMainViewId +#include //for menu bar +#include "GSCallBarringPlugin.h" +#include +#include +#include +#include +#include // For HlpLauncher + +// ========================= MEMBER FUNCTIONS ================================ +// --------------------------------------------------------------------------- +// +// C++ constructor. +// +// --------------------------------------------------------------------------- +CGSSettListMainBarringView::CGSSettListMainBarringView() + { + } + +// --------------------------------------------------------------------------- +// +// Symbian OS two-phased constructor (second phase) +// +// --------------------------------------------------------------------------- +void CGSSettListMainBarringView::ConstructL() + { + BaseConstructL( R_GS_BARRING_MAIN_VIEW ); + + // Create call barring and Internet call barring views. + iBarringView = CGSSettListBarringView::NewL(); + iAppUi->AddViewL( iBarringView ); + + iInternetBarringView = CGSSettListInternetBarringView::NewL(); + iAppUi->AddViewL( iInternetBarringView ); + } + +// --------------------------------------------------------------------------- +// +// Symbian OS two-phased constructor (first phase) +// +// --------------------------------------------------------------------------- +CGSSettListMainBarringView* CGSSettListMainBarringView::NewLC() + { + CGSSettListMainBarringView* self = + new ( ELeave ) CGSSettListMainBarringView; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// C++ destructor +// +// --------------------------------------------------------------------------- +CGSSettListMainBarringView::~CGSSettListMainBarringView() + { + } + +// --------------------------------------------------------------------------- +// +// Returns Id of the Barring view. +// +// --------------------------------------------------------------------------- +TUid CGSSettListMainBarringView::Id() const + { + return KCallMainBarringViewId; + } + +// --------------------------------------------------------------------------- +// +// Handles other than list box events. +// +// --------------------------------------------------------------------------- +void CGSSettListMainBarringView::HandleCommandL( TInt aCommand ) + { + iCurrentItem = iContainer->iListBox->CurrentItemIndex(); + + switch ( aCommand ) + { + case EAknSoftkeyOpen: + case EGSCmdAppOpen: + HandleListBoxSelectionL(); + break; + case EAknSoftkeyBack: + iAppUi->ActivateLocalViewL( KGSTelPluginUid ); + break; + case EAknCmdHelp: + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), iAppUi->AppHelpContextL() ); + } + break; + default: + iAppUi->HandleCommandL( aCommand ); + break; + } + } + +// --------------------------------------------------------------------------- +// +// Activates view. +// +// --------------------------------------------------------------------------- +void CGSSettListMainBarringView::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + CGSLocalBaseView::DoActivateL( aPrevViewId, aCustomMessageId, + aCustomMessage ); + + iContainer->iListBox->SetTopItemIndex( iTopItemIndex ); + + if ( iCurrentItem >= 0 && + iCurrentItem < iContainer->iListBox->Model()->NumberOfItems() ) + { + iContainer->iListBox->SetCurrentItemIndexAndDraw( iCurrentItem ); + } + } + +// --------------------------------------------------------------------------- +// +// Deactivates view. +// +// --------------------------------------------------------------------------- +void CGSSettListMainBarringView::DoDeactivate() + { + if ( iContainer ) + { + iCurrentItem = iContainer->iListBox->CurrentItemIndex(); + iTopItemIndex = iContainer->iListBox->TopItemIndex(); + + iAppUi->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + iContainer = NULL; + } + } + +// ----------------------------------------------------------------------------- +// CGSSettListMainBarringView::ProcessCommandL +// ----------------------------------------------------------------------------- +void CGSSettListMainBarringView::ProcessCommandL( TInt aCommand ) + { + MenuBar()->SetContextMenuTitleResourceId(R_CALL_BARRING_MSK_CONTEXTMENUBAR); + // Call base class + CAknView::ProcessCommandL( aCommand ); + } +// --------------------------------------------------------------------------- +// +// Before showing a options menu, delete options key specific settings if +// rocker key has been pressed. +// --------------------------------------------------------------------------- +// +void CGSSettListMainBarringView::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + // show or hide the 'help' menu item when supported + if( aResourceId == R_GS_MENU_ITEM_HELP ) + { + User::LeaveIfNull( aMenuPane ); + + //Handle Help Fature + if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + } + +// --------------------------------------------------------------------------- +// +// Creates new iContainer. +// +// --------------------------------------------------------------------------- +void CGSSettListMainBarringView::NewContainerL() + { + iContainer = new ( ELeave ) CGSSettListMainBarringContainer; + } + + +// --------------------------------------------------------------------------- +// +// Handles changing of barring password. +// +// --------------------------------------------------------------------------- +void CGSSettListMainBarringView::HandleListBoxSelectionL() + { + const TInt currentItem = Container()->CurrentFeatureId(); + + switch ( currentItem ) + { + case EGSCBCellular: + iAppUi->ActivateLocalViewL( KCallBarringViewId ); + break; + case EGSCBInternet: + iAppUi->ActivateLocalViewL( KCallInternetBarringViewId ); + break; + default: + break; + } + } + +// --------------------------------------------------------------------------- +// CGSSettListMainBarringView::Container +// +// Returns call container item +// --------------------------------------------------------------------------- +// +CGSSettListMainBarringContainer* CGSSettListMainBarringView::Container() + { + return static_cast ( iContainer ); + } + +// End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSCallBarringPlugin. +* +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSCallBarringPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gscallbarringplugin.iby ) +../rom/GSCallBarringPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gscallbarringpluginresources.iby ) +loc/CallBarringPlugin.loc MW_LAYER_LOC_EXPORT_PATH( callbarringplugin.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gscallbarringplugin.mif + OPTION HEADERFILE gscallbarringplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_set_barr_sub +END + + +PRJ_MMPFILES +GSCallBarringPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSCallBarringPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallBarringPlugin/loc/CallBarringPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallBarringPlugin/loc/CallBarringPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,164 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSCallBarringPlugin. +* +*/ + + +// LOCALISATION STRINGS + +//d: title for call settings folder +//l: list_single_large_graphic_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_folder_barring "Call Barring" + + +//BARRING FOLDER +//d: title for barring folder when opened +//l: title_pane_t2/opt9 +// +#define qtn_set_title_restrictions "Call barring settings" + +//d: text to indicate outgoing calls in call barring-folder +//l: list_double2_pane +// +#define text_no_outgoing "Outgoing calls" + +//d: text to indicate international calls in call barring-folder +//l: list_double2_pane +// +#define text_no_international "International calls" + +//d: text to indicate international calls except to home country +//d: in call barring-folder +//l: list_double2_pane +// +#define text_no_inter_but_home "International calls except to home country" + +//d: text to indicate incoming calls in call barring-folder +//l: list_double2_pane +// +#define text_no_incoming "Incoming calls" + +//d: text to indicate incoming calls when abroad in call barring-folder +//l: list_double2_pane +// +#define text_no_incom_if_roam "Incoming calls when abroad" + +// ACTIONS IN CALL BARRING FOLDER +//d: action in call barring folder, +//d: activating the corresponding barring service +//l: list_single_pane_t1_cp2 +// +#define text_activate_barring "Activate" + +//d: action in call barring folder, +//d: cancelling the corresponding barring service +//l: list_single_pane_t1_cp2 +// +#define text_cancel_barring "Cancel" + +//d: action in call barring folder, +//d: checking status of the corresponding barring service +//l: list_single_pane_t1_cp2 +// +#define text_status_barring "Check status" + +//d: text to indicate cancelling call barrings in call barring-folder +//l: list_single_pane_t1_cp2 +// +#define text_cancel_all_barrings "Cancel all barrings" + +//d: text to indicate changing barring password in call barring-folder +//l: list_single_pane_t1_cp2 +// +#define qtn_barr_list_password "Change barrings' password" + +// CALL BARRING INTERROGATION AND PASSWORD RELATED STUFF +//d: text to the code query which opens when one is about to enter +//d: barring password +//l: popup_query_data_window +// +#define text_password "Barring password: " + +//d: when the barring password is being changed, +//d: this is the text when the old pw is asked +//l: popup_query_data_window +// +#define text_old_pass "Current password: " + +//d: when the barring password is being changed, +//d: this is the text when the new pw is entered +//l: popup_query_data_window +// +#define text_new_pass "Enter new password: " + +//d: when the barring password is being changed, +//d: this is the text when the new pw is confirmed +//l: popup_query_data_window +// +#define text_verify_pass "Verify new password: " + +//VOIP + +//d: text to indicate cellular call selection in call barring-folder +//l: list_double2_pane +// +#define qtn_cell_call_barring "Cellular call Barring" + +//d: text to indicate internet call selection in call barring-folder +//l: list_double2_pane +// +#define qtn_voip_call_barring "Internet call Barring" + +//d: text to indicate internet call selection in call barring-folder +//l: list_double2_pane +// +#define qtn_set_title_restrictions_int "Anonymous call barring" + +//d: text to indicate anonymous calls in call barring-folder +//l: list_setting_pane_t1 +// +#define qtn_voip_barring_anonymous "Anonymous calls" + +//d: text to indicate anonymous call type +//l: list_set_graphic_pane_t1 +// +#define qtn_voip_barring_active "Active" + +//d: text to indicate anonymous call type +//l: list_set_graphic_pane_t1 +// +#define qtn_voip_barring_not_active "Not active" + +//d: title for barring folder when opened +//l: title_pane_t2/opt9 +// +#define qtn_title_cell_call_barring "Cellular call barring" + +//d: title for barring folder when opened +//l: title_pane_t2/opt9 +// +#define qtn_title_voip_call_barring "Internet call barring" + +//d: note is shown when the barring is set for anonymous internet call and SCCP software is installed +//l: popup_note_window +// +#define qtn_voip_sccp_call_barring_note "Note that anonymous call barring does not affect SCCP based Internet calls" + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Data/102824A3.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Data/102824A3.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for Call Divert settings plugin. +* +*/ + + +// INCLUDES +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x102824A3; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x102824A4; + version_no = 1; + display_name = "Call Divert Plugin"; + default_data = "0x1020723D";//Parent UID + #ifdef RD_CONTROL_PANEL + opaque_data = "40";//Order number + #else //RD_CONTROL_PANEL + opaque_data = "20";//Order number + #endif //RD_CONTROL_PANEL + } + }; + } + }; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Data/GSCallDivertPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Data/GSCallDivertPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,559 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for GSCallDivertPlugin +* +*/ + +// RESOURCE IDENTIFIER +NAME CFWD // 4 letter ID + +// INCLUDES +#include + +#include "CallDivertPlugin.hrh" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include // AIW for pbk2 +#include // AIW for pbk2 + +// CONSTANTS + + +// RESOURCE DEFINITIONS + +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +RESOURCE TBUF + { + buf="CFWD"; + } + +//---------------------------------------------------- +// +// EIK_APP_INFO +// It contains application information. +// +//---------------------------------------------------- +// +RESOURCE EIK_APP_INFO + { + } + + +//---------------------------------------------------- +// r_gs_call_divert_caption +// +// Data call view caption for plugin +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_call_divert_caption + { + buf = qtn_set_folder_divert; + } + +//Divert + +//---------------------------------------------------- +// +// r_cf_main_view +// The main view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cf_main_view + { + menubar = r_cf_menubar_open_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN; + } + + + +//---------------------------------------------------- +// +// r_cf_menubar_open_exit +// Call forward menu bar. +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_cf_menubar_open_exit + { + titles = + { + MENU_TITLE + { + menu_pane = r_gs_menu_item_exit; + }, + MENU_TITLE + { + menu_pane = r_gs_menu_item_help; + }, + MENU_TITLE + { + menu_pane = r_cf_cancel_all_diverts; + }, + MENU_TITLE + { + menu_pane = r_gs_menu_item_open; + } + }; + } + + + +//---------------------------------------------------- +// +// r_cf_cancel_all_diverts +// Call forward "cancel all" menu pane. +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_cf_cancel_all_diverts + { + items = + { + MENU_ITEM + { + command = ECFCmdCancelAll; + txt = text_cancel_all_diverts; + } + }; + } + + +//---------------------------------------------------- +// +// r_cf_main_view_title +// Title for the main view: "Call Divert" +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cf_main_view_title + { + txt = qtn_div_heading_cf; + } + + +//---------------------------------------------------- +// +// r_cf_div_view_menu +// Menu pane for Options. +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_cf_div_view_menu + { + items = + { + MENU_ITEM + { + command = ECFCmdActivate; + txt = text_activate_divert; + }, + MENU_ITEM + { + command = ECFCmdCancel; + txt = text_cancel_divert; + }, + MENU_ITEM + { + command = ECFCmdCheckStatus; + txt = text_check_status; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = EAknCmdExit; + txt = qtn_options_exit; + } + }; + } + +//---------------------------------------------------- +// +// r_cf_menubar_options_view +// Menu bar in the Main view. +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_cf_menubar_options_view + { + titles = + { + MENU_TITLE {menu_pane = r_cf_div_view_menu;} + }; + } + +//---------------------------------------------------- +// +// r_cf_menubar_div_view +// Menu bar in the Main view when selection key has been pressed. +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_cf_menubar_div_view + { + titles = + { + MENU_TITLE {menu_pane = r_cf_div_view_menu;} + }; + } + + +//----------------------------------------------------------------------------- +// +// r_cf_main_lbx_resource +// List box resource. +// +//----------------------------------------------------------------------------- +// +RESOURCE LISTBOX r_cf_main_lbx_resource + { + array_id = r_cf_main_lbx; + flags = EEikListBoxMultipleSelection; + } + + +//---------------------------------------------------- +// +// r_cf_voice_view_title +// Title for the sub view: "Voice Call Diverts" +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cf_voice_view_title + { + txt = qtn_div_heading_voice; + } + +//---------------------------------------------------- +// +// r_cf_video_view_title +// Title for the sub view: "Video Call Diverts" +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cf_video_view_title + { + txt = qtn_div_heading_video; + } + +//----------------------------------------------------------------------------- +// +// r_cf_div_lbx +// List items in the call divert view. +// +//----------------------------------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_cf_div_lbx + { + items = + { + GS_FEATURE + { + txt = " \t"qtn_div_dlist_all"\t\t"; + item = ECFDivertVoiceCalls; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = " \t"qtn_div_dlist_all_video"\t\t"; + item = ECFDivertVideoCalls; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = " \t"qtn_div_dlist_busy"\t\t"; + item = ECFDivertWhenBusy; + }, + GS_FEATURE + { + txt = " \t"qtn_div_dlist_noreply"\t\t"; + item = ECFDivertWhenNoAnswer; + }, + GS_FEATURE + { + txt = " \t"qtn_div_dlist_outreach"\t\t"; + item = ECFDivertWhenOutOfReach; + }, + GS_FEATURE + { + txt = " \t"qtn_div_dlist_notavail"\t\t"; + item = ECFDivertWhenNotAvailable; + } + }; + } + +//----------------------------------------------------------------------------- +// +// r_cf_main_lbx +// List items in the call divert main view. IDs are from enum +// TGSCallDivertServiceGroups. +// +//----------------------------------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_cf_main_lbx + { + items = + { + GS_FEATURE + { + txt = " \t"qtn_div_voice_calls; + item = EGSSettIdVoiceDivert; + }, + GS_FEATURE + { + txt = " \t"qtn_div_video_calls; + item = EGSSettIdVideoDivert; + } + }; + } + +//---------------------------------------------------- +// +// r_cf_div_view +// The diverts view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cf_div_view + { + menubar = r_cf_menubar_options_view; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_CONTEXTOPTIONS; + } + +// ----------------------------------------------------------------------------- +// +// r_cf_restricted_main_lbx_resource +// List box resource. +// +//----------------------------------------------------------------------------- +// +RESOURCE LISTBOX r_cf_restricted_main_lbx_resource + { + array_id = r_cf_restricted_main_lbx; + flags = EEikListBoxMultipleSelection; + } + +//----------------------------------------------------------------------------- +// +// r_cf_restricted_main_lbx +// List items in the restricted call divert main view. +// +//----------------------------------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_cf_restricted_main_lbx + { + items = + { + GS_FEATURE + { + txt = " \t"qtn_div_restricted; + item = ECFDivertVoiceCalls; + } + }; + } + +//----------------------------------------------------------------------------- +// +// r_title_array +// Titles for specific popups. +// +//----------------------------------------------------------------------------- +// +RESOURCE ARRAY r_title_array + { + items = + { + LBUF {txt = qtn_div_title_all;}, + LBUF {txt = qtn_div_title_all_video;}, + LBUF {txt = qtn_div_title_busy;}, + LBUF {txt = qtn_div_title_not_answered;}, + LBUF {txt = qtn_div_title_not_reach;}, + LBUF {txt = qtn_div_title_not_available;} + }; + } + +//----------------------------------------------------------------------------- +// +// (various resources) +// Texts for additional dialogs and popups. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_text_divert_to_voice_mail {buf = text_divert_to_voice_mail;} +RESOURCE TBUF r_text_divert_to_number {buf = text_divert_to_number;} +RESOURCE TBUF r_text_slist_seconds {buf = qtn_div_slist_seconds;} +RESOURCE TBUF r_text_delay_header {buf = qtn_div_heading_delay;} +RESOURCE TBUF r_text_prmpt_data_number {buf = qtn_ss_prmpt_video_number;} +RESOURCE TBUF r_text_prmpt_number {buf = qtn_div_prmpt_number;} +RESOURCE TBUF r_invalid_number {buf = text_invalid_number;} + +//----------------------------------------------------------------------------- +// +// r_data_query +// "To other number"-dialog +// +//----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_data_query + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_SEARCH_BACK; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_DATA_QUERY + { + layout = EPhoneLayout; + control = EDWIN + { + flags = EEikEdwinNoHorizScrolling; + width = 10; + lines = 1; + maxlength = KGSMaxDataLength; + numeric_keymap=EAknEditorStandardNumberModeKeymap; + allowed_input_modes=EAknEditorNumericInputMode; + default_input_mode=EAknEditorNumericInputMode; + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cf_softkeys_search_cancel, own cba for +// search - cancel softkey combination +// +//---------------------------------------------------- +// +RESOURCE CBA r_cf_softkeys_search_cancel + { + buttons = + { + CBA_BUTTON{id=EAknSoftkeySearch; txt=text_softkey_search; }, + CBA_BUTTON{id=EAknSoftkeyCancel; txt=text_softkey_cancel; }, + CBA_BUTTON{id=EAknSoftkeySearch; txt=text_softkey_search; } + }; + } + + +RESOURCE TBUF r_qtn_ss_divert_to_video_mailbox + { + buf = qtn_ss_divert_to_video_mailbox; + } + +RESOURCE TBUF r_qtn_ss_divert_vcall_to_other_number + { + buf = qtn_ss_divert_vcall_to_other_number; + } + +//MSK Labels and Resources + +//---------------------------------------------------- +// +// r_call_divert_msk_contextmenubar +// Options menu with 'Open'. +// Context Menu Options for MSK key handling +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_call_divert_msk_contextmenubar + { + titles = + { + MENU_TITLE {menu_pane = r_cf_msk_div_view_menu;} + }; + } + + +//---------------------------------------------------- +// +// r_cf_msk_div_view_menu +// Menu pane for Context Options. +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_cf_msk_div_view_menu + { + items = + { + MENU_ITEM + { + command = ECFCmdActivate; + txt = text_activate_divert; + }, + MENU_ITEM + { + command = ECFCmdCancel; + txt = text_cancel_divert; + }, + MENU_ITEM + { + command = ECFCmdCheckStatus; + txt = text_check_status; + } + }; + } + +//---------------------------------------------------- +// +// r_call_divert_contact_selection_interest +// Contact selection interest. +// +//---------------------------------------------------- +RESOURCE AIW_INTEREST r_call_divert_contact_selection_interest + { + items= + { + AIW_CRITERIA_ITEM + { + id = KAiwCmdSelect; // serviceCmd used here also as ID + serviceCmd = KAiwCmdSelect; + contentType = EGenericParamContactLinkArrayStr; + serviceClass = KAiwClassBase; + maxProviders = 1; + } + }; + } + + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/GSCallDivertPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/GSCallDivertPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSCallDivertPlugin project file. +* +*/ + +#include // For RESOURCE_FILES_DIR + +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gscalldivertplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x102824A3 +VENDORID VID_DEFAULT + +SOURCEPATH Src // /GSTelPlugin +SOURCE GSCallDivertPluginImplementationTable.cpp +SOURCE GSLocalBaseView.cpp +SOURCE GSRestrictedDivertContainer.cpp +SOURCE GSCallDivertPluginContainer.cpp +SOURCE GSCallDivertPlugin.cpp +SOURCE GSCallDivertContainer.cpp +SOURCE GSCallDivertView.cpp +SOURCE GSCallDivertModel.cpp + +//SOURCE GSTelPlugin.cpp +//SOURCE GSTelPluginContainer.cpp +//SOURCE GSTelPluginModel.cpp + +SOURCE GSCallDivertQuery.cpp + +//User include paths +USERINCLUDE Inc +USERINCLUDE Data // For *.rh +USERINCLUDE loc +USERINCLUDE ../Data +USERINCLUDE ../Logger +USERINCLUDE ../GSTelPlugin/Inc + +// The above include is required becasue of secuicodequerydialog.h + +//System include paths +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/cshelp +// Default system include paths for middleware layer modules. +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH Data + +START RESOURCE 102824A3.rss +TARGET gscalldivertplugin.rsc +END + +START RESOURCE GSCallDivertPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +LIBRARY aknskins.lib // for enhanced skinning +LIBRARY aknskinsrv.lib // for enhanced skinning +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY centralrepository.lib +LIBRARY cenrepnotifhandler.lib +LIBRARY commonengine.lib // For RConeResourceLoader +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY eikctl.lib +LIBRARY etelmm.lib // security, network, call +LIBRARY euser.lib +LIBRARY featmgr.lib // Feature manager +LIBRARY gsecomplugin.lib +LIBRARY gsframework.lib // For base classes +LIBRARY gslistbox.lib // For CGSListBoxItemTextArray +LIBRARY pbkeng.lib +LIBRARY pbkview.lib +LIBRARY phoneclient.lib // handle phonenumbers +LIBRARY phonesettings.lib +LIBRARY psui.lib // phone settings notes UI +LIBRARY sssettings.lib // Supplementary settings +LIBRARY numbergrouping.lib +LIBRARY flogger.lib // For GSLogger + +LIBRARY aknnotify.lib // for CAknGlobalNote.h +LIBRARY hlplch.lib // for "Help" options menu +LIBRARY eikdlg.lib // eikon dialogs +LIBRARY apgrfx.lib +LIBRARY servicehandler.lib // AIW + +LIBRARY vpbkeng.lib // Phonebook2 +LIBRARY pbk2presentation.lib // Phonebook2 + +SOURCEPATH Data +DOCUMENT 102824A3.rss +DOCUMENT GSCallDivertPluginRsc.rss + + +// End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Inc/CallDivertPlugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/CallDivertPlugin.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains definition of constants used in CallDivertPlugin. +* +*/ + +#ifndef GSCALLDIVERTPLUGIN_HRH +#define GSCALLDIVERTPLUGIN_HRH + +// Data query max length +#ifndef KGSMaxDataLength + #define KGSMaxDataLength 21 +#endif + +/** +* Main view is actually a selection list of three basic service groups which +* are wanted to be configured: +* - Voice calls §qtn_div_voice_calls§ , +* - Data and video calls §qtn_div_data_video_calls§ if the Video telephone is +* supported, otherwise Data calls §qtn_div_data_calls§ , and +* - Fax calls §qtn_div_fax_calls§ +* When the user selects one of these, control moves to its basic service group +* Divert service view, see ? 4.2.1.1 Divert setting service views. +*/ +enum TGSCallDivertServiceGroups + { + EGSSettIdVoiceDivert, + EGSSettIdVideoDivert + }; + +/** +* Each basic service group has the same five call forwarding service items in +* their own views. All three views are specified in this Section, and are +* called accordingly as Div_voi, Div_dat, and Div_fax views when a reference is +* needed. +*/ +enum TGSCallDivertServices + { + ECFDivertVoiceCalls = 0, + ECFDivertVideoCalls, + ECFDivertWhenBusy, + ECFDivertWhenNoAnswer, + ECFDivertWhenOutOfReach, + ECFDivertWhenNotAvailable + }; + +/** +* Divert settings view’s options menu has the following functions: +* - Activate §text_activate_divert§ starts an activation "process" before the service request is sent to the network for a currently focused service. I.e. for the voice calls in case of first five items, further specification in ? 4.3.1.1 For voice calls, and in Fax and Data cases see ? 4.3.1.2 For data and video calls. This option belongs to the context specific options menu list. +* - Cancel §text_cancel_divert§ deactivates a currently focused service, i.e. deactivates only those basic services which are activated with the Activate function, see more in ? 4.3.2 Deactivation. This option belongs to the context specific options menu list. +* - Check status §text_check_status§ asks the status of the focused service from the network, i.e. interrogations only those basic services which are activated with the Activate function, see more in ? 4.3.3 Status checking. For composite conditional service If not available this function is not available. This option belongs to the context specific options menu list. +* - Help §qtn_options_help§ opens a context sensitive help (ref. ? |18| ) with help IDs [DIV_HLP_CALL_FORW_VOI] for the Div_voi view, [DIV_HLP_CALL_FORW_DAT] for the Div_dat view, and [DIV_HLP_CALL_FORW_FAX] for the Div_fax view. +* - Exit §qtn_options_exit§ . Closes the Control Panel application (ref. ? |3| ) +* I.e. with functions Cancel and Check status service request is sent immediately without any additional queries. +* +*/ +enum TGSCallDivertFunctions + { + ECFCmdActivate = 5001, + ECFCmdCancel, + ECFCmdCheckStatus, + ECFCmdCancelAll + }; + +#endif // GSCALLDIVERTPLUGIN_HRH + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for Call Divert view. +* +*/ + + +#ifndef GSCALLDIVERTCONTAINER_H +#define GSCALLDIVERTCONTAINER_H + +// INCLUDES +#include "gsbasecontainer.h" +#include "CallDivertPlugin.hrh" + +// FORWARD DECLARATION +class CGSListBoxItemTextArray; + +// CLASS DECLARATION +/** +* GSCallDivertContainer container class +*/ +class CGSCallDivertContainer : public CGSBaseContainer + { + public: // Constructors and destructor + + /** + * Symbian OS default constructor. + * + * @param aRect gives the size of container + */ + void ConstructL( const TRect& aRect ); + + /* Destructor */ + ~CGSCallDivertContainer(); + + /* Constructor */ + CGSCallDivertContainer( TGSCallDivertServiceGroups aItemId ); + + public: + /** + * Retrieves the feature id for the selected item in the listbox + * @return listbox item array's current feature. + */ + TInt CurrentFeatureId() const; + + private: + + void GetHelpContext( TCoeHelpContext& aContext ) const; + + /* Updates listbox + * @param aItemId + */ + void UpdateListBoxL( TInt aItemId ); + + /* Creates listbox + * @param aResLbxId + */ + void ConstructListBoxL( TInt aResLbxId ); + + /* Sets title to container */ + void SetTitleL(); + + void CreateListBoxItemsL(); + + private: //new + void MakeAllVoiceCallDivertsItemL(); + void MakeAllVideoCallDivertsItemL(); + void MakeIfBusyItemL(); + void MakeIfNotAnsweredItemL(); + void MakeIfOutOfReachItemL(); + void MakeIfNotAvailableItemL(); + + private: + // listbox item array + CGSListBoxItemTextArray* iListboxItemArray; + //variable to store the main view selection + TGSCallDivertServiceGroups iItemId; + + }; + +#endif //GSCALLDIVERTCONTAINER_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertModel.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,224 @@ +/* +* 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: Model for call divert functionality. Tries to encapsulate +* most of hw/engine related functionality from UI components. +* +*/ + +#ifndef CGSCALLDIVERTMODEL_H_ +#define CGSCALLDIVERTMODEL_H_ + + +#include +#include "CallDivertPlugin.hrh" + +#include +#include +#include + + +// Forward declarations: +class CPsetCallDiverting; +class CPsetContainer; +class CPsuiContainer; +class CPsuiDivertObs; +class CPhCltUssd; +class RSSSettings; +class CPbkContactEngine; +class CGSCallDivertView; +class CRepository; + +class CGSCallDivertModel : public CBase + { + public: + + /** + * Symbian OS two-phase Constructor + * @return + */ + static CGSCallDivertModel* NewL ( ); + + /** + * Destructor + */ + virtual ~CGSCallDivertModel ( ); + + public: // Functions + + /** + * Send call divert request. + * @param aCallDivertSetting Data used for call divert. + * @param aInfo Defines the precise action. + * @param aVmbxDivert ETrue if voice mailbox is used as divert number. + * @param aCommand This is for CancelAll command. + */ + void SendCallDivertRequestL( + TCallDivertSetting& aCallDivertSetting, + RMobilePhone::TMobilePhoneServiceAction aInfo, + TBool& aVmbxDivert, + TInt aCommand, + TGSCallDivertServices aService ); + + /** + * Handles attempts to divert to voicemail box. + * @param aTelNumber telephone number of the voicemail box + * @return KErrNone on success, otherwise KErrCancel + */ + TInt VoiceMailActivationL( TDes& aTelNumber ); + + /** + * Handles attempts to divert to videomail box. + * @param aTelNumber telephone number of the videomail box + * @return KErrNone on success, otherwise KErrCancel + */ + TInt VideoMailActivationL( TDes& aTelNumber ); + + /** + * Handles attempts to check divert status in restricted + * mode (KFeatureIdRestrictedCallDivert). + */ + void CheckStatusRestrictedCallDivertL(); + + /** + * Handles attempts to cancel call divert restricted + * mode (KFeatureIdRestrictedCallDivert). + */ + void CancelRestrictedCallDivertL(); + + /** + * Returns the contact name matching the number, or the number if + * no contact name is found. + * Pushes the found (i.e. returned) name into CleanupStack. + * @param aTelNum number on which to base the fetch. + * @return Pointer to contact name + */ + HBufC* MatchNumberToContactLC( const TDesC& aTelNum ); + + /** + * @ return Reference to divert handling engine. Does NOT transfer + * ownership. + */ + CPsetCallDiverting* DivertHandler(); + + /** + * @param aView Reference to call divert view. Does NOT transfer + * ownership. + */ + void SetDivertView( CGSCallDivertView* aDivertView ); + + /** + * @return Currently selected divert service group. + */ + TGSCallDivertServiceGroups DivertServiceGroup(); + + /** + * Sets new divert service group. Voice/Data/Fax... + * See TGSCallDivertServiceGroups + * @param aDivertServiceGroup New divert service group. + */ + void SetDivertServiceGroup( + TGSCallDivertServiceGroups aDivertServiceGroup ); + + /** + * Checks number grouping feature from central repository. + * @return ETrue - Feature supported. + * EFalse - Feature not supported. + */ + TBool NumberGroupingSupportedL(); + + private: // Functions + + /** + * Symbian OS default constructor + */ + void ConstructL ( ); + + /** + * C++ Constructor + */ + CGSCallDivertModel ( ); + + /** + * Handles attempts to activate call divert in restricted + * mode (KFeatureIdRestrictedCallDivert). + */ + void ActivateRestrictedCallDivertL( TTelNumber& aDivertNumber ); + + /** + * Sets parameters for calling Phone Settings' method. + */ + void SetDivertParametersL( TCallDivertSetting& aDivert, + TBasicServiceGroups& aBsc, + TGSCallDivertServices aService, + TGSCallDivertServiceGroups aServiceGroup ); + + /** + * Uses the phonesettings-module. + * + * @param aDivert gives required information such as number, + * timervalue, status etc + * @param aInfo defines the precise action + * @param aVmbxValidNumber divert is to a voicemail box number + * @param aCommand this is for CancelAll command + */ + void EngineOperatorL( TCallDivertSetting& aDivert, + const RMobilePhone::TMobilePhoneServiceAction & aInfo, + TBool& aVmbxValidNumber, + TInt aCommand, + TGSCallDivertServices aService, + TGSCallDivertServiceGroups aServiceGroup ); + + /** + * Removes special chars ('*','+','p','w' and '#') from VMBX number. + */ + static void RemoveSpecialChar( + TDes& aVmbxNumber, + const TDesC& aSpecChar ); + + + private: // Member variables + + // Selected call divert group. Selected from the main view. Value is + // stored here as is accessed by several components. + TGSCallDivertServiceGroups iDivertServiceGroup; + + // PhoneSettings engine object for diverts + CPsetCallDiverting* iForward; + + // PhoneSettings container + CPsetContainer* iSettings; + + // PSUI container + CPsuiContainer* iObsContainer; + + // Shows PSUI notes + CPsuiDivertObs* iCfObserver; + + // Sending with notes + CPhCltUssd* iBasicClient; + + // For fetching line in use info + RSSSettings* iSsSettings; + + // Contact engine for retrieving contact numbers + CPbkContactEngine* iContactEngine; + + // Reference to call divert view. NOT owned. + CGSCallDivertView* iDivertView; + + // Repository for number grouping run time variation. + CRepository* iNumberGroupingRepository; + }; + +#endif /*CGSCALLDIVERTMODEL_H_*/ diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,172 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View handling for Call Divert. +* +*/ + + +#ifndef CFVIEW_H +#define CFVIEW_H + +// INCLUDES +#include "CallDivertPlugin.hrh" + +#include +#include +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CGSCallDivertPluginContainer; +class CGSCallDivertView; +class CPsetCustomerServiceProfile; +class CGSCallDivertModel; + +// CONSTANTS +_LIT( KGSCallDivertPluginIconDirAndName, "z:GSCallDivertPlugin.mbm"); + +// CLASS DECLARATION + +/** +* CGSCallDivertPlugin view class +*/ +class CGSCallDivertPlugin : public CGSBaseView, + public MGSSettingPSObserver + { + public: // Constructors and destructor + + /* Symbian OS default constructor */ + void ConstructL(); + + /* Destructor */ + ~CGSCallDivertPlugin(); + + + /* Symbian OS two-phase Constructor + * + * @return pointer to CGSCallDivertPlugin object + */ + static CGSCallDivertPlugin* NewLC(); + + /* C++ Constructor */ + CGSCallDivertPlugin(); + + /** + * Symbian OS two-phased constructor + * @return GS connection view. + */ + static CGSCallDivertPlugin* NewL( TAny* aInitParams ); + + + public: // functions from base class CAknView + + /** + * From CAknView, gives the id of the view. + * + * @return Returns the TUid of the view. + */ + TUid Id() const; + + /** + * From MEikCommandObserver, handles the commands. + * + * @param aCommand identifies the command given. + */ + void HandleCommandL( TInt aCommand ); + + public: // From CGSPluginInterface + + /** + * @see CGSPluginInterface header file. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * @see CGSPluginInterface header file. + */ + TInt PluginProviderCategory() const; + + /** + * @see CGSPluginInterface header file. + */ + TBool Visible() const; + + protected: // From MEikMenuObserver + + /** + * + */ + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + + public: //new + + /** + * Updates listbox's item's value. + * @param aItemId An item which is updated. + * + */ + void UpdateListBox( TInt aItemId ); + + void SetCSPActiveL( TBool aValue ); + + private: // from base class CGSBaseView + + /* From CAknView, activates the view. */ + void DoActivateL( + const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ); + + /* From CAknView, deactivates the view. */ + void DoDeactivate(); + + void NewContainerL(); + + private: // from CGSBaseView + + void HandleListBoxSelectionL(); + + //Retrieves container pointer. + CGSCallDivertPluginContainer* Container(); + + private: // From MGSSettingPSObserver + /** + * Callback from MGSSettingPSObserver + */ + void HandleNotifyPSL( const TUid aUid, const TInt& aKey, + const TRequestStatus& aStatus ); + + private: + + // Local view of call diverts. + CGSCallDivertView* iCallDivertView; + // PubSub object for BT SAP state. + CGSPubSubsListener* iBtSapListener; + // Check if CSP is active. + CPsetCustomerServiceProfile* iCSP; + + // Model for call diverts. + CGSCallDivertModel* iCallDivertModel; + }; + +#endif +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertPluginContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertPluginContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for Call Divert Plugin. +* +*/ + + +#ifndef GSDIVERTPLUGINCONTAINER_H +#define GSDIVERTPLUGINCONTAINER_H + +// INCLUDES +#include "gsbasecontainer.h" + +// CLASS DECLARATION +class CGSListBoxItemTextArray; + +// CLASS DECLARATION +/** +* CGSCallDivertPluginContainer container class +*/ +class CGSCallDivertPluginContainer : public CGSBaseContainer + { + public: // Constructors and destructor + + /** + * Symbian OS default constructor. + * + * @param aRect gives the size of container + */ + void ConstructL( const TRect& aRect ); + + /** Destructor */ + ~CGSCallDivertPluginContainer(); + + private: + + void GetHelpContext( TCoeHelpContext& aContext ) const; + + public: + /** + * Updates the listbox items + * @param aFeatureId: selected listbox item ID + */ + void UpdateListBoxL( TInt aFeatureId ); + + /** + * Retrieves the feature id for the selected item in the listbox + * @return listbox item array's current feature. + */ + TGSCallDivertServiceGroups CurrentFeatureId() const; + + + protected: + /* Creates listbox + * @param aResLbxId + */ + void ConstructListBoxL( TInt aResLbxId ); + + private: // Functions + void MakeVoiceDivertsItemL(); + void MakeVideoDivertsItemL(); + + private: // Member variables + CGSListBoxItemTextArray* iListboxItemArray; + + }; + +#endif // GSDIVERTPLUGINCONTAINER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertQuery.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertQuery.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Data query dialog for Call Divert view. +* +*/ + + +#ifndef GSCALLDIVERTQUERY_H +#define GSCALLDIVERTQUERY_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* GSCallDivertQuery is responsible for creating a data query dialog. +* This class basicly just switches the active softkeys. +*/ +class CGSCallDivertQuery : public CAknTextQueryDialog + { + public: // Constructors and destructor + + /* Two-phased constructor */ + static CGSCallDivertQuery* NewL( TDes& aDataText, + const TTone& aTone, + TInt aOKCba, + TInt aDefaultCba ); + + /* Destructor */ + ~CGSCallDivertQuery() {}; + + public: // Functions from base class + + /** + * From CAknQueryDialog, takes care of user input. + * @param aKeyEvent which event + * @param aType type of event + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * From CAknQueryDialog, takes care of user input. + * @param aKeyEvent which event + * @return boolean + */ + TBool NeedToDismissQueryL( const TKeyEvent& aKeyEvent ); + + /** + * From CEikDialog, called after layout. + */ + void PostLayoutDynInitL(); + + /** + * From CEikDialog, called before layout. + */ + void PreLayoutDynInitL(); + + /** + * From CEikdialog, check if it is OK to exit. + * @param aButtonId id of pressed button + */ + TBool OkToExitL( TInt aButtonId ); + + /** + * From CAknQueryDialog. Used to update data after stylus event. + */ + TBool HandleQueryEditorStateEventL( CAknQueryControl* aQueryControl, + TQueryControlEvent aEventType, + TQueryValidationStatus aStatus ); + + private: + /* C++ default constructor */ + CGSCallDivertQuery( TDes& aDataText, + const TTone& aTone, + TInt aOKCba, + TInt aDefaultCba ); + + /** + * Updates softkeys to Search-Cancel if required. + */ + void UpdateSoftkeysL(); + + /** + * Changes softkeys as specified. + * + * @param aCba new cba + */ + void SetCbaL( TInt aCba ); + + private: + // OK cba, used when there is text in query. + TInt iOKCba; + // Default cba, used when there is no text in query. + const TInt iDefaultCba; + // Current cba. + TInt iCurrentCba; + // About to exit the Query + TInt iLeaving; + }; + +#endif +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertView.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,374 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View handling for Call Divert. +* +*/ + + +#ifndef CFCALLDIVERTVIEW_H +#define CFCALLDIVERTVIEW_H + +// INCLUDES +#include "GSLocalBaseView.h" +#include "CallDivertPlugin.hrh" + +#include +#include +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CAiwServiceHandler; +class CGSCallDivertModel; +class CGSCallDivertPluginContainer; +class CGSCallDivertQuery; +class CVPbkContactLinkArray; +class CVPbkContactManager; +class MVPbkContactLink; + + +// CLASS DECLARATION + +/** +* CGSCallDivertView view class. +*/ +class CGSCallDivertView : public CGSLocalBaseView, + public MAiwNotifyCallback, + public MVPbkSingleContactOperationObserver, + public MVPbkContactStoreListObserver + { + public: // Constructors and destructor + + /** + * Symbian OS default constructor + */ + void ConstructL(); + + /** + * Destructor + */ + ~CGSCallDivertView(); + + + /** + * Symbian OS two-phase Constructor + * @return pointer to CGSCallDivertView object + */ + static CGSCallDivertView* NewLC( CGSCallDivertModel* aModel ); + + + + public: // Functions from base class CAknView + + /* C++ Constructor */ + CGSCallDivertView( CGSCallDivertModel* aModel ); + + /** + * From CAknView, gives the id of the view. + * + * @return Returns the TUid of the view. + */ + TUid Id() const; + + /** + * From MEikCommandObserver, handles the commands. + * + * @param aCommand identifies the command given. + */ + void HandleCommandL( TInt aCommand ); + /** + * From MEikCommandObserver, handles the commands. + * + * @param aCommand identifies the command given. + */ + void ProcessCommandL( TInt aCommand ); + + public: // MAiwNotifyCallback + + /** + * From MAiwNotifyCallback. Handles notifications caused by an + * asynchronous Execute*CmdL call or an event. + * + * @param aCmdId The service command associated to the event. + * @param aEventId Occured event, see AiwCommon.hrh. + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL. + * @return Error code for the callback. + */ + TInt HandleNotifyL( + TInt aCmdId, + TInt aEventId, + CAiwGenericParamList& aEventParamList, + const CAiwGenericParamList& aInParamList); + + public: // From MVPbkSingleContactOperationObserver + + /** + * This is called when user has selected a contact from pbk2 + * contacts-dialog. + * @param aOperation pbk2 related operation. Not used here. + * @param aContact Selected contact data. + */ + void VPbkSingleContactOperationComplete( + MVPbkContactOperationBase& aOperation, + MVPbkStoreContact* aContact ); + /** + * See MVPbkSingleContactOperationObserver. + */ + void VPbkSingleContactOperationFailed( + MVPbkContactOperationBase& aOperation, + TInt aError ); + + public: // From MVPbkContactStoreListObserver + + /** + * See MVPbkContactStoreListObserver. + */ + void OpenComplete(); + + /** + * See MVPbkContactStoreListObserver. + */ + void StoreReady( MVPbkContactStore& aContactStore ); + + /** + * See MVPbkContactStoreListObserver. + */ + void StoreUnavailable( MVPbkContactStore& aContactStore, + TInt aReason ); + + /** + * See MVPbkContactStoreListObserver. + */ + void HandleStoreEventL( MVPbkContactStore& aContactStore, + TVPbkContactStoreEvent aStoreEvent ); + + public: // New + + /** + * Creates time list to be used in "not available" cf service. + * @return Returns user keypress of the list + */ + TInt CreateTimeListL(); + + private: // From base class CGSBaseView + + /** + * See CGSBaseView. + */ + void NewContainerL(); + + /** + * See CGSBaseView. + */ + void HandleListBoxSelectionL(); + + private: //new + + /** + * Executes divert query dialog. + * --> voice calls -> all voice calls -> activate -> this popup. + * OR + * --> data calls -> all data calls -> activate -> this popup. + * + * @param aTelNumber user selected existing divert-to number + * @param aTitle gives title to the list + * @param aVmbxValidNumber divert is to a voicemail box number + * @return Returns TTelnumber to be the target for operation. + */ + void ExecuteDivertQueryL( TTelNumber& aTelNumber, + const TPtrC& aTitle, + TBool& aVmbxValidNumber ); + + /** + * Displays a query for divert number. Used for all divert types: + * - voice + * - data + * - fax + * diverts. + * + * @param aValue text in the editor + * @param aType Dataquery resource ID text + * @return Returns the number. + */ + void ExecuteDivertNumberQueryL( TDes& aValue, TInt aType ); + + /** + * Single item fetch from the phonebook + * @param aNumber fetched phonenumber + */ + void StartAsyncPhoneNumberFetchL( /*TDes& aNumber*/ ); + + + /** + * Checks if the user given telephone number contain + * illegal ('#', 'p', 'w', ...) characters + * + * @param aDivertTo user given telephone number + */ + static TInt ValidatePhoneNumberL( const TDesC& aDivertTo ); + + /** + * Appends to array a delay time in steps of five (5,10,15,...). + * Delay time is figured out by multiplying index by five. + * + * @param aArrayToAppend + * @param aIndex + */ + void AppendDelayItemL( CDesCArrayFlat& aArrayToAppend, TInt aIndex ); + + + /** + * Seeks '+' from given number. + * @param aDivertTo the number checked for + * @return Either KErrNone (no plus) or KCFErrIllegalNumber. + */ + static TInt FindPlus( const TDesC& aDivertTo ); + + /** + * Sets prompt text to a query. + */ + void SetPromptToQueryL( CGSCallDivertQuery& aQuery, + const TInt& aType ); + + /** + * Creates items for Delay time list + */ + void CreateDelayTimeItemsL( CDesCArrayFlat& aItems ); + + /** + * Creates items for Delay time list for restricted call divert + */ + void CreateRestrictedCallDivertDelayTimeItemsL( CDesCArrayFlat& aItems ); + + /** + * Displays invalid number note. + */ + static void ShowErrorNoteL(); + + /** + * Updates most recently used voice divert numbers to cenrep + * + * @param aItems array in which all items are + * @param aNumber telNumber to be updated + */ + void UpdateDefaultVoiceDivertNumbersL( TDes& aNumber ); + + /** + * Reads 3 previously used voice divert numbers. + * + * @param aItems array in which the items are put into + * @param aDefaultNumbers array from which default items are read + */ + void ReadDefaultVoiceDivertNumbersL( CDesCArray& aItems, + CDesC16ArrayFlat& aDefaultNumbers ); + + /** + * Creates items for the target list ('To voicemailbox', ...) + * + * @param aItems array in which the items are put into + * @param aDefaultNumbers array from which default items are read + */ + void CreateVoiceDivertItemsL( CDesCArray& aItems, + CDesC16ArrayFlat& aDefaultNumbers ); + + /** + * Creates items for the target list ('To voicemailbox', ...) + * + * @param aItems array in which the items are put into + */ + void CreateVideoDivertItemsL( CDesCArray& aItems ); + + /** + * Handles users selection from Target menu + */ + TTelNumber HandleVoiceDivertSelectionL( + CAknSinglePopupMenuStyleListBox& aList, + CDesC16ArrayFlat& aDefNumbers, + TBool& aVmbxDivert ); + + /** + * Handles users selection from Target menu + */ + TTelNumber HandleVideoDivertSelectionL( + CAknSinglePopupMenuStyleListBox& aList ); + + /** + * Displays data call number query and activates data divert + * @param aTelNumber Phone number for call divert + */ + void DisplayDataCallDivertNumberQueryL( TTelNumber& aTelNumber ); + + /** + * Remove invalid " ", "()" which were sync with PC suite. + * Make sure the call divert behavior is the same as user making a phone call. + * Illegal ('#', 'p', 'w', ...) characters are handled in ValidatePhoneNumberL(). + * @param aNumber Phone number for call divert + * @param aInvalidChars the invalid chars to remove + */ + void RemoveInvalidChars( TDes& aNumber ); + + private: + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + private: + // Has selection key been pressed + TBool iRockerPress; + + // Array of setting item titles + CDesCArray* iTitles; + + /** + * Member variables related to AIW service handler used by pbk2 contact + * selection functionality. Former functionality was synchronous dialog + * based but pbk2 framework required refactoring this to asynchronous. + * As a result a bucket load of observers and functionality otherwise + * unused is needed here. Basically the call divert plugin is now + * changed into a state machine because of pbk2 requirement. + */ + // AIW service for pbk2. + CAiwServiceHandler* iServiceHandler; + // Handles contact stores. + CVPbkContactManager* iContactManager; + // Pointer to both a contact and a contact field + CVPbkContactLinkArray* iContactLinks; + // Pbk stores are opened. + TBool iStoresOpened; + // Stores pbk2 operations. + MVPbkContactOperationBase* iRetrieveOperation; + // Used pbk2 number query which is asynchronously. + TBool iNumberFetchedAsynchronously; + + + // Call divert request is for voice mailbox. + TBool iVoiceMailboxDivert; + + //Context menu items for call forwarding + CDesCArrayFlat* iContextMenuItems; + + // Reference to call divert model. NOT owned. + CGSCallDivertModel* iModel; + TBool iVideoMailboxSupported; + + }; + + + +#endif //CFCALLDIVERTVIEW_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSLocalBaseView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSLocalBaseView.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base vew in GSTelPlugin. +* +*/ + + +#ifndef GSLOCALBASEVIEW_H +#define GSLOCALBASEVIEW_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class CGSBaseContainer; +class CAknNavigationDecorator; +class CAknViewAppUi; + +// CLASS DECLARATION +/*************************************************** +* CGSLocalBaseView view class * +***************************************************/ +class CGSLocalBaseView : public CAknView, + public MEikListBoxObserver + { + public: + // Panic code used in this class + enum KGSViewPanicCodes + { + EGSViewPanicNullPtr = 1 + }; + + public: // Constructors and destructor + + /** + * Symbian OS default constructor. + * + */ + virtual void ConstructL()=0; + + /* C++ Constructor */ + CGSLocalBaseView(); + + /** + * Destructor. + */ + ~CGSLocalBaseView(); + + public: + + /** + * This function is used to set the current item in the listbox. + * @param aIndex Current item. Default value is 0 i.e. the first item of the list. + * + */ + virtual void SetCurrentItem( TInt aIndex = 0 ); + + protected: // from CAknView + + /** + * Handles client rect change. + * + */ + void HandleClientRectChange(); + + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + void DoDeactivate(); + + protected: // from MEikListBoxObserver + + /** + * Handles listbox events. + * @param aListBox Listbox where the event occurred. + * @param aEventType Event type. + * + */ + void HandleListBoxEventL( CEikListBox* aListBox, + TListBoxEvent aEventType ); + + protected: //new + + /** + * Sets the correct navi pane for the view (eg. tabs, empty, string etc.) + * + */ + virtual void SetNaviPaneL(); + + /** + * Creates context for view's navi pane. + * @param aResourceId Resource id for navi pane context's resource. + * + */ + virtual void CreateNaviPaneContextL( TInt aResourceId ); + + protected: + // Called by DoActivateL + virtual void NewContainerL() = 0; + virtual void CreateContainerL(); + + private: + + /** + * Handles selection of list box. + * Called by HandleListBoxEventL + */ + virtual void HandleListBoxSelectionL() = 0; + + protected: // Member variables + //Navi pane + CAknNavigationDecorator* iNaviPaneContext; + //Handle to get the view + CAknViewAppUi* iAppUi; + // currently selected listbox item + TInt iCurrentItem; + // first item in the listbox + TInt iTopItemIndex; + // pointer to the container + CGSBaseContainer* iContainer; + }; +//end of file +#endif //GSLOCALBASEVIEW_H diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSRestrictedDivertContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSRestrictedDivertContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for Restricted Call Divert view. +* +*/ + + +#ifndef GSDIVERTRESTRICTEDCONTAINER_H +#define GSDIVERTRESTRICTEDCONTAINER_H + +// INCLUDES +#include "gsbasecontainer.h" + +// CLASS DECLARATION +class CGSListBoxItemTextArray; + +// CLASS DECLARATION +/** +* CGSRestrictedDivertContainer container class +*/ +class CGSRestrictedDivertContainer : public CGSBaseContainer + { + public: // Constructors and destructor + + /** + * Symbian OS default constructor. + * + * @param aRect gives the size of container + */ + void ConstructL( const TRect& aRect ); + + /* Destructor */ + ~CGSRestrictedDivertContainer(); + + private: + + void GetHelpContext( TCoeHelpContext& aContext ) const; + + public: + /** + * Updates the listbox items + * @param aFeatureId: selected listbox item ID + */ + void UpdateListBoxL( TInt aFeatureId ); + + /** + * Retrieves the feature id for the selected item in the listbox + * @return listbox item array's current feature. + */ + TInt CurrentFeatureId() const; + + + protected: + /* Creates listbox + * @param aResLbxId + */ + void ConstructListBoxL( TInt aResLbxId ); + + private: + void CreateListBoxItemsL(); + void MakeRestrictedDivertItemL(); + + private: + CGSListBoxItemTextArray* iListboxItemArray; + + }; + +#endif //GSDIVERTRESTRICTEDCONTAINER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Inc/LocalViewId.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Inc/LocalViewId.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View ID's for all Telephony Plug-in views. +* +*/ + + +#ifndef LOCALVIEWID_H +#define LOCALVIEWID_H + +const TUid KCallDivertPluginId = {0x102824A3}; +const TUid KCallDivertViewId = {85}; + +#endif //LOCALVIEWID_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,224 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for Call Divert's view. +* +*/ + + +// INCLUDE FILES +#include "GSCallDivertContainer.h" +#include "CallDivertPlugin.hrh" + +#include +#include +#include +#include // for help context of Divert +#include // for KUidGS + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSCallDivertContainer::CGSCallDivertContainer +// +// C++ constructor +// --------------------------------------------------------------------------- +CGSCallDivertContainer::CGSCallDivertContainer( TGSCallDivertServiceGroups aItemId ) + : iItemId( aItemId ) + { + } + +// --------------------------------------------------------------------------- +// CGSCallDivertContainer::ConstructL +// +// Symbian OS two phased constructor +// --------------------------------------------------------------------------- +void CGSCallDivertContainer::ConstructL( const TRect& aRect ) + { + iListBox = new ( ELeave ) CAknSettingStyleListBox; + switch( iItemId ) + { + case EGSSettIdVoiceDivert: + BaseConstructL( aRect, R_CF_VOICE_VIEW_TITLE, R_CF_DIV_LBX ); + break; + case EGSSettIdVideoDivert: + BaseConstructL( aRect, R_CF_VIDEO_VIEW_TITLE, R_CF_DIV_LBX ); + break; + default: + break; + } + + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertContainer::~CGSCallDivertContainer +// +// Destructor +// --------------------------------------------------------------------------- +CGSCallDivertContainer::~CGSCallDivertContainer() + { + if ( iListboxItemArray ) + { + delete iListboxItemArray; + } + } + +// --------------------------------------------------------------------------- +// CGSCallDivertContainer::GetHelpContext +// +// This function is called when Help application is launched. +// Only available, when __SERIES60_HELP is defined. +// --------------------------------------------------------------------------- +void CGSCallDivertContainer::GetHelpContext( + TCoeHelpContext& aContext ) const + { + aContext.iMajor = KUidGS; + + switch( iItemId ) + { + case EGSSettIdVoiceDivert: + aContext.iContext = KDIV_HLP_CALL_FORW_VOI; + break; + case EGSSettIdVideoDivert: + aContext.iContext = KDIV_HLP_CALL_FORW_DAT; + break; + default: + break; + } + } + +// --------------------------------------------------------------------------- +// CGSCallDivertContainer::ConstructListBoxL +// Creates list box from resources. +// +// --------------------------------------------------------------------------- +// +void CGSCallDivertContainer::ConstructListBoxL( TInt aResLbxId ) + { + iListBox->ConstructL(this, EAknListBoxSelectionList); + + iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, + *iListBox, *iCoeEnv ); + iListBox->Model()->SetItemTextArray( iListboxItemArray ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + CreateListBoxItemsL(); + } + +// --------------------------------------------------------------------------- +// CGSCallDivertContainer::CreateListBoxItemsL +// +// Creates List box items +// --------------------------------------------------------------------------- +void CGSCallDivertContainer::CreateListBoxItemsL() + { + if ( iItemId == EGSSettIdVoiceDivert ) + { + MakeAllVoiceCallDivertsItemL(); + } + else if ( iItemId == EGSSettIdVideoDivert ) + { + MakeAllVideoCallDivertsItemL(); + } + + MakeIfBusyItemL(); + MakeIfNotAnsweredItemL(); + MakeIfOutOfReachItemL(); + MakeIfNotAvailableItemL(); + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertContainer::MakeAllVoiceCallDivertsItemL +// +// Create voice call diverts item +// --------------------------------------------------------------------------- +void CGSCallDivertContainer::MakeAllVoiceCallDivertsItemL() + { + iListboxItemArray->SetItemVisibilityL( ECFDivertVoiceCalls, + CGSListBoxItemTextArray::EVisible ); + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertContainer::MakeAllVideoCallDivertsItemL +// +// Create data & video call diverts item +// --------------------------------------------------------------------------- +void CGSCallDivertContainer::MakeAllVideoCallDivertsItemL() + { + iListboxItemArray->SetItemVisibilityL( ECFDivertVideoCalls, + CGSListBoxItemTextArray::EVisible ); + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertContainer::MakeAllVoiceCallDivertsItemL +// +// Create if_busy item +// --------------------------------------------------------------------------- +void CGSCallDivertContainer::MakeIfBusyItemL() + { + iListboxItemArray->SetItemVisibilityL( ECFDivertWhenBusy, + CGSListBoxItemTextArray::EVisible ); + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertContainer::MakeAllVoiceCallDivertsItemL +// +// Create if_not_answered item +// --------------------------------------------------------------------------- +void CGSCallDivertContainer::MakeIfNotAnsweredItemL() + { + iListboxItemArray->SetItemVisibilityL( ECFDivertWhenNoAnswer, + CGSListBoxItemTextArray::EVisible ); + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertContainer::MakeAllVoiceCallDivertsItemL +// +// Create if_out_of_reach item +// --------------------------------------------------------------------------- +void CGSCallDivertContainer::MakeIfOutOfReachItemL() + { + iListboxItemArray->SetItemVisibilityL( ECFDivertWhenOutOfReach, + CGSListBoxItemTextArray::EVisible ); + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertContainer::MakeIfNotAvailableItemL +// +// Create if_not_available item +// --------------------------------------------------------------------------- +void CGSCallDivertContainer::MakeIfNotAvailableItemL() + { + iListboxItemArray->SetItemVisibilityL( ECFDivertWhenNotAvailable, + CGSListBoxItemTextArray::EVisible ); + } + +// --------------------------------------------------------------------------- +// CGSCallDivertContainer::CurrentFeatureId +// +// +// --------------------------------------------------------------------------- +TInt CGSCallDivertContainer::CurrentFeatureId() const + { + return iListboxItemArray->CurrentFeature( ); + } + + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertModel.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,598 @@ +/* +* 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: Model for call divert functionality. Tries to encapsulate +* most of hw/engine related functionality from UI components. +* +*/ + + + + +// User includes: +#include "featmgr.h" +#include "GSCallDivertModel.h" +#include "GSCallDivertView.h" +#include "GsLogger.h" +#include "GSPhoneSettingConstants.h" + + +// System includes: +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Constants for restricted call divert +const TInt KMaxLengthSendString = 40; +_LIT( KOne, "1" ); +_LIT( KAsterisk, "*" ); +_LIT( KHashMark, "#" ); +_LIT( KOneHundredTwenty, "120" ); + +// Class neme descriptor for panic descriptions +_LIT( KGSCallDivertModel, "CGSCallDivertModel" ); + + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::CGSCallDivertModel +// --------------------------------------------------------------------------- +CGSCallDivertModel::CGSCallDivertModel() +{ +} + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::NewL +// --------------------------------------------------------------------------- +CGSCallDivertModel* CGSCallDivertModel::NewL() +{ + CGSCallDivertModel* self = new( ELeave ) CGSCallDivertModel; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; +} + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::ConstructL +// --------------------------------------------------------------------------- +void CGSCallDivertModel::ConstructL() +{ + iContactEngine = CPbkContactEngine::NewL(); + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + iBasicClient = CPhCltUssd::NewL(); + } + iSettings = CPsetContainer::NewL(); + iObsContainer = CPsuiContainer::NewL(); + iCfObserver = iObsContainer->CreateCFObsL(); + iForward = iSettings->CreateCFObjectL( *iCfObserver ); + iSsSettings = new (ELeave) RSSSettings; + User::LeaveIfError( iSsSettings->Open() ); +} + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::~CGSCallDivertModel +// --------------------------------------------------------------------------- +CGSCallDivertModel::~CGSCallDivertModel() +{ + // These objects have to be deleted in specific order or otherwise a access + // violation will follow. So, if changing order, be very careful and test + // thoroughly. + delete iContactEngine; + delete iObsContainer; + delete iCfObserver; + delete iForward; + delete iSettings; + if (FeatureManager::FeatureSupported ( KFeatureIdRestrictedCallDivert ) ) + { + delete iBasicClient; + } + if( iSsSettings ) + { + iSsSettings->Close ( ); + delete iSsSettings; + } + if( iNumberGroupingRepository ) + { + delete iNumberGroupingRepository; + iNumberGroupingRepository = NULL; + } +} + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::SendCallDivertRequestL +// --------------------------------------------------------------------------- +void CGSCallDivertModel::SendCallDivertRequestL( + TCallDivertSetting& aCallDivertSetting, + RMobilePhone::TMobilePhoneServiceAction aInfo, + TBool& aVmbxDivert, + TInt aCommand, + TGSCallDivertServices aDivertService ) + { + // Set Delay time if necessary. + TInt retVal = KCFNoNeedToGetTimeValue; + + //User is doing activation + if ( aCallDivertSetting.iSetting == EActivateDiverting ) + { + if ( aCallDivertSetting.iNumber == KNullDesC ) + { + return; //User started to activate, but cancelled. + } + //Delay time needs to be set for no answer, not available. + if ( aDivertService == ECFDivertWhenNoAnswer || + aDivertService == ECFDivertWhenNotAvailable ) + { + retVal = iDivertView->CreateTimeListL(); + } + } + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + // Always ask for duration if it's restricted call divert + retVal = iDivertView->CreateTimeListL(); + } + //Call Phonesettings if all values have been set. + if ( retVal ) + { + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + __GSLOGSTRING( "[CGSCallDivertModel::SendCallDivertRequestL] -- Sending restricted call divert request: --" ); + __GSLOGSTRING1( "[CGSCallDivertModel::SendCallDivertRequestL] aCallDivertSetting.iNumber:%S", &aCallDivertSetting.iNumber ); + __GSLOGSTRING1( "[CGSCallDivertModel::SendCallDivertRequestL] iDivertServiceGroup: %d", iDivertServiceGroup ); + + ActivateRestrictedCallDivertL( aCallDivertSetting.iNumber ); + } + else + { + __GSLOGSTRING( "[CGSCallDivertModel::SendCallDivertRequestL] -- Sending call divert request: --" ); + __GSLOGSTRING1( "[CGSCallDivertModel::SendCallDivertRequestL] aCallDivertSetting.iNumber:%S", &aCallDivertSetting.iNumber ); + __GSLOGSTRING1( "[CGSCallDivertModel::SendCallDivertRequestL] aInfo: %d", aInfo ); + __GSLOGSTRING1( "[CGSCallDivertModel::SendCallDivertRequestL] aVmbxDivert: %d", aVmbxDivert ); + __GSLOGSTRING1( "[CGSCallDivertModel::SendCallDivertRequestL] aCommand: %d", aCommand ); + __GSLOGSTRING1( "[CGSCallDivertModel::SendCallDivertRequestL] aDivertService: %d", aDivertService ); + __GSLOGSTRING1( "[CGSCallDivertModel::SendCallDivertRequestL] iDivertServiceGroup: %d", iDivertServiceGroup ); + + // Make a call to PhoneSettings. + EngineOperatorL( aCallDivertSetting, aInfo, aVmbxDivert, aCommand, aDivertService, iDivertServiceGroup ); + } + } + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::EngineOperatorL +// +// Seems to be a blocking function... +// Handles the engine operating, arguments tell what to call and +// the number if needed. +// --------------------------------------------------------------------------- +void CGSCallDivertModel::EngineOperatorL( + TCallDivertSetting& aDivert, + const RMobilePhone::TMobilePhoneServiceAction& aInfo, + TBool& aVmbxValidNumber, + TInt aCommand, + TGSCallDivertServices aDivertService, + TGSCallDivertServiceGroups aDivertServiceGroup ) + { + __GSLOGSTRING("[CGSCallDivertModel::EngineOperatorL] Start..."); + + TBasicServiceGroups bsc = EAllTeleAndBearer; + aDivert.iNoReplyTimer = 0; + + if ( aCommand == ECFCmdCancelAll ) + { + aDivert.iCondition = EDivertConditionAllCalls; + aDivert.iSetting = EEraseDiverting; + aDivert.iStatus = EDivertingStatusUnknown; + aDivert.iServiceGroup = EServiceGroupAllTeleservices; + aDivert.iNumber.Zero(); + iForward->SetDivertingL( aDivert, bsc ); + + __GSLOGSTRING("[CGSCallDivertModel::EngineOperatorL] ECFCmdCancelAll"); + return; + } + + SetDivertParametersL( aDivert, bsc, aDivertService, aDivertServiceGroup ); + __GSLOGSTRING1("[CGSCallDivertModel::EngineOperatorL] ServiceGroup: %d", bsc); + + switch ( aInfo ) + { + case RMobilePhone::EServiceActionUnspecified: + iForward->GetDivertingStatusL( aDivert.iServiceGroup, + aDivert.iCondition, + bsc ); + break; + case RMobilePhone::EServiceActionActivate: + aDivert.iSetting = EActivateDiverting; + iForward->SetDivertingL( aDivert, bsc, aVmbxValidNumber ); + break; + case RMobilePhone::EServiceActionErase: + aDivert.iSetting = EEraseDiverting; + iForward->SetDivertingL( aDivert, bsc ); + break; + case RMobilePhone::EServiceActionDeactivate: + aDivert.iSetting = ECancelDiverting; + iForward->SetDivertingL( aDivert, bsc ); + break; + case RMobilePhone::EServiceActionRegister: + aDivert.iSetting = ERegisterDiverting; + iForward->SetDivertingL( aDivert, bsc, aVmbxValidNumber ); + break; + default: + Panic ( KGSCallDivertModel, EInvalidDivertAction ); + break; + } + __GSLOGSTRING("[CGSCallDivertModel::EngineOperatorL] End."); + } + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::VoiceMailActivationL +// +// Handles activation attempts to voicemail box. +// --------------------------------------------------------------------------- +TInt CGSCallDivertModel::VoiceMailActivationL( TDes& aTelNumber ) + { + __GSLOGSTRING1("[CGSCallDivertModel::VoiceMailActivationL] aTelNumber: %S", &aTelNumber); + TRAPD( err, iForward->VoiceMailQueryL( aTelNumber ) ); + if ( err ) + { + __GSLOGSTRING1("[CGSCallDivertModel::VoiceMailActivationL] err=%d", err); + // If application is killed via FSW, contact selection query + // returns KLeaveExit. This should propagate to "root" + // application where it reaches the active scheduler loop + // and thus allows proper application exit when the loop exits. + // Therefore propagate the error to caller and do not ignore it. + if ( KLeaveExit == err ) + { + __GSLOGSTRING("[CGSCallDivertModel::VoiceMailActivationL] KLeaveExit"); + User::Leave( err ); + } + return KErrCancel; + } + //Vmbx number can be "invalid" from CF point of view, because they are allowed to + //contain special characters. These must be removed before making a divert to the + //vmbx number. + //E.g. number +35850888#45 becomes +35850888 (end is dropped). + TInt noOfInvalidChars = KCFInvalidChars().Length(); + + for ( TInt index = 0; index < noOfInvalidChars; index++ ) + { + RemoveSpecialChar( aTelNumber, KCFInvalidChars().Mid( index, 1 ) ); + } + __GSLOGSTRING1("[CGSCallDivertModel::VoiceMailActivationL] aTelNumber: %S", &aTelNumber); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::VideoMailActivationL +// +// Handles activation attempts to videomail box. +// --------------------------------------------------------------------------- +TInt CGSCallDivertModel::VideoMailActivationL( TDes& aTelNumber ) + { + __GSLOGSTRING1("[CGSCallDivertModel::VideoMailActivationL] aTelNumber: %S", &aTelNumber); + // Trapped to return KErrCancel in all cases in order to provide same + // behaviour as in VoiceMailActivationL method (Both methods can be used + // in the same manner) + TRAPD( err, iForward->VideoMailQueryL( aTelNumber ) ); + if ( err ) + { + return KErrCancel; + } + //Vmbx number can be "invalid" from CF point of view, because they are allowed to + //contain special characters. These must be removed before making a divert to the + //vmbx number. + //E.g. number +35850888#45 becomes +35850888 (end is dropped). + TInt noOfInvalidChars = KCFInvalidChars().Length(); + TPtrC invalidChars( KCFInvalidChars ); + for ( TInt index = 0; index < noOfInvalidChars; index++ ) + { + RemoveSpecialChar( aTelNumber, TPtrC( &invalidChars[ index ] ) ); + } + __GSLOGSTRING1("[CGSCallDivertModel::VideoMailActivationL] aTelNumber: %S", &aTelNumber); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::ActivateRestrictedCallDivertL +// +// Handles attempts to activate call divert in restricted mode +// --------------------------------------------------------------------------- +void CGSCallDivertModel::ActivateRestrictedCallDivertL( + TTelNumber& aDivertNumber ) + { + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + //Send Number and ringing time to network by using USSD. + HBufC* sendString = HBufC::NewLC( KMaxLengthSendString ); + TPtr ptr = sendString->Des(); + + //Start call forwarding has following syntax: + //*120*SI1*SI2*SI3 # SEND(Start & Set CF number & Set the time (sec.)) + //where: S1 = 1 + //SI2:(CF number) + //SI3: 0 - 120(ringing time (sec.)) + ptr.Append( KAsterisk ); + ptr.Append( KOneHundredTwenty ); + ptr.Append( KAsterisk ); + ptr.Append( KOne ); + ptr.Append( KAsterisk ); + ptr.Append( aDivertNumber ); + ptr.Append( KAsterisk ); + ptr.AppendNum( iForward->GetTimerValueL() ); + ptr.Append( KHashMark ); + + iBasicClient->SendUssd( *sendString ); + CleanupStack::PopAndDestroy( sendString ); + } + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::CheckStatusRestrictedCallDivertL +// +// Handles attempts to check divert status in restricted mode +// --------------------------------------------------------------------------- +void CGSCallDivertModel::CheckStatusRestrictedCallDivertL() + { + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + //Check call forwarding: * # 120*SI1 # SEND + HBufC* sendString = HBufC::NewLC( KMaxLengthSendString ); + TPtr ptr = sendString->Des(); + ptr.Append( KAsterisk ); + ptr.Append( KHashMark ); + ptr.Append( KOneHundredTwenty ); + ptr.Append( KAsterisk ); + ptr.Append( KOne ); + ptr.Append( KHashMark ); + iBasicClient->SendUssd( *sendString ); + CleanupStack::PopAndDestroy( sendString ); + } + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::CancelRestrictedCallDivertL +// +// Handles attempts to cancel call divert in restricted mode +// --------------------------------------------------------------------------- +void CGSCallDivertModel::CancelRestrictedCallDivertL() + { + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + //Cancel call forwarding: # 120*SI1 # SEND + HBufC* sendString = HBufC::NewLC( KMaxLengthSendString ); + TPtr ptr = sendString->Des(); + ptr.Append( KHashMark ); + ptr.Append( KOneHundredTwenty ); + ptr.Append( KAsterisk ); + ptr.Append( KOne ); + ptr.Append( KHashMark ); + iBasicClient->SendUssd( *sendString ); + CleanupStack::PopAndDestroy( sendString ); + } + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::SetDivertParametersL +// +// Sets parameters for EngineOperator function +// --------------------------------------------------------------------------- +void CGSCallDivertModel::SetDivertParametersL( + TCallDivertSetting& aDivert, + TBasicServiceGroups& aBsc, + TGSCallDivertServices aDivertService, + TGSCallDivertServiceGroups aDivertServiceGroup ) + { + aDivert.iStatus = EDivertingStatusUnknown; + //complains for ambiguous definition of EUnknown + //need to correct in PhoneSettings. + aBsc = ( TBasicServiceGroups )-1; + + if ( aDivertServiceGroup == EGSSettIdVoiceDivert ) + { + aDivert.iServiceGroup = EServiceGroupVoice; + } + else + { + aDivert.iServiceGroup = EServiceGroupData; + aBsc = EAllBearer; + } + + switch ( aDivertService ) + { + case ECFDivertVoiceCalls: + { + aDivert.iCondition = EDivertConditionUnconditional; + TInt alsLine = ESSSettingsAlsNotSupported; + TInt alsError = iSsSettings->Get( ESSSettingsAls, alsLine ); + if ( alsLine == ESSSettingsAlsNotSupported || ( alsLine == ESSSettingsAlsPrimary ) ) + { + // Etelephony only activates voice service nothing else or causes + // voice service status request. + aBsc = ETelephony; + } + else // ESSSettingsAlsAlternate + { + // EAltTele only activates alternate service nothing else or causes + // alternate service status request. + aBsc = EAltTele; + } + break; + } + case ECFDivertWhenBusy: + aDivert.iCondition = EDivertConditionBusy; + break; + case ECFDivertWhenNoAnswer: + aDivert.iCondition = EDivertConditionNoReply; + aDivert.iNoReplyTimer = iForward->GetTimerValueL(); + break; + case ECFDivertWhenOutOfReach: + aDivert.iCondition = EDivertConditionNotReachable; + break; + case ECFDivertWhenNotAvailable: + aDivert.iCondition = EDivertConditionAllConditionalCases; + aDivert.iNoReplyTimer = iForward->GetTimerValueL(); + break; + case ECFDivertVideoCalls: + aBsc = EAllBearer; + aDivert.iCondition = EDivertConditionUnconditional; + break; + default: + Panic ( KGSCallDivertModel, EInvalidCurrentItem ); + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::MatchNumberToContactLC +// +// Returns the contact name matching the number, or the number if +// no contact name is found. +// Pushes the found (i.e. returned) name into Cleanupstack. +// @see CContactDatabase::MatchPhoneNumberL(const TDesC&,const TInt) +// --------------------------------------------------------------------------- +HBufC* CGSCallDivertModel::MatchNumberToContactLC( const TDesC& aTelNum ) + { + CContactIdArray* idArray = iContactEngine->MatchPhoneNumberL( + aTelNum, + KCFCharactersToMatch ); + CleanupStack::PushL( idArray ); + HBufC* contactTitle = NULL; + // fill data only if only single match is found + TInt matches = idArray->Count(); + TBool conflict = EFalse; + if ( matches >= KCFSingleContact ) + { + //several matches, have to check that id is the same + if ( matches != KCFSingleContact ) + { + for ( TInt i = 1 ; i < matches ; i++ ) + { + //all have to have same ID + if ( (*idArray)[i] != (*idArray)[0] ) + { + conflict = ETrue; + break; //stop comparing + } + } + } + //Contact names are only shown if single match with same ID. + if ( !conflict ) + { + CPbkContactItem* pbkItem = + iContactEngine->ReadContactLC( ( *idArray )[0] ); + contactTitle = iContactEngine->GetContactTitleL( *pbkItem ); + CleanupStack::PopAndDestroy( pbkItem ); + } + } + CleanupStack::PopAndDestroy( idArray ); + CleanupStack::PushL( contactTitle ); + if( contactTitle ) + { + __GSLOGSTRING1("[CGSCallDivertModel::MatchNumberToContactLC] contactTitle: %S", &contactTitle); + } + return contactTitle; + } + + +// --------------------------------------------------------------------------- +// Removes a special character from vmbx number. +// --------------------------------------------------------------------------- +void CGSCallDivertModel::RemoveSpecialChar( TDes& aVmbxNumber, + const TDesC& aSpecChar ) + { + TInt location = aVmbxNumber.Find( aSpecChar ); + if ( location != KErrNotFound ) + { + aVmbxNumber = aVmbxNumber.Left( location ); + } + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::DivertHandler +// --------------------------------------------------------------------------- +CPsetCallDiverting* CGSCallDivertModel::DivertHandler() + { + return iForward; + } + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::SetDivertView +// --------------------------------------------------------------------------- +void CGSCallDivertModel::SetDivertView( CGSCallDivertView* aDivertView ) + { + iDivertView = aDivertView; + } + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::CGSCallDivertModel +// --------------------------------------------------------------------------- +TGSCallDivertServiceGroups CGSCallDivertModel::DivertServiceGroup() + { + return iDivertServiceGroup; + } + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::SetDivertServiceGroup +// --------------------------------------------------------------------------- +void CGSCallDivertModel::SetDivertServiceGroup( + TGSCallDivertServiceGroups aDivertServiceGroup ) + { + iDivertServiceGroup = aDivertServiceGroup; + __GSLOGSTRING1( "[CGSCallDivertModel::SetDivertServiceGroup] aDivertServiceGroup:%d ", + aDivertServiceGroup ) + } + + + +// --------------------------------------------------------------------------- +// CGSCallDivertModel::NumberGroupingSupportedL +// +// --------------------------------------------------------------------------- +TBool CGSCallDivertModel::NumberGroupingSupportedL() + { + TInt numberGroupingVal; + TBool retVal = EFalse; + if( !iNumberGroupingRepository ) + { + iNumberGroupingRepository = CRepository::NewL( KCRUidNumberGrouping ); + } + iNumberGroupingRepository->Get( KNumberGrouping, numberGroupingVal ); + switch( numberGroupingVal ) + { + case CPNGNumberGrouping::ENumberGroupingDisabled: + retVal = EFalse; + break; + case CPNGNumberGrouping::ENumberGroupingEnabled: + retVal = ETrue; + break; + default: + retVal = EFalse; + break; + } + return retVal; + } + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,432 @@ +/* +* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Main view handling for Call Divert. +* +*/ + + +// INCLUDE FILES +#include "GSCallDivertPlugin.h" +#include "GSCallDivertPluginContainer.h" +#include "GSCallDivertView.h" +#include "LocalViewId.h" +#include "GSCallDivertModel.h" + +#include +#include +#include // For HlpLauncher +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// LOCAL CONSTANTS +_LIT( KGSCallDivertPluginResourceFileName, "z:GSCallDivertPluginRsc.rsc" ); +_LIT( KGSNameOfClass, "CGSCallDivertPlugin" ); +enum + { + EGSCallDivertPluginPanicNullPtr + }; + +// ========================= MEMBER FUNCTIONS ================================ +// --------------------------------------------------------------------------- +// CGSCallDivertPlugin::CGSCallDivertPlugin +// +// C++ constructor. +// --------------------------------------------------------------------------- +CGSCallDivertPlugin::CGSCallDivertPlugin() + { + } + +// --------------------------------------------------------------------------- +// CGSCallDivertPlugin::ConstructL +// +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +void CGSCallDivertPlugin::ConstructL() + { + FeatureManager::InitializeLibL(); + OpenLocalizedResourceFileL( KGSCallDivertPluginResourceFileName, + iResourceLoader ); + + //PS listener initialization + iBtSapListener = CGSPubSubsListener::NewL( + KPSUidBluetoothSapConnectionState, + KBTSapConnectionState, this ); + + SetCSPActiveL( ETrue ); + BaseConstructL( R_CF_MAIN_VIEW ); + + iCallDivertModel = CGSCallDivertModel::NewL(); + CGSCallDivertView* callDivertView = CGSCallDivertView::NewLC( iCallDivertModel ); + iAppUi->AddViewL( callDivertView ); + CleanupStack::Pop( callDivertView ); + iCallDivertView = callDivertView; + } + +// --------------------------------------------------------------------------- +// CGSCallDivertPlugin::~CGSCallDivertPlugin +// +// Destructor. +// --------------------------------------------------------------------------- +CGSCallDivertPlugin::~CGSCallDivertPlugin() + { + FeatureManager::UnInitializeLib(); + TRAP_IGNORE( SetCSPActiveL( EFalse ) ); + if ( iBtSapListener ) + { + delete iBtSapListener; + } + + if( iContainer ) + { + AppUi()->RemoveFromViewStack( *this, iContainer ); + AppUi()->RemoveView( KCallDivertPluginId ); + delete iContainer; + } + delete iCallDivertModel; + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertPlugin::NewL() +// +// Symbian OS default constructor +// --------------------------------------------------------------------------- +CGSCallDivertPlugin* CGSCallDivertPlugin::NewL( TAny* /*aInitParams*/ ) + { + CGSCallDivertPlugin* self = new( ELeave ) CGSCallDivertPlugin(); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertPlugin::NewLC +// +// 1st phase constructor. +// --------------------------------------------------------------------------- +CGSCallDivertPlugin* CGSCallDivertPlugin::NewLC() + { + CGSCallDivertPlugin* self = + new ( ELeave ) CGSCallDivertPlugin; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// CGSCallDivertPlugin::NewContainerL +// +// Creates new iContainer. +// --------------------------------------------------------------------------- +void CGSCallDivertPlugin::NewContainerL() + { + iContainer = new ( ELeave ) CGSCallDivertPluginContainer; + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertPlugin::Id +// +// implementation of the frameworks virtual function, closely related with view +// architecture and has little or no relevance here +// --------------------------------------------------------------------------- +TUid CGSCallDivertPlugin::Id() const + { + return KCallDivertPluginId; + } + +// --------------------------------------------------------------------------- +// CGSCallDivertPlugin::HandleCommandL +// +// Handles the received commands +// --------------------------------------------------------------------------- +void CGSCallDivertPlugin::HandleCommandL( TInt aCommand ) + { + switch ( aCommand ) + { + case EAknSoftkeyBack: + iAppUi->ActivateLocalViewL( KGSTelPluginUid ); + break; + case EGSCmdAppOpen: + case EAknSoftkeyOpen: + HandleListBoxSelectionL(); + break; + case ECFCmdCancelAll: + iCallDivertView->HandleCommandL( ECFCmdCancelAll ); + break; + case EAknCmdHelp: + { + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), iAppUi->AppHelpContextL() ); + } + break; + } + default: + iAppUi->HandleCommandL( aCommand ); + break; + } + } + +// --------------------------------------------------------------------------- +// CGSCallDivertPlugin::HandleListBoxSelectionL +// +// Handles List box selection +// --------------------------------------------------------------------------- +void CGSCallDivertPlugin::HandleListBoxSelectionL() + { + // Other components will see updated value each time this funciton is + // called. + iCallDivertModel->SetDivertServiceGroup( Container()->CurrentFeatureId() ); + + switch ( iCallDivertModel->DivertServiceGroup() ) + { + case EGSSettIdVoiceDivert: + case EGSSettIdVideoDivert: + iAppUi->ActivateLocalViewL( KCallDivertViewId ); + break; + default: + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertPlugin::UpdateListBox +// +// Calls Containers UpdateListBoxL method +// --------------------------------------------------------------------------- +void CGSCallDivertPlugin::UpdateListBox( TInt aItemId ) + { + if ( Container() ) + { + TRAP_IGNORE( Container()->UpdateListBoxL( aItemId ) ); + } + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertPlugin::DoActivateL +// +// Activates view +// --------------------------------------------------------------------------- +void CGSCallDivertPlugin::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + + iContainer->iListBox->SetTopItemIndex( iTopItemIndex ); + + if ( iCurrentItem >= 0 && + iCurrentItem < iContainer->iListBox->Model()->NumberOfItems() ) // magic + { + iContainer->iListBox->SetCurrentItemIndexAndDraw( iCurrentItem ); + } + } + +// --------------------------------------------------------------------------- +// CGSCallDivertPlugin::DoDeactivate +// +// Deactivates view +// --------------------------------------------------------------------------- +void CGSCallDivertPlugin::DoDeactivate() + { + CGSBaseView::DoDeactivate(); + } + +// --------------------------------------------------------------------------- +// CGSCallDivertPlugin::Container +// +// Returns call container item +// --------------------------------------------------------------------------- +// +CGSCallDivertPluginContainer* CGSCallDivertPlugin::Container() + { + return static_cast ( iContainer ); + } + + +// ========================= From CGSPluginInterface ================== + +// ---------------------------------------------------------------------------- +// CGSCallDivertPlugin::GetCaption +// +// Return application/view caption. +// ---------------------------------------------------------------------------- +// +void CGSCallDivertPlugin::GetCaptionL( TDes& aCaption ) const + { + // the resource file is already opened. + HBufC* result = StringLoader::LoadL( R_GS_CALL_DIVERT_CAPTION ); + + aCaption.Copy( *result ); + delete result; + } + + +// ---------------------------------------------------------------------------- +// CGSCallDivertPlugin::PluginProviderCategory +// +// A means to identify the location of this plug-in in the framework. +// ---------------------------------------------------------------------------- +// +TInt CGSCallDivertPlugin::PluginProviderCategory() const + { + //To identify internal plug-ins. + return KGSPluginProviderInternal; + } + + +// ---------------------------------------------------------------------------- +// CGSCallDivertPlugin::Visible +// +// Provides the visibility status of self to framework. +// ---------------------------------------------------------------------------- +// +TBool CGSCallDivertPlugin::Visible() const + { + TBool result( ETrue ); + TInt value = 0; + iBtSapListener->Get( value ); + if ( value == EBTSapNotConnected || value == EBTSapConnecting ) + { + //Now checking also for CSP support + __ASSERT_ALWAYS( iCSP, User::Panic( KGSNameOfClass, + EGSCallDivertPluginPanicNullPtr ) ); + TInt err = KErrNone; + err = iCSP->IsCFSupported( result ); + //CSP modifies result value even if something goes wrong + //CSP will return KErrNotSupported (-5) in cases when + //it is not possible to read CSP values from SIM card + //Call Barring should be still displayed in this case + if ( err != KErrNone ) + { + result = ETrue; + } + } + else + { + result = EFalse; + } + return result; + } + +// ----------------------------------------------------------------------------- +// CGSCallDivertPlugin::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CGSCallDivertPlugin::CreateIconL( const TUid aIconType ) + { + //EMbm + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSCallDivertPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropSetDivSub, + fp->FullName(), + EMbmGscalldivertpluginQgn_prop_set_div_sub, + EMbmGscalldivertpluginQgn_prop_set_div_sub_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + CleanupStack::PopAndDestroy( fp ); + + return icon; + } + +// --------------------------------------------------------------------------- +// CGSCallDivertPlugin::HandleNotifyPSL +// +// Handling PS keys change +// --------------------------------------------------------------------------- +// +void CGSCallDivertPlugin::HandleNotifyPSL( const TUid aUid, const TInt& aKey, + const TRequestStatus& /* aStatus */ ) + { + if ( aUid == KPSUidBluetoothSapConnectionState && + aKey == KBTSapConnectionState ) + { + Visible(); + } + } + +// ---------------------------------------------------------------------------- +// CGSCallDivertPlugin::SetCSPActiveL +// +// Set Customer Service Profile active +// ---------------------------------------------------------------------------- +// +void CGSCallDivertPlugin::SetCSPActiveL( TBool aValue ) + { + if ( aValue ) + { + iCSP = CPsetCustomerServiceProfile::NewL(); + User::LeaveIfError( iCSP->OpenCSProfileL() ); + } + else + { + delete iCSP; + iCSP = NULL; + } + } + + +// ---------------------------------------------------------------------------- +// CGSCallDivertPlugin::DynInitMenuPaneL() +// +// Display the dynamic menu +// ---------------------------------------------------------------------------- +void CGSCallDivertPlugin::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + // show or hide the 'help' menu item when supported + if( aResourceId == R_GS_MENU_ITEM_HELP ) + { + User::LeaveIfNull( aMenuPane ); + + if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPluginContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPluginContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for Call Divert's view. +* +*/ + + +// INCLUDE FILES +#include "CallDivertPlugin.hrh" +#include "GSCallDivertPluginContainer.h" + +#include +#include +#include +#include // for help context of Divert +#include // for KUidGS +#include + +// ========================= MEMBER FUNCTIONS ================================ +// --------------------------------------------------------------------------- +// CGSCallDivertPluginContainer::ConstructL +// Symbian OS two phased constructor +// +// --------------------------------------------------------------------------- +void CGSCallDivertPluginContainer::ConstructL( const TRect& aRect ) + { + iListBox = new ( ELeave ) CAknSettingStyleListBox; + BaseConstructL( aRect, R_CF_MAIN_VIEW_TITLE, R_CF_MAIN_LBX ); + } + +// --------------------------------------------------------------------------- +// CGSCallDivertPluginContainer::~CGSCallDivertPluginContainer +// Destructor +// +// --------------------------------------------------------------------------- +CGSCallDivertPluginContainer::~CGSCallDivertPluginContainer() + { + if ( iListboxItemArray ) + { + delete iListboxItemArray; + } + } + +// --------------------------------------------------------------------------- +// CGSCallDivertPluginContainer::GetHelpContext +// This function is called when Help application is launched. +// Only available, when __SERIES60_HELP is defined. +// --------------------------------------------------------------------------- +// +void CGSCallDivertPluginContainer::GetHelpContext( + TCoeHelpContext& aContext ) const + { + aContext.iMajor = KUidGS; + aContext.iContext = KDIV_HLP_CALL_FORW_MAIN; + } + +// --------------------------------------------------------------------------- +// CGSCallDivertPluginContainer::ConstructListBoxL +// Creates list box from resources. +// +// --------------------------------------------------------------------------- +// +void CGSCallDivertPluginContainer::ConstructListBoxL( TInt aResLbxId ) + { + iListBox->ConstructL( this, EAknListBoxSelectionList ); + + iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, + *iListBox, *iCoeEnv ); + iListBox->Model()->SetItemTextArray( iListboxItemArray ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + MakeVoiceDivertsItemL(); + MakeVideoDivertsItemL(); + } + +// --------------------------------------------------------------------------- +// CGSCallDivertPluginContainer::UpdateListBoxL +// +// +// --------------------------------------------------------------------------- +void CGSCallDivertPluginContainer::UpdateListBoxL( TInt aFeatureId ) + { + switch( aFeatureId ) + { + case EGSSettIdVoiceDivert: + MakeVoiceDivertsItemL(); + break; + case EGSSettIdVideoDivert: + MakeVideoDivertsItemL(); + break; + default: + break; + } + + // Update the listbox + iListBox->HandleItemAdditionL(); + } + +// --------------------------------------------------------------------------- +// CGSCallDivertPluginContainer::CurrentFeatureId +// +// +// --------------------------------------------------------------------------- +TGSCallDivertServiceGroups CGSCallDivertPluginContainer::CurrentFeatureId() const + { + // Actually listbox item IDs are from TGSCallDivertServiceGroups so safe to cast + return (TGSCallDivertServiceGroups) iListboxItemArray->CurrentFeature( ); + } + +// --------------------------------------------------------------------------- +// CGSCallDivertPluginContainer::MakeVoiceDivertsItemL +// +// +// --------------------------------------------------------------------------- +void CGSCallDivertPluginContainer::MakeVoiceDivertsItemL() + { + iListboxItemArray->SetItemVisibilityL( EGSSettIdVoiceDivert, + CGSListBoxItemTextArray::EVisible ); + } + +// --------------------------------------------------------------------------- +// CGSCallDivertPluginContainer::MakeDataAndVideoDivertsItemL +// +// +// --------------------------------------------------------------------------- +void CGSCallDivertPluginContainer::MakeVideoDivertsItemL() + { + + if ( FeatureManager::FeatureSupported( + KFeatureIdCsVideoTelephony ) ) + { + iListboxItemArray->SetItemVisibilityL( EGSSettIdVideoDivert, + CGSListBoxItemTextArray::EVisible ); + } + else + { + iListboxItemArray->SetItemVisibilityL( EGSSettIdVideoDivert, + CGSListBoxItemTextArray::EInvisible ); + } + } +//End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for this plugin +* +*/ + + +// System includes +#include +#include + +// User includes +#include "GSCallDivertPlugin.h" + +// Constants +const TImplementationProxy KGSCallDivertPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x102824A4, CGSCallDivertPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// +// Gate/factory function +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSCallDivertPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSCallDivertPluginImplementationTable; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertQuery.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertQuery.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,222 @@ +/* +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Phone number query for Call Divert view. +* +*/ + + +// INCLUDE FILES +#include "GSCallDivertQuery.h" + +// CONSTANTS +const TInt KCFQueryClosing = 1; +const TInt KCFQueryRunning = 0; + +// ================= MEMBER FUNCTIONS ======================= +// --------------------------------------------------------- +// GSCallDivertQuery::NewL +// --------------------------------------------------------- +CGSCallDivertQuery* CGSCallDivertQuery::NewL( TDes& aDataText, + const TTone& aTone, TInt aOKCba, TInt aDefaultCba ) + { + CGSCallDivertQuery* self = + new ( ELeave ) CGSCallDivertQuery( + aDataText, aTone, aOKCba, aDefaultCba ); + return self; + } + +// --------------------------------------------------------- +// GSCallDivertQuery::GSCallDivertQuery +// --------------------------------------------------------- +CGSCallDivertQuery::CGSCallDivertQuery( + TDes& aDataText, + const TTone& aTone, + TInt aOKCba, + TInt aDefaultCba ) + : CAknTextQueryDialog( aDataText, aTone ), + iOKCba( aOKCba ), + iDefaultCba( aDefaultCba ) + { + } + +// --------------------------------------------------------- +// GSCallDivertQuery::OfferKeyEventL +// --------------------------------------------------------- +TKeyResponse CGSCallDivertQuery::OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + if ( aKeyEvent.iCode == EKeyEnter ) + { + CAknQueryControl* control = + static_cast ( Control( EGeneralQuery ) ); + if ( control->GetTextLength() ) + { + TryExitL( EAknSoftkeyOk ); + } + else + { + TryExitL( EAknSoftkeySearch ); + } + + return EKeyWasConsumed; + } + + CAknTextQueryDialog::OfferKeyEventL( aKeyEvent, aType ); + + if ( aKeyEvent.iCode != EKeyEscape ) + { + UpdateSoftkeysL(); + } + + return EKeyWasConsumed; + } + + +// --------------------------------------------------------- +// GSCallDivertQuery::OfferKeyEventL +// --------------------------------------------------------- +TBool CGSCallDivertQuery::NeedToDismissQueryL( const TKeyEvent& aKeyEvent ) + { + if ( aKeyEvent.iCode == EKeyOK ) + { + CAknQueryControl* control = + static_cast ( Control( EGeneralQuery ) ); + // check if the editor is empty or has some text + if ( control && control->GetTextLength() ) + { + return EFalse; + } + else + { + return ETrue; + } + } + else + { + return EFalse; + } + } + + +// --------------------------------------------------------- +// GSCallDivertQuery::PostLayoutDynInitL +// --------------------------------------------------------- +void CGSCallDivertQuery::PostLayoutDynInitL() + { + iCurrentCba = 0; + iLeaving = KCFQueryRunning; + CAknTextQueryDialog::PostLayoutDynInitL(); + UpdateSoftkeysL(); + } + +// --------------------------------------------------------- +// GSCallDivertQuery::UpdateSoftkeysL +// --------------------------------------------------------- +void CGSCallDivertQuery::UpdateSoftkeysL() + { + if ( iLeaving != KCFQueryRunning ) + { + return; + } + CAknQueryControl* control = + static_cast ( Control( EGeneralQuery ) ); + if ( control && control->GetTextLength() ) + { + // There is text in cba; we can update softkeys to OK - Cancel. + SetCbaL( iOKCba ); + } + else + { + // There is no text in cba; update softkeys to Search - Back. + SetCbaL( iDefaultCba ); + } + } + +// --------------------------------------------------------- +// GSCallDivertQuery::OkToExitL +// --------------------------------------------------------- +TBool CGSCallDivertQuery::OkToExitL( TInt aButtonId ) + { + + if ( aButtonId == EAknSoftkeySearch ) + { + return ETrue; + } + if ( aButtonId == EAknSoftkeyCancel ) + { + iLeaving = KCFQueryClosing; + return ETrue; + } + if ( aButtonId == EAknSoftkeyBack ) + { + iLeaving = KCFQueryClosing; + return ETrue; + } + iLeaving = KCFQueryClosing; + return CAknTextQueryDialog::OkToExitL( aButtonId ); + } + + +// --------------------------------------------------------- +// GSCallDivertQuery::SetCba +// --------------------------------------------------------- +void CGSCallDivertQuery::SetCbaL( TInt aCba ) + { + if ( iCurrentCba != aCba ) + { + CEikButtonGroupContainer& buttonGroup = ButtonGroupContainer(); + buttonGroup.SetCommandSetL( aCba ); + buttonGroup.DrawNow(); + iCurrentCba = aCba; + } + MakeLeftSoftkeyVisible( ETrue ); + } + + +// --------------------------------------------------------- +// GSCallDivertQuery::PreLayoutDynInitL +// --------------------------------------------------------- +void CGSCallDivertQuery::PreLayoutDynInitL() + { + iCurrentCba = 0; + CAknTextQueryDialog::PreLayoutDynInitL(); + + if( this->Text().Length() ) + { + MakeLeftSoftkeyVisible( ETrue ); + } + } + + +// --------------------------------------------------------- +// GSCallDivertQuery::HandleQueryEditorStateEventL +// --------------------------------------------------------- +TBool CGSCallDivertQuery::HandleQueryEditorStateEventL( + CAknQueryControl* aQueryControl, + TQueryControlEvent aEventType, + TQueryValidationStatus aStatus ) + { + CAknTextQueryDialog::HandleQueryEditorStateEventL( aQueryControl, + aEventType, + aStatus ); + if( aEventType == EQueryControlEditorStateChanging && + aStatus == EEditorValueValid ) + { + UpdateSoftkeysL(); + } + return EFalse; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertView.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,1386 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Main view handling for Call Divert. +* +*/ + + +// INCLUDE FILES +#include "GSCallDivertContainer.h" +#include "GSCallDivertModel.h" +#include "GSCallDivertQuery.h" +#include "GSCallDivertView.h" +#include "GsLogger.h" +#include "GSPhoneSettingConstants.h" +#include "GSRestrictedDivertContainer.h" +#include "LocalViewId.h" + + +#include +#include +#include //for AknErrorNote +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // for restricted call forward +#include +#include +#include +#include +#include +#include +#include +#include +#include // for Number Grouping +#include +#include +#include +#include +#include +#include +#include +#include +#include // for Help Launcher +#include // For HlpLauncher +#include +#include +#include +#include +#include + +using namespace AiwContactAssign; + +// LOCAL CONSTANTS +_LIT( KGSDivertClassName, "CGSCallDivertView" ); + +_LIT( KCallDivertInvalidchars, " ()" ); + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSCallDivertView::CGSCallDivertView +// +// C++ constructor. +// --------------------------------------------------------------------------- +CGSCallDivertView::CGSCallDivertView( CGSCallDivertModel* aModel ) + : iModel( aModel ) + { + } + +// --------------------------------------------------------------------------- +// CGSCallDivertView::ConstructL +// +// Symbian OS two-phased constructor. +// --------------------------------------------------------------------------- +void CGSCallDivertView::ConstructL() + { + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + iModel->SetDivertServiceGroup( EGSSettIdVoiceDivert ); + } + iModel->SetDivertView( this ); + + iStoresOpened = EFalse; + iNumberFetchedAsynchronously = EFalse; + + BaseConstructL( R_CF_DIV_VIEW ); + + iTitles = iCoeEnv->ReadDesCArrayResourceL( R_TITLE_ARRAY ); + iRockerPress = EFalse; + + //Check video mailbox suppport from cenrep + //Since it is static feature, needs to be checked only once + CRepository* videoMailboxRepository = + CRepository::NewLC( KCRUidVideoMailbox ); + videoMailboxRepository->Get( KVideoMbxSupport, iVideoMailboxSupported ); + CleanupStack::PopAndDestroy( videoMailboxRepository ); + + // AIW for pbk2 contact selection functionality. Construct contact manager + // with the same store configuration as in Phonebook currently. + iServiceHandler = CAiwServiceHandler::NewL(); + iServiceHandler->AttachL( R_CALL_DIVERT_CONTACT_SELECTION_INTEREST ); + CPbk2StoreConfiguration* configuration = CPbk2StoreConfiguration::NewL(); + CleanupStack::PushL( configuration ); + CVPbkContactStoreUriArray* uriArray = configuration->CurrentConfigurationL(); + CleanupStack::PushL( uriArray ); + iContactManager = CVPbkContactManager::NewL( *uriArray ); + iContactManager->ContactStoresL().OpenAllL( *this ); + CleanupStack::PopAndDestroy( uriArray ); + CleanupStack::PopAndDestroy( configuration ); + } + +// --------------------------------------------------------------------------- +// CGSCallDivertView::~CGSCallDivertView +// +// Destructor. +// --------------------------------------------------------------------------- +CGSCallDivertView::~CGSCallDivertView() + { + if ( iTitles ) + { + delete iTitles; + } + if( iRetrieveOperation ) + { + delete iRetrieveOperation; + iRetrieveOperation = NULL; + } + if( iContactLinks ) + { + delete iContactLinks; + iContactLinks = NULL; + } + + TRAP_IGNORE + ( + if( iContactManager ) + { + iContactManager->ContactStoresL().CloseAll( *this ); + iStoresOpened = EFalse; + delete iContactManager; + } + ); + delete iServiceHandler; + + + if( iContextMenuItems ) + { + delete iContextMenuItems; + iContextMenuItems = NULL; + } + } + +// --------------------------------------------------------------------------- +// CGSCallDivertView::NewLC +// +// 1st phase constructor. +// --------------------------------------------------------------------------- +CGSCallDivertView* CGSCallDivertView::NewLC( CGSCallDivertModel* aModel ) + { + CGSCallDivertView* self; + self = new ( ELeave ) CGSCallDivertView( aModel ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// CGSCallDivertView::NewContainerL +// +// Creates new iContainer. +// --------------------------------------------------------------------------- +void CGSCallDivertView::NewContainerL() + { + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + iContainer = new (ELeave) CGSRestrictedDivertContainer(); + } + else + { + iContainer = new (ELeave) CGSCallDivertContainer( + iModel->DivertServiceGroup() ); + } + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertView::Id +// +// implementation of the frameworks virtual function, closely related with view +// architecture and has little or no relevance here +// --------------------------------------------------------------------------- +TUid CGSCallDivertView::Id() const + { + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + return KCallDivertPluginId; + } + else + { + return KCallDivertViewId; + } + } + +// --------------------------------------------------------------------------- +// CGSCallDivertView::HandleCommandL +// +// Handles the received commands +// --------------------------------------------------------------------------- +void CGSCallDivertView::HandleCommandL( TInt aCommand ) + { + iVoiceMailboxDivert = EFalse; + TBool sendRequest = EFalse; + RMobilePhone::TMobilePhoneServiceAction info = + RMobilePhone::EServiceActionRegister; + TCallDivertSetting divertRequest; + + if ( aCommand != ECFCmdCancelAll && iContainer ) + { + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + CGSRestrictedDivertContainer& container = + *static_cast( iContainer ); + iCurrentItem = container.CurrentFeatureId(); + } + else + { + CGSCallDivertContainer& container = + *static_cast( iContainer ); + iCurrentItem = container.CurrentFeatureId(); + } + __GSLOGSTRING1("[CGSCallDivertView::HandleCommandL] iCurrentItem: %d", iCurrentItem); + + __ASSERT_ALWAYS( iCurrentItem != KErrNotFound, Panic( KGSDivertClassName, + EInvalidCurrentItem ) ); + } + + switch ( aCommand ) + { + case EGSCmdAppChange: + iRockerPress = EFalse; + if ( iContainer ) + { + HandleListBoxEventL( iContainer->iListBox, EEventEnterKeyPressed ); + } + break; + case EAknSoftkeyBack: + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + iAppUi->ActivateLocalViewL( KGSTelPluginUid ); + } + else + { + iAppUi->ActivateLocalViewL( KCallDivertPluginId ); + } + break; + case EAknSoftkeyExit: + AppUi()->HandleCommandL( EEikCmdExit ); + break; + case ECFCmdActivate: + divertRequest.iSetting = EActivateDiverting; + info = RMobilePhone::EServiceActionRegister; + + // Activate depends on the selected call type (voice/data/fax) + switch( iModel->DivertServiceGroup() ) + { + case EGSSettIdVoiceDivert: + // Handle voice divert. Fetch used numbers and show it in query. + ExecuteDivertQueryL( + divertRequest.iNumber, + iTitles->MdcaPoint( iCurrentItem ), + iVoiceMailboxDivert ); + sendRequest = ETrue; + break; + case EGSSettIdVideoDivert: + if( iVideoMailboxSupported ) + { + // Fetch used data divert number and show it in query. + ExecuteDivertQueryL( + divertRequest.iNumber, + iTitles->MdcaPoint( iCurrentItem ), + iVoiceMailboxDivert ); + sendRequest = ETrue; + } + else + { + DisplayDataCallDivertNumberQueryL( divertRequest.iNumber ); + sendRequest = ETrue; + } + break; + default: + User::Panic( KGSDivertClassName, KErrArgument ); + break; + } + break; + case ECFCmdCancel: + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + sendRequest = EFalse; + iModel->CancelRestrictedCallDivertL(); + } + else + { + sendRequest = ETrue; + divertRequest.iSetting = ECancelDiverting; + info = RMobilePhone::EServiceActionErase; + } + break; + case ECFCmdCheckStatus: + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + sendRequest = EFalse; + iModel->CheckStatusRestrictedCallDivertL(); + } + else + { + sendRequest = ETrue; + divertRequest.iSetting = ECheckStatus; + info = RMobilePhone::EServiceActionUnspecified; + } + break; + case ECFCmdCancelAll: + sendRequest = ETrue; + divertRequest.iSetting = EEraseDiverting; + info = RMobilePhone::EServiceActionErase; + break; + case EAknCmdHelp: + { + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), iAppUi->AppHelpContextL() ); + } + break; + } + default: + iAppUi->HandleCommandL( aCommand ); + break; + } + + // If a request needs to be sent. + if ( sendRequest ) + { + // will not divert in case empty number + iModel->SendCallDivertRequestL( divertRequest, + info, + iVoiceMailboxDivert, + aCommand, + (TGSCallDivertServices) iCurrentItem ); + } + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertView::HandleListBoxSelectionL +// +// Handles List box selection +// --------------------------------------------------------------------------- +void CGSCallDivertView::HandleListBoxSelectionL() + { + iRockerPress = ETrue; + CEikMenuBar* menuBar = MenuBar(); + if ( iRockerPress ) + { + menuBar->SetMenuTitleResourceId( R_CF_MENUBAR_OPTIONS_VIEW ); + menuBar->SetMenuType( CEikMenuBar::EMenuContext ); + } + else + { + menuBar->SetMenuTitleResourceId( R_CF_MENUBAR_DIV_VIEW ); + menuBar->SetMenuType( CEikMenuBar::EMenuOptions ); + } + + // Display menu bar. + menuBar->TryDisplayMenuBarL(); + + // Reset menu type to original default (EMenuOptions). + menuBar->SetMenuType( CEikMenuBar::EMenuOptions ); + + iRockerPress = EFalse; + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertView::ExecuteDivertQueryL +// +// --> voice calls -> all voice calls -> activate -> this popup. +// OR +// --> video calls -> all video calls -> activate -> this popup. +// +// ---Example--- +// All [voice/]video calls: +// To [voice/]video mailbox +// [050512345678] +// [543454545435] +// [342343242343] +// To other number +// --------------------------------------------------------------------------- +// +void CGSCallDivertView::ExecuteDivertQueryL( TTelNumber& aTelNumber, + const TPtrC& aTitle, + TBool& aVmbxValidNumber ) + { + __GSLOGSTRING("[CGSCallDivertView::ExecuteDivertQueryL]"); + + CAknSinglePopupMenuStyleListBox* list = + new ( ELeave ) CAknSinglePopupMenuStyleListBox; + CleanupStack::PushL( list ); + + CDesC16ArrayFlat* defNumbers = + new ( ELeave ) CDesC16ArrayFlat( KCFDefaultNumbers ); + CleanupStack::PushL( defNumbers ); + + CAknPopupList* divertPopup = + CAknPopupList::NewL( list, R_AVKON_SOFTKEYS_OK_CANCEL__OK ); + CleanupStack::PushL( divertPopup ); + + list->ConstructL( divertPopup,CEikListBox::ELeftDownInViewRect ); + list->CreateScrollBarFrameL( ETrue ); + list->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, + CEikScrollBarFrame::EAuto ); + divertPopup->SetTitleL( aTitle ); + if( iContextMenuItems ) + { + delete iContextMenuItems; + iContextMenuItems = NULL; + } + iContextMenuItems = new ( ELeave ) CDesCArrayFlat( KCFMaxNrOfTargets ); + if( iModel->DivertServiceGroup() == EGSSettIdVoiceDivert ) + { + CreateVoiceDivertItemsL( *iContextMenuItems, *defNumbers ); + } + else + { + CreateVideoDivertItemsL( *iContextMenuItems ); + } + __GSLOGSTRING2( "[CGSCallDivertView::ExecuteDivertQueryL] ItemCount: %d, defNumCount: %d", + iContextMenuItems->Count(), + defNumbers->Count() ); + CTextListBoxModel* model = list->Model(); + model->SetItemTextArray( iContextMenuItems ); + model->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + // Executeld handles the events in the list + TBool modified = divertPopup->ExecuteLD(); + __GSLOGSTRING1("[CGSCallDivertView::ExecuteDivertQueryL] modified: %d", modified); + CleanupStack::Pop(); //voiceDivertPopup + + if ( modified ) + { + if( iModel->DivertServiceGroup() == EGSSettIdVoiceDivert ) + { + aTelNumber = HandleVoiceDivertSelectionL( *list, + *defNumbers, + aVmbxValidNumber ); + } + else + { + aTelNumber = HandleVideoDivertSelectionL( *list ); + } + } + __GSLOGSTRING1( "[CGSCallDivertView::ExecuteVoiceDivertQueryL] aTelNumber: %S", + &aTelNumber); + CleanupStack::PopAndDestroy( 2 ); //defNumbers, list + __GSLOGSTRING( "[CGSCallDivertView::ExecuteVoiceDivertQueryL] End." ); + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertView::HandleVoiceDivertSelectionL +// +// Handles user's choice in the Target list. +// --------------------------------------------------------------------------- +TTelNumber CGSCallDivertView::HandleVoiceDivertSelectionL( + CAknSinglePopupMenuStyleListBox& aList, + CDesC16ArrayFlat& aDefNumbers, + TBool& aVmbxDivert ) + { + __GSLOGSTRING("[CGSCallDivertView::HandleVoiceDivertSelectionL] Start..."); + TTelNumber telNumber; + telNumber.Zero(); + TInt index = aList.CurrentItemIndex(); + __GSLOGSTRING1("[CGSCallDivertView::HandleVoiceDivertSelectionL] index: %d", index); + + if ( index == KCFDivertToMailBox ) + { + if ( iModel->VoiceMailActivationL( telNumber ) == KErrNone ) + { + if ( telNumber == KNullDesC ) + { + ShowErrorNoteL(); + } + aVmbxDivert = ETrue; + } + } + //To other number - make a dataquery + else if ( index == ( aList.Model()->NumberOfItems() - 1 ) ) + { + ExecuteDivertNumberQueryL( telNumber, R_TEXT_PRMPT_NUMBER ); + __GSLOGSTRING1("[CGSCallDivertView::HandleVoiceDivertSelectionL] telNumber: %S", &telNumber); + + UpdateDefaultVoiceDivertNumbersL( telNumber ); + } + //To pre-defined default number + else + { + telNumber = aDefNumbers.MdcaPoint( index - 1 ); + iModel->DivertHandler()->SwapDefaultNumberL( index ); + } + __GSLOGSTRING("[CGSCallDivertView::HandleVoiceDivertSelectionL] End."); + return telNumber; + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertView::HandleVideoDivertSelectionL +// +// Handles user's choice in the video Target list. +// --------------------------------------------------------------------------- +TTelNumber CGSCallDivertView::HandleVideoDivertSelectionL( + CAknSinglePopupMenuStyleListBox& aList ) + { + __GSLOGSTRING("[GSCallDivertView::HandleVideoDivertSelectionL] Start"); + TTelNumber telNumber( 0 ); + TInt index = aList.CurrentItemIndex(); + if ( index == KCFDivertToMailBox ) + { + if ( iModel->VideoMailActivationL( telNumber ) == KErrNone ) + { + if ( telNumber == KNullDesC ) + { + ShowErrorNoteL(); + } + } + } + else if( index == ( aList.Model()->NumberOfItems() - 1 ) ) + { // To other number - make a dataquery (Last item in list) + DisplayDataCallDivertNumberQueryL( telNumber ); + __GSLOGSTRING1("[GSCallDivertView::HandleVideoDivertSelectionL] telNumber: %S", &telNumber ); + } + __GSLOGSTRING("[GSCallDivertView::HandleVideoDivertSelectionL] Finished"); + return telNumber; + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertView::DisplayDataCallDivertNumberQueryL +// +// Displays data call number query and sets call divert +// --------------------------------------------------------------------------- +void CGSCallDivertView::DisplayDataCallDivertNumberQueryL( TTelNumber& aTelNumber ) + { + aTelNumber = *iModel->DivertHandler()->GetUsedDataNumberLC(); + ExecuteDivertNumberQueryL( aTelNumber, R_TEXT_PRMPT_DATA_NUMBER ); + if( aTelNumber != KNullDesC ) + { + iModel->DivertHandler()->SetUsedDataNumberL( aTelNumber ); + } + CleanupStack::PopAndDestroy(); // aTelNumber from GetUsedDataNumberLC() + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertView::ExecuteDivertNumberQueryL +// +// Executes general number query dialog used by all diverts (voice/data/fax) +// --------------------------------------------------------------------------- +// +void CGSCallDivertView::ExecuteDivertNumberQueryL( TDes& aValue, TInt aType ) + { + TBool accepted = EFalse; + while ( !accepted ) + { + RemoveInvalidChars( aValue ); + if ( aValue.Length() > KGSMaxDataLength ) + { + //Chop the first extra digits and keep the last KGSMaxDataLength + //digits intact. This is according to the spec. + aValue.Delete( 0, aValue.Length() - KGSMaxDataLength ); + } + + __GSLOGSTRING1("[CGSCallDivertView] ExecuteDivertNumberQueryL: aValue: %S", &aValue); + + if( AknTextUtils::DigitModeQuery( AknTextUtils::EDigitModeEditorDefault ) ) + { + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( aValue ); + } + CGSCallDivertQuery* query = CGSCallDivertQuery::NewL( aValue, + CAknQueryDialog::ENoTone, + R_AVKON_SOFTKEYS_OK_CANCEL__OK, R_CF_SOFTKEYS_SEARCH_CANCEL ); + CleanupStack::PushL( query ); + SetPromptToQueryL( *query, aType ); + TInt queryAction = query->ExecuteLD( R_DATA_QUERY ); + CleanupStack::Pop( query ); + AknTextUtils::ConvertDigitsTo( aValue, EDigitTypeWestern ); + switch ( queryAction ) + { + case EAknSoftkeySearch: + if( iStoresOpened ) + { + // Reset the number selection because 'search' is selected. + aValue.Zero(); + StartAsyncPhoneNumberFetchL(); + accepted = ETrue;// Change to asynchronous mode + } + break; + case EAknSoftkeyOk: + accepted = ETrue; + if ( ValidatePhoneNumberL( aValue ) > KCFValidPhoneNumber || + aValue.Length() == 0 ) + { + accepted = EFalse; + } + if ( iNumberFetchedAsynchronously ) + { + switch( iModel->DivertServiceGroup() ) + { + case EGSSettIdVoiceDivert: + UpdateDefaultVoiceDivertNumbersL( aValue ); + break; + case EGSSettIdVideoDivert: + { + TTelNumber dataNumber( aValue );// Convert to TTelNumber + iModel->DivertHandler()->SetUsedDataNumberL( dataNumber ); + break; + } + default: + break; + } + iNumberFetchedAsynchronously = EFalse; + } + break; + case EAknSoftkeyBack: + case EAknSoftkeyCancel: + default: + accepted = ETrue; + aValue.Zero(); + break; + } + } + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertView::StartAsyncPhoneNumberFetchL +// +// Fetches values from phonebook ASYNCHRONOUSLY (pbk2 requirement). +// --------------------------------------------------------------------------- +// +void CGSCallDivertView::StartAsyncPhoneNumberFetchL() + { + TUint fetchFlags = 0; + + // Construct empty filter + CVPbkFieldTypeSelector* contactViewFilter = + CVPbkFieldTypeSelector::NewL(iContactManager->FieldTypes()); + CleanupStack::PushL(contactViewFilter); + + // Append the filter object with suitable criteria (only contacts with + // phone number shown) + VPbkContactViewFilterBuilder::BuildContactViewFilterL(*contactViewFilter, + EVPbkContactViewFilterPhoneNumber, *iContactManager); + RVPbkContactFieldDefaultPriorities array; + CleanupClosePushL(array); + + TAiwSingleItemSelectionDataV3 data = TAiwSingleItemSelectionDataV3(); + // Details selection shows only phone numbers + data.SetAddressSelectType(EAiwPhoneNumberSelect); + data.SetDefaultPriorities(array); + // Contact list shows only contacts that have phone number(s) + data.SetFetchFilter(contactViewFilter); + data.SetFlags(fetchFlags); + + CAiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + TAiwGenericParam param(EGenericParamContactSelectionData, + TAiwVariant(TAiwSingleItemSelectionDataV3Pckg(data))); + inParamList.AppendL(param); + + iServiceHandler->ExecuteServiceCmdL( + KAiwCmdSelect, + inParamList, + iServiceHandler->OutParamListL(), + 0, + this); + + CleanupStack::PopAndDestroy(); // array + CleanupStack::PopAndDestroy( contactViewFilter ); + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertView::ValidatePhoneNumberL +// +// Puts a single resource string into a list. +// --------------------------------------------------------------------------- +TInt CGSCallDivertView::ValidatePhoneNumberL( const TDesC& aDivertTo ) + { + TInt enteredNumber = KErrNone; + TInt noOfInvalidChars = KCFInvalidChars().Length(); + + // Plus is a special case, as it is accepted as first character. + // FindPlus returns KCFErrIllegalNumber(1) if the number is not + // acceptable. + enteredNumber += FindPlus( aDivertTo ); + for ( TInt index = 0; index < noOfInvalidChars; index++ ) + { + enteredNumber += aDivertTo.Find( + KCFInvalidChars().Mid( index, 1 ) ); + } + // Find returns KErrNotFound(-1), if character(s) is not found. + // Therefore, after four searches for special characters in the + // number, all results that have greater than -5 as result are not + // acceptable. + if ( enteredNumber > KCFValidPhoneNumber ) + { + ShowErrorNoteL(); + __GSLOGSTRING( "[CGSCallDivertView::ValidatePhoneNumberL] Invalid phone number. " ); + } + return enteredNumber; + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertView::AppendDelayItemL +// +// Appends items to delay time list. +// --------------------------------------------------------------------------- +void CGSCallDivertView::AppendDelayItemL( CDesCArrayFlat& aArrayToAppend, + TInt aIndex ) + { + //Delay times are defined as 5,10,15,20,25,30. + //Append each of these to a list. + TInt delaySeconds = KCFDelayStep * ( aIndex + 1); + HBufC* string = StringLoader::LoadLC( R_TEXT_SLIST_SECONDS, delaySeconds ); + + TPtr bufPtr = string->Des(); + if( AknTextUtils::DigitModeQuery( AknTextUtils::EDigitModeShownToUser ) ) + { + AknTextUtils::LanguageSpecificNumberConversion( bufPtr ); + } + aArrayToAppend.AppendL( *string ); + CleanupStack::PopAndDestroy( string ); + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertView::CreateVoiceDivertItemsL +// +// Creates items for the targert list. +// --------------------------------------------------------------------------- +void CGSCallDivertView::CreateVoiceDivertItemsL( + CDesCArray& aItems, + CDesC16ArrayFlat& aDefaultNumbers ) + { + HBufC* item = StringLoader::LoadLC( R_TEXT_DIVERT_TO_VOICE_MAIL ); + aItems.AppendL( *item ); + CleanupStack::PopAndDestroy( item ); + ReadDefaultVoiceDivertNumbersL( aItems, aDefaultNumbers ); + HBufC* string = StringLoader::LoadLC( R_TEXT_DIVERT_TO_NUMBER ); + aItems.AppendL( *string ); + CleanupStack::PopAndDestroy( string ); + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertView::CreateVideoDivertItemsL +// +// Creates items for the data target list. +// --------------------------------------------------------------------------- +void CGSCallDivertView::CreateVideoDivertItemsL( CDesCArray& aItems ) + { + HBufC* item = StringLoader::LoadLC( R_QTN_SS_DIVERT_TO_VIDEO_MAILBOX ); + aItems.AppendL( *item ); + CleanupStack::PopAndDestroy( item ); + HBufC* string = StringLoader::LoadLC( R_QTN_SS_DIVERT_VCALL_TO_OTHER_NUMBER ); + aItems.AppendL( *string ); + CleanupStack::PopAndDestroy( string ); + } + + +// --------------------------------------------------------------------------- +// +// Seeks '+' from given number. If '+' is first character, it is ignored. +// +// --------------------------------------------------------------------------- +TInt CGSCallDivertView::FindPlus( const TDesC& aDivertTo ) + { + TInt seekPlus = aDivertTo.Find( KCFPlusSign ); + if ( seekPlus == KErrNotFound ) + { + //no '+' in the number + return KErrNone; + } + //first char '+', but there can additional '+'s + if ( seekPlus == 0 ) + { + //ignore first '+' + TPtrC concat = aDivertTo.Right( aDivertTo.Length() - 1 ); + seekPlus = concat.Find( KCFPlusSign ); + if ( seekPlus != KErrNotFound ) + { + return KCFErrIllegalNumber; //two '+'s in number + } + return KErrNone; + } + //'+' in number, but not first char + else + { + return KCFErrIllegalNumber; + } + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertView::SetPromptToQueryL +// Sets prompt to a query. +// +// --------------------------------------------------------------------------- +void CGSCallDivertView::SetPromptToQueryL( CGSCallDivertQuery& aQuery, + const TInt& aType ) + { + HBufC* title = StringLoader::LoadLC( aType ); + aQuery.SetPromptL( *title ); + CleanupStack::PopAndDestroy( title ); + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertView::CreateDelayTimeItemsL +// Creates items for delay time list. +// +// --------------------------------------------------------------------------- +// +void CGSCallDivertView::CreateDelayTimeItemsL( CDesCArrayFlat& aItems) + { + for ( TInt index = 0; index < KGSNrOfDelays; index++ ) + { + AppendDelayItemL( aItems, index ); + } + } + + +// --------------------------------------------------------------------------- +// CGSCallDivertView::CreateRestrictedCallDivertDelayTimeItemsL +// Creates items for Delay time list for restricted call divert. +// +// --------------------------------------------------------------------------- +// +void CGSCallDivertView::CreateRestrictedCallDivertDelayTimeItemsL( + CDesCArrayFlat& aItems ) + { + // first item is 0 seconds + AppendDelayItemL( aItems, -1); + for ( TInt index = 0; index < KGSNrOfDelays; index++ ) + { + AppendDelayItemL( aItems, index ); + } + AppendDelayItemL( aItems, ( 60 / KCFDelayStep ) - 1); + AppendDelayItemL( aItems, ( 90 / KCFDelayStep ) - 1); + AppendDelayItemL( aItems, ( 120 / KCFDelayStep ) - 1); + } + +// ----------------------------------------------------------------------------- +// CGSCallDivertView::ProcessCommandL +// ----------------------------------------------------------------------------- +void CGSCallDivertView::ProcessCommandL( TInt aCommand ) + { + MenuBar()->SetContextMenuTitleResourceId( R_CALL_DIVERT_MSK_CONTEXTMENUBAR ); + // Call base class + CAknView::ProcessCommandL( aCommand ); + } + + +// --------------------------------------------------------------------------- +// +// Before showing a options menu, delete options key specific settings if +// rocker key has been pressed. +// --------------------------------------------------------------------------- +// +void CGSCallDivertView::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + TInt currentItem; + CEikMenuBar* menuBar = MenuBar(); + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + CGSRestrictedDivertContainer &container = + *static_cast( iContainer ); + currentItem = container.CurrentFeatureId(); + } + else + { + CGSCallDivertContainer& container = + *static_cast( iContainer ); + currentItem = container.CurrentFeatureId(); + } + + if ( aResourceId == R_CF_DIV_VIEW_MENU ) + { + if (!menuBar->ItemSpecificCommandsEnabled() && menuBar->GetMenuType() == CEikMenuBar::EMenuOptions) + { + aMenuPane->SetItemDimmed( ECFCmdActivate, ETrue ); + aMenuPane->SetItemDimmed( ECFCmdCancel, ETrue ); + aMenuPane->SetItemDimmed( ECFCmdCheckStatus, ETrue ); + } + //remove help, if not supported from the main divert view + //in this step, help is added to context menu too, which + //is deleted in the next conditional stmt + if ( FeatureManager::FeatureSupported ( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + + if ( iRockerPress ) + { + //remove Exit & Help from the menu + aMenuPane->SetItemDimmed( EAknCmdExit, ETrue ); + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + else + { + iRockerPress = EFalse; + } + } + + if ( aResourceId == R_CF_MSK_DIV_VIEW_MENU || + aResourceId == R_CF_DIV_VIEW_MENU ) + { + // when not available does not have check status + if ( currentItem == ECFDivertWhenNotAvailable ) + { + aMenuPane->SetItemDimmed( ECFCmdCheckStatus, ETrue ); + } + } + } + +// --------------------------------------------------------- +// CGSCallDivertView::ShowErrorNote +// +// --------------------------------------------------------- +void CGSCallDivertView::ShowErrorNoteL() + { + HBufC* string = StringLoader::LoadLC( R_INVALID_NUMBER ); + CAknErrorNote* note = new ( ELeave ) CAknErrorNote ( ETrue ); + note->ExecuteLD( *string ); + CleanupStack::PopAndDestroy( string ); + } + +// --------------------------------------------------------------------------- +// CGSCallDivertView::ReadDefaultVoiceDivertNumbersL +// +// Creates defcault items for the target list. +// --------------------------------------------------------------------------- +void CGSCallDivertView::ReadDefaultVoiceDivertNumbersL( + CDesCArray& aItems, + CDesC16ArrayFlat& aDefaultNumbers ) + { + TInt amount = KErrNone; + + // this is for fetching name to a number from phonebook + HBufC* defaultName = NULL; + + //Default numbers are fetched from shared data + amount = iModel->DivertHandler()->GetDefaultNumbersL( aDefaultNumbers ); + __ASSERT_ALWAYS( amount == aDefaultNumbers.MdcaCount(), + Panic( KGSDivertClassName, ECFDefaultNumberCountError ) ); + + for ( TInt i = 0; i < amount; i++ ) + { + //Default numbers should be checked, if there is a contact name associated + // with it. + defaultName = NULL; + defaultName = iModel->MatchNumberToContactLC( aDefaultNumbers.MdcaPoint( i ) ); + __GSLOGSTRING1("[CGSCallDivertView] ReadDefaultVoiceDivertNumbersL: defaultName: %S", &defaultName); + if ( defaultName ) + { + aItems.AppendL( *defaultName ); + } + else + { + TTelNumber string; + if ( iModel->NumberGroupingSupportedL() ) + { + CPNGNumberGrouping* numberGrouping = CPNGNumberGrouping::NewL( + KPSUIMaxPSUIItemLength ); + CleanupStack::PushL( numberGrouping ); + + if ( aDefaultNumbers.MdcaPoint( i ).Length() <= + numberGrouping->MaxDisplayLength() ) + { + numberGrouping->Set( aDefaultNumbers.MdcaPoint( i ) ); + string = numberGrouping->FormattedNumber(); + } + CleanupStack::PopAndDestroy( numberGrouping ); + } + if ( !string.Length() ) + { + string = aDefaultNumbers.MdcaPoint(i); + } + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( string ); + aItems.AppendL( string ); + __GSLOGSTRING1("[CGSCallDivertView] ReadDefaultVoiceDivertNumbersL: string: %S", &string); + } + CleanupStack::PopAndDestroy(); //defaultName + } + } + +// --------------------------------------------------------------------------- +// CGSCallDivertView::UpdateDefaultVoiceDivertNumbersL +// +// Updates most recently used numbers to cenrep +// --------------------------------------------------------------------------- +void CGSCallDivertView::UpdateDefaultVoiceDivertNumbersL( TDes& aNumber ) + + { + if ( aNumber != KNullDesC && iContextMenuItems ) + { + //If activation is done to already existing default number, + //but using the "Other number" selection, this must be verified. + HBufC* contactName = iModel->MatchNumberToContactLC( aNumber ); + + TInt found = KErrNone; + TInt loc = KErrNotFound; + + if ( contactName ) + { + found = iContextMenuItems->Find( *contactName, loc ); + } + else + { + found = iContextMenuItems->Find( aNumber, loc ); + } + CleanupStack::PopAndDestroy(); //contactName + + if ( found > 0 ) //number is not part of current def.numbers + { + iModel->DivertHandler()->SetNewDefaultNumberL( aNumber ); + } + else + { + iModel->DivertHandler()->SwapDefaultNumberL( loc ); + } + } + else + { + __GSLOGSTRING( "[CGSCallDivertView::UpdateDefaultVoiceDivertNumbersL] iContextMenuItems == NULL!!" ); + } + + } + +// --------------------------------------------------------------------------- +// CGSCallDivertView::HandleNotifyL +// +// AIW callback function. +// --------------------------------------------------------------------------- +TInt CGSCallDivertView::HandleNotifyL( + TInt aCmdId, + TInt aEventId, + CAiwGenericParamList& aEventParamList, + const CAiwGenericParamList& /*aInParamList*/ ) + { + TInt err = KErrNone; + if( ( aCmdId == KAiwCmdSelect ) || ( aCmdId == KAiwCmdAssign ) ) + { + if( aEventId == KAiwEventCompleted ) + { + TInt index = 0; + iNumberFetchedAsynchronously = ETrue; + const TAiwGenericParam* param = aEventParamList.FindFirst( + index, EGenericParamContactLinkArray ); + + if( param && iStoresOpened ) + { + if( iContactLinks ) + { + delete iContactLinks; + iContactLinks = NULL; + } + TPtrC8 contactLinks = param->Value().AsData(); + + CVPbkContactLinkArray* localContactLinks = + CVPbkContactLinkArray::NewLC( + contactLinks, + iContactManager->ContactStoresL() ); + + CleanupStack::Pop( localContactLinks ); + iContactLinks = localContactLinks; + + if( iContactLinks->Count() > 0 ) + { + iRetrieveOperation = iContactManager->RetrieveContactL( iContactLinks->At( 0 ), *this ); + } + } + } + else if (aEventId == KAiwEventCanceled) + { + // Do nothing. + } + else if (aEventId == KAiwEventOutParamCheck) + { + // This is needed as PBK2 mysteriously crashes if check is not + // acccepted. There's no actual need to check anything but to go + // ahead here so setting to ETrue. + err = ETrue; + } + else if (aEventId == KAiwEventQueryExit) + { + err = ETrue; + } + } + return err; + } + + +// -------------------------------------------------------------------------- +// CGSCallDivertView::VPbkSingleContactOperationComplete +// -------------------------------------------------------------------------- +// +void CGSCallDivertView::VPbkSingleContactOperationComplete( + MVPbkContactOperationBase& /*aOperation*/, + MVPbkStoreContact* aContact ) + { + if( iRetrieveOperation ) + { + delete iRetrieveOperation; + iRetrieveOperation = NULL; + } + TRAP_IGNORE + ( + MVPbkStoreContactField* field = aContact->Fields().RetrieveField( iContactLinks->At( 0 ) ); + if ( field && field->FieldData().DataType() == EVPbkFieldStorageTypeText ) + { + // aContact has selected phone number from Pbk2 dialog. Set this as + // a text for ExecuteDivertNumberQueryL. + TCallDivertSetting setting; + setting.iSetting = EActivateDiverting; + setting.iNumber = MVPbkContactFieldTextData::Cast( field->FieldData() ).Text(); + + //Ask for user input. + ExecuteDivertNumberQueryL( setting.iNumber, R_TEXT_PRMPT_NUMBER ); + + // ExecuteDivertNumberQueryL() will set setting.iNumber to KNullDesC if user + // selected 'search'. In this case program execution is moved to + // pbk2 asynchronous dialog and this function can exit without + // sending call divert request. + if( setting.iNumber != KNullDesC ) + { + // Send divert request. + iModel->SendCallDivertRequestL( setting, + RMobilePhone::EServiceActionRegister, + iVoiceMailboxDivert, + ECFCmdActivate, + (TGSCallDivertServices) iCurrentItem ); + } + } + ); + delete aContact;// Ownership is taken by this + } + + +// -------------------------------------------------------------------------- +// CGSCallDivertView::VPbkSingleContactOperationFailed +// -------------------------------------------------------------------------- +// +void CGSCallDivertView::VPbkSingleContactOperationFailed( + MVPbkContactOperationBase& /*aOperation*/, + TInt /*aError*/) + { + if( iRetrieveOperation ) + { + delete iRetrieveOperation; + iRetrieveOperation = NULL; + } + + } + +// -------------------------------------------------------------------------- +// CGSCallDivertView::OpenComplete +// -------------------------------------------------------------------------- +// +void CGSCallDivertView::OpenComplete() + { + iStoresOpened = ETrue; + } + +// -------------------------------------------------------------------------- +// CGSCallDivertView::StoreReady +// -------------------------------------------------------------------------- +// +void CGSCallDivertView::StoreReady( MVPbkContactStore& /*aContactStore*/ ) + { + // Do nothing + } + +// -------------------------------------------------------------------------- +// CGSCallDivertView::StoreUnavailable +// -------------------------------------------------------------------------- +// +void CGSCallDivertView::StoreUnavailable + ( MVPbkContactStore& /*aContactStore*/, TInt /*aReason*/ ) + { + // Do nothing + } + +// -------------------------------------------------------------------------- +// CGSCallDivertView::HandleStoreEventL +// -------------------------------------------------------------------------- +// +void CGSCallDivertView::HandleStoreEventL( MVPbkContactStore& /*aContactStore*/, + TVPbkContactStoreEvent /*aStoreEvent*/ ) + { + // Do nothing + } + + + +// --------------------------------------------------------------------------- +// CGSCallDivertView::CreateTimeListL +// +// Activates this view's popup list in order to change time-setting. +// --------------------------------------------------------------------------- +TInt CGSCallDivertView::CreateTimeListL() + { + CAknSinglePopupMenuStyleListBox* list = + new ( ELeave ) CAknSinglePopupMenuStyleListBox; + CleanupStack::PushL( list ); + + CAknPopupList* popupList = + CAknPopupList::NewL( list, R_AVKON_SOFTKEYS_OK_CANCEL__OK ); + CleanupStack::PushL( popupList ); + + HBufC* title = StringLoader::LoadLC( R_TEXT_DELAY_HEADER ); + popupList->SetTitleL( *title ); + CleanupStack::PopAndDestroy( title ); + + list->ConstructL( popupList,CEikListBox::ELeftDownInViewRect ); + list->CreateScrollBarFrameL( ETrue ); + list->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, + CEikScrollBarFrame::EAuto ); + + CDesCArrayFlat* items; + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + items = new ( ELeave ) CDesCArrayFlat( KGSNrOfDelays + 4 ); + CleanupStack::PushL( items ); + CreateRestrictedCallDivertDelayTimeItemsL( *items ); + } + else + { + items = new ( ELeave ) CDesCArrayFlat( KGSNrOfDelays ); + CleanupStack::PushL( items ); + CreateDelayTimeItemsL( *items ); + } + CTextListBoxModel* model = list->Model(); + model->SetItemTextArray( items ); + model->SetOwnershipType( ELbmOwnsItemArray ); + CleanupStack::Pop(); //items + list->HandleItemAdditionL(); + + //set focus according to file read by phonesettings + //set delay timer field value + TInt currIndex = KErrNone; + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + TInt itemCount = items->Count(); + if (( iModel->DivertHandler()->GetTimerValueL() / KCFDelayStep ) > ( itemCount - 4)) + { + // Within 60, 90, 120 range + switch ( iModel->DivertHandler()->GetTimerValueL() ) + { + case 60: + currIndex = itemCount - 3; + break; + case 90: + currIndex = itemCount - 2; + break; + case 120: + currIndex = itemCount - 1; + break; + } + } + else + { + currIndex = iModel->DivertHandler()->GetTimerValueL() / KCFDelayStep; + } + } + else + { + currIndex = ( iModel->DivertHandler()->GetTimerValueL() / KCFDelayStep ) - 1; + } + __GSLOGSTRING1( "[CGSCallDivertView::CreateTimeListL] currIndex: %d", currIndex ); + + list->SetCurrentItemIndex( currIndex ); + //if possible show topmost item + list->SetTopItemIndex(0); + + TInt keyPress = popupList->ExecuteLD(); + CleanupStack::Pop( popupList ); + if ( keyPress ) + { + TInt index = list->CurrentItemIndex(); + __GSLOGSTRING1( "[CGSCallDivertView::CreateTimeListL] index: %d", index ); + + if( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallDivert ) ) + { + TInt itemCount = items->Count(); + if ( index > ( itemCount - 4)) + { + // Within 60, 90, 120 range + if ( index == itemCount - 3) + { + iModel->DivertHandler()->SetTimerValueL( 60 ); + } + else if ( index == itemCount - 2 ) + { + iModel->DivertHandler()->SetTimerValueL( 90 ); + } + else if ( index == itemCount - 1 ) + { + iModel->DivertHandler()->SetTimerValueL( 120 ); + } + } + else + { + // first entry is 0 seconds + currIndex = iModel->DivertHandler()->SetTimerValueL( index * KCFDelayStep ); + } + } + else + { + //save to file the correct value calculated from index + iModel->DivertHandler()->SetTimerValueL( ( index + 1 ) * KCFDelayStep ); + } + } + CleanupStack::PopAndDestroy( list ); + return keyPress; + } + +// -------------------------------------------------------------------------- +// CGSCallDivertView::RemoveInvalidChars +// Remove invalid " ", "()" which were sync with PC suite. +// -------------------------------------------------------------------------- +// +void CGSCallDivertView::RemoveInvalidChars( TDes& aNumber ) + { + TInt noOfInvalidchars = KCallDivertInvalidchars().Length(); + TInt location = KErrNone; + // delete the invalid chars of KCallDivertInvalidchars. + //aNumber changed to valid phone number if it contains invalid chars + for ( TInt index = 0; index < noOfInvalidchars; index++ ) + { + while ( ETrue ) + { + location = aNumber.Find( KCallDivertInvalidchars().Mid( index, 1 ) ); + if ( location == KErrNotFound ) + { + break; + } + aNumber.Delete( location, 1 ); //delete the invalid char, aNumber changed + } + } + } +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Src/GSLocalBaseView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSLocalBaseView.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,209 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base view for all the views in General Settings +* +*/ + + +// INCLUDE FILES +#include "GSLocalBaseView.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//Disabling warning caused by KGSDoActivateError constant +#pragma diag_suppress 177 +// CONSTANTS +_LIT( KGSDoActivateError, "DoActivateL" ); + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::CGSLocalBaseView +// +// C++ constructor +// --------------------------------------------------------------------------- +// +CGSLocalBaseView::CGSLocalBaseView() + { + iAppUi = iAvkonViewAppUi; + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::~CGSLocalBaseView +// +// Destructor +// --------------------------------------------------------------------------- +// +CGSLocalBaseView::~CGSLocalBaseView() + { + if ( iContainer && iAppUi ) + { + iAppUi->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + } + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::SetCurrentItem +// +// +// --------------------------------------------------------------------------- +// +void CGSLocalBaseView::SetCurrentItem( TInt aIndex ) + { + iCurrentItem = aIndex; + if( iContainer ) + { + iContainer->SetSelectedItem( aIndex ); + } + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::HandleListBoxEventL +// +// +// --------------------------------------------------------------------------- +// +void CGSLocalBaseView::HandleListBoxEventL( CEikListBox* /*aListBox*/, + TListBoxEvent aEventType ) + { + switch ( aEventType ) + { + case EEventEnterKeyPressed: + case EEventItemSingleClicked: + HandleListBoxSelectionL(); + break; + default: + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::SetNaviPaneL +// +// +// --------------------------------------------------------------------------- +// +void CGSLocalBaseView::SetNaviPaneL() + { + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::CreateNaviPaneContextL +// +// +// --------------------------------------------------------------------------- +// +void CGSLocalBaseView::CreateNaviPaneContextL( TInt /*aResourceId*/ ) + { + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::HandleClientRectChange +// +// +// --------------------------------------------------------------------------- +// +void CGSLocalBaseView::HandleClientRectChange() + { + if ( iContainer && iContainer->iListBox ) + { + iContainer->SetRect( ClientRect() ); + } + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::DoActivateL +// Activates the view. +// +// --------------------------------------------------------------------------- +// +void CGSLocalBaseView::DoActivateL(const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/) + { + if( iContainer ) + { + iAppUi->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + iContainer = NULL; + } + + CreateContainerL(); + + iAppUi->AddToViewStackL( *this, iContainer ); + iContainer->iListBox->SetListBoxObserver( this ); + + SetNaviPaneL(); + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::DoDeactivate() +// +// +// --------------------------------------------------------------------------- +// +void CGSLocalBaseView::DoDeactivate() + { + if ( iContainer ) + { + iAppUi->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + iContainer = NULL; + } + } + + +// --------------------------------------------------------------------------- +// CGSLocalBaseView::CreateContainerL() +// +// +// --------------------------------------------------------------------------- +// +void CGSLocalBaseView::CreateContainerL() + { + NewContainerL(); + __ASSERT_DEBUG( iContainer, + User::Panic( KGSDoActivateError, EGSViewPanicNullPtr ) ); + iContainer->SetMopParent( this ); + + TRAPD( error, iContainer->ConstructL( ClientRect() ) ); + + if ( error ) + { + delete iContainer; + iContainer = NULL; + User::Leave( error ); + } + } + + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/Src/GSRestrictedDivertContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSRestrictedDivertContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,142 @@ +/* +* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for Restricted Call Divert's view. +* +*/ + + +// INCLUDE FILES +#include "GSRestrictedDivertContainer.h" +#include "CallDivertPlugin.hrh" + +#include +#include +#include +#include // for help context of Divert +#include +#include + + +// ========================= MEMBER FUNCTIONS ================================ +// --------------------------------------------------------------------------- +// CGSRestrictedDivertContainer::ConstructL +// Symbian OS two phased constructor +// +// --------------------------------------------------------------------------- +void CGSRestrictedDivertContainer::ConstructL( const TRect& aRect ) + { + iListBox = new ( ELeave ) CAknSettingStyleListBox; + BaseConstructL( aRect, R_CF_MAIN_VIEW_TITLE, R_CF_RESTRICTED_MAIN_LBX ); + } + +// --------------------------------------------------------------------------- +// CGSRestrictedDivertContainer::~CGSRestrictedDivertContainer +// Destructor +// +// --------------------------------------------------------------------------- +CGSRestrictedDivertContainer::~CGSRestrictedDivertContainer() + { + if ( iListboxItemArray ) + { + delete iListboxItemArray; + } + } + +// --------------------------------------------------------------------------- +// CGSRestrictedDivertContainer::GetHelpContext +// This function is called when Help application is launched. +// Only available, when __SERIES60_HELP is defined. +// --------------------------------------------------------------------------- +// +void CGSRestrictedDivertContainer::GetHelpContext( + TCoeHelpContext& aContext ) const + { + aContext.iMajor = KUidGS; + aContext.iContext = KDIV_HLP_CALL_FORW_MAIN; + } + + +// --------------------------------------------------------------------------- +// CGSRestrictedDivertContainer::ConstructListBoxL +// Creates list box from resources. +// +// --------------------------------------------------------------------------- +// +void CGSRestrictedDivertContainer::ConstructListBoxL( TInt aResLbxId ) + { + iListBox->ConstructL( this, EAknListBoxSelectionList ); + + iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, + *iListBox, *iCoeEnv ); + iListBox->Model()->SetItemTextArray( iListboxItemArray ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + CreateListBoxItemsL(); + } + +// --------------------------------------------------------------------------- +// CGSRestrictedDivertContainer::CreateListBoxItemsL +// Creates List box items +// +// --------------------------------------------------------------------------- +void CGSRestrictedDivertContainer::CreateListBoxItemsL() + { + MakeRestrictedDivertItemL(); + } + +// --------------------------------------------------------------------------- +// CGSRestrictedDivertContainer::UpdateListBoxL +// +// +// --------------------------------------------------------------------------- +void CGSRestrictedDivertContainer::UpdateListBoxL( TInt aFeatureId ) + { + switch( aFeatureId ) + { + case EGSSettIdVoiceDivert: + MakeRestrictedDivertItemL(); + break; + default: + break; + } + + // Update the listbox + iListBox->HandleItemAdditionL(); + } + + +// --------------------------------------------------------------------------- +// CGSRestrictedDivertContainer::CurrentFeatureId +// +// +// --------------------------------------------------------------------------- +TInt CGSRestrictedDivertContainer::CurrentFeatureId() const + { + return iListboxItemArray->CurrentFeature( ); + } + + +// --------------------------------------------------------------------------- +// CGSRestrictedDivertContainer::MakeVoiceDivertsItemL +// +// +// --------------------------------------------------------------------------- +void CGSRestrictedDivertContainer::MakeRestrictedDivertItemL() + { + iListboxItemArray->SetItemVisibilityL( EGSSettIdVoiceDivert, + CGSListBoxItemTextArray::EVisible ); + } + + +//End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSGenPlugin. +* +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSCallDivertPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gscalldivertplugin.iby ) +../rom/GSCallDivertPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gscalldivertpluginresources.iby ) +loc/cf.loc MW_LAYER_LOC_EXPORT_PATH( cf.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gscalldivertplugin.mif + OPTION HEADERFILE gscalldivertplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_set_div_sub +END + + +PRJ_MMPFILES +GSCallDivertPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSCallDivertPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallDivertPlugin/loc/cf.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallDivertPlugin/loc/cf.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,261 @@ +/* +* Copyright (c) 2002, 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This file contains the localised strings for call forward folder in gs +* +*/ + + +//d: title for call settings folder +//l: list_single_large_graphic_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_folder_divert "Call Divert" + +//d: title for call divert settings folder +//l: title_pane_t2/opt9 +// +#define qtn_div_heading_cf "Call divert" + +//d: option in call forward's list, divert all voice calls +//l: list_double2_pane +// +#define qtn_div_dlist_all "All voice calls" + +//d: option in call forward's list, divert all video calls +//l: list_double2_pane +// +#define qtn_div_dlist_all_video "All video calls" + +//d: option in call forward's list, divert all voice calls +//l: list_double2_pane +// +#define qtn_div_dlist_busy "If busy" + +//d: option in call forward's list, divert when not answered +//l: list_double2_pane +// +#define qtn_div_dlist_noreply "If not answered" + +//d: option in call forward's list, divert when off or no coverage +//l: list_double2_pane +// +#define qtn_div_dlist_notavail "If not available" + +//d: option in call forward's list, divert busy, no answer, off or no coverage +//l: list_double2_pane +// +#define qtn_div_dlist_outreach "If out of reach" + +//d: option in call forward's list, divert all fax calls +//l: list_double2_pane +// +#define qtn_div_dlist_faxall "All fax calls" + +//d: option in call forward's list, divert all data calls +//l: list_double2_pane +// +#define qtn_div_dlist_dataall "All data calls" + +//d: activating highlighted call forward +//l: list_single_pane_t1_cp2 +// +#define text_activate_divert "Activate" + +//d: cancelling highlighted call forward +//l: list_single_pane_t1_cp2 +// +#define text_cancel_divert "Cancel" + +//d: checking status of highlighted call forward +//l: list_single_pane_t1_cp2 +// +#define text_check_status "Check status" + +//d: option in call forward's list, cancelling all diverts +//l: list_single_pane_t1_cp2 +// +#define text_cancel_all_diverts "Cancel all diverts" + +//d: heading to call forward's menu list, divert all voice calls +//l: heading_pane_t1 +// +#define qtn_div_title_all "All voice calls" + +//d: heading to call forward's menu list, divert all video calls +//l: heading_pane_t1 +// +#define qtn_div_title_all_video "All video calls" + +//d: heading to call forward's menu list, divert all voice calls +//l: heading_pane_t1 +// +#define qtn_div_title_busy "If busy" + +//d: heading to call forward's menu list, divert when not answered +//l: heading_pane_t1 +// +#define qtn_div_title_not_answered "If not answered" + +//d: heading to call forward's menu list, divert when off or no coverage +//l: heading_pane_t1 +// +#define qtn_div_title_not_reach "If out of reach" + +//d: heading to call forward's menu list; CFB, CFNRly or CFNRch +//l: heading_pane_t1 +// +#define qtn_div_title_not_available "If not available" + +//d: heading to call forward's menu list, divert all fax calls +//l: heading_pane_t1 +// +#define qtn_div_title_all_fax "All fax calls" + +//d: heading to call forward's menu list, divert all data calls +//l: heading_pane_t1 +// +#define qtn_div_title_all_data "All data calls" + +//d: diverting call to the voice mailbox +//l: list_single_pane_t1_cp2 +// +#define text_divert_to_voice_mail "To voice mailb." + +//d: diverting call to some other number +//l: list_single_pane_t1_cp2 +// +#define text_divert_to_number "To other No." + +//d: entering number to which the forward is targeted, prompt to data query +//l: popup_query_data_window +// +#define qtn_div_prmpt_number "Number: " + +//d: entering number to which the fax divert is targeted, prompt to data query +//l: popup_query_data_window +// +#define qtn_div_prmpt_fax_number "Enter number: " + +//d: entering number to which the data divert is targeted, prompt to data query +//l: popup_query_data_window +// +#define qtn_div_prmpt_data_number "Enter number: " + +//d: entering number to which the video divert is targeted, prompt to data query +//l: popup_query_data_window_t3/opt2 +// +#define qtn_ss_prmpt_video_number "Number: " + +//d: information note when divert succesfully deactivated +//l: heading_pane_t1 +// +#define qtn_div_heading_delay "Select delay time" + +//d: list to choose from when activating divert with possible timing +//d: %N stands for numbers 5,10,15,20,25,30 +//l: list_single_pane_t1_cp2 +// +#define qtn_div_slist_seconds "%N seconds" + +//d: error note text when entering invalid phone number +//l: popup_note_window +// +#define text_invalid_number "Phone number not valid" + +//d: title for voice call divert settings sub-folder +//l: title_pane_t2/opt9 +// +#define qtn_div_heading_voice "Voice call diverts" + +//d: title for data call divert settings sub-folder +//l: title_pane_t2/opt9 +// +#define qtn_div_heading_data "Data call diverts" + +//d: title for data and video call divert settings sub-folder +//l: title_pane_t2/opt9 +// +#define qtn_div_heading_data_video "Data and video call diverts" + +//d: title for video call divert settings sub-folder +//l: title_pane_t2/opt9 +// +#define qtn_div_heading_video "Video call diverts" + +//d: title for fax call divert settings sub-folder +//l: title_pane_t2/opt9 +// +#define qtn_div_heading_fax "Fax call diverts" + +//d: selection in call divert menu, divert voice calls +//l: list_double2_pane +// +#define qtn_div_voice_calls "Voice calls" + +//d: selection in call divert menu, divert data calls +//l: list_double2_pane +// +#define qtn_div_data_calls "Data calls" + +//d: selection in call divert menu, divert data and video calls +//l: list_double2_pane +// +#define qtn_div_data_video_calls "Data and video calls" + +//d: selection in call divert menu, divert fax calls +//l: list_double2_pane +// +#define qtn_div_fax_calls "Fax calls" + +//d: data & video calls selection in call forward's selection list +//l: list_double2_pane +// +#define qtn_div_dlist_all_data_video "All data and video calls" + +//d: selection in call divert menu, divert video calls +//l: list_double2_pane +// +#define qtn_div_video_calls "Video calls" + +//d: diverting video call to the video mailbox +//l: list_single_pane_t1_cp2 +//w: +//r:3.1 +// +#define qtn_ss_divert_to_video_mailbox "To video mailbox" + +//d: diverting video call to other number user defined number +//l: list_single_pane_t1_cp2 +//w: +//r:3.1 +// +#define qtn_ss_divert_vcall_to_other_number "To other number" + +//d: selection in restricted call divert menu, call forward settings +//l: list_double2_pane +//w: +//r:3.1 +// +#define qtn_div_restricted "Call forward settings" + +//d: Title for forwarding all data and video calls popup menu +//l: heading_pane_t1 +//w: +//r:3.1 +// +#define qtn_div_title_all_data_and_videocalls "All data & video calls" + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/GSCallPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/GSCallPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSCallPlugin project file. +* +*/ + +#include // For RESOURCE_FILES_DIR +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gscallplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x102824A1 +VENDORID VID_DEFAULT + +SOURCEPATH src // /GSCallPlugin +SOURCE GSCallPluginImplementationTable.cpp +SOURCE GSCallPluginContainer.cpp +SOURCE GSCallPlugin.cpp +SOURCE GSCallPluginModel.cpp + +//User include paths +USERINCLUDE inc +USERINCLUDE data // For *.rh +USERINCLUDE loc +USERINCLUDE ../Data +USERINCLUDE ../Cenrep +USERINCLUDE ../Logger +USERINCLUDE ../GSTelPlugin/Inc + +// The above include is required becasue of secuicodequerydialog.h + +//System include paths +SYSTEMINCLUDE /epoc32/include/ecom +// Default system include paths for middleware layer modules. +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH data + +START RESOURCE 102824A1.rss +TARGET gscallplugin.rsc +END + +START RESOURCE GSCallPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +START RESOURCE SoftReject.rss +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +LIBRARY aknskins.lib // for enhanced skinning +LIBRARY aknskinsrv.lib // for enhanced skinning +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY centralrepository.lib +LIBRARY cenrepnotifhandler.lib +LIBRARY commonengine.lib // For RConeResourceLoader +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY egul.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY eikctl.lib +LIBRARY etelmm.lib // security, network, call +LIBRARY euser.lib +LIBRARY featmgr.lib // Feature manager +LIBRARY gsecomplugin.lib +LIBRARY gsframework.lib // For base classes +LIBRARY gslistbox.lib // For CGSListBoxItemTextArray +LIBRARY numbergrouping.lib +LIBRARY phonesettings.lib +LIBRARY psui.lib // phone settings notes UI +LIBRARY sssettings.lib // Supplementary settings +LIBRARY flogger.lib // For GSLogger + +// still image related libraries +LIBRARY backgroundimage.lib +LIBRARY mgfetch.lib // for image selection list +LIBRARY drmcommon.lib +LIBRARY imageconversion.lib + +LIBRARY secui.lib // security +LIBRARY aknnotify.lib // for CAknGlobalNote.h +LIBRARY hlplch.lib // for "Help" options menu +LIBRARY eikdlg.lib phoneclient.lib // eikon dialogs + +#if defined(__VOIP) && defined(RD_VOIP_REL_2_2) +LIBRARY serviceprovidersettings.lib +#endif // __VOIP && RD_VOIP_REL_2_2 + +SOURCEPATH data +DOCUMENT 102824A1.rss +DOCUMENT GSCallPluginRsc.rss +DOCUMENT SoftReject.rss + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSCallPlugin. +* +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSCallPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gscallplugin.iby ) +../rom/GSCallPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gscallpluginresources.iby ) +loc/GSCallPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gscallplugin.loc ) +loc/SoftReject.loc MW_LAYER_LOC_EXPORT_PATH( softreject.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gscallplugin.mif + OPTION HEADERFILE gscallplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_set_call_sub.bmp -c8,8 qgn_prop_set_call_tab4.bmp +END +PRJ_MMPFILES +GSCallPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSCallPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/data/102824A1.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/data/102824A1.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for Call Settings plugin. +* +*/ + + +// INCLUDES +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x102824A1; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x102824A2; + version_no = 1; + display_name = "Call Settings Plugin"; + default_data = "0x1020723D";//Parent UID + opaque_data = "10";//Order number + } + }; + } + }; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/data/GSCallPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/data/GSCallPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,1340 @@ +/* +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for GSCallPlugin +* +*/ + +// RESOURCE IDENTIFIER +NAME CALP // 4 letter ID + +// INCLUDES +#include + +#include +#include +#include "GSCallPlugin.hrh" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include + +// CONSTANTS +//#define KGsCallPluginIcons "Z:"APP_RESOURCE_DIR"\\gscallplugin.mbm" + + +// RESOURCE DEFINITIONS + +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +RESOURCE TBUF + { + buf="CALL"; + } + +//---------------------------------------------------- +// +// EIK_APP_INFO +// It contains application information. +// +//---------------------------------------------------- +// +RESOURCE EIK_APP_INFO + { + } + + +//---------------------------------------------------- +// r_gs_call_view_caption +// +// Telephony view caption for plugin +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_call_plugin_caption + { + buf = qtn_set_folder_call; + } + + +//---------------------------------------------------- +// r_gs_call_view_title +// +// Telephony view title +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_tel_view_title + { + txt = qtn_set_title_settings_telephone; + } + + +//CALL + +//---------------------------------------------------- +// +// r_gs_call_wait_view_menu +// Call Wait sub-menupane +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_call_wait_view_menu + { + items = + { + MENU_ITEM + { + command = EGSCmdCallWaitActivate; + txt = text_activate_waiting; + }, + MENU_ITEM + { + command = EGSCmdCallWaitDeactivate; + txt = text_cancel_waiting; + }, + MENU_ITEM + { + command = EGSCmdCallWaitInquiry; + txt = text_status_waiting; + } + }; + } + + +//---------------------------------------------------- +// +// r_gs_menubar_call_view +// Call sub-menubar +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_gs_menubar_call_view + { + titles = + { + MENU_TITLE { menu_pane = r_gs_call_view_menu; } + }; + } + +//---------------------------------------------------- +// +// r_gs_call_view +// Call sub-menu view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_call_view + { + menubar = r_gs_menubar_call_view; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_EMPTY; + } + +//---------------------------------------------------- +// +// r_gs_call_view_menu +// Call sub-menupane +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_call_view_menu + { + items= + { + MENU_ITEM + { + command = EAppCmdCreatePopupList; + txt = qtn_set_options_change; + flags = EEikMenuItemAction; // action command + + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = EAknCmdExit; + txt = qtn_options_exit; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_call_view_title +// Call sub-menu title +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_call_view_title + { + txt = qtn_set_title_settings_call; + } + + +//---------------------------------------------------- +// +// r_own_number_sending_heading +// Title to own number sending setting page +// +//---------------------------------------------------- +// +RESOURCE TBUF r_own_number_sending_heading + { + buf = qtn_own_number_sending_heading; + } + +//---------------------------------------------------- +// +// r_cli_sending_default +// CLI setting value to own number sending setting page +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cli_sending_default + { + buf = text_cli_sending_default; + } + +//---------------------------------------------------- +// +// r_cli_sending_on +// CLI setting value to own number sending setting page +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cli_sending_on + { + buf = text_cli_sending_on; + } + +//---------------------------------------------------- +// +// r_cli_sending_off +// CLI setting value to own number sending setting page +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cli_sending_off + { + buf = text_cli_sending_off; + } + +//---------------------------------------------------- +// +// r_cterm_setting +// Call Termination Note setting page resources +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cterm_setting + { + buf = text_cterm_setting; + } + +//---------------------------------------------------- +// +// r_call_termination_note_on +// Call Termination Note setting page item +// +//---------------------------------------------------- +// +RESOURCE TBUF r_call_termination_note_on + { + buf = text_call_termination_note_on; + } + +//---------------------------------------------------- +// +// r_call_termination_note_off +// Call Termination Note setting page item +// +//---------------------------------------------------- +// +RESOURCE TBUF r_call_termination_note_off + { + buf = text_call_termination_note_off; + } + +//---------------------------------------------------- +// +// r_gs_show_call_duration_setting_page +// Show Call Duration setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_gs_show_call_duration_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_logs_lda3_time; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +//---------------------------------------------------- +// +// r_gs_show_call_duration_setting_page_lbx +// setting page items for show call duration +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_gs_show_call_duration_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_logs_ldv3_timer_on; + }, + LBUF + { + txt = qtn_logs_ldv3_timer_off; + } + }; + } + +//----------------------------------------------------------------------------- +// +// r_call_lbx_resource +// Call listbox resource +// +//----------------------------------------------------------------------------- +// +RESOURCE LISTBOX r_call_lbx_resource + { + array_id = r_call_lbx; + flags = EEikListBoxMultipleSelection; + } + +//----------------------------------------------------------------------------- +// +// r_call_lbx +// Call listbox items +// +//----------------------------------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_call_lbx + { + items = + { + GS_FEATURE + { + txt = "\t"qtn_cp_setting_opening_slide"\t\t"; + item = EGSOpeningSlideAnswerCallItemId; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = "\t"qtn_cp_setting_closing_slide"\t\t"; + item = EGSClosingSlideEndCallItemId; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = "\t"text_clir"\t\t"; + item = EGSCliItemId; + }, + GS_FEATURE + { + txt = "\t"qtn_clir_voip"\t\t"; + item = EGSICSendIntCallIdItemId; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = "\t"text_call_waiting"\t\t"; + item = EGSCallWaitingItemId; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = "\t"qtn_voip_call_waiting"\t\t"; + item = EGSICWaitingItemId; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = "\t"qtn_voip_do_not_disturb"\t\t"; + item = EGSDndItemId; + type = EGSListBoxItemTypeIsDynamic; + }, +#ifndef RD_VOIP_REL_2_2 + GS_FEATURE + { + txt = "\t"qtn_set_voip_settings_preferred_tel"\t\t"; + item = EGSICPreferredTelephonyId; + type = EGSListBoxItemTypeIsDynamic; + }, +#endif // !RD_VOIP_REL_2_2 + GS_FEATURE + { + txt = "\t"qtn_gs_soft_reject_text"\t\t"; + item = EGSSoftRejectTextItemId; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = "\t"qtn_gs_long_press_call_key"\t\t"; + item = EGSLongPressCallKeyItemId; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = "\t"qtn_gs_own_image_vt_call"\t\t"; + item = EGSOwnImageVtCallItemId; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = "\t"qtn_gs_still_image_vt_call"\t\t"; + item = EGSStillImageItemId; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE //NEW + { + txt = "\t"qtn_gs_auto_redial_to_voice"\t\t"; + item = EGSAutoRedialToVoiceItemId; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = "\t"qtn_set_replace_prefix"\t\t"; + item = EGSReplacePrefixItemId; + type = EGSListBoxItemTypeIsDynamic; + }, + /*GS_FEATURE + { + txt = "\t"qtn_ccbs_setting_item"\t\t"; + item = EGSCCBSItemId; + type = EGSListBoxItemTypeIsDynamic; + },*/ + + GS_FEATURE + { + txt = "\t"qtn_logs_lda3_time"\t\t"; + item = EGSShowCallDurationItemId; + }, + GS_FEATURE + { + txt = "\t"text_cterm_setting"\t\t"; + item = EGSSummaryAfterCallItemId; + }, + GS_FEATURE + { + txt = "\t"qtn_als_phoneline_in_use"\t\t"; + item = EGSLineChangeItemId; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = "\t"qtn_als_phonelinet_blocking"\t\t"; + item = EGSALSBlockItemId; + type = EGSListBoxItemTypeIsDynamic; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_still_image_setting_page +// VT still image setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_gs_still_image_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_gs_still_image_vt_call; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +//---------------------------------------------------- +// +// r_gs_still_image_setting_page_lbx +// "Not used" option for Still Image feature +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_gs_still_image_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_gs_still_image_notused; + }, + LBUF + { + txt = qtn_gs_still_image_define; + } + }; + } + + +//---------------------------------------------------- +// +// r_gs_replace_prefix_setting_page +// Japanese replace prefix setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_gs_replace_prefix_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_set_replace_prefix; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +//---------------------------------------------------- +// +// r_gs_replace_prefix_setting_page_lbx +// setting page items for Japanese replace prefix +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_gs_replace_prefix_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_set_replace_prefix_on; + }, + LBUF + { + txt = qtn_set_replace_prefix_off; + } + }; + } + + +//---------------------------------------------------- +// +// r_replace_prefix_data_query +// Replace prefix data query. +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_replace_prefix_data_query + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + itemflags=EEikDlgItemTakesEnterKey; + control = AVKON_DATA_QUERY + { + layout = EPhoneLayout; + label = qtn_set_prefix_data_query; + control = EDWIN + { + flags=EEikEdwinNoHorizScrolling; + width=10; + lines=1; + maxlength=10; + numeric_keymap = EAknEditorStandardNumberModeKeymap; + allowed_input_modes = EAknEditorNumericInputMode; + default_input_mode = EAknEditorNumericInputMode; + }; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_gs_drm_not_allowed +// DRM protected image cannot be selected as VT still iamge. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_drm_not_allowed + { + buf = qtn_drm_not_allowed; + } + + +//----------------------------------------------------------------------------- +// +// r_als_line_selection_mode +// ALS: Line in use +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_als_line_selection_mode + { + buf = qtn_als_line_selection_mode; + } + + +//----------------------------------------------------------------------------- +// +// r_als_line1 +// ALS: Line in use item +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_als_line1 + { + buf = qtn_als_line1; + } + +//----------------------------------------------------------------------------- +// +// r_als_line2 +// ALS: Line in use item +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_als_line2 + { + buf = qtn_als_line2; + } + +//----------------------------------------------------------------------------- +// +// r_als_phoneline_block_mode +// ALS: Line block mode +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_als_phoneline_block_mode + { + buf = qtn_als_phoneline_block_mode; + } + +//----------------------------------------------------------------------------- +// +// r_als_line_blocking_on_sel +// ALS: Line block mode +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_als_line_blocking_on_sel + { + buf = text_als_line_blocking_on_sel; + } + +//----------------------------------------------------------------------------- +// +// text_als_line_blocking_off_sel +// ALS: Line block mode +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_als_line_blocking_off_sel + { + buf = text_als_line_blocking_off_sel; + } + +//----------------------------------------------------------------------------- +// +// r_als_line_blocking_on +// ALS: Line block mode +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_als_line_blocking_on + { + buf = text_als_line_blocking_on; + } + +//----------------------------------------------------------------------------- +// +// r_als_line_blocking_off +// ALS: Line block mode +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_als_line_blocking_off + { + buf = text_als_line_blocking_off; + } + + +// **COMMON RESOURCES FOR CALL, BARRING AND NETWORK + +//---------------------------------------------------- +// +// r_requesting_note +// Note layout when requesting something from network +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_requesting_note + { + flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar | + EEikDialogFlagCbaButtons | EEikDialogFlagWait; + buttons = r_softkeys_empty_quit; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = ERequestingNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + singular_label = text_sending; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_softkeys_empty_quit +// Softkeys for requesting notes: empty-quit +// +//---------------------------------------------------- +// +RESOURCE CBA r_softkeys_empty_quit + { + buttons = + { + CBA_BUTTON {txt = "";}, + CBA_BUTTON {id = EGSSoftkeyQuit; txt = text_softkey_quit;} + }; + } + + +//---------------------------------------------------- +// +// r_gs_image_corrupted +// Image corrupted information note. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_corrupted + { + buf = qtn_set_image_format_wrong; + } + +//---------------------------------------------------- +// +// r_gs_image_too_large +// Image corrupted information note. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_too_large + { + buf = qtn_set_image_too_large; + } + + +//---------------------------------------------------- +// +// r_image_load_wait_note +// Image loading wait note. +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_image_load_wait_note + { + flags = EAknWaitNoteFlags; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EImageLoadWaitNote; + control= AVKON_NOTE + { + layout = EWaitLayout; + singular_label = qtn_set_loading_image; + imagefile = AVKON_ICON_FILE; + imageid = EMbmAvkonQgn_note_progress; + imagemask = EMbmAvkonQgn_note_progress_mask; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + }; + } + }; + } + +// VOIP SETTINGS + +// **INTERNET CALL CLIR + +//---------------------------------------------------- +// +// r_set_ic_clir +// Internet call CLIR setting page resources +// +//---------------------------------------------------- +// +RESOURCE TBUF r_set_ic_clir + { + buf = qtn_clir_voip; + } + +//---------------------------------------------------- +// +// r_set_ic_clir_on +// Internet call CLIR setting page item +// +//---------------------------------------------------- +// +RESOURCE TBUF r_set_ic_clir_on + { + buf = text_cli_sending_on; + } + +//---------------------------------------------------- +// +// r_set_ic_clir_off +// Internet call CLIR setting page item +// +//---------------------------------------------------- +// +RESOURCE TBUF r_set_ic_clir_off + { + buf = text_cli_sending_off; + } + +//---------------------------------------------------- +// +// r_ic_clir_setting_page_lbx +// On/Off setting page's listbox, used by +// Internet call CLIR. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_ic_clir_setting_page_lbx + { + items = + { + LBUF + { + txt = text_cli_sending_on; + }, + LBUF + { + txt = text_cli_sending_off; + } + }; + } + +// **INTERNET CALL WAITING + +//---------------------------------------------------- +// +// r_set_ic_waiting +// Internet call waiting setting page resources +// +//---------------------------------------------------- +// +RESOURCE TBUF r_set_ic_waiting + { + buf = qtn_voip_call_waiting; + } + +//---------------------------------------------------- +// +// r_set_ic_waiting_on +// Internet call waiting setting page item +// +//---------------------------------------------------- +// +RESOURCE TBUF r_set_ic_waiting_active + { + buf = qtn_voip_waiting_active; + } + +//---------------------------------------------------- +// +// r_set_ic_waiting_off +// Internet call waiting setting page item +// +//---------------------------------------------------- +// +RESOURCE TBUF r_set_ic_waiting_not_active + { + buf = qtn_voip_waiting_not_active; + } + +//---------------------------------------------------- +// +// r_ic_waiting_setting_page_lbx +// Active/Not active setting page's listbox, used by +// Internet call waiting. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_ic_waiting_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_voip_waiting_active; + }, + LBUF + { + txt = qtn_voip_waiting_not_active; + } + }; + } + +//---------------------------------------------------- +// +// r_qtn_voip_sccp_no_clir +// Note is shown IC clir is activated and sccp is +// installed +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_voip_sccp_no_clir + { + buf = qtn_voip_sccp_no_clir; + } + +// **PREFERRED TELEPHONY + +//---------------------------------------------------- +// +// r_set_ic_preferred_telephony +// Preferred telephony setting page resources +// +//---------------------------------------------------- +// +RESOURCE TBUF r_set_ic_preferred_telephone + { + buf = qtn_set_voip_settings_preferred_tel; + } + +//---------------------------------------------------- +// +// r_set_ic_preferred_telephony_cs +// Preferred telephony setting page item +// +//---------------------------------------------------- +// +RESOURCE TBUF r_set_ic_preferred_telephone_cs + { + buf = qtn_set_voip_preferred_tel_cs; + } + +//---------------------------------------------------- +// +// r_set_ic_preferred_telephony_ps +// Preferred telephony setting page item +// +//---------------------------------------------------- +// +RESOURCE TBUF r_set_ic_preferred_telephone_ps + { + buf = qtn_set_voip_preferred_tel_ps; + } + +//---------------------------------------------------- +// +// r_ic_preferred_call_type_setting_page_lbx +// CS/PS setting page's listbox, used by +// Preferred type. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_ic_preferred_call_type_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_set_voip_preferred_tel_cs; + }, + LBUF + { + txt = qtn_set_voip_preferred_tel_ps; + } + }; + } + +//---------------------------------------------------- +// +// r_ic_preferred_telephone_query_text +// Message query's text when activating +// Internet telephony +// +//---------------------------------------------------- +// +RESOURCE TBUF r_ic_preferred_telephone_query_text + { + buf = qtn_voip_pref_teleph_set_note; + } + +//---------------------------------------------------- +// +// r_ic_preferred_telephone_query +// Message query when activating Internet telephony +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_ic_preferred_telephone_query + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK; + items= + { + DLG_LINE + { + type = EAknCtPopupHeadingPane; + id = EAknMessageQueryHeaderId; + control = AVKON_HEADING + { + }; + }, + DLG_LINE + { + type = EAknCtMessageQuery; + id = EAknMessageQueryContentId; + control = AVKON_MESSAGE_QUERY + { + }; + } + }; + } + +// **DO NOT DISTURB + +//---------------------------------------------------- +// +// r_set_ic_dnd +// Internet call do not disturb setting page resources +// +//---------------------------------------------------- +// +RESOURCE TBUF r_set_ic_dnd + { + buf = qtn_voip_do_not_disturb; + } + +//---------------------------------------------------- +// +// r_set_ic_dnd_active +// Internet call dnd setting page item +// +//---------------------------------------------------- +// +RESOURCE TBUF r_set_ic_dnd_active + { + buf = qtn_voip_do_not_disturb_on; + } + +//---------------------------------------------------- +// +// r_set_ic_dnd_not_active +// Internet call dnd setting page item +// +//---------------------------------------------------- +// +RESOURCE TBUF r_set_ic_dnd_not_active + { + buf = qtn_voip_do_not_disturb_off; + } + + //---------------------------------------------------- +// +// r_ic_dnd_setting_page_lbx +// Active/Not active setting page's listbox, used by +// Internet call dnd. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_ic_dnd_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_voip_do_not_disturb_on; + }, + LBUF + { + txt = qtn_voip_do_not_disturb_off; + } + }; + } + + +//MSK Labels and Resources + + +// ----------------------------------------------------------------------------- +// +// r_call_msk_change +// Middle softkey label: change. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_call_msk_change + { + buf = qtn_msk_change; + } + +// ----------------------------------------------------------------------------- +// +// r_call_softkey_option +// Middle softkey label: Options. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_call_softkey_option + { + buf = text_softkey_option; + } + +RESOURCE TBUF r_text_active_call {buf = qtn_info_during_call;} + +//---------------------------------------------------- +// +// r_setting_page +// Setting page for Network selection mode/MCN items +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id= r_setting_listbox; + } + +//---------------------------------------------------- +// +// r_gs_msk_contextmenubar +// Options menu with 'Open' and SetasDefault items . +// Context Menu Options for MSK key handling +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_call_divert_msk_contextmenubar + { + titles = + { + MENU_TITLE {menu_pane = r_cf_msk_div_view_menu;} + }; + } + + +//---------------------------------------------------- +// +// r_cf_msk_div_view_menu +// Menu pane for Context Options. +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_cf_msk_div_view_menu + { + items = + { + MENU_ITEM + { + command = ECFCmdActivate; + txt = text_activate_divert; + }, + MENU_ITEM + { + command = ECFCmdCancel; + txt = text_cancel_divert; + }, + MENU_ITEM + { + command = ECFCmdCheckStatus; + txt = text_check_status; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_long_press_call_setting_page +// Long Press Call Key setting page. +// +//---------------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_gs_long_press_call_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_gs_long_press_call_key; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +//---------------------------------------------------- +// +// r_gs_long_press_call_setting_page_lbx +// Options: Inactive and Video call +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_gs_long_press_call_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_gs_long_press_call_key_inactive; + }, + LBUF + { + txt = qtn_gs_long_press_call_key_video; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_own_image_vt_call_setting_page +// Own image vt call setting page. +// +//---------------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_gs_own_image_vt_call_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_gs_own_image_vt_call; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +//---------------------------------------------------- +// +// r_gs_own_image_vt_call_setting_page_lbx +// Options: Ask first, No, Yes +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_gs_own_image_vt_call_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_gs_own_image_ask_first; + }, + LBUF + { + txt = qtn_gs_own_image_no; + }, + LBUF + { + txt = qtn_gs_own_image_yes; + } + }; + } + +//---------------------------------------------------- +// +// r_cp_setting_title_opening_slide +// Title to opening slide answer setting page +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cp_setting_title_opening_slide + { + buf = qtn_cp_setting_title_opening_slide; + } + +//---------------------------------------------------- +// +// r_cp_setting_opening_slide_answer +// value to opening slide answer setting page +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cp_setting_opening_slide_answer + { + buf = qtn_cp_setting_opening_slide_answer; + } + +//---------------------------------------------------- +// +// r_cp_setting_opening_slide_not_answer +// value to opening slide answer setting page +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cp_setting_opening_slide_not_answer + { + buf = qtn_cp_setting_opening_slide_not_answer; + } + +//---------------------------------------------------- +// +// r_cp_setting_title_closing_slide +// Title to colsing slide end setting page +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cp_setting_title_closing_slide + { + buf = qtn_cp_setting_title_closing_slide; + } + +//---------------------------------------------------- +// +// r_cp_setting_closing_slide_end +// value to colsing slide end setting page +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cp_setting_closing_slide_end + { + buf = qtn_cp_setting_closing_slide_end; + } + +//---------------------------------------------------- +// +// r_cp_setting_closing_slide_not_end +// value to colsing slide end setting page +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cp_setting_closing_slide_not_end + { + buf = qtn_cp_setting_closing_slide_not_end; + } + + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/data/SoftReject.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/data/SoftReject.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,140 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for Soft Reject +* +*/ + +// RESOURCE IDENTIFIER +NAME PHSR // 4 letter ID + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include + +// RESOURCE DEFINITIONS + +RESOURCE RSS_SIGNATURE + { + } + +//----------------------------------------------------------------------------- +// +// r_soft_reject_on +// Soft reject: "On" +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_soft_reject_on + { + buf = qtn_gs_soft_on; + } + +//----------------------------------------------------------------------------- +// +// r_soft_reject_off +// Soft reject: "Off" +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_soft_reject_off + { + buf = qtn_gs_soft_off; + } + +//---------------------------------------------------- +// +// qtn_gs_soft_reject_text_title +// Soft Reject Text setting page resources +// "Soft Reject" +//---------------------------------------------------- +// +RESOURCE TBUF r_soft_reject_text + { + buf = qtn_gs_soft_reject_text_title; + } + +//----------------------------------------------------------------------------- +// +// r_soft_reject_default_txt +// Default text for Soft reject. +// "Hi, I?m busy at the moment, but I contact you a bit later." +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_soft_reject_default_txt + { + buf = qtn_gs_soft_default_text; + } + +//----------------------------------------------------------------------------- +// +// r_soft_reject_txt_title +// Default text title. +// "Text for Soft reject" +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_soft_reject_txt_title + { + buf = qtn_gs_soft_reject_text; + } + +//---------------------------------------------------- +// +// r_setting_app_edwin +// Text editor for Soft Reject text. +// +//---------------------------------------------------- +// +RESOURCE EDWIN r_setting_app_edwin + { + flags = 0; + width = 9; + lines = 5; + maxlength = 160; + } + +//---------------------------------------------------- +// +// r_text_setting_page +// Setting page for Soft Reject text. +// "Text for Soft reject" +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_text_setting_page + { + label= qtn_gs_soft_reject_text_title; + type = EEikCtEdwin; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + editor_resource_id = r_setting_app_edwin; + } + +//---------------------------------------------------- +// +// qtn_mocal_sett_softrej_title +// Soft Reject setting page resources +// "Soft reject" +//---------------------------------------------------- +// +RESOURCE TBUF r_soft_reject + { + buf = qtn_mocal_sett_softrej_title; + } + + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/inc/GSCallPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/inc/GSCallPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,479 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Call sub-menu in General Settings. +* +*/ + + +#ifndef GSCALLPLUGIN_H +#define GSCALLPLUGIN_H + +// INCLUDES +#include "GSCallPluginModel.h" +#include "MGsFWMSKLabelObserver.h" + +#include //for MSSSettingsObserver +#include +#include +#include +#include +#include + +#include +#include +#include + +// FORWARD DECLARATIONS +class CGSCallPluginContainer; +class CAknRadioButtonSettingPage; +class CPsetContainer; +class CPsuiContainer; +class CPsuiWaitingObs; +class CPsetCallWaiting; +class CAknPopupList; +class CGSTelPluginModel; +class CGSCcbsHandler; +class CAknWaitDialog; +class CAknViewAppUi; + +// Constants +const TUid KCallPluginUID = { 0x102824A2 }; + +// Resource file name +_LIT( KGSCallPluginResourceFileName, "z:GSCallPluginRsc.rsc" ); + +_LIT( KGSCallPluginIconDirAndName, "z:GSCallPlugin.mbm"); + +// CLASS DECLARATION +/** +* CGSCallPlugin view class +*/ +class CGSCallPlugin : public CGSBaseView, + public MSSSettingsObserver, + public MMGFetchVerifier, + public MGSAsyncImageHandlingObserver, + public MGsFWMSKObserver + { + public: // Constructor and destructor + + /* C++ Constructor */ + CGSCallPlugin(); + + /** + * Symbian OS two-phased constructor + * @return + */ + static CGSCallPlugin* NewL( TAny* aInitParams ); + + /* Symbian OS two-phase Constructor + * + * @return pointer to CGSCallPlugin object + */ + static CGSCallPlugin* NewLC(); + + /** + * Destructor. + */ + ~CGSCallPlugin(); + + public: // Functions from CAknView + + /** + * From CAknView, returns the views id. + * + * @return Returns id of the view. + */ + TUid Id() const; + + /** + * See base class. + */ + void HandleClientRectChange(); + + /** + * See base class. + */ + void HandleStatusPaneSizeChange(); + + /** + * From MEikCommandObserver, handles the menu based commands. + * + * @param aCommand identifies the given command. + */ + void HandleCommandL( TInt aCommand ); + + /** + * See base class. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * See base class. + */ + void DoDeactivate(); + + public: // From base classes + /* + * From MSSSettingsObserver, observer function + * @param aSetting Current setting + * @param aNewValue New value for the setting + */ + void PhoneSettingChanged( TSSSettingsSetting aSetting, + TInt aNewValue ); + + /** + * Updates specific value to container + * @param aListItem item index to update + * @param aNewValue new value for the setting + */ + void UpdateListBoxL( const TInt& aListItem, TInt aNewValue ); + + /** + * From MEikCommandObserver, handles the commands. + * + * @param aCommand identifies the command given. + */ + void ProcessCommandL( TInt aCommand ); + + /** + * Checks if the MSK label needs to be adjusted. + */ + void CheckMiddleSoftkeyLabelL(); + + public: // From CGSPluginInterface + + /** + * See base class. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + TInt PluginProviderCategory() const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + public: //new + /** + * Remove command and label from MSK. + */ + void RemoveCommandFromMSK( const TBool flag); + + /** + * Adds given resource text as MSK to CBA. + * + * @param aResourceId middle softkey label. + * @param aCommandId command that should be performed when MSK + * is pressed. + * @since S60 v3.1 + */ + void SetMiddleSoftKeyLabelL( const TInt aResourceId,const TInt aCommandId ); + + protected: // from CGSBaseView + /** + * See base class. + */ + void NewContainerL(); + + /** + * See base class. + */ + void HandleListBoxSelectionL(); + + protected: //from MMGFetchVerifier + + /** + * Display Backlight setting page + */ + TBool VerifySelectionL( const MDesCArray* aSelectedFiles ); + + protected: //from MGSSyncImageHandlingObserver + + /** + * Method derived from MGSSyncImageHandlingObserver + * Run when the asynchronous image converting is complete. + */ + void ImageHandlingCompleteL( TInt aError ); + + protected: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + protected: //new + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + /** + * Shows settingpage for on-off settings. + * + * @param aPage reveals what page should be displayed. + */ + void ShowSettingPageL( TGSCallItemIds aPage ); + + /** + * Responsible for showing als related settingpage. + * Separate method is needed because als settings differ quite + * a bit from the other on/off settings. + * + * @param aPage reveals what page should be displayed. + */ + void ShowAlsSettingPageL( TGSCallItemIds aPage ); + + /** + * Processes user's selection + * @param aSetting tells which value to switch + * Used when Central Repository is enabled + */ + void SwitchOnOffSetting( TCallSettId aSetting ); + + /** + * Adds item to a list + * @param aList reference to a list + * @param aItem resource ID of the item to be added + */ + void AppendItemL( CDesCArrayFlat& aList, TInt aItem ); + + + /** + * Selects what kind of menu to create next + * + * @param aIndex currently selected item + */ + virtual void HandleCreatePopupL( TInt aIndex ); + + /** + * Sets title to a setting page. + * + * @param aDlg reference to a setting page + * @param aTitleID resource ID of title + */ + void SetTitleToSettingL( CAknRadioButtonSettingPage& aDlg, + TInt aTitleID ); + + /** + * Sets title to status pane. + * + * @param aTitleID resource ID of title + */ + /*void SetTitleL( TInt aTitleID );*/ + + /** + * Switches value between shared data (0 = off, 1 = on) + * and setting page (1 = off, 0 = on). + * @param aValue value to switch + * @return switched value + */ + TInt SwitchValue( TInt& aValue ); + + /** + * Shows notes when Als Block value has been changed. + */ + void ShowAlsBlockNoteL(); + + /** + * Converts value between setting page and SsSettings. + * @param aValue value to convert + */ + void AlsBlockConvertValue( TInt& aValue ); + + /** + * Converts value between setting page and SsSettings. + * @param aValue value to convert + */ + void CliConvertValue( TInt& aValue ); + + /** + * Calls Security to make a Pin2 query. + * + * @return KPSPinQueryOk if query OK, otherwise 0. + */ + TInt MakePin2QueryL(); + + /** + * Calls Security to make a Security code query. + * + * @return ETrue if query OK. + */ + TBool MakeSecCodeQueryL(); + + /** + * Changes value in shared data for Als or Als Blocking. + */ + void SwitchAlsSettingL(); + + + /** + * Shows Soft reject setting page. + */ + void ShowSoftRejectSettingPageL(); + + + + /** + * Display the Setting page for Replace Prefix item + * @param aCurrentValue currently selected value in the setting page. + * @return ETrue if the setting page selection has changed. + */ + TBool ShowPrefixSettingPageL( TInt& aCurrentValue ); + + /** + * Toggles the Replace prefix between ON & OFF + * @param aSettingPage Tells whether to display the setting page + */ + void ChangePrefixSettingL( TBool aSettingPage ); + + /** + * Set the new changes to VOIP variables. + * @param aPage one of the TGSCallItemIds value w.r.t VOIP + * @param aCurrentSetting currently selected setting page item + */ + void SetVoipSettingBasedSelectedLine( + const TGSCallItemIds aPage, + TInt aCurrentSetting ); + + /** + * Gets line for selected VoIP setting. + * @param aPage one of the TGSCallItemIds value w.r.t VOIP + * @return line for selected VoIP setting. + */ + TInt GetLineForSelectedVoipSetting( const TGSCallItemIds aPage ); + + /** + * Display background image list from media gallery. + */ + void ShowVTStillImageSettingPageL(); + + /** + * + */ + void ShowStillImageListL(); + + /** + * Display image load wait note dialog. + */ + void ShowImageLoadWaitNoteL(); + + /** + * Hide image load wait note dialog. + */ + void HideImageLoadWaitNoteL(); + + /** + * Prompt image related errors to the user. + * @param aError system wide Symbian errors + */ + void HandleImageErrorsL( TInt aError ); + + /** + * Check if the input file is DRM protected + * @param aOriginalFileName Path of the bitmap file + * @return ETrue if file is DRM protected. + * EFalse otherwise. + */ + TBool CheckDRMProtectionL( const TDesC& aOriginalFileName ); + + TBool ShowCallDurationSettingPageL( TInt& aCurrentValue ); + + void ChangeCallDurationSettingL( TBool aSettingPage ); + + /** + * Shows note if preferred call setting + * was changed to the Internet Telephone. + */ + void ShowPreferredTelephonyNoteL(); + + /* + * Toggles between the setting values based on aShowSettingPage + * @param aShowSettingPage is ETrue then setting page is shown + */ + void ChangeLongPressCallKeySettingL( const TBool aShowSettingPage ); + + /* + * Launches setting page with the LongPressCallKey setting items + * @Param gets the updated value set + */ + TBool ShowLongPressCallKeySettingPageL( TInt& aCurrentValue ); + + /** + * Launches settings page for Own Image during video call setting + */ + void ShowOwnImageVtCallSettingPageL(); + + private: + //Retrieves container pointer. + CGSCallPluginContainer* Container(); + + /* + * Checks call state. + * @return one of the call states from P&S key + */ + TInt CheckCallStateL(); + + protected: // Member Variables + //CGSCallPluginModel class variable + CGSCallPluginModel* iModel; + //General access class for phonesettings. + CPsetContainer* iSettings; + //Call waiting SS handler + CPsetCallWaiting* iWaiting; + //General access class for PSUI. + CPsuiContainer* iObsContainer; + //Call waiting note handler + CPsuiWaitingObs* iCwObserver; + //Fetches ss related phone settings. + RSSSettings* iSsSettings; + //Value of als. + TInt iAls; + //Value of ALS Blocking. + TInt iAlsBlock; + //Value of Clir + TInt iClir; + //Has the rocker been pressed. + TBool iRockerPress; + //Creates and handles calls to CCBS Manager. + CGSCcbsHandler* iCcbsHandler; + + private: + // for image handling + CGSAsyncImageHandling* iImageHandler; + // for load wait dialog + CAknWaitDialog* iWaitDialog; + // local variation for restricted CLIR + TBool iRestrictedClir; + // local variation for secure CLIR + TBool iSecureClir; + // video Telephony Still Image state + TInt iVtStillImage; + // Previous video Telephony Still Image state + TInt iPreviousVtStillImage; + // check if which command MSK is set during destruction + TBool iMskCommandFlag; + //Lock for VT still image listbox item + TBool iVTImageSelectionOngoing; + + }; + + +#endif //GSCALLPLUGIN_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/inc/GSCallPlugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/inc/GSCallPlugin.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,214 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains definition of constants used in GSCallPlugin. +* +*/ + +#ifndef GSCALLPLUGIN_HRH +#define GSCALLPLUGIN_HRH + + +enum TGSCallNotes + { + ECWActivateNote = 1, + ECWCancelNote, + ECWNotActiveNote, + ERequestCancelledNote, + ERequestingNote, + EAlsDisabledNote, + EAlsEnabledNote, + ECallInProgress, + ECugIndexErrorNote, + EImageLoadWaitNote + }; + +enum TGSCallMenuCommands + { + EAppCmdCreatePopupList = 4, + EAppCmdChange, + EGSCmdCallWaitActivate, + EGSCmdCallWaitInquiry, + EGSCmdCallWaitDeactivate, + EGSCmdOwnNumberSendOn, + EGSCmdOwnNumberSendOff, + EGSCmdOwnNumberSendDefault, + //EGSCmdCCBSInquiry, + EGSCmdStillImage + }; + + +enum TCallSettId + { + EGSNotSet, + EGSOpeningSlideAnswerCall, + EGSClosingSlideEndCall, + EGSSoftRejectDefault, + EGSSummaryAfterCall, + EGSCallDuration + }; + +enum TGSCallSettingActions + { + EGSAlsSetPrimary = 0, + EGSAlsBlockingOn = 0, + EGSClirPreset = 0, + EGSCallWaitingOn = 0, + EGSCallWaitingOff = 1, + EGSClirOn = 1, + EGSAlsSetAlternate = 1, + EGSAlsBlockingOff = 1, + EGSSettingDlgNumber = 1, + EGSClirOff = 2, + EGSCallWaitingStatus = 2 + }; + +enum TGSCustomerServiceGroups + { + EGSCSPCallWaiting = 1, + EGSCSPAlternateLine, + EGSCenRepSoftReject + }; + +enum TCugPopupIndex + { + EGSCugNetworkDefault = 0, + EGSCugOn = 1, + EGSCugOff = 2 + }; + + +enum TGSSoftKeys + { + EGSSoftkeyQuit = 1, + EGSSoftkeyEmpty + }; + + +//Call view's list items. +enum TGSCallItemIds + { + EGSOpeningSlideAnswerCallItemId, + EGSClosingSlideEndCallItemId, + EGSCliItemId, + EGSCallWaitingItemId, + //EGSCCBSItemId, + EGSSummaryAfterCallItemId, + EGSSoftRejectTextItemId, + EGSStillImageItemId, + EGSAutoRedialToVoiceItemId, + EGSReplacePrefixItemId, + EGSLineChangeItemId, + EGSALSBlockItemId, + EGSICSendIntCallIdItemId, + EGSICWaitingItemId, + EGSICPreferredTelephonyId, + EGSDndItemId, + EGSShowCallDurationItemId, + EGSLongPressCallKeyItemId, + EGSOwnImageVtCallItemId + }; + +// VoIP specific setting id's +enum TGSVoIPSetting + { + EGSVoIPSendIntCallId = 0, + EGSVoIPCW, + EGSVoIPPreType, + EGSVoIPDnd, + EGSVoIPBarring + }; + +// Send my Internet call caller id +enum TGSSendIntCallId + { + EGSSendIntCallIdOn = 0, // Default + EGSSendIntCallIdOff, + EGSSendIntCallIdDefault + }; + +// Internet call waiting +enum TGSVoIPCallWaiting + { + EGSCSCallWaitingOff = 0, // Default + EGSCSCallWaitingOn + }; + +// Preferred call type +enum TGSVoIPPreferredType + { + EGSPreferredCS = 0, // Default + EGSPreferredPS + }; + +// Internet call do not disturb +enum TGSVoIPCallDnd + { + EGSCSCallDndOff = 0, // Default + EGSCSCallDndOn + }; + +//VT still image in use lbx indexes +enum TGSVtStillImage + { + EGSVtStillImageNotInUse = 0, + EGSVtStillImageInUse + }; + +//Listbox item indexes for Actions +enum + { + ECFCmdActivate = 5001, + ECFCmdCancel, + ECFCmdCheckStatus, + ECFCmdCancelAll + }; + +//Listbox item index for Long Press Call Key +// NOTE : EGSLongPressCallKeyVoiceCall is the default value normally +// NOTE: When Restore Factory Settings is done, the default value +// is set to EGSLongPressCallKeyInActive +// Three key values are used for a CenRep key though we have two +// two setting items because these values are also been used by +// CallUi and Phone Application. +enum + { + EGSLongPressCallKeyNotSet = 0, // Value mapped to "InActive" + EGSLongPressCallKeyVoiceCall, // Value mapped to "InActive" + EGSLongPressCallKeyVideoCall // Value mapped to "Video Call" + }; + +//slide settings are shown or not +enum TGSShowSlideSettings + { + EGSNotShowSlideSettings = 0, + EGSShowSlideSettings + }; + +//opening slide answer call +enum TGSOpeningSlideAnswerCall + { + EGSOpeningSlideAnswerCallOff = 0, + EGSOpeningSlideAnswerCallOn + }; + +//closing slide end call +enum TGSClosingSlideEndCall + { + EGSClosingSlideEndCallOff = 0, + EGSClosingSlideEndCallOn + }; + +#endif // GSCALLPLUGIN_HRH + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/inc/GSCallPluginContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/inc/GSCallPluginContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,259 @@ +/* +* Copyright (c) 2002 - 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Container for Call sub-menu in General Settings. +* +*/ + + +#ifndef GSCALLPLUGINCONTAINER_H +#define GSCALLPLUGINCONTAINER_H + +// INCLUDES +#include "MGsFWMSKLabelObserver.h" +#include "GSPhoneSettingConstants.h" + +#include +#include +#include +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class RSSSettings; +class CGSListBoxItemTextArray; +class CGSCallPluginModel; + +// CONSTANTS +// this is required also by the view class implementation. +_LIT( KGSSoftRejectResource, "z:softreject.rsc" ); + + +// CLASS DECLARATION +/** +* CGSCallPluginContainer container class +*/ +class CGSCallPluginContainer : public CGSBaseContainer + { + public: // Constructors and destructor + + /** + * Symbian OS default constructor. + * + * @param aRect gives the correct TRect for construction. + */ + void ConstructL( const TRect& aRect ); + + /** + * Destructor. + */ + ~CGSCallPluginContainer(); + + public: + + /** + * Updates list box + * + * @param aItemId is a updated list box item + * @param aNewValue is a new value to be used for settings + */ + virtual void UpdateListBoxL( TInt aItemId, TInt aNewValue ); + + /** + * Creates list box + * + * @param aResLbxId is resource number to create. + */ + void ConstructListBoxL( TInt aResLbxId ); + + /** + * Retrieves the currently selected listbox feature id + * @return feature id. + * @since 2.5 + */ + TInt CurrentFeatureId( ) const; + + /** + * Retrieves soft reject text. + * @param aSoftRejectTxt retrieved text. + * @since 2.5 + */ + void GetSoftRejectTextL( TDes& aSoftRejectTxt ); + + /** + * Reads from soft reject resource file. + * @param aResourceId reource ID to read. + * @return read resource text. + * @since 2.5 + */ + HBufC* ReadFromResourceL( TInt aResourceId ); + + /** + * Defines observer for the middle softkey label changes. + * Can only be set once. Further attempts are ignored. + * @since S60 v3.1 + */ + void SetMiddleSoftkeyObserver( MGsFWMSKObserver* aObserver ); + + /** + * OfferKeyEvent to this Call Container class for updating the label + * Up and Down rocker keys are handled + * @since S60 v3.1 + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + protected: //new + + /** + * Creates list box items + */ + virtual void CreateListBoxItemsL(); + + + /** + * Creates Still Image list box item. + */ + virtual void MakeStillImageItemL(); + + /** + * Creates Own Number sending list box item. + */ + virtual void MakeONSItemL(); + + /** + * Creates Call Waiting list box item + */ + virtual void MakeCWItemL(); + + /** + * Creates Phone line used list box item + * @param aAlsValue value of setting + */ + virtual void MakePLUItemL( TInt& aAlsValue); + + /** + * Creates Phone line blocked list box item + * @param aAlsBlockValue value of setting + */ + void MakePLBItemL( TInt& aAlsBlockValue ); + + /** + * Creates Speed Dialing, Anykey Answer, Summary After Call + * and Automatic redial items. + * @param aIndex which item to create + */ + virtual void MakeCallItemL( TInt aIndex ); + + + + /** + * Creates Soft reject text item. + */ + void MakeSoftRejectTxtItemL(); + + /** + * Required for help. + */ + void GetHelpContext(TCoeHelpContext& aContext) const; + + /** + * Creates Replace Prefix list box item + */ + void MakeReplacePrefixItemL(); + + /** + * Create IC CLIR item. + * @since 3.0 + */ + void MakeICClirItemL(); + + /** + * Create IC waiting item. + * @since 3.0 + */ + void MakeICWaitingItemL(); + + /** + * Create Preferred call type item. + * @since 3.0 + */ + void MakeICPreferredCallTypeItemL(); + + /** + * Create DND item. + * @since 3.0 + */ + void MakeDndItemL(); + + /** + * Create Call Duration item. + * @since 3.1 + */ + void MakeCallDurationItemL(); + + /** + * Create Long press call key items. + * @since 4.0 + */ + void MakeLongPressCallKeyItemL(); + + /** + * Creates Own Image during video call item + * @since 3.2 + */ + void MakeOwnImageVtCallItemL(); + + /** + * Create "Opening slide to answer call" and "Closing slide to end call" item + * @since 5.1 + */ + void MakeSlideSettingsItem( TInt aItemId ); + + protected: // Member variables + //SsSettings engine for CLI. + RSSSettings* iSsSettings; + //Resource based features. + CGSListBoxItemTextArray* iListboxItemArray; + //user selection for still image + CDesCArrayFlat* iStillImgValues; + //replace prefix items + CDesCArrayFlat* iChangeModeItems; + // List items in Internet Call CLIR. + CDesCArrayFlat* iClirItems; + // List items in Internet Call waiting. + CDesCArrayFlat* iCWItems; + // List items in Preferred call type. + CDesCArrayFlat* iPCTItems; + // List items in do not disturb. + CDesCArrayFlat* iDndItems; + // Call Plugin model object + CGSCallPluginModel* iModel; + // List items in call duration item. + CDesCArrayFlat* iCallDurationItems; + // List items in call duration item. + CDesCArrayFlat* iLongPressCallKeyItems; + // List items in own image vt call item. + CDesCArrayFlat* iOwnImageVtCallItems; + /** + * Middle softkey label observer. + * Own. + */ + MGsFWMSKObserver* iMSKObserver; + + }; + +#endif //GSCALLPLUGINCONTAINER_H diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/inc/GSCallPluginModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/inc/GSCallPluginModel.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,297 @@ +/* +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Call Settings plugin model. +* +*/ + + +#ifndef GSCALLPLUGINMODEL_H +#define GSCALLPLUGINMODEL_H + +// INCLUDES +#include "GSCallPlugin.hrh" + +#include +#include +#include + + +// CONSTANTS +// Panic codes for used in this compilation unit +enum KGSCallPluginModelPanicCodes + { + EGSCallPluinModelPanicNullPtr = 1 + }; + +const TInt KGSVTStillImageValue = 0; + +// FORWARD DECLARATIONS +class CPsetCustomerServiceProfile; +class CGSBackgroundImage; + +class CSPSettings; + +// CLASS DEFINITION +/** +* CGSCallPluginModel is the model class of GS app. +* It provides functions to get and set setting values. +*/ +class CGSCallPluginModel : public CBase + { + public: // Constructor and destructor + /** + * Two-phased constructor + */ + static CGSCallPluginModel* NewL(); + + /** + * Destructor + */ + ~CGSCallPluginModel(); + + public: //new + + + /* + * Returns one of the call related values from shared data. + * @param aKeyName name of the shared data key to fetch + * @param aId value of shared data key + * @return ETrue: no errors + * EFalse: an error has occurred + */ + TBool GetCallSettingValue( const TCallSettId aCallId, TInt& aId ); + + /* + * Sets one of the call related values from shared data. + * @param aKeyName name of the shared data key to set + * @param aId value of shared data key + * @return ETrue: no errors + * EFalse: an error has occurred + */ + TInt SetCallSettingValue( const TCallSettId aCallId, TInt aId ); + + /** + * Gets CSP status + * + * @return ETrue: CSP is set + * EFalse: CSP is not set + */ + TBool GetCSPStatus(); + + /** + * Sets CSP Active + * @param aValue TBool + * @return ETrue: CSP is set + * EFalse: CSP is not set + */ + void SetCSPActiveL( TBool aValue ); + + /** + * Returns if CSP setting is supported + * @param aSettingNumber TInt + * @return ETrue: CSP is supported + * EFalse: CSP is not supported + */ + TBool IsSettingSupported( TInt aSettingNumber ); + + /** + * Gets soft reject text from shared data. + * @param aText User defined text for soft reject. + */ + TBool GetSoftRejectText( TDes& aText ); + + /** + * Sets user defined text to shared data for soft reject. + * @param aText User defined text for soft reject. + */ + TBool SetSoftRejectText( TDes& aText ); + + //Still Image functions + /** + * Get the current value for Still Image + * from Shared Data + */ + TInt VTStillImageL(); + + /** + * Set the current value for Still Image + * to Shared Data + */ + void SetVTStillImageL( const TInt aValue ); + + /** + * Get the Japanese prefix change mode value from shared data + * @return mode + */ + TInt PrefixChangeModeL(); + + /** + * Set the Japanese prefix change mode value to shared data + * @param aMode integer value (0/1) + */ + void SetPrefixChangeModeL( TInt aMode ); + + /** + * Get the Japanese prefix data from shared data + * @param aText the edited value from data query + */ + void PrefixChangeDataL( TDes& aText ); + + /** + * Set the Japanese prefix data to shared data + * @param aText the edited value from data query + */ + void SetPrefixChangeDataL( const TDesC& aText ); + + /** + * Check if Restricted Send Caller Id is supported. + * This is handled using GS local variation + * @return ETrue if supported. + */ + TBool RestrictedSendCallerIdSupportedL(); + + /** + * Check if Secure Send Caller Id is supported. + * This is handled using GS local variation + * @return ETrue if supported. + */ + TBool SecureSendCallerIdSupportedL(); + + /** + * Returns one of the VoIP call related values from Cent. Repository + * @param aVoipSettingId name of the Cent. Repository key to fetch + * @param aVoipId value of Cent. Repository key + * @return KErrNone if successful + */ + TInt GetVoIPCallSettingValue( + const TGSVoIPSetting aVoipSettingId, + TInt& aVoipId ); + + /** + * Sets one of the VoIP call related values from Cent. Repository + * @param aVoipSettingId name of the Cent. Repository key to set + * @param aVoipId value of Cent. Repository key + * @return KErrNone if successful + */ + TInt SetVoIPCallSettingValue( + const TGSVoIPSetting aVoipSettingId, + TInt aVoipId ); + + /** + * Gets SCCP status from Central Repository + * @param aStatus value of Cent. Repository key + * @return KErrNone if successful + */ + TInt GetSCCPStatus( TInt& aStatus ); + + /** + * Switches value between CenRep (0 = off, 1 = on) + * and setting page (1 = off, 0 = on). + * @param aValue value to switch + * @return switched value + */ + void SwitchValue( TInt& aValue ); + + /** + * Get Call Duration value from CenRep + */ + TInt CallDurationL(); + + /** + * Set Call Duration value to CenRep key. + * @param aValue value to set + */ + void SetCallDurationL( TInt aValue ); + + /** + * Get Long Press Call Key value + */ + TInt LongPressCallKeyL(); + + /** + * Set Long Press Call Key value to CenRep key. + * @param aValue value to set + */ + void SetLongPressCallKeyL( const TInt aValue ); + + /** + * Maps the Long Press Call Key setting value + * @Param value to be mapped + **/ + void MapLongPressKeyCallKeyValue( TInt &aValue ); + + + /** + * Check if VoIP features are supported + * This is done using Central Repository + * @return ETrue if VoIP is supported + */ + TBool VoIPSupported(); + + /** + * Get own image vt call status + */ + TInt OwnImageVtCallStatusL(); + + /** + * Set Own Image video call value to CenRep key. + * @param aValue value to set + */ + void SetOwnImageVtCallStatusL( const TInt aValue ); + + /** + * Check if slide settings items should be shown + * @return ETrue if slide settings items should be shown + */ + TBool SlideSettingsShownL() const; + + private: // Private constructors + /** + * Default C++ contructor + */ + CGSCallPluginModel(); + + /** + * Symbian OS default constructor + * @return void + */ + void ConstructL(); + + + private: // new + void InitializeCentralRepositoryL(); + void UninitializeCentralRepository(); + + public: // data members + CGSBackgroundImage* iBackgroundApi; + + private: + CPsetCustomerServiceProfile* iCSP; //check if CSP is active + + //Central repository objects + CRepository* iTelephonyRepository; + CRepository* iCommonCallephonyRepository; + CRepository* iGSVariationRepository; + CRepository* iRichCallRepository; + CRepository* iLogsRepository; + CRepository* iCommonTelephonyRepository; + + TInt iLocalVariationValues; //local variated constants + CSPSettings* iSpSettings; + + }; + +#endif // GSCALLPLUGINMODEL_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/inc/MGsFWMSKLabelObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/inc/MGsFWMSKLabelObserver.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Indicates that MSK label might be in need of update. +* +*/ + + +#ifndef M_GSFWMSKLABELOBSERVER_H +#define M_GSFWMSKLABELOBSERVER_H + +#include + +/** + * Observer interface to enable observer to verify currently displayed + * middle softkey label. The inherited method should be called when + * the middle softkey label is in need of updating after a navigation + * event has been detected. + * @since S60 v3.1 + */ +class MGsFWMSKObserver + { + +public: + + /** + * Observer interface to verify currently displayed middle softkey label. + */ + virtual void CheckMiddleSoftkeyLabelL() = 0; + + }; + + +#endif // M_GSFWMSKLABELOBSERVER_H diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/loc/GSCallPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/loc/GSCallPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,514 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSCallPlugin. +* +*/ + + +// LOCALISATION STRINGS + +//d: title for call settings folder +//l: title_pane_t2/opt9 +//w: +//r: 3.1 +#define qtn_set_title_settings_call "Call settings" + +//d: title for call settings folder +//l: list_single_large_graphic_pane_t1 +//w: +//r:3.1 +#define qtn_set_folder_call "Call" + +//-----------------------------still image----------------------------------- +//d: Command in general settings call folder, opens Video call's still image +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define qtn_gs_still_image_vt_call "Video call's still image" + +//d: command concerning video call's still image not used +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_gs_still_image_notused "Not used" + +//d: command concerning video call's still image user defined +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_gs_still_image_define "User defined" + +//d: error note text when user selects a DRM protected VT Still image +//d: connection active +//l: popup_note_window +//w: +//r: 3.1 +#define qtn_drm_not_allowed "Unable to select a copyright protected item" + +//--------------------------end still image----------------------------------- + + +//d: Command in general settings call folder, opens 'Open slide to answer calls' view +//l: list_setting_pane_t1 +//w: +//r: 5.1 +#define qtn_cp_setting_opening_slide "Open slide to answer calls" + +//d: Command in general settings call folder, opens 'Close slide to end calls' view +//l: list_setting_pane_t1 +//w: +//r: 5.1 +#define qtn_cp_setting_closing_slide "Close slide to end calls" + +//d: Command in general settings call folder, opens sending own number +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define text_clir "Own number sending" + +//d: Command in general settings call folder, opens call waiting +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define text_call_waiting "Call waiting" + +//d: automatic redial-setting item in call folder +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define qtn_set_call_repeat "Automatic redial" + +//d: Command in general settings call folder, opens summary after call +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define text_cterm_setting "Summary after call" + +//d: Command in general settings call folder, opens one key calling +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define qtn_mocal_setting_onekey "One key calling" + +//d: Command in general settings call folder, opens any key answering +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define qtn_set_anykey_answer "Anykey answer" + +//d: phone line selection list item in general settings call folder +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define qtn_als_phoneline_in_use "Phone line in use" + +//d: phone line blocking list item in general settings call folder +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define qtn_als_phonelinet_blocking "Phone line blocking" + +//d: heading in one key calling view +//l: main_pane_set_t1 +//w: +//r: 3.1 +#define qtn_mocal_sett_onekey_title "One key calling" + +//d: heading in automatic redial view +//l: main_pane_set_t1 +//w: +//r: 3.1 +#define qtn_mocal_sett_redial_title "Automatic redial" + + +// +// SHOW CALL DURATION +// + +//d: heading in 'Open slide to answer calls' view +//l: main_pane_set_t1 +//w: +//r: 5.1 +#define qtn_cp_setting_title_opening_slide "Open slide to answer calls" + +//d: setting item text for opening slide answer call +//l: list_set_graphic_pane_t1 +//w: +//r: 5.1 +#define qtn_cp_setting_opening_slide_answer "On" + +//d: setting item text for opening slide not answer call +//l: list_set_graphic_pane_t1 +//w: +//r: 5.1 +#define qtn_cp_setting_opening_slide_not_answer "Off" + +//d: heading in 'Close slide to end calls' view +//l: main_pane_set_t1 +//w: +//r: 5.1 +#define qtn_cp_setting_title_closing_slide "Close slide to end calls" + +//d: setting item text for closing slide end call +//l: list_set_graphic_pane_t1 +//w: +//r: 5.1 +#define qtn_cp_setting_closing_slide_end "On" + +//d: setting item text for closing slide not end cal +//l: list_set_graphic_pane_t1 +//w: +//r: 5.1 +#define qtn_cp_setting_closing_slide_not_end "Off" + + +//d:Show call duration list item in call folder +//l:list_setting_pane_t1 +//w: +//r: 3.1 +#define qtn_logs_lda3_time "Show call duration" + +//d: setting item text for show call duration +//d: setting item value ON +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +// +#define qtn_logs_ldv3_timer_on "Yes" + +//d: setting item text for show call duration +//d: setting item value OFF +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +// +#define qtn_logs_ldv3_timer_off "No" + +//d:Information note when call duration setting is to be changed and +//d:a call is active. +//l:popup_note_window +//w: +//r: 3.1 +#define qtn_info_during_call "End active call first" + +//CLIR +//d: command concerning own number sending +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define text_cli_sending_default "Set by network" + +//d: command concerning own number sending +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define text_cli_sending_on "On" + +//d: command concerning own number sending +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define text_cli_sending_off "Off" + +//d: heading in own number sending view +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define qtn_own_number_sending_heading "Own number sending" + + +//d: command concerning call waiting +//l: list_single_pane_t1_cp2 +//w: +//r: 3.1 +#define text_activate_waiting "Activate" + +//d: command concerning call waiting +//l: list_single_pane_t1_cp2 +//w: +//r: 3.1 +#define text_cancel_waiting "Cancel" + +//d: command concerninc call waiting +//l: list_single_pane_t1_cp2 +//w: +//r: 3.1 +#define text_status_waiting "Check status" + +// ON-OFF FEATURES +//d: automatic redial setting item text when feature on +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_set_call_repeat_on "On" + +//d: automatic redail setting item text when feature off +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_set_call_repeat_off "Off" + +//d: onekey calling setting item text when feature on +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_set_one_key_call_on "On" + +//d: onekey calling setting item text when feature off +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_set_one_key_call_off "Off" + +//d: anykey answer setting item text when feature on +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_set_anykey_on "On" + +//d: anykey answer setting item text when feature off +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_set_anykey_off "Off" + +//d: summary after call setting item text when feature off +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define text_call_termination_note_on "On" + +//d: summary after call setting item text when feature off +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define text_call_termination_note_off "Off" + +//ALS FEATURES +//d: setting item heading when selecting line +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define qtn_als_line_selection_mode "Line selection mode:" + +//d: setting item text for primary line +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_als_line1 "Line 1" + +//d: setting item text for alternate line +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_als_line2 "Line 2" + +//d: setting item heading in phone line blocking +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define qtn_als_phoneline_block_mode "Phone line blocking mode:" + +//d: confirmation note when line change disabled +//l: popup_note_window +//w: +//r: 3.1 +#define text_als_line_blocking_on_sel "Line change disabled" + +//d: confirmation note when line change enabled +//l: popup_note_window +//w: +//r: 3.1 +#define text_als_line_blocking_off_sel "Line change enabled" + +//d: line blocking disabled selection (OFF) in the settings page +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define text_als_line_blocking_off "Off" + +//d: line blocking enabled selection (ON) in the settings page +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define text_als_line_blocking_on "On" + +// JAPANESE: Replace Prefix + +//d: Command in general settings call folder, opens Replace calling prefix +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define qtn_set_replace_prefix "Replace calling prefix" + +//d: command concerning Replace calling prefix +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_set_replace_prefix_on "On" + +//d: command concerning Replace calling prefix +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_set_replace_prefix_off "Off" + +//d: text to the code query which opens when one is about to enter +//d: replacement for '+' +//l: popup_query_data_window +//w: +//r: 3.1 +#define qtn_set_prefix_data_query "For not-81 country code: " + + +// ********* VOIP *********** // +//d: heading in internet call clir view +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define qtn_clir_voip "Send my Int. call caller ID" + +//d: heading in internet call waiting view +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define qtn_voip_call_waiting "Internet call waiting" + +//d: internet call waiting setting item text when feature on +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_voip_waiting_active "Active" + +//d: internet call waiting setting item text when feature off +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_voip_waiting_not_active "Not active" + +//d: heading in preferred telephony view +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define qtn_set_voip_settings_preferred_tel "Preferred telephone" + +//d: preferred telephony item text when feature cellural telephony +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_set_voip_preferred_tel_cs "Cellular telephone" + +//d: preferred telephony item text when feature internet telephony +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_set_voip_preferred_tel_ps "Internet telephone" + +//d: preferred telephony note text when selecting internet telephony +//l: popup_info_list_pane_t1 +//w: +//r: 3.1 +#define qtn_voip_pref_teleph_set_note "Regardless of this setting, creating a call via Call creation key makes always a cellular call if internet call service is not available" + +//d: Command in general settings call folder, opens call waiting +//l: list_setting_pane_t1 +//w: +//r: 3.1 +#define qtn_voip_do_not_disturb "Internet call do not disturb" + +//d: Command in general settings call folder, opens call waiting +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_voip_do_not_disturb_on "On" + +//d: Command in general settings call folder, opens call waiting +//l: list_set_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_voip_do_not_disturb_off "Off" + +//d: note is shown when CLIR settings is changed and and SCCP software is installed +//l: popup_note_window +//w: +//r: 3.1 +#define qtn_voip_sccp_no_clir "Note that Send Int. call caller ID does not affect SCCP based Internet calls" + +//d: activating highlighted call forward +//l: list_single_pane_t1_cp2 +// +#define text_activate_divert "Activate" + +//d: cancelling highlighted call forward +//l: list_single_pane_t1_cp2 +// +#define text_cancel_divert "Cancel" + +//d: checking status of highlighted call forward +//l: list_single_pane_t1_cp2 +// +#define text_check_status "Check status" + +/********************************************************************* +* LONG.PRESS.OF.SEND.LAUNCH.VIDEO.CALL +*********************************************************************/ +//d:Text of a list item in Call view's list +//d:Long press of Call key item +//l:list_setting_pane_t1 +//w: +//r: 4.0 +#define qtn_gs_long_press_call_key "Long press of Call key" + +//d:Item in Long press of Call key setting page's list +//d:Setting value Inactive +//l:list_set_graphic_pane_t1 +//w: +//r: 4.0 +#define qtn_gs_long_press_call_key_inactive "Inactive" + +//d:Item in Long press of Call key setting page's list +//d:Setting value Video call +//l:list_set_graphic_pane_t1 +//w: +//r: 4.0 +#define qtn_gs_long_press_call_key_video "Video call" + + +//Video call mute status item + +//d: Command in general settings call folder, opens sending own video +//l: list_setting_pane_t1 +//w: +//r: 3.2 +#define qtn_gs_own_image_vt_call "Own video in answered call" + +//d: option for own video sending +//l: list_set_graphic_pane_t1 +//w: +//r: 3.2 +#define qtn_gs_own_image_ask_first "Ask first" + +//d: option for own video sending +//l: list_set_graphic_pane_t1 +//w: +//r: 3.2 +#define qtn_gs_own_image_no "No" + +//d: option for own video sending +//l: list_set_graphic_pane_t1 +//w: +//r: 3.2 +#define qtn_gs_own_image_yes "Yes" + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/loc/SoftReject.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/loc/SoftReject.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Resource file for Phone Application +* +*/ + + +// LOCALISATION STRINGS + +//d: heading in soft reject settings menu +//l: list_setting_pane_t1 +// +#define qtn_mocal_sett_softrej_title "Reject call with message" + +//d: heading in soft reject text settings menu +//l: list_setting_pane_t1 +// +#define qtn_gs_soft_reject_text_title "Message text" + +//d: Command in general settings call folder, opens soft reject menu +//l: list_setting_pane_t1 +// +#define qtn_gs_soft_reject "Reject call with message" + +//d: Command in general settings call folder, opens soft reject text menu +//l: list_setting_pane_t1 +// +#define qtn_gs_soft_reject_text "Message text" + + +//d: soft reject selection (ON) in the settings page +//l: list_set_graphic_pane_t1 +// +#define qtn_gs_soft_on "On" + +//d: soft reject selection (OFF) in the settings page +//l: list_set_graphic_pane_t1 +// +#define qtn_gs_soft_off "Off" + +// d: It is used as softkey text. If pressed, the call isn't rejected, +// d: but an SMS editor with soft reject default text is opened. +// l: control_pane_t1/opt7 +// +#define qtn_softkey_soft_reject "Soft Reject" + +//d: soft reject text in the settings page +//l: list_set_graphic_pane_t1 +// +#define qtn_gs_soft_default_text "Hi, I’m busy at the moment, but I contact you a bit later." + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/src/GSCallPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/src/GSCallPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,2177 @@ +/* +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Call submenu in General Settings. +* +*/ + + +// INCLUDE FILES +#include "GSCallPlugin.h" //for CGSCallPlugin +#include "GSCallPluginContainer.h" //for CGSCallPluginContainer +#include "GsLogger.h" +#include "GSCallPlugin.h" //for pluginUID +#include // for title pane +#include +#include // For HlpLauncher +#include //for Note Wrappers +#include //for Radiobutton pages +#include //for TextSettings pages +#include //for Message Query Dialog +#include +#include +#include +#include + +// headers for still image +#include +#include // Image selection +#include + +#include //for menu bar +#include //for container +#include //for CPsuiContainer +#include +#include //for PIN2 query +#include //for TSecUi +#include //for CSecuritySettings +#include //for resource IDs +#include +#include +#include //for CGSListBoxItemTextArray + +#include +#include +#include + +// LOCAL CONSTANTS +_LIT( KGSNameOfClass, "GSCallPlugin" ); +_LIT( KGSVTStillImgPath, "" ); +//Use default values for external calls. +const TInt KGSUseDefault = 0; +//Call Prefix setting page items +const TInt KGSSettingItemOff = 1; +const TInt KGSSettingItemOn = 0; +//Lines in setting page. +const TInt KGSFirstLine = 0; +const TInt KGSSecondLine = 1; +// Middle Softkey control ID. +const TInt KGSMSKControlID = 3; + +// VT still image values. Basically everything above 0 should be considered as +// 'On' value so do not compare with 1 +const TInt KGSVTStillImageOff = 0; + + +// ========================= MEMBER FUNCTIONS ================================ +// --------------------------------------------------------------------------- +// +// Constructor. +// +// --------------------------------------------------------------------------- +CGSCallPlugin::CGSCallPlugin() + :iMskCommandFlag( ETrue ) + { + } + +// --------------------------------------------------------------------------- +// +// Symbian OS two-phased constructor (second phase) +// +// --------------------------------------------------------------------------- +void CGSCallPlugin::ConstructL() + { + __GSLOGSTRING("[GSCallPlugin]--> CGSCallPlugin::ConstructL"); + OpenLocalizedResourceFileL( KGSCallPluginResourceFileName, + iResourceLoader ); + + BaseConstructL( R_GS_CALL_VIEW ); + + iModel = CGSCallPluginModel::NewL(); + iRestrictedClir = iModel->RestrictedSendCallerIdSupportedL(); + iSecureClir = iModel->SecureSendCallerIdSupportedL(); + __GSLOGSTRING("[GSCallPlugin]--> ConstructL - Model created"); + iSettings = CPsetContainer::NewL(); + __GSLOGSTRING("[GSCallPlugin]--> ConstructL - PSetContainer created"); + iObsContainer = CPsuiContainer::NewL(); + __GSLOGSTRING("[GSCallPlugin]--> ConstructL - PsuiContainer created"); + iCwObserver = iObsContainer->CreateCWObsL(); + __GSLOGSTRING("[GSCallPlugin]--> ConstructL - CreateCWObsL done"); + iWaiting = iSettings->CreateCWObjectL( *iCwObserver ); + __GSLOGSTRING("[GSCallPlugin]--> ConstructL - CreateCWObjectL done"); + iSsSettings = new (ELeave) RSSSettings; + __GSLOGSTRING("[GSCallPlugin]--> ConstructL - SSSettings created"); + + User::LeaveIfError( iSsSettings->Open() ); + User::LeaveIfError( iSsSettings->RegisterAll( *this ) ); + __GSLOGSTRING("[GSCallPlugin]--> ConstructL - SSSettings opening successful"); + +#ifndef __WINS__ + iSsSettings->Get( ESSSettingsAls, iAls ); + iSsSettings->Get( ESSSettingsAlsBlocking, iAlsBlock ); +#endif //__WINS__ + + iVTImageSelectionOngoing = EFalse; + + __GSLOGSTRING("[GSCallPlugin] <--CGSCallPlugin::ConstructL"); + } + +// --------------------------------------------------------------------------- +// +// Symbian OS two-phased constructor (first phase) +// +// --------------------------------------------------------------------------- +CGSCallPlugin* CGSCallPlugin::NewLC() + { + CGSCallPlugin* self = new ( ELeave ) CGSCallPlugin; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// CGSCallPlugin::NewL() +// Static constructor +// +// --------------------------------------------------------------------------- +// +CGSCallPlugin* CGSCallPlugin::NewL( TAny* /*aInitParams*/ ) + { + CGSCallPlugin* self = new(ELeave) CGSCallPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// +// Destructor +// +// --------------------------------------------------------------------------- +CGSCallPlugin::~CGSCallPlugin() + { + __GSLOGSTRING("[GSCallPlugin] ~CGSCallPlugin()|->"); + + delete iObsContainer; + delete iCwObserver; + if ( iWaiting ) + { + delete iWaiting; + } + delete iSettings; + + if ( iSsSettings ) + { + iSsSettings->CancelAll( *this ); + iSsSettings->Close(); + delete iSsSettings; + } + + if( iModel ) + { + delete iModel; + } + + if( iImageHandler ) + { + delete iImageHandler; + } + + __GSLOGSTRING("[GSCallPlugin] ~CGSCallPlugin()-|"); + } + +// --------------------------------------------------------------------------- +// +// Returns Id of the Call submenu +// +// --------------------------------------------------------------------------- +TUid CGSCallPlugin::Id() const + { + return KCallPluginUID; + } + +// --------------------------------------------------------------------------- +// +// Handles user inputs in Options menu +// +// --------------------------------------------------------------------------- +void CGSCallPlugin::HandleCommandL( TInt aCommand ) + { + __GSLOGSTRING1("[GSCallPlugin] HandleCommandL(%d)|->", aCommand ); + switch ( aCommand ) + { + case EGSMSKCmdAppChange: + HandleListBoxSelectionL(); + break; + // Command Obtained from Context Options + // set in ProcessCommandL() + case ECFCmdActivate: + case EGSCmdCallWaitActivate: + iWaiting->SetCallWaitingL( MPsetCallWaiting::EActivateCallWaiting, + EAllTeleAndBearer ); + break; + // Command Obtained from Context Options + // set in ProcessCommandL() + case ECFCmdCheckStatus: + case EGSCmdCallWaitInquiry: + iWaiting->GetCallWaitingStatusL(); + break; + // Command Obtained from Context Options + // set in ProcessCommandL() + case ECFCmdCancel: + case EGSCmdCallWaitDeactivate: + iWaiting->SetCallWaitingL( MPsetCallWaiting::EDeactivateCallWaiting, + EAllTeleAndBearer ); + break; + case EAppCmdCreatePopupList: + { + const TInt currentFeatureId = Container()->CurrentFeatureId(); + HandleCreatePopupL( currentFeatureId ); + } + break; + case EAknSoftkeyBack: + iAppUi->ActivateLocalViewL( KGSTelPluginUid ); + break; + case EAknCmdHelp: + { + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), iAppUi->AppHelpContextL() ); + } + break; + } + default: + iAppUi->HandleCommandL( aCommand ); + break; + } + __GSLOGSTRING("[CGSCallPlugin] HandleCommandL()-|"); + } + + +// --------------------------------------------------------------------------- +// +// Handles user inputs in Options menu +// +// --------------------------------------------------------------------------- +void CGSCallPlugin::ProcessCommandL( TInt aCommand ) + { + MenuBar()->SetContextMenuTitleResourceId( R_CALL_DIVERT_MSK_CONTEXTMENUBAR ); + // Call base class + CAknView::ProcessCommandL( aCommand ); + } +// --------------------------------------------------------------------------- +// +// Activates the view +// +// --------------------------------------------------------------------------- +void CGSCallPlugin::DoActivateL( const TVwsViewId& aPrevViewId , + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + __GSLOGSTRING( "[GSCallPlugin] DoActivateL()|->" ); + CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + Container()->SetMiddleSoftkeyObserver( this ); + SetMiddleSoftKeyLabelL( R_CALL_MSK_CHANGE, EGSMSKCmdAppChange ); + // This way we set which command is set for MSK + iMskCommandFlag = ETrue; +// iContainer->iListBox->SetTopItemIndex( iTopItemIndex ); + +// if ( iCurrentItem >= 0 && +// iCurrentItem < iContainer->iListBox->Model()->NumberOfItems() ) +// { +// iContainer->iListBox->SetCurrentItemIndexAndDraw( iCurrentItem ); +// } + CheckMiddleSoftkeyLabelL(); + + // If AppUid is different or placeholderview is used, this view has been launched from outside GS + if ( iPrevViewId.iAppUid != KUidGS || iPrevViewId.iViewUid == TUid::Uid(0x0DEADBED ) ) + { + CEikButtonGroupContainer* cbaGroup = Cba(); + if( cbaGroup ) + { + HBufC* rightSKText = StringLoader::LoadLC ( R_GS_CBA_EXIT ); + TPtr rskPtr = rightSKText->Des(); + cbaGroup->SetCommandL( 2, EAknSoftkeyExit, *rightSKText ); + CleanupStack::PopAndDestroy( rightSKText ); + } + } + + __GSLOGSTRING( "[GSCallPlugin] DoActivateL()-|" ); + } + +// --------------------------------------------------------------------------- +// +// Deactivates the view +// +// --------------------------------------------------------------------------- +void CGSCallPlugin::DoDeactivate() + { + __GSLOGSTRING("[GSCallPlugin]--> DoDeactivate"); + if ( iContainer ) + { + if ( iContainer->iListBox && iContainer->iListBox->View() ) + { + iTopItemIndex = iContainer->iListBox->TopItemIndex(); + iCurrentItem = iContainer->iListBox->CurrentItemIndex(); + } + CGSBaseView::DoDeactivate(); + } + __GSLOGSTRING("[GSCallPlugin] <--DoDeactivate"); + } + + + +// --------------------------------------------------------------------------- +// +// Handle status pane size changed +// +// --------------------------------------------------------------------------- +void CGSCallPlugin::HandleStatusPaneSizeChange() + { + if ( Container() ) + Container()->SetRect( ClientRect()); + } + + +// --------------------------------------------------------------------------- +// +// Shows setting page - for ON/OFF setting items +// +// --------------------------------------------------------------------------- +void CGSCallPlugin::ShowSettingPageL( TGSCallItemIds aPage ) + { + __GSLOGSTRING("[GSCallPlugin]--> CGSCallPlugin::ShowSettingPageL"); + + CDesCArrayFlat* items = + new ( ELeave ) CDesCArrayFlat( KGSCallPopupMenuItems ); + CleanupStack::PushL( items ); + + TInt titleID = 0; + TInt currentSettingItem = KErrNone; + TCallSettId keyName = EGSNotSet; + + switch ( aPage ) + { + case EGSOpeningSlideAnswerCallItemId: + keyName = EGSOpeningSlideAnswerCall; + titleID = R_CP_SETTING_TITLE_OPENING_SLIDE; + AppendItemL( *items, R_CP_SETTING_OPENING_SLIDE_ANSWER ); + AppendItemL( *items, R_CP_SETTING_OPENING_SLIDE_NOT_ANSWER ); + break; + case EGSClosingSlideEndCallItemId: + keyName = EGSClosingSlideEndCall; + titleID = R_CP_SETTING_TITLE_CLOSING_SLIDE; + AppendItemL( *items, R_CP_SETTING_CLOSING_SLIDE_END ); + AppendItemL( *items, R_CP_SETTING_CLOSING_SLIDE_NOT_END ); + break; + case EGSICSendIntCallIdItemId: + titleID = R_SET_IC_CLIR; + AppendItemL( *items, R_SET_IC_CLIR_ON ); + AppendItemL( *items, R_SET_IC_CLIR_OFF ); + break; + case EGSICWaitingItemId: + titleID = R_SET_IC_WAITING; + AppendItemL( *items, R_SET_IC_WAITING_ACTIVE ); + AppendItemL( *items, R_SET_IC_WAITING_NOT_ACTIVE ); + break; + case EGSICPreferredTelephonyId: + titleID = R_SET_IC_PREFERRED_TELEPHONE; + AppendItemL( *items, R_SET_IC_PREFERRED_TELEPHONE_CS ); + AppendItemL( *items, R_SET_IC_PREFERRED_TELEPHONE_PS ); + break; + case EGSDndItemId: + titleID = R_SET_IC_DND; + AppendItemL( *items, R_SET_IC_DND_ACTIVE ); + AppendItemL( *items, R_SET_IC_DND_NOT_ACTIVE ); + break; + case EGSCliItemId: + titleID = R_OWN_NUMBER_SENDING_HEADING; + + // Restrict the default option if necessary + if ( !iRestrictedClir ) + { + AppendItemL( *items, R_CLI_SENDING_DEFAULT ); + } + + AppendItemL( *items, R_CLI_SENDING_ON ); + AppendItemL( *items, R_CLI_SENDING_OFF ); + break; + case EGSSummaryAfterCallItemId: + keyName = EGSSummaryAfterCall; + titleID = R_CTERM_SETTING; + AppendItemL( *items, R_CALL_TERMINATION_NOTE_ON ); + AppendItemL( *items, R_CALL_TERMINATION_NOTE_OFF ); + break; + default: + Panic( KGSNameOfClass, EInvalidIndex ); + break; + } + + if ( aPage == EGSICSendIntCallIdItemId || + aPage == EGSICWaitingItemId || + aPage == EGSICPreferredTelephonyId || + aPage == EGSDndItemId ) + { + currentSettingItem = GetLineForSelectedVoipSetting( aPage ); + } + // CLI item does not have a keyName and/or literal, hence + // this additional checking for CLI item. + else if ( aPage != EGSCliItemId && keyName != EGSNotSet ) + { + iModel->GetCallSettingValue( keyName, currentSettingItem ); + __GSLOGSTRING1("[GSCallPlugin] ShowSettingPageL: currentSettingItem: %d", currentSettingItem); + // switch value to settings page value + SwitchValue( currentSettingItem ); + } + else + { + TInt err = iSsSettings->Get( ESSSettingsClir, currentSettingItem ); + __GSLOGSTRING1("[GSCallPlugin] ShowSettingPageL: currentSettingItem1: %d", currentSettingItem); + if ( err == KErrNone ) + { + CliConvertValue( currentSettingItem ); + + if ( iRestrictedClir ) + { + // For indexing listbox which does not include KGSCliDefault + currentSettingItem--; + } + } + } + + HBufC* buffer = NULL; + + buffer = HBufC::NewLC( KGSMaxStringLength ); + TPtr str = buffer->Des(); + StringLoader::Load( str, titleID ); + + TPtr string = buffer->Des(); + const TInt oldSettingItem = currentSettingItem; + CAknRadioButtonSettingPage* dlg = new ( ELeave ) + CAknRadioButtonSettingPage( + &string, + EAknSettingPageNoOrdinalDisplayed, + KGSUseDefault, + KGSUseDefault, + R_SETTING_PAGE, + currentSettingItem, + items ); + + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { + const TBool settingItemChanged = oldSettingItem != currentSettingItem; + + if ( aPage == EGSICSendIntCallIdItemId || + aPage == EGSICWaitingItemId || + aPage == EGSICPreferredTelephonyId || + aPage == EGSDndItemId ) + { + // Change new VoIP setting based selected line. + SetVoipSettingBasedSelectedLine( aPage, currentSettingItem ); + } + else + { + if ( aPage != EGSCliItemId && keyName != EGSNotSet ) + { + // switch settings page value to shared data value + SwitchValue( currentSettingItem ); + iModel->SetCallSettingValue( keyName, currentSettingItem ); + __GSLOGSTRING1("[GSCallPlugin] ShowSettingPageL: currentSettingItem2: %d", currentSettingItem); + } + else + { + if ( iRestrictedClir ) + { + // For indexing listbox which does not include KGSCliDefault + currentSettingItem++; + } + + CliConvertValue( currentSettingItem ); + + // Secure setting of Send Caller Id if required + if ( !iSecureClir ) + { + iSsSettings->Set( ESSSettingsClir, currentSettingItem ); + } + else + { + if ( settingItemChanged && MakeSecCodeQueryL() ) + { + iSsSettings->Set( ESSSettingsClir, currentSettingItem ); + } + } + __GSLOGSTRING1("[GSCallPlugin] ShowSettingPageL: currentSettingItem3: %d", currentSettingItem); + } + } + + UpdateListBoxL( aPage, currentSettingItem ); + } + + CleanupStack::PopAndDestroy( buffer ); + CleanupStack::PopAndDestroy( items ); + __GSLOGSTRING("[GSCallPlugin] <--CGSCallPlugin::ShowSettingPageL"); + } + +// --------------------------------------------------------------------------- +// +// Shows ALS setting page - either line blocking or line selected +// +// --------------------------------------------------------------------------- +void CGSCallPlugin::ShowAlsSettingPageL( TGSCallItemIds aPage ) + { + __GSLOGSTRING("[GSCallPlugin]--> CGSCallPlugin::ShowAlsSettingPageL"); + CDesCArrayFlat* items = new ( ELeave ) CDesCArrayFlat( KGSCallPopupMenuItems ); + CleanupStack::PushL( items ); + + TInt currentItem = 0; + + switch ( aPage ) + { + case EGSLineChangeItemId: + //causes PIN2 query to launch, if necessary + if ( iAlsBlock == ESSSettingsAlsBlockingOn ) + { + TInt pin = MakePin2QueryL(); + if ( pin != KGSPinQueryOk ) + { + CleanupStack::PopAndDestroy( items ); + return; //User failed in Pin2 Query + } + } + AppendItemL( *items, R_ALS_LINE1 ); + AppendItemL( *items, R_ALS_LINE2 ); + currentItem = iAls - 1; + break; + case EGSALSBlockItemId: + { + TInt pin = MakePin2QueryL(); + if ( pin != KGSPinQueryOk ) + { + CleanupStack::PopAndDestroy( items ); + return; //User failed in Pin2 Query + } + AppendItemL( *items, R_ALS_LINE_BLOCKING_ON ); + AppendItemL( *items, R_ALS_LINE_BLOCKING_OFF ); + if ( iAlsBlock == ESSSettingsAlsBlockingOn ) + { + currentItem = KGSAlsBlockOn; + } + else + { + currentItem = KGSAlsBlockOff; + } + break; + } + default: + Panic( KGSNameOfClass, EInvalidIndex ); + break; + } + HBufC* buffer = + HBufC::NewLC( KGSMaxStringLength ); + TPtr string( buffer->Des() ); + StringLoader::Load( + string, + ( aPage == EGSLineChangeItemId ) ? + R_ALS_LINE_SELECTION_MODE : + R_ALS_PHONELINE_BLOCK_MODE ); + + CAknRadioButtonSettingPage* dlg = new ( ELeave ) + CAknRadioButtonSettingPage( + &string, + EAknSettingPageNoOrdinalDisplayed, + KGSUseDefault, + KGSUseDefault, + R_SETTING_PAGE, + currentItem, + items ); + + // handle als and blocking separately... + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { + if ( aPage == EGSALSBlockItemId ) + { + AlsBlockConvertValue( currentItem ); + iSsSettings->Set( ESSSettingsAlsBlocking, iAlsBlock ); + } + else if ( aPage == EGSLineChangeItemId ) + { + iAls = currentItem + 1; + iSsSettings->Set( ESSSettingsAls, iAls ); + } + } + CleanupStack::PopAndDestroy( 2 ); // items, string + __GSLOGSTRING("[GSCallPlugin] <--CGSCallPlugin::ShowAlsSettingPageL"); + } + + +// --------------------------------------------------------------------------- +// +// Changes value from 0 to 1 and vice versa +// Used when Central Repository is enabled +// +// --------------------------------------------------------------------------- +void CGSCallPlugin::SwitchOnOffSetting( TCallSettId aSetting ) + { + TInt value = KGSSettingOff; + // Reads a value and switches value (0 -> 1, 1 -> 0). + iModel->GetCallSettingValue( aSetting, value ); + SwitchValue( value ); + iModel->SetCallSettingValue( aSetting, value ); + } + +// --------------------------------------------------------------------------- +// +// Appends given item to given list +// +// --------------------------------------------------------------------------- +void CGSCallPlugin::AppendItemL( CDesCArrayFlat& aList, TInt aItem ) + { + HBufC* string = StringLoader::LoadLC( aItem ); + aList.AppendL( *string ); + CleanupStack::PopAndDestroy( string ); + } + +// --------------------------------------------------------------------------- +// +// Selects what kind of menu is created +// +// --------------------------------------------------------------------------- +void CGSCallPlugin::HandleCreatePopupL( TInt aIndex ) + { + __GSLOGSTRING("[GSCallPlugin]--> CGSCallPlugin::HandleCreatePopupL"); + switch ( aIndex ) + { + case EGSCallWaitingItemId: + break; + case EGSLineChangeItemId: + ShowAlsSettingPageL( EGSLineChangeItemId ); + break; + case EGSALSBlockItemId: + ShowAlsSettingPageL( EGSALSBlockItemId ); + break; + case EGSSoftRejectTextItemId: + ShowSoftRejectSettingPageL(); + UpdateListBoxL( EGSSoftRejectTextItemId, KGSNotUsed ); + break; + case EGSStillImageItemId: + if ( FeatureManager::FeatureSupported( + KFeatureIdCsVideoTelephony ) ) + { + ShowVTStillImageSettingPageL(); + } + break; + case EGSOwnImageVtCallItemId: + if ( FeatureManager::FeatureSupported( + KFeatureIdCsVideoTelephony ) ) + { + ShowOwnImageVtCallSettingPageL(); + } + break; + case EGSReplacePrefixItemId: + if ( FeatureManager::FeatureSupported( KFeatureIdJapanPrefixChange ) ) + { + ChangePrefixSettingL( ETrue ); + UpdateListBoxL( EGSReplacePrefixItemId, KGSNotUsed ); + } + break; + case EGSShowCallDurationItemId: + ChangeCallDurationSettingL( ETrue ); + UpdateListBoxL( EGSShowCallDurationItemId, KGSNotUsed ); + break; + case EGSLongPressCallKeyItemId: + #ifdef RD_VT_LONG_SEND_KEY + ChangeLongPressCallKeySettingL( ETrue ); + #endif + break; + default: + ShowSettingPageL( static_cast ( aIndex ) ); + break; + } + __GSLOGSTRING("[GSCallPlugin] <--CGSCallPlugin::HandleCreatePopupL"); + } + +// --------------------------------------------------------------------------- +// +// Sets title text to a setting page +// +// --------------------------------------------------------------------------- +void CGSCallPlugin::SetTitleToSettingL( CAknRadioButtonSettingPage& aDlg, + TInt aTitleID ) + { + HBufC* title = StringLoader::LoadLC ( aTitleID ); + aDlg.SetSettingTextL( *title ); + CleanupStack::PopAndDestroy( title ); + } + + +/*// --------------------------------------------------------------------------- +// +// Sets title text to a status pane +// +// --------------------------------------------------------------------------- +void CGSCallPlugin::SetTitleL( TInt aTitleID ) + { + CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane(); + CleanupStack::PushL(statusPane); + CAknTitlePane* titlePane = (CAknTitlePane*) statusPane->ControlL(TUid::Uid( + EEikStatusPaneUidTitle)); + CleanupStack::PushL( titlePane ); + + TResourceReader reader; + iCoeEnv->CreateResourceReaderLC( reader, aTitleID ); + titlePane->SetFromResourceL( reader ); + + CleanupStack::PopAndDestroy();//reader + + CleanupStack::Pop(titlePane); + CleanupStack::Pop(statusPane); + } +*/ + +// --------------------------------------------------------------------------- +// +// Switches value between setting page and shared data. +// Values in shared data do not map nicely to values in setting menu, +// therefore sharedData:SettingOn(1) => settingPage:IndexOn(0). +// --------------------------------------------------------------------------- +TInt CGSCallPlugin::SwitchValue( TInt& aValue ) + { + if ( aValue == KGSSettingOn ) + { + aValue = KGSIndexOn; + } + else if ( aValue == KGSSettingOff ) + { + aValue = KGSIndexOff; + } + return aValue; + } + +// --------------------------------------------------------------------------- +// +// Observes changes to ALS, ALS Block and CLIR values. +// +// --------------------------------------------------------------------------- +void CGSCallPlugin::PhoneSettingChanged( TSSSettingsSetting aSetting, + TInt aNewValue ) + { + __GSLOGSTRING("[GSCallPlugin]--> CGSCallPlugin::PhoneSettingChanged"); + TInt updateMe = KErrNone; + switch( aSetting ) + { + case ESSSettingsClir: + iClir = aNewValue; + updateMe = EGSCliItemId; + break; + case ESSSettingsAls: + iAls = aNewValue; + updateMe = EGSLineChangeItemId; + break; + case ESSSettingsAlsBlocking: + iAlsBlock = aNewValue; + updateMe = EGSALSBlockItemId; + TRAP_IGNORE( ShowAlsBlockNoteL() ); + break; + default: + break; + } + __GSLOGSTRING1("[GSCallPlugin] PhoneSettingChanged: aNewValue: %d", aNewValue); + if ( ( iContainer ) && ( updateMe != KErrNone ) ) + { + TRAP_IGNORE( UpdateListBoxL( updateMe, aNewValue ) ); + } + __GSLOGSTRING("[GSCallPlugin] <--CGSCallPlugin::PhoneSettingChanged"); + } + +// --------------------------------------------------------------------------- +// +// Shows notes when Als Block value has been changed. +// +// --------------------------------------------------------------------------- +void CGSCallPlugin::ShowAlsBlockNoteL() + { + TInt noteText; + if ( iAlsBlock == ESSSettingsAlsBlockingOn ) + { + noteText = R_ALS_LINE_BLOCKING_ON_SEL; + } + else + { + noteText = R_ALS_LINE_BLOCKING_OFF_SEL; + } + + HBufC* string = StringLoader::LoadLC( noteText ); + CAknInformationNote* note = new ( ELeave ) CAknInformationNote(); + note->ExecuteLD( *string ); + CleanupStack::PopAndDestroy( string ); + } + +// --------------------------------------------------------------------------- +// +// Creates new iContainer. +// +// --------------------------------------------------------------------------- +void CGSCallPlugin::NewContainerL() + { + __GSLOGSTRING("[GSCallPlugin]--> NewContainerL"); + iContainer = new (ELeave) CGSCallPluginContainer; + __GSLOGSTRING("[GSCallPlugin] <--NewContainerL"); + } + +// --------------------------------------------------------------------------- +// CGSCallPlugin::HandleListBoxSelectionL +// +// Handle user selection in the listbox to perform an associated action +// --------------------------------------------------------------------------- +void CGSCallPlugin::HandleListBoxSelectionL() + { + TBool updateValue = EFalse; + TInt value( KErrNone ); + CEikMenuBar* menuBar = this->MenuBar(); + + const TInt currentFeatureId = Container()->CurrentFeatureId(); + + TBool featureVoipSupported = iModel->VoIPSupported(); + + switch ( currentFeatureId ) + { + case EGSOpeningSlideAnswerCallItemId: + SwitchOnOffSetting( EGSOpeningSlideAnswerCall ); + updateValue = ETrue; + break; + case EGSClosingSlideEndCallItemId: + SwitchOnOffSetting( EGSClosingSlideEndCall ); + updateValue = ETrue; + break; + case EGSCliItemId: + ShowSettingPageL( EGSCliItemId ); + break; + case EGSCallWaitingItemId: + iRockerPress = ETrue; + menuBar->SetMenuType(CEikMenuBar::EMenuContext); + menuBar->TryDisplayMenuBarL(); + menuBar->SetMenuType(CEikMenuBar::EMenuOptions); + iRockerPress = EFalse; + break; + case EGSICSendIntCallIdItemId: // Send my Internet call id. + if ( featureVoipSupported ) + { + iModel->GetVoIPCallSettingValue( EGSVoIPSendIntCallId, value ); + + if ( value == EGSSendIntCallIdOff ) + { + iModel->SetVoIPCallSettingValue( + EGSVoIPSendIntCallId, EGSSendIntCallIdOn ); + } + else + { + iModel->SetVoIPCallSettingValue( + EGSVoIPSendIntCallId, EGSSendIntCallIdOff ); + + TInt status( KErrNone ); + iModel->GetSCCPStatus( status ); + + if ( status == 1 ) + { + HBufC* prompt = StringLoader:: + LoadLC( R_QTN_VOIP_SCCP_NO_CLIR ); + CAknInformationNote* note = + new(ELeave) CAknInformationNote( ETrue ); + note->ExecuteLD( *prompt ); + CleanupStack::PopAndDestroy( prompt ); + } + } + updateValue = ETrue; + } + break; + case EGSICWaitingItemId: // Internet call waiting item. + if ( featureVoipSupported ) + { + iModel->GetVoIPCallSettingValue( EGSVoIPCW, value ); + + if ( value == EGSCSCallWaitingOff ) + { + iModel->SetVoIPCallSettingValue( + EGSVoIPCW, EGSCSCallWaitingOn ); + } + else + { + iModel->SetVoIPCallSettingValue( + EGSVoIPCW, EGSCSCallWaitingOff ); + } + updateValue = ETrue; + } + break; + case EGSICPreferredTelephonyId: // Preferred call type. + if ( featureVoipSupported ) + { + iModel->GetVoIPCallSettingValue( EGSVoIPPreType, value ); + + if ( value == EGSPreferredCS ) + { + iModel->SetVoIPCallSettingValue( + EGSVoIPPreType, EGSPreferredPS ); + + // Show message query dialog if preferred call + // setting was changed to the Int. Telephone. + ShowPreferredTelephonyNoteL(); + } + else + { + iModel->SetVoIPCallSettingValue( + EGSVoIPPreType, EGSPreferredCS ); + } + updateValue = ETrue; + } + break; + case EGSDndItemId: // Do not disturb. + if ( featureVoipSupported ) + { + iModel->GetVoIPCallSettingValue( EGSVoIPDnd, value ); + + if ( value == EGSCSCallDndOff ) + { + iModel->SetVoIPCallSettingValue( + EGSVoIPDnd, EGSCSCallDndOn ); + } + else + { + iModel->SetVoIPCallSettingValue( + EGSVoIPDnd, EGSCSCallDndOff ); + } + updateValue = ETrue; + } + break; + case EGSSoftRejectTextItemId: + ShowSoftRejectSettingPageL(); + updateValue = ETrue; + break; + case EGSSummaryAfterCallItemId: + SwitchOnOffSetting( EGSSummaryAfterCall ); + updateValue = ETrue; + break; + case EGSLineChangeItemId: + SwitchAlsSettingL(); + break; + case EGSALSBlockItemId: + ShowAlsSettingPageL( EGSALSBlockItemId ); + break; + //Still image listbox creating + case EGSStillImageItemId: + if ( FeatureManager::FeatureSupported( + KFeatureIdCsVideoTelephony ) && + !iVTImageSelectionOngoing ) + { + //Locking listbox selection so user cannot click + //VT still image item twice + iVTImageSelectionOngoing = ETrue; + + //This takes some time + ShowVTStillImageSettingPageL(); + + //Releasing lock + iVTImageSelectionOngoing = EFalse; + } + break; + case EGSOwnImageVtCallItemId: + if ( FeatureManager::FeatureSupported( + KFeatureIdCsVideoTelephony ) ) + { + ShowOwnImageVtCallSettingPageL(); + } + break; + case EGSReplacePrefixItemId: + if ( FeatureManager::FeatureSupported( KFeatureIdJapanPrefixChange ) ) + { + ChangePrefixSettingL( EFalse ); + updateValue = ETrue; + } + break; + case EGSShowCallDurationItemId: + ChangeCallDurationSettingL( EFalse ); + updateValue = ETrue; + break; + case EGSLongPressCallKeyItemId: + #ifdef RD_VT_LONG_SEND_KEY + ChangeLongPressCallKeySettingL( EFalse ); + #endif + break; + default: + break; + } + if ( updateValue ) + { + UpdateListBoxL( currentFeatureId, KGSNotUsed ); + } + } + +// --------------------------------------------------------------------------- +// +// Converts value from setting page to SsSettings: +// settin page: line change disabled(0) => ESSSettingsAlsBlockingOn(2) +// settin page: line change enabled(1) => ESSSettingsAlsBlockingOff(1) +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::AlsBlockConvertValue( TInt& aValue ) + { + __GSLOGSTRING("[GSCallPlugin]--> CGSCallPlugin::AlsBlockConvertValue"); + __GSLOGSTRING1("[GSCallPlugin] AlsBlockConvertValue: aValue: %d", aValue); + if ( aValue == KGSAlsBlockOn ) + { + iAlsBlock = ESSSettingsAlsBlockingOn; + } + else + { + iAlsBlock = ESSSettingsAlsBlockingOff; + } + __GSLOGSTRING1("[GSCallPlugin] AlsBlockConvertValue: aValue: %d", aValue); + __GSLOGSTRING("[GSCallPlugin] <--CGSCallPlugin::AlsBlockConvertValue"); + } + +// --------------------------------------------------------------------------- +// +// Converts value from setting page to SsSettings: +// settin page: own number sending default(0) => +// SsSettings: ESSSettingsClirNetworkDefault(0) +// settin page: own number sending on (1) => +// SsSettings: ESSSettingsClirExplicitSuppress(2) +// settin page: own number sending off (2) => +// SsSettings: ESSSettingsClirExplicitInvoke(1) +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::CliConvertValue( TInt& aValue ) + { + switch ( aValue ) + { + case KGSCliDefault: + aValue = ESSSettingsClirNetworkDefault; + break; + case KGSCliOn: + aValue = ESSSettingsClirExplicitSuppress; + break; + case KGSCliOff: + aValue = ESSSettingsClirExplicitInvoke; + break; + default: + //error, return to-be converted value w/o changes + break; + } + } + +// --------------------------------------------------------------------------- +// +// Updates specific value to container. +// +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::UpdateListBoxL( const TInt& aListItem, + TInt aNewValue ) + { + /*if ( aListItem == EGSStillImageItemId ) + { + TRAP_IGNORE( iAvkonAppUi->StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL ) ); + SetTitleL( R_GS_CALL_VIEW_TITLE ); + TRAP_IGNORE( iAvkonAppUi->StatusPane()->DrawNow() ); + }*/ + if ( Container() ) + { + Container()->UpdateListBoxL( aListItem, aNewValue ); + } + CheckMiddleSoftkeyLabelL(); + } + +// --------------------------------------------------------------------------- +// +// Before showing a options menu +// +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + __GSLOGSTRING("[GSCallPlugin]--> DynInitMenuPaneL"); + const TInt currentFeatureId = Container()->CurrentFeatureId(); + CEikMenuBar* menuBar = this->MenuBar(); + if ( aResourceId == R_GS_CALL_VIEW_MENU ) + { + if ( currentFeatureId == EGSCallWaitingItemId ) + { + //add CW menu + if (MenuBar()->ItemSpecificCommandsEnabled() || MenuBar()->GetMenuType() == CEikMenuBar::EMenuContext) + { + aMenuPane->AddMenuItemsL( R_GS_CALL_WAIT_VIEW_MENU,EAppCmdCreatePopupList ); + } + + //hide Change if call waiting is selected + aMenuPane->SetItemDimmed( EAppCmdCreatePopupList, ETrue ); + + if ( iRockerPress ) + { + aMenuPane->SetItemDimmed( EAknCmdExit, ETrue ); + } + + if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) + && !iRockerPress ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + else + { + //for other items than call waiting + if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + } + + __GSLOGSTRING("[GSCallPlugin] <--DynInitMenuPaneL"); + } + +// --------------------------------------------------------------------------- +// +// Requests user to enter PIN2 +// +// --------------------------------------------------------------------------- +// +TInt CGSCallPlugin::MakePin2QueryL() + { + TInt retValue = KErrNone; + TSecUi::InitializeLibL(); + + CSecuritySettings* settings = CSecuritySettings::NewL(); + CleanupStack::PushL( settings ); + + if ( settings->AskPin2L() ) + { + retValue = KGSPinQueryOk; + } + + CleanupStack::PopAndDestroy( settings ); + TSecUi::UnInitializeLib(); + + return retValue; + } + +// --------------------------------------------------------------------------- +// +// Requests user to enter security code +// +// --------------------------------------------------------------------------- +// +TInt CGSCallPlugin::MakeSecCodeQueryL() + { + TBool retValue = EFalse; + TSecUi::InitializeLibL(); + + CSecuritySettings* settings = CSecuritySettings::NewL(); + CleanupStack::PushL( settings ); + + retValue = settings->AskSecCodeL(); + + CleanupStack::PopAndDestroy( settings ); + TSecUi::UnInitializeLib(); + + return retValue; + } + +// --------------------------------------------------------------------------- +// +// Changes value in shared data for Als +// +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::SwitchAlsSettingL() + { + __GSLOGSTRING("[GSCallPlugin]--> CGSCallPlugin::SwitchAlsSettingL"); + //causes PIN2 query to launch, if necessary + if ( iAlsBlock == ESSSettingsAlsBlockingOn ) + { + TInt pin = MakePin2QueryL(); + if ( pin != KGSPinQueryOk ) + { + __GSLOGSTRING("[GSCallPlugin] SwitchAlsSettingL: User failed in Pin2 Query"); + return; //User failed in Pin2 Query + } + } + iSsSettings->Get( ESSSettingsAls, iAls ); + if ( iAls == ESSSettingsAlsPrimary ) + { + iAls = ESSSettingsAlsAlternate; + } + else + { + iAls = ESSSettingsAlsPrimary; + } + iSsSettings->Set( ESSSettingsAls, iAls ); + __GSLOGSTRING("[GSCallPlugin] <--CGSCallPlugin::SwitchAlsSettingL"); + } + + +// --------------------------------------------------------------------------- +// +// Show Soft Reject Text setting page +// +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::ShowSoftRejectSettingPageL() + { + __GSLOGSTRING("[GSCallPlugin]--> ShowSoftRejectSettingPageL"); + HBufC* dynamicText = HBufC::NewLC( KGSSMSTxtEditorLength ); + TPtr string( dynamicText->Des() ); + + Container()->GetSoftRejectTextL( string ); + + HBufC* title = Container()->ReadFromResourceL( R_SOFT_REJECT_TXT_TITLE ); + CleanupStack::PushL( title ); + + // Open resource file, to get the resource texts for setting page. + // Find the resource file + RConeResourceLoader loader( *iCoeEnv ); + TParse parse; + parse.Set( KGSSoftRejectResource, &KDC_RESOURCE_FILES_DIR, NULL ); + TFileName fileName( parse.FullName() ); + + // Get language of resource file + BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName ); + + // Open resource file + TInt err = loader.Open( fileName ); + if ( err == KErrNotFound ) + { + User::Leave( KErrGeneral ); + } + CleanupClosePushL( loader ); + + CAknSettingPage* dlg = new( ELeave )CAknTextSettingPage( + title, + EAknSettingPageNoOrdinalDisplayed, + KGSUseDefault, + KGSUseDefault, + R_TEXT_SETTING_PAGE, + string, + CAknTextSettingPage::EZeroLengthAllowed | + CAknTextSettingPage::EPredictiveTextEntryPermitted ); + + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { + TInt value = KGSSettingOn; + iModel->SetCallSettingValue( EGSSoftRejectDefault, value ); + AknTextUtils::StripCharacters( string, KAknStripTabs ); + iModel->SetSoftRejectText( string ); + } + + CleanupStack::PopAndDestroy( 3 ); //title, dynamicText, loader + __GSLOGSTRING("[GSCallPlugin] <--ShowSoftRejectSettingPageL"); + } + + +// --------------------------------------------------------------------------- +// +// Show Replace Prefix setting page +// +// --------------------------------------------------------------------------- +// +TBool CGSCallPlugin::ShowPrefixSettingPageL( TInt& aCurrentValue ) + { + __GSLOGSTRING("[GSCallPlugin]--> ShowPrefixSettingPageL"); + CDesCArrayFlat* items = + iCoeEnv->ReadDesC16ArrayResourceL( R_GS_REPLACE_PREFIX_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + + CAknRadioButtonSettingPage* dlg = + new (ELeave) CAknRadioButtonSettingPage( R_GS_REPLACE_PREFIX_SETTING_PAGE, + aCurrentValue, items ); + + TBool ret = dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); + CleanupStack::PopAndDestroy( items ); + + __GSLOGSTRING1("[GSCallPlugin] ShowPrefixSettingPageL: aCurrentValue: %d", aCurrentValue); + __GSLOGSTRING("[GSCallPlugin] <--ShowPrefixSettingPageL"); + return ret; + } + +// --------------------------------------------------------------------------- +// CGSCallPlugin::ChangePrefixSettingL +// +// Change replace prefix setting. +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::ChangePrefixSettingL( TBool aSettingPage ) + { + __GSLOGSTRING("[GSCallPlugin]--> ChangePrefixSettingL"); + + TInt changeMode = iModel->PrefixChangeModeL(); + TInt prevChangeMode = changeMode; + TBool updateValue = ETrue; + TBool rockerPress = EFalse; + + __GSLOGSTRING1("[GSCallPlugin] ChangePrefixSettingL: prevChangeMode: %d", prevChangeMode); + if ( aSettingPage ) + { + updateValue = ShowPrefixSettingPageL( changeMode ); + } + else + { + rockerPress = ETrue; + if( changeMode == KGSSettingItemOff ) + { + changeMode = KGSSettingItemOn; + } + else + { + changeMode = KGSSettingItemOff; + } + } + + __GSLOGSTRING1("[GSCallPlugin] ChangePrefixSettingL: changeMode: %d", changeMode); + if ( updateValue ) + { + //if the value is changed and is set to ON, display the query dialog + if ( changeMode == KGSSettingItemOn ) + { + HBufC* replacePrefix = HBufC::NewLC( KGSReplacePrefixTextLength ); + TPtr string( replacePrefix->Des() ); + string.Zero(); + + iModel->PrefixChangeDataL( string ); + + CAknTextQueryDialog* dlg = new( ELeave ) CAknTextQueryDialog( string ); + + TBool ret = dlg->ExecuteLD( R_REPLACE_PREFIX_DATA_QUERY ); + if( ret ) + { + rockerPress = ETrue; + iModel->SetPrefixChangeDataL( string ); + } + else + { + rockerPress = EFalse; + } + CleanupStack::PopAndDestroy( replacePrefix ); + + } + else + { + rockerPress = ETrue; + } + } + + if ( prevChangeMode != changeMode && rockerPress ) + { + iModel->SetPrefixChangeModeL( changeMode ); + } + + __GSLOGSTRING("[GSCallPlugin] <--ChangePrefixSettingL"); + } + + +// --------------------------------------------------------------------------- +// CGSCallPlugin::SetVoipSettingBasedSelectedLine +// +// Set the new changes to VOIP variables. +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::SetVoipSettingBasedSelectedLine( + const TGSCallItemIds aPage, TInt aCurrentSetting ) + { + switch ( aPage ) + { + case EGSICSendIntCallIdItemId: + if ( aCurrentSetting == KGSFirstLine ) + { + iModel->SetVoIPCallSettingValue( + EGSVoIPSendIntCallId, EGSSendIntCallIdOn ); + } + else + { + iModel->SetVoIPCallSettingValue( + EGSVoIPSendIntCallId, EGSSendIntCallIdOff ); + } + break; + case EGSICWaitingItemId: + if ( aCurrentSetting == KGSFirstLine ) + { + iModel->SetVoIPCallSettingValue( + EGSVoIPCW, EGSCSCallWaitingOn ); + } + else + { + iModel->SetVoIPCallSettingValue( + EGSVoIPCW, EGSCSCallWaitingOff ); + } + break; + case EGSICPreferredTelephonyId: + if ( aCurrentSetting == KGSFirstLine ) + { + iModel->SetVoIPCallSettingValue( + EGSVoIPPreType, EGSPreferredCS ); + } + else + { + iModel->SetVoIPCallSettingValue( + EGSVoIPPreType, EGSPreferredPS ); + + // Show message query dialog if preferred call + // setting was changed to the Int. Telephone. + TRAP_IGNORE( ShowPreferredTelephonyNoteL() ); + } + break; + case EGSDndItemId: + if ( aCurrentSetting == KGSFirstLine ) + { + iModel->SetVoIPCallSettingValue( + EGSVoIPDnd, EGSCSCallDndOn ); + } + else + { + iModel->SetVoIPCallSettingValue( + EGSVoIPDnd, EGSCSCallDndOff ); + } + break; + default: + break; + } + } + +// --------------------------------------------------------------------------- +// CGSCallPlugin::Container +// +// Returns call container item +// --------------------------------------------------------------------------- +// +CGSCallPluginContainer* CGSCallPlugin::Container() + { + return static_cast ( iContainer ); + } + +// --------------------------------------------------------------------------- +// CGSCallPlugin::GetLineForSelectedVoipSetting +// +// Returns selected line based on setting value. +// --------------------------------------------------------------------------- +// +TInt CGSCallPlugin::GetLineForSelectedVoipSetting( + const TGSCallItemIds aPage ) + { + if ( !iModel->VoIPSupported() ) + { + return KErrNone; + } + + TInt value( KErrNone ); + + // Get value based from setting page. + switch ( aPage ) + { + case EGSICSendIntCallIdItemId: // No swap. + iModel->GetVoIPCallSettingValue( EGSVoIPSendIntCallId, value ); + break; + case EGSICWaitingItemId: + iModel->GetVoIPCallSettingValue( EGSVoIPCW, value ); + break; + case EGSICPreferredTelephonyId: // No swap. + iModel->GetVoIPCallSettingValue( EGSVoIPPreType, value ); + break; + case EGSDndItemId: + iModel->GetVoIPCallSettingValue( EGSVoIPDnd, value ); + break; + default: + break; + } + + // Swap items. + if ( aPage != EGSICPreferredTelephonyId && + aPage != EGSICSendIntCallIdItemId ) + { + if ( value == KGSSecondLine ) + { + value = KGSFirstLine; + } + else + { + value = KGSSecondLine; + } + } + + return value; + } + + +// --------------------------------------------------------------------------- +// CGSCallPlugin::ShowVTStillImageSettingPageL +// +// Display Video Telephony Still Image setting page. +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::ShowVTStillImageSettingPageL() + { + iVtStillImage = iModel->VTStillImageL(); + // Store previous in case something goes wrong. + iPreviousVtStillImage = iVtStillImage; + + CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( + R_GS_STILL_IMAGE_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + + // Map CenRep value to lbx items: + TInt dialogSelection = EGSVtStillImageNotInUse; + if ( iVtStillImage != KGSVTStillImageOff ) dialogSelection = EGSVtStillImageInUse; + + CAknRadioButtonSettingPage* dlg = + new( ELeave ) CAknRadioButtonSettingPage( R_GS_STILL_IMAGE_SETTING_PAGE, + dialogSelection, items ); + + TBool ret = dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); + + if ( ret ) + { + if ( dialogSelection == EGSVtStillImageNotInUse ) + { + // Still image not used + iModel->SetVTStillImageL( KGSVTStillImageOff ); + } + else + { + // User decided to update still image + ShowStillImageListL(); + } + + // Update VT item in CGSCallPlugin listbox. iVtStillImage value is + // irrelevant as UpdateListBoxL actually reads the new value from + // CenRep and converts it to lbx item value correctly (Off/On). + UpdateListBoxL( EGSStillImageItemId, iVtStillImage ); + } + CleanupStack::PopAndDestroy( items ); + } + + +// --------------------------------------------------------------------------- +// CGSCallPlugin::ShowStillImageListL() +// +// Display background image list from media gallery. +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::ShowStillImageListL() + { + CDesCArray* selectedFiles = new ( ELeave ) CDesCArrayFlat( 1 ); + CleanupStack::PushL( selectedFiles ); + + TBool ret = MGFetch::RunL( *selectedFiles, EImageFile, EFalse, this ); + + if ( ret && selectedFiles->MdcaCount() == 1 ) + { + iImageHandler = CGSAsyncImageHandling::NewL( iCoeEnv->FsSession(), + this, KGSVTStillImgPath ); + + TPtrC imagePath = selectedFiles->MdcaPoint( 0 ); + + TRAPD( error, iModel->iBackgroundApi->SetVTStillImagePathL( imagePath, + *iImageHandler ) ); + if ( error == KErrNone ) + { + // Show wait note + ShowImageLoadWaitNoteL(); + } + else + { + HandleImageErrorsL( error ); + } + } + CleanupStack::PopAndDestroy( selectedFiles ); + } + + +// --------------------------------------------------------------------------- +// CGSCallPlugin::ImageHandlingComplete() +// +// Method derived from MGSSyncImageHandlingObserver +// Run when the asynchronous image converting is complete +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::ImageHandlingCompleteL( TInt aError ) + { + if ( aError != KErrNone ) + { + HandleImageErrorsL( aError ); + } + else + { + // Needs to increment iVtStillImage value so CenRep will send + // notificatios to VT (only changing value will fire notification). + iModel->SetVTStillImageL( ++iVtStillImage ); + UpdateListBoxL( EGSStillImageItemId, EGSVtStillImageInUse ); + } + + HideImageLoadWaitNoteL(); + + delete iImageHandler; + iImageHandler = NULL; + } + + +// --------------------------------------------------------------------------- +// CGSCallPlugin::ShowImageLoadWaitNoteL() +// +// Display image load wait note dialog. +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::ShowImageLoadWaitNoteL() + { + if ( !iWaitDialog ) + { + iWaitDialog = new( ELeave ) CAknWaitDialog( + ( REINTERPRET_CAST(CEikDialog**, + &iWaitDialog ) ), ETrue ); + + iWaitDialog->ExecuteDlgLD( CAknNoteDialog::ENoTone, + R_IMAGE_LOAD_WAIT_NOTE ); + } + } + +// --------------------------------------------------------------------------- +// CGSCallPlugin::HideImageLoadWaitNoteL() +// +// Hide image load wait note dialog. +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::HideImageLoadWaitNoteL() + { + if ( iWaitDialog ) + { + iWaitDialog->ProcessFinishedL(); // deletes the dialog + iWaitDialog = NULL; + } + } + + +// --------------------------------------------------------------------------- +// CGSCallPlugin::HandleImageErrorsL +// +// Prompt image related errors to the user +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::HandleImageErrorsL( TInt aError ) + { + TInt resourceId; + switch( aError ) + { + case KErrNotSupported: + case KErrUnderflow: + // Image is corrupted or in wrong format + resourceId = R_GS_IMAGE_CORRUPTED; + break; + case KErrDiskFull: + case KErrNoMemory: + // Image is too large + resourceId = R_GS_IMAGE_TOO_LARGE; + break; + default: + // Better to give some error message than result in CONE5 panic: + resourceId = R_GS_IMAGE_CORRUPTED; + break; + } + // Show information note + HBufC* prompt = iCoeEnv->AllocReadResourceLC( resourceId ); + CAknInformationNote* note = new( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *prompt ); + + // Setting previous VT still image value (rollback) + iModel->SetVTStillImageL( iPreviousVtStillImage ); + UpdateListBoxL( EGSStillImageItemId, iPreviousVtStillImage ); + CleanupStack::PopAndDestroy( prompt ); + } + + +// --------------------------------------------------------------------------- +// CGSCallPlugin::VerifySelectionL() +// +// An overloaded method from MMGFetchVerifier interface class +// --------------------------------------------------------------------------- +// +TBool CGSCallPlugin::VerifySelectionL( const MDesCArray* aSelectedFiles ) + { + const TBool KGSDrmProtectedContent = ETrue; + + TBool ret = ETrue; + // + if ( aSelectedFiles->MdcaCount() == 1 ) + { + const TPtrC fileName( aSelectedFiles->MdcaPoint( 0 ) ); + + // First, check if the selected file is DRM protected + if ( ret && CheckDRMProtectionL( fileName ) == + KGSDrmProtectedContent ) + { + // display the note to user + // Show information note + HBufC* prompt = iCoeEnv->AllocReadResourceLC( + R_GS_DRM_NOT_ALLOWED ); + + CAknInformationNote* note = + new( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *prompt ); + + CleanupStack::PopAndDestroy( prompt ); + ret = EFalse; + } + + // Next, check whether the image header is valid + if ( ret ) + { + CImageDecoder* imageDecoder = NULL; + TRAPD( err, imageDecoder = CImageDecoder::FileNewL( + iCoeEnv->FsSession(), fileName, ContentAccess::EPeek ) ); + + if ( err != KErrNone ) + { + // Show information note + HBufC* prompt = iCoeEnv->AllocReadResourceLC( + R_GS_IMAGE_CORRUPTED ); + CAknInformationNote* note = + new( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD(*prompt); + CleanupStack::PopAndDestroy( prompt ); + + ret = EFalse; + } + delete imageDecoder; + } + } + + return ret; + } + + +// --------------------------------------------------------------------------- +// CGSCallPlugin::CheckDRMProtectionL +// +// Check if the selected image file is DRM protected. +// --------------------------------------------------------------------------- +// +TBool CGSCallPlugin::CheckDRMProtectionL( const TDesC& aOriginalFileName ) + { + TBool isProtected( EFalse ); + DRMCommon* drmClient = DRMCommon::NewL(); + CleanupStack::PushL( drmClient ); + TInt error = drmClient->Connect(); + if ( error != DRMCommon::EOk ) + { + User::Leave( KErrCorrupt ); + } + + if ( aOriginalFileName != KNullDesC ) + { + error = drmClient->IsProtectedFile( aOriginalFileName, isProtected ); + if ( error != DRMCommon::EOk ) + { + User::Leave( KErrCorrupt ); + } + } + + CleanupStack::PopAndDestroy( drmClient ); + return isProtected; + } + +// --------------------------------------------------------------------------- +// +// Show Call Duration setting page +// +// --------------------------------------------------------------------------- +// +TBool CGSCallPlugin::ShowCallDurationSettingPageL( TInt& aCurrentValue ) + { + __GSLOGSTRING("[GSCallPlugin]--> ShowCallDurationSettingPageL"); + CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( + R_GS_SHOW_CALL_DURATION_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + + CAknRadioButtonSettingPage* dlg = new (ELeave) CAknRadioButtonSettingPage( + R_GS_SHOW_CALL_DURATION_SETTING_PAGE, + aCurrentValue, items ); + + TBool ret = dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); + CleanupStack::PopAndDestroy( items ); + + __GSLOGSTRING("[GSCallPlugin] <--ShowCallDurationSettingPageL"); + return ret; + } + +// --------------------------------------------------------------------------- +// CGSCallPlugin::ChangeCallDurationSettingL +// +// Change Call Duration setting. +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::ChangeCallDurationSettingL( TBool aSettingPage ) + { + __GSLOGSTRING("[GSCallPlugin]--> ChangeCallDurationSettingL"); + + TInt callState = CheckCallStateL(); + + // Get information of whether there are open connections or not + if ( callState != EPSCTsyCallStateUninitialized && + callState != EPSCTsyCallStateNone ) + { + HBufC* prompt = iCoeEnv->AllocReadResourceLC( R_TEXT_ACTIVE_CALL ); + + CAknInformationNote* note = + new( ELeave ) CAknInformationNote( ETrue ); + + note->ExecuteLD( *prompt ); + + CleanupStack::PopAndDestroy( prompt ); + + return; + } + + TInt duration = iModel->CallDurationL(); + TBool updateValue = ETrue; + + if ( aSettingPage ) + { + updateValue = ShowCallDurationSettingPageL( duration ); + } + else + { + if( duration == KGSSettingItemOff ) + { + duration = KGSSettingItemOn; + } + else + { + duration = KGSSettingItemOff; + } + } + + if ( updateValue ) + { + iModel->SetCallDurationL( duration ); + UpdateListBoxL( EGSShowCallDurationItemId, KGSNotUsed ); + } + + __GSLOGSTRING("[GSCallPlugin] <--ChangePrefixSettingL"); + } + + +// --------------------------------------------------------------------------- +// CGSCallPlugin::CheckCallStateL +// +// Check call state using PubSub or SA +// --------------------------------------------------------------------------- +// +TInt CGSCallPlugin::CheckCallStateL() + { + TInt callState = KErrNone; + //here are open connections or not + RProperty::Get( KPSUidCtsyCallInformation, + KCTsyCallState, + callState ); + return callState; + } + + +// --------------------------------------------------------------------------- +// CGSCallPlugin::ShowPreferredTelephonyNoteL +// +// Shows note if preferred call setting was changed to the Int. Telephone. +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::ShowPreferredTelephonyNoteL() + { + // Create message query dialog. + HBufC* text = StringLoader::LoadLC( R_IC_PREFERRED_TELEPHONE_QUERY_TEXT ); + CAknMessageQueryDialog* query = CAknMessageQueryDialog::NewL( *text ); + query->SetMessageTextL( text->Des() ); + + // Show message query dialog. + query->ExecuteLD( R_IC_PREFERRED_TELEPHONE_QUERY ); + + CleanupStack::PopAndDestroy( text ); + } + + +// ----------------------------------------------------------------------------- +// When this method is called, view checks based on highlight focus, if the MSK +// label is correct. +// ----------------------------------------------------------------------------- +// +void CGSCallPlugin::CheckMiddleSoftkeyLabelL() + { + const TInt currentFeatureId = Container()->CurrentFeatureId(); + RemoveCommandFromMSK( iMskCommandFlag ); + if ( currentFeatureId == EGSCallWaitingItemId ) + { + // First remove any prevous commands. + SetMiddleSoftKeyLabelL( R_CALL_SOFTKEY_OPTION, + EAknSoftkeyContextOptions ); + // This way we set which command is set for MSK + iMskCommandFlag = EFalse; + } + else + { + //Set middle softkey as Change. + SetMiddleSoftKeyLabelL( R_CALL_MSK_CHANGE, + EGSMSKCmdAppChange ); + // This way we set which command is set for MSK + iMskCommandFlag = ETrue; + } + } + +// ----------------------------------------------------------------------------- +// Remove unnecessary commands from Middle softkey. +// @flag = ETrue means presently MSK value is "Change" so we remove that +// @flag = EFalse means presently MSK value is "Context Options" so we remove that +// ----------------------------------------------------------------------------- +// +void CGSCallPlugin::RemoveCommandFromMSK(const TBool flag ) + { + CEikButtonGroupContainer* cbaGroup = Cba(); + if ( cbaGroup ) + { + if ( flag ) + { + cbaGroup->RemoveCommandFromStack( + KGSMSKControlID, EGSMSKCmdAppChange ); + } + else + { + cbaGroup->RemoveCommandFromStack( + KGSMSKControlID, EAknSoftkeyContextOptions ); + } + } + } +// --------------------------------------------------------------------------- +// Sets middle softkey label. +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::SetMiddleSoftKeyLabelL( + const TInt aResourceId, const TInt aCommandId ) + { + CEikButtonGroupContainer* cbaGroup = Cba(); + if ( cbaGroup ) + { + HBufC* middleSKText = StringLoader::LoadLC( aResourceId ); + TPtr mskPtr = middleSKText->Des(); + cbaGroup->AddCommandToStackL( + KGSMSKControlID, + aCommandId, + mskPtr ); + CleanupStack::PopAndDestroy( middleSKText ); + } + } + +// ----------------------------------------------------------------------------- +// CGSCallPlugin::HandleClientRectChange +// +// +// ----------------------------------------------------------------------------- +// +void CGSCallPlugin::HandleClientRectChange() + { + if ( iContainer ) + { + iContainer->SetRect( ClientRect() ); + } + } + +// ========================= From CGSPluginInterface ================== + +// ----------------------------------------------------------------------------- +// CGSCallPlugin::GetCaptionL +// +// +// ----------------------------------------------------------------------------- +// +void CGSCallPlugin::GetCaptionL( TDes& aCaption ) const + { + HBufC* result = StringLoader::LoadL( R_GS_CALL_PLUGIN_CAPTION ); + aCaption.Copy( *result ); + delete result; + } + + +// ----------------------------------------------------------------------------- +// CGSCallPlugin::PluginProviderCategory +// +// +// ----------------------------------------------------------------------------- +// +TInt CGSCallPlugin::PluginProviderCategory() const + { + //This plugin is created by 3rd party. + return KGSPluginProviderInternal; + } + + +// ----------------------------------------------------------------------------- +// CGSCallPlugin::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CGSCallPlugin::CreateIconL( const TUid aIconType ) + { + //EMbm + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSCallPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropSetCallSub, + fp->FullName(), + EMbmGscallpluginQgn_prop_set_call_sub, + EMbmGscallpluginQgn_prop_set_call_sub_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + CleanupStack::PopAndDestroy( fp ); + + return icon; + } + + +// --------------------------------------------------------------------------- +// CGSCallPlugin::ChangeLongPressCallKeySettingL +// +// Change Long Press Call Key setting. +// values: 0,1 --> Inactive (Default Value is 1 and when RFS default value is 0) +// 2 --> Video call +// --------------------------------------------------------------------------- +// +void CGSCallPlugin::ChangeLongPressCallKeySettingL( const TBool aShowSettingPage ) + { + __GSLOGSTRING("[GSCallPlugin]--> ChangeLongPressCallKeySettingL"); + TInt statusLongPressCallKey = iModel->LongPressCallKeyL(); + TBool updateValue = ETrue; + + if ( aShowSettingPage ) + { + // If the status of Long Key is not active then we decrement to + // the value of statusLongPressCallKey so that the values are + // then tuned to launch the setting page normally with two setting + // items InActive and Video Call + // Refer to GSCallPlugin.hrh file for more info for the description + iModel->MapLongPressKeyCallKeyValue( statusLongPressCallKey ); + updateValue = ShowLongPressCallKeySettingPageL( + statusLongPressCallKey ); + + // Here if the selected index is 1 it means Video Call from the setting page + // we then again map this value back to 2 which is EGSLongPressCallKeyVideoCall + // Refer to GSCallPlugin.hrh for more details + if ( statusLongPressCallKey == EGSLongPressCallKeyVoiceCall ) + { + statusLongPressCallKey = EGSLongPressCallKeyVideoCall; + } + else // If selected index in setting page is InActive ( 0) we map + // this to EGSLongPressCallKeyVoiceCall which is 1 + { + statusLongPressCallKey = EGSLongPressCallKeyVoiceCall; + } + } + else // switch the value + { + if ( statusLongPressCallKey == EGSLongPressCallKeyNotSet || + statusLongPressCallKey == EGSLongPressCallKeyVoiceCall ) + { + statusLongPressCallKey = EGSLongPressCallKeyVideoCall; + } + else + { + statusLongPressCallKey = EGSLongPressCallKeyVoiceCall; + } + } + if ( updateValue ) + { + iModel->SetLongPressCallKeyL( statusLongPressCallKey ); + UpdateListBoxL( EGSLongPressCallKeyItemId, KGSNotUsed ); + } + + __GSLOGSTRING("[GSCallPlugin] <--ChangeLongPressCallKeySettingL"); + } + +// --------------------------------------------------------------------------- +// +// Launching Long Press Key setting page +// +// --------------------------------------------------------------------------- +// +TBool CGSCallPlugin::ShowLongPressCallKeySettingPageL( TInt& aCurrentValue ) + { + __GSLOGSTRING("[GSCallPlugin]--> ShowLongPressCallKeySettingPageL"); + CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( + R_GS_LONG_PRESS_CALL_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + + CAknRadioButtonSettingPage* dlg = new (ELeave) CAknRadioButtonSettingPage( + R_GS_LONG_PRESS_CALL_SETTING_PAGE, + aCurrentValue, items ); + + TBool ret = dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); + CleanupStack::PopAndDestroy( items ); + + __GSLOGSTRING("[GSCallPlugin] <--ShowLongPressCallKeySettingPageL"); + return ret; + } + + +// ---------------------------------------------------------------------------- +// CGSCallPlugin::ShowOwnImageVtCallSettingPageL +// +// Displaying settings page for Own Image during video call setting +// ---------------------------------------------------------------------------- +// +void CGSCallPlugin::ShowOwnImageVtCallSettingPageL() + { + __GSLOGSTRING("[GSCallPlugin]--> ShowOwnImageVtCallSettingPageL"); + TInt currentValue = iModel->OwnImageVtCallStatusL(); + CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( + R_GS_OWN_IMAGE_VT_CALL_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + + CAknRadioButtonSettingPage* dlg = new (ELeave) CAknRadioButtonSettingPage( + R_GS_OWN_IMAGE_VT_CALL_SETTING_PAGE, + currentValue, items ); + + TBool ret = dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); + + if( ret ) + { + iModel->SetOwnImageVtCallStatusL( currentValue ); + UpdateListBoxL( EGSOwnImageVtCallItemId, currentValue ); + } + + CleanupStack::PopAndDestroy( items ); + + __GSLOGSTRING("[GSCallPlugin] <--ShowOwnImageVtCallSettingPageL"); + } + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,1064 @@ +/* +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for the Call folder +* +*/ + + +// INCLUDE FILES + +#include "GSCallPluginContainer.h" //for CGSCallPluginContainer +#include "GsLogger.h" //for logging traces +#include "gssettingid.h" //for constants +#include "GSCallPluginModel.h" //plug-in model +#include "GSCallPlugin.h" + + +#include //for CAknSettingStyleListBox +#include //for CPsetCli +#include //for CPsetSAObserver +#include //for CSP features +#include //for resource IDs +#include +#include +#include +#include //for listbox clases +#include +#include +#include + +//LOCAL CONSTANTS +_LIT( KGSNameOfClass, "CGSCallPluginContainer" ); +_LIT(KGSReplaceListControlChars, "\n\t\x2029"); + +// ========================= MEMBER FUNCTIONS ================================ +// --------------------------------------------------------------------------- +// +// Symbian OS two phased constructor +// +// --------------------------------------------------------------------------- +void CGSCallPluginContainer::ConstructL( const TRect& aRect ) + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::ConstructL"); + + __GSLOGSTRING("[CGSCallPluginContainer] Creating model..."); + iModel = CGSCallPluginModel::NewL(); + __GSLOGSTRING("[CGSCallPluginContainer] Model created."); + + iListBox = new ( ELeave ) CAknSettingStyleListBox; + + __GSLOGSTRING("[CGSCallPluginContainer]--> ConstructL - Model created"); + + iSsSettings = new (ELeave) RSSSettings; + User::LeaveIfError( iSsSettings->Open() ); + __GSLOGSTRING("[CGSCallPluginContainer]--> ConstructL - SSSettings created & opened"); + + BaseConstructL( aRect, + R_GS_CALL_VIEW_TITLE, + R_CALL_LBX ); + + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::ConstructL"); + } + +// --------------------------------------------------------------------------- +// +// Destructor +// +// --------------------------------------------------------------------------- +CGSCallPluginContainer::~CGSCallPluginContainer() + { + if ( iSsSettings ) + { + iSsSettings->Close(); + } + delete iSsSettings; + + delete iClirItems; + delete iCWItems; + delete iPCTItems; + delete iDndItems; + + if ( iStillImgValues ) + { + delete iStillImgValues; + } + if ( iChangeModeItems && + FeatureManager::FeatureSupported ( KFeatureIdJapanPrefixChange ) ) + { + delete iChangeModeItems; + } + if ( iCallDurationItems ) + { + delete iCallDurationItems; + } + if ( iLongPressCallKeyItems ) + { + delete iLongPressCallKeyItems; + } + if ( iListboxItemArray ) + { + delete iListboxItemArray; + } + if ( iOwnImageVtCallItems ) + { + delete iOwnImageVtCallItems; + } + if ( iModel ) + { + delete iModel; + } + } + +// --------------------------------------------------------------------------- +// +// Creates list box +// +// --------------------------------------------------------------------------- +void CGSCallPluginContainer::ConstructListBoxL( TInt aResLbxId ) + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::ConstructListBoxL"); + + iListBox->ConstructL( this, EAknListBoxSelectionList ); + + iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, + *iListBox, *iCoeEnv ); + iListBox->Model()->SetItemTextArray( iListboxItemArray ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + iStillImgValues = iCoeEnv->ReadDesC16ArrayResourceL( + R_GS_STILL_IMAGE_SETTING_PAGE_LBX ); + + if ( iModel->VoIPSupported() ) + { + iClirItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_IC_CLIR_SETTING_PAGE_LBX ); + iCWItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_IC_WAITING_SETTING_PAGE_LBX ); + iPCTItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_IC_PREFERRED_CALL_TYPE_SETTING_PAGE_LBX ); + iDndItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_IC_DND_SETTING_PAGE_LBX ); + } + + if ( FeatureManager::FeatureSupported( KFeatureIdJapanPrefixChange ) ) + { + iChangeModeItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_GS_REPLACE_PREFIX_SETTING_PAGE_LBX ); + } + + iCallDurationItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_GS_SHOW_CALL_DURATION_SETTING_PAGE_LBX ); + + iLongPressCallKeyItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_GS_LONG_PRESS_CALL_SETTING_PAGE_LBX ); + + iOwnImageVtCallItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_GS_OWN_IMAGE_VT_CALL_SETTING_PAGE_LBX ); + + CreateListBoxItemsL(); + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::ConstructListBoxL"); + } + +// --------------------------------------------------------------------------- +// +// Creates List box items +// +// --------------------------------------------------------------------------- +void CGSCallPluginContainer::CreateListBoxItemsL() + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::CreateListBoxItemsL"); +// do not get check CSP if not using WINS +#ifndef __WINS__ + //Set CSP on, if it is not already + if ( !iModel->GetCSPStatus() ) + { + iModel->SetCSPActiveL( ETrue ); + } +#endif //__WINS__ + + //create slide settings items + if ( iModel->SlideSettingsShownL() ) + { + MakeSlideSettingsItem( EGSOpeningSlideAnswerCallItemId ); + MakeSlideSettingsItem( EGSClosingSlideEndCallItemId ); + } + + //Create own number sending, call waiting soft-reject items and ccbs + MakeONSItemL(); + MakeCWItemL(); + + if ( iModel->VoIPSupported() ) + { + MakeICClirItemL(); + MakeICWaitingItemL(); +#ifndef RD_VOIP_REL_2_2 + MakeICPreferredCallTypeItemL(); +#endif // !RD_VOIP_REL_2_2 + MakeDndItemL(); + } + + + MakeSoftRejectTxtItemL(); + + if ( FeatureManager::FeatureSupported( + KFeatureIdCsVideoTelephony ) ) + { + MakeStillImageItemL(); //Still Image item + MakeOwnImageVtCallItemL(); //VT call own image mute item + } + + if ( FeatureManager::FeatureSupported( KFeatureIdJapanPrefixChange ) ) + { + MakeReplacePrefixItemL(); + } + + // Create on/off settings + MakeCallItemL( KGSSettIdSummaryAfterCall ); + + //Create line in use + TInt als = ESSSettingsAlsNotSupported; + TInt alsError = iSsSettings->Get( ESSSettingsAls, als ); + + if ( als != ESSSettingsAlsNotSupported && alsError == KErrNone ) + { + MakePLUItemL( als ); + + //Create Line blocking + TInt alsBlock = ESSSettingsAlsBlockingNotSupported; + alsError = iSsSettings->Get( ESSSettingsAlsBlocking, alsBlock ); + if ( alsBlock != ESSSettingsAlsBlockingNotSupported && + alsError == KErrNone ) + { + MakePLBItemL( alsBlock ); + } + } + MakeCallDurationItemL(); + + #ifdef RD_VT_LONG_SEND_KEY + MakeLongPressCallKeyItemL(); + #endif + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::CreateListBoxItemsL"); + } + +// --------------------------------------------------------------------------- +// +// Updates list box with a changed item +// +// --------------------------------------------------------------------------- +void CGSCallPluginContainer::UpdateListBoxL( TInt aFeatureId, TInt aNewValue ) + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::UpdateListBoxL"); + switch( aFeatureId ) + { + case EGSOpeningSlideAnswerCallItemId: + case EGSClosingSlideEndCallItemId: + if ( iModel->SlideSettingsShownL() ) + { + MakeSlideSettingsItem( aFeatureId ); + } + break; + case EGSCliItemId: + MakeONSItemL(); + break; +// case EGSCCBSItemId: + case EGSCallWaitingItemId: + return; //CW and CCBS does not have a value => no need to update + case EGSICSendIntCallIdItemId: + if ( iModel->VoIPSupported() ) + { + MakeICClirItemL(); + } + break; + case EGSICWaitingItemId: + if ( iModel->VoIPSupported() ) + { + MakeICWaitingItemL(); + } + break; + case EGSICPreferredTelephonyId: + if ( iModel->VoIPSupported() ) + { + MakeICPreferredCallTypeItemL(); + } + break; + case EGSDndItemId: + if ( iModel->VoIPSupported() ) + { + MakeDndItemL(); + } + break; + case EGSSummaryAfterCallItemId: + MakeCallItemL( KGSSettIdSummaryAfterCall ); + break; + case EGSALSBlockItemId: + MakePLBItemL( aNewValue ); + break; + case EGSLineChangeItemId: + MakePLUItemL( aNewValue ); + break; + + case EGSSoftRejectTextItemId: + MakeSoftRejectTxtItemL(); + break; + case EGSStillImageItemId: + if ( FeatureManager::FeatureSupported( + KFeatureIdCsVideoTelephony ) ) + { + MakeStillImageItemL(); + } + break; + case EGSReplacePrefixItemId: + if ( FeatureManager::FeatureSupported( KFeatureIdJapanPrefixChange ) ) + { + MakeReplacePrefixItemL(); + } + break; + case EGSShowCallDurationItemId: + MakeCallDurationItemL(); + break; + case EGSLongPressCallKeyItemId: + #ifdef RD_VT_LONG_SEND_KEY + MakeLongPressCallKeyItemL(); + #endif + break; + case EGSOwnImageVtCallItemId: + if ( FeatureManager::FeatureSupported( + KFeatureIdCsVideoTelephony ) ) + { + MakeOwnImageVtCallItemL(); + } + break; + default: + Panic( KGSNameOfClass, EInvalidIndex ); + break; + } + + //iListBox->HandleItemAdditionL(); + iListBox->DrawDeferred(); + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::UpdateListBoxL"); + } + + +// --------------------------------------------------------------------------- +// +// Creates StillImage list item. +// +// --------------------------------------------------------------------------- +void CGSCallPluginContainer::MakeStillImageItemL() + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeStillImageItemL"); + HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 ); + TPtr ptrBuffer ( dynamicText->Des() ); + + TInt dialogSelection = EGSVtStillImageNotInUse; + if ( iModel->VTStillImageL() ) + dialogSelection = EGSVtStillImageInUse; + ptrBuffer = (*iStillImgValues)[ dialogSelection ]; + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSStillImageItemId, ptrBuffer ); + CleanupStack::PopAndDestroy( dynamicText ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSStillImageItemId, + CGSListBoxItemTextArray::EVisible ); + + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeStillImageItemL"); + } + + + +// --------------------------------------------------------------------------- +// +// Creates OwnNumberSending list item. +// +// --------------------------------------------------------------------------- +void CGSCallPluginContainer::MakeONSItemL() + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeONSItemL"); + HBufC16* dynamicText = NULL; + + TInt clir = ESSSettingsClirNetworkDefault; + //to allow emulator usage without phone, do not retrieve values. + TInt err = iSsSettings->Get( ESSSettingsClir, clir ); + __GSLOGSTRING2("[CGSCallPluginContainer] MakeONSItemL: clir: %d, Error: %d", clir, err); + if ( err != KErrNone ) + { + return; + } + + switch( clir ) + { + case ESSSettingsClirExplicitSuppress: + dynamicText = StringLoader::LoadL( R_CLI_SENDING_ON ); + break; + case ESSSettingsClirExplicitInvoke: + dynamicText = StringLoader::LoadL( R_CLI_SENDING_OFF ); + break; + default: + if ( iModel->RestrictedSendCallerIdSupportedL() ) + { + //set initially to ON if restricted CLIR is supported + dynamicText = StringLoader::LoadL( R_CLI_SENDING_ON ); + TInt err = iSsSettings->Set( + ESSSettingsClir, ESSSettingsClirExplicitSuppress ); + if ( err != KErrNone ) + { + delete dynamicText; + return; + } + } + else + { + dynamicText = StringLoader::LoadL( R_CLI_SENDING_DEFAULT ); + } + break; + } + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSCliItemId, *dynamicText ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSCliItemId, + CGSListBoxItemTextArray::EVisible ); + + delete dynamicText; + dynamicText = NULL; + + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeONSItemL"); + } + +// --------------------------------------------------------------------------- +// +// Creates CallWaiting list item. +// +// --------------------------------------------------------------------------- +void CGSCallPluginContainer::MakeCWItemL() + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeCWItemL"); +#ifndef __WINS__ + //Create call waiting + if ( iModel->IsSettingSupported( EGSCSPCallWaiting ) ) + { +#endif //__WINS__ + iListboxItemArray->SetItemVisibilityL( EGSCallWaitingItemId, + CGSListBoxItemTextArray::EVisible ); +#ifndef __WINS__ + } +#endif //__WINS__ + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeCWItemL"); + } + +// --------------------------------------------------------------------------- +// CGSCallPluginContainer::MakeICClirItemL() +// +// +// --------------------------------------------------------------------------- +// +void CGSCallPluginContainer::MakeICClirItemL() + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeICClirItemL"); + TInt value( KErrNone ); + iModel->GetVoIPCallSettingValue( EGSVoIPSendIntCallId, value ); + + HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 ); + TPtr ptrBuffer ( dynamicText->Des() ); + + ptrBuffer = ( *iClirItems )[ value ]; + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSICSendIntCallIdItemId, ptrBuffer ); + + iListboxItemArray->SetItemVisibilityL( EGSICSendIntCallIdItemId, + CGSListBoxItemTextArray::EVisible ); + + CleanupStack::PopAndDestroy( dynamicText ); + + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeICClirItemL"); + } + +// --------------------------------------------------------------------------- +// CGSCallPluginContainer::MakeICWaitingItemL() +// +// +// --------------------------------------------------------------------------- +// +void CGSCallPluginContainer::MakeICWaitingItemL() + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeICWaitingItemL"); + TInt value( KErrNone ); + iModel->GetVoIPCallSettingValue( EGSVoIPCW, value ); + + // Swap items because of different order. + if ( value == EGSCSCallWaitingOff ) + { + value = EGSCSCallWaitingOn; + } + else + { + value = EGSCSCallWaitingOff; + } + + HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 ); + TPtr ptrBuffer ( dynamicText->Des() ); + + ptrBuffer = ( *iCWItems )[ value ]; + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSICWaitingItemId, ptrBuffer ); + iListboxItemArray->SetItemVisibilityL( EGSICWaitingItemId, + CGSListBoxItemTextArray::EVisible ); + + CleanupStack::PopAndDestroy( dynamicText ); + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeICWaitingItemL"); + } + +// --------------------------------------------------------------------------- +// CGSCallPluginContainer::MakeICPreferredCallTypeItemL() +// +// +// --------------------------------------------------------------------------- +// +void CGSCallPluginContainer::MakeICPreferredCallTypeItemL() + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeICPreferredCallTypeItemL"); + TInt value( KErrNone ); + iModel->GetVoIPCallSettingValue( EGSVoIPPreType, value ); + + HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 ); + TPtr ptrBuffer ( dynamicText->Des() ); + + ptrBuffer = ( *iPCTItems )[ value ]; + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSICPreferredTelephonyId, ptrBuffer ); + CleanupStack::PopAndDestroy( dynamicText ); + + iListboxItemArray->SetItemVisibilityL( EGSICPreferredTelephonyId, + CGSListBoxItemTextArray::EVisible ); + + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeICPreferredCallTypeItemL"); + } + +// --------------------------------------------------------------------------- +// CGSCallPluginContainer::MakeDndItemL() +// +// +// --------------------------------------------------------------------------- +// +void CGSCallPluginContainer::MakeDndItemL() + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeDndItemL"); + TInt value( KErrNone ); + iModel->GetVoIPCallSettingValue( EGSVoIPDnd, value ); + + // Swap items because of different order. + if ( value == EGSCSCallDndOff ) + { + value = EGSCSCallDndOn; + } + else + { + value = EGSCSCallDndOff; + } + + HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 ); + TPtr ptrBuffer ( dynamicText->Des() ); + + ptrBuffer = ( *iDndItems )[ value ]; + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSDndItemId, ptrBuffer ); + CleanupStack::PopAndDestroy( dynamicText ); + + iListboxItemArray->SetItemVisibilityL( EGSDndItemId, + CGSListBoxItemTextArray::EVisible ); + + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeDndItemL"); + } + +// --------------------------------------------------------------------------- +// +// Creates PhoneLineInUse list item. +// +// --------------------------------------------------------------------------- +void CGSCallPluginContainer::MakePLUItemL( TInt& aAlsValue ) + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakePLUItemL"); + + if ( aAlsValue == ESSSettingsAlsNotSupported ) + { + iListboxItemArray->SetItemVisibilityL( EGSLineChangeItemId, + CGSListBoxItemTextArray::EInvisible ); + + __GSLOGSTRING("[CGSCallPluginContainer] <--MakePLUItemL:AlsNotSupported"); + return; + } + + HBufC* dynamicText = NULL; + + if ( aAlsValue == ESSSettingsAlsAlternate ) + { + dynamicText = StringLoader::LoadL( R_ALS_LINE2 ); + } + else + { + dynamicText = StringLoader::LoadL( R_ALS_LINE1 ); + } + + // for A&H number conversion + TPtr bufPtr = dynamicText->Des(); + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( bufPtr ); + + iListboxItemArray->SetDynamicTextL( EGSLineChangeItemId, *dynamicText ); + + // Add to listbox + iListboxItemArray->SetItemVisibilityL( EGSLineChangeItemId, + CGSListBoxItemTextArray::EVisible ); + + delete dynamicText; + dynamicText = NULL; + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakePLUItemL"); + } + +// --------------------------------------------------------------------------- +// +// Creates PhoneLineBlocking list item. No item is created, if service is not +// supported. +// +// --------------------------------------------------------------------------- +void CGSCallPluginContainer::MakePLBItemL( TInt& aAlsBlockValue ) + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakePLBItemL"); + HBufC* dynamicText = NULL; + + if ( aAlsBlockValue == ESSSettingsAlsBlockingOn ) + { + dynamicText = StringLoader::LoadL( R_ALS_LINE_BLOCKING_ON ); + } + else + { + dynamicText = StringLoader::LoadL( R_ALS_LINE_BLOCKING_OFF ); + } + + iListboxItemArray->SetDynamicTextL( EGSALSBlockItemId, *dynamicText ); + + // Add to listbox + iListboxItemArray->SetItemVisibilityL( EGSALSBlockItemId, + CGSListBoxItemTextArray::EVisible ); + + delete dynamicText; + dynamicText = NULL; + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakePLBItemL"); + } + +// --------------------------------------------------------------------------- +// +// Creates Speed Dialing, Anykey Answer, Summary After Call +// and Automatic redial items. +// +// --------------------------------------------------------------------------- +void CGSCallPluginContainer::MakeCallItemL( TInt aIndex ) + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeCallItemL"); + HBufC* settingOn = NULL; + HBufC* settingOff = NULL; + TInt value = KGSSettingOff; //default is OFF for all + TInt settingItem = 0; + TBool ok = ETrue; + + TCallSettId keyName = EGSNotSet; + + switch ( aIndex ) + { + case KGSSettIdSummaryAfterCall: + keyName = EGSSummaryAfterCall; + settingItem = EGSSummaryAfterCallItemId; + settingOn = StringLoader::LoadLC( R_CALL_TERMINATION_NOTE_ON ); + settingOff = StringLoader::LoadLC( R_CALL_TERMINATION_NOTE_OFF ); + break; + default: + Panic( KGSNameOfClass, EInvalidIndex ); + break; + } + + if( ok ) //if everything is ok so far + { + iModel->GetCallSettingValue( keyName, value ); + __GSLOGSTRING1("[CGSCallPluginContainer] MakeCallItemL: value: %d", value); + + // Finally, set the dynamic text + if ( value == KGSSettingOn ) + { + iListboxItemArray->SetDynamicTextL( settingItem, settingOn->Des() ); + } + else + { + iListboxItemArray->SetDynamicTextL( settingItem, settingOff->Des() ); + } + + CleanupStack::PopAndDestroy( 2 ); //settingOn, settingOff + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( settingItem, + CGSListBoxItemTextArray::EVisible ); + } + + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeCallItemL"); + } + +// --------------------------------------------------------------------------- +// CGSCallPluginContainer::GetHelpContext(TCoeHelpContext& aContext) const +// Gets Help +// +// --------------------------------------------------------------------------- +// +void CGSCallPluginContainer::GetHelpContext(TCoeHelpContext& aContext) const + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::GetHelpContext"); + aContext.iMajor = KUidGS; + aContext.iContext = KSCP_HLP_CALL; + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::GetHelpContext"); + } + +// --------------------------------------------------------------------------- +// Creates Call Completion When Busy Subscriber item. +// +// --------------------------------------------------------------------------- +// +/* +void CGSCallPluginContainer::MakeCCBSItemL() + { + if ( FeatureManager::FeatureSupported( KFeatureIdPhoneCcbs ) ) + { + iListboxItemArray->SetItemVisibilityL( EGSCCBSItemId, + CGSListBoxItemTextArray::EVisible ); + } + } +*/ + +// --------------------------------------------------------------------------- +// CGSCallPluginContainer::CurrentFeatureId() +// +// --------------------------------------------------------------------------- +// +TInt CGSCallPluginContainer::CurrentFeatureId( ) const + { + return iListboxItemArray->CurrentFeature( ); + } + + +// --------------------------------------------------------------------------- +// Creates Soft reject text item. +// +// --------------------------------------------------------------------------- +// +void CGSCallPluginContainer::MakeSoftRejectTxtItemL() + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeSoftRejectTxtItemL"); + HBufC* dynamicText = HBufC::NewLC( KGSSMSTxtEditorLength ); + TPtr string( dynamicText->Des() ); + string.Zero(); + + GetSoftRejectTextL( string ); + if ( string.Length() == 0 ) + { + string = KGSEmptySpace; + } + + + AknTextUtils::ReplaceCharacters( string, KGSReplaceListControlChars, + TChar(' ') ); + + iListboxItemArray->SetDynamicTextL( EGSSoftRejectTextItemId, string ); + + CleanupStack::PopAndDestroy( dynamicText ); + + iListboxItemArray->SetItemVisibilityL( EGSSoftRejectTextItemId, + CGSListBoxItemTextArray::EVisible ); + + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeSoftRejectTxtItemL"); + } + +// --------------------------------------------------------------------------- +// Gets the value to the Soft Reject Txt. +// +// --------------------------------------------------------------------------- +// +void CGSCallPluginContainer::GetSoftRejectTextL( TDes& aSoftRejectTxt ) + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::GetSoftRejectTextL"); + TInt value = KGSSettingOff; + + TCallSettId keyName = EGSSoftRejectDefault; + iModel->GetCallSettingValue( keyName, value ); + + if ( value == KGSSettingOff ) + { + HBufC* defaultText = ReadFromResourceL( R_SOFT_REJECT_DEFAULT_TXT ); + CleanupStack::PushL( defaultText ); + aSoftRejectTxt = *defaultText; + CleanupStack::PopAndDestroy(); //defaultText + } + else + { + TGSSMSTextEditor softRejectTxt; + iModel->GetSoftRejectText( softRejectTxt ); + aSoftRejectTxt = softRejectTxt; + } + + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::GetSoftRejectTextL"); + } + +// --------------------------------------------------------- +// CGSCallPluginContainer::ReadFromResourceL +// --------------------------------------------------------- +// +HBufC* CGSCallPluginContainer::ReadFromResourceL( + TInt aResourceId ) + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::ReadFromResourceL"); + // Find the resource file + RConeResourceLoader loader( *iCoeEnv ); + TParse parse; + parse.Set( KGSSoftRejectResource, &KDC_RESOURCE_FILES_DIR, NULL ); + TFileName fileName( parse.FullName() ); + + // Get language of resource file + BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName ); + + // Open resource file + TInt err = loader.Open( fileName ); + if ( err == KErrNotFound ) + { + return NULL; + } + + CleanupClosePushL( loader ); + HBufC* result = StringLoader::LoadL( aResourceId ); + CleanupStack::PopAndDestroy(); //loader & it is closed also. + + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::ReadFromResourceL"); + return result; + } + +// --------------------------------------------------------------------------- +// Creates Replace Prefix list box item. +// +// --------------------------------------------------------------------------- +// +void CGSCallPluginContainer::MakeReplacePrefixItemL() + { + __GSLOGSTRING("[CGSCallPluginContainer]--> MakeReplacePrefixItemL"); + HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 ); + TPtr ptrBuffer ( dynamicText->Des() ); + + const TInt changeMode = iModel->PrefixChangeModeL(); + ptrBuffer = ( *iChangeModeItems )[ changeMode ]; + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSReplacePrefixItemId, ptrBuffer ); + CleanupStack::PopAndDestroy( dynamicText ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSReplacePrefixItemId, + CGSListBoxItemTextArray::EVisible ); + + __GSLOGSTRING("[CGSCallPluginContainer] <--MakeReplacePrefixItemL"); + } + +// --------------------------------------------------------------------------- +// Creates Show Call Duration list box item. +// +// --------------------------------------------------------------------------- +// +void CGSCallPluginContainer::MakeCallDurationItemL() + { + __GSLOGSTRING("[CGSCallPluginContainer]--> MakeCallDurationItemL"); + HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 ); + TPtr ptrBuffer ( dynamicText->Des() ); + + const TInt duration = iModel->CallDurationL(); + ptrBuffer = ( *iCallDurationItems )[ duration ]; + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSShowCallDurationItemId, ptrBuffer ); + CleanupStack::PopAndDestroy( dynamicText ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSShowCallDurationItemId, + CGSListBoxItemTextArray::EVisible ); + + __GSLOGSTRING("[CGSCallPluginContainer] <--MakeCallDurationItemL"); + } + +// --------------------------------------------------------------------------- +// Creates Long Press Call Key list box items. +// +// --------------------------------------------------------------------------- +// +void CGSCallPluginContainer::MakeLongPressCallKeyItemL() + { + __GSLOGSTRING("[CGSCallPluginContainer]--> MakeLongPressCallKeyItemL"); + HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 ); + TPtr ptrBuffer ( dynamicText->Des() ); + + TInt statusLongPressCallKey = iModel->LongPressCallKeyL(); + // Here we again decrement by 1 so that values resemble appropriate title + // EGSLongPressCallKeyVoiceCall ------> InActive in GS + // EGSLongPressCallKeyVideoCall ------> Video Call in GS + // Refer to GSCallPlugin.hrh file for more info for the description + iModel->MapLongPressKeyCallKeyValue( statusLongPressCallKey ); + ptrBuffer = ( *iLongPressCallKeyItems )[ statusLongPressCallKey ]; + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSLongPressCallKeyItemId, ptrBuffer ); + CleanupStack::PopAndDestroy( dynamicText ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSLongPressCallKeyItemId, + CGSListBoxItemTextArray::EVisible ); + + __GSLOGSTRING("[CGSCallPluginContainer] <--MakeLongPressCallKeyItemL"); + } + + +// ---------------------------------------------------------------------------- +// CGSCallPluginContainer::MakeOwnImageVtCallItemL +// +// Own image mute status on video call +// ---------------------------------------------------------------------------- +// +void CGSCallPluginContainer::MakeOwnImageVtCallItemL() + { + __GSLOGSTRING("[CGSCallPluginContainer]--> MakeOwnImageVtCallItemL"); + HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 ); + TPtr ptrBuffer ( dynamicText->Des() ); + + TInt statusOwnImageVtCallKey = iModel->OwnImageVtCallStatusL(); + ptrBuffer = ( *iOwnImageVtCallItems )[ statusOwnImageVtCallKey ]; + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSOwnImageVtCallItemId, ptrBuffer ); + CleanupStack::PopAndDestroy( dynamicText ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSOwnImageVtCallItemId, + CGSListBoxItemTextArray::EVisible ); + + __GSLOGSTRING("[CGSCallPluginContainer] <--MakeOwnImageVtCallItemL"); + } + + +// --------------------------------------------------------------------------- +// Sets observer for MSK label updations. +// --------------------------------------------------------------------------- +// +void CGSCallPluginContainer::SetMiddleSoftkeyObserver( + MGsFWMSKObserver* aObserver ) + { + if ( !iMSKObserver && aObserver ) + { + iMSKObserver = aObserver; + } + } + +// --------------------------------------------------------------------------- +// CGSCallPluginContainer::OfferKeyEventL +// Called when a key is pressed. +// --------------------------------------------------------------------------- +TKeyResponse CGSCallPluginContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + switch ( aKeyEvent.iCode ) + { + case EKeyUpArrow: + case EKeyDownArrow: + { + TKeyResponse listboxResp = + iListBox->OfferKeyEventL( aKeyEvent, aType ); + if ( iMSKObserver ) + { + iMSKObserver->CheckMiddleSoftkeyLabelL(); + } + return listboxResp; + } + case EKeyLeftArrow: + case EKeyRightArrow: + // Listbox takes all events even if it doesn't use them + return EKeyWasNotConsumed; + default: + break; + } + + return iListBox->OfferKeyEventL( aKeyEvent, aType ); + } + +// --------------------------------------------------------------------------- +// +// CGSCallPluginContainer::MakeSlideSettingsItem +// Create a slide settings item ( "Opening slide to answer call" or "Closing slide to end call" ) +// +// --------------------------------------------------------------------------- +void CGSCallPluginContainer::MakeSlideSettingsItem( TInt aItemId ) + { + __GSLOGSTRING("[CGSCallPluginContainer]--> CGSCallPluginContainer::MakeSlideSettingsItem"); + + HBufC* settingValue = NULL; + TInt value(0); + + switch ( aItemId ) + { + case EGSOpeningSlideAnswerCallItemId: + iModel->GetCallSettingValue( EGSOpeningSlideAnswerCall,value ); + if ( EGSOpeningSlideAnswerCallOn == value ) + { + settingValue = StringLoader::LoadLC + ( R_CP_SETTING_OPENING_SLIDE_ANSWER ); + } + else + { + settingValue = StringLoader::LoadLC + ( R_CP_SETTING_OPENING_SLIDE_NOT_ANSWER ); + } + break; + case EGSClosingSlideEndCallItemId: + iModel->GetCallSettingValue( EGSClosingSlideEndCall,value ); + if ( EGSClosingSlideEndCallOn == value ) + { + settingValue = StringLoader::LoadLC + ( R_CP_SETTING_CLOSING_SLIDE_END ); + } + else + { + settingValue = StringLoader::LoadLC + ( R_CP_SETTING_CLOSING_SLIDE_NOT_END ); + } + break; + default: + Panic( KGSNameOfClass, EInvalidIndex ); + } + + iListboxItemArray->SetDynamicTextL( aItemId,settingValue->Des() ); + + CleanupStack::PopAndDestroy( settingValue ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL + ( aItemId,CGSListBoxItemTextArray::EVisible ); + + __GSLOGSTRING("[CGSCallPluginContainer] <--CGSCallPluginContainer::MakeSlideSettingsItem"); + } +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* ECOM proxy table for this plugin +* +*/ + + +// System includes +#include +#include + +// User includes +#include "GSCallPlugin.h" + +// Constants +const TImplementationProxy KGSCallPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x102824A2, CGSCallPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// +// Gate/factory function +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSCallPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSCallPluginImplementationTable; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginModel.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,758 @@ +/* +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Model/Engine for Call Settings Plugin +* +*/ + + +// INCLUDE FILES +#include "GSCallPluginModel.h" +#include "GsLogger.h" //for logging traces +#include "SettingsPrivateCRKeys.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include //PubSub +#include +#include + +#if defined(__VOIP) && defined(RD_VOIP_REL_2_2) +#include +#endif // __VOIP && RD_VOIP_REL_2_2 +//CONSTANTS +// default value for autolock period +// default value for Sat operations + +_LIT( KGSNameOfClass, "CGSCallPluginModel" ); + +// Max int size + +//for switching values in SwitchValue() +const TInt KGSSettingOff = 0; +const TInt KGSSettingOn = 1; +const TInt KGSIndexOff = 1; +const TInt KGSIndexOn = 0; + +// ================= MEMBER FUNCTIONS ======================= + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::NewL +// +// Symbian OS two-phased constructor +// ---------------------------------------------------------------------------- +// +CGSCallPluginModel* CGSCallPluginModel::NewL() + { + CGSCallPluginModel* self = new( ELeave ) CGSCallPluginModel; + CleanupStack::PushL( self ); + self->ConstructL(); + + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::CGSCallPluginModel +// +// C++ default constructor can NOT contain any code, that +// might leave. +// ---------------------------------------------------------------------------- +// +CGSCallPluginModel::CGSCallPluginModel() + { + } + + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::ConstructL +// +// EPOC default constructor can leave. +// ---------------------------------------------------------------------------- +// +void CGSCallPluginModel::ConstructL() + { + FeatureManager::InitializeLibL(); + + InitializeCentralRepositoryL(); + + iBackgroundApi = CGSBackgroundImage::NewL(); + + SetCSPActiveL( ETrue ); + + User::LeaveIfError( iGSVariationRepository->Get( + KSettingsVariationFlags, iLocalVariationValues ) ); +#if defined(__VOIP) && defined(RD_VOIP_REL_2_2) + iSpSettings = CSPSettings::NewL(); +#endif // __VOIP && RD_VOIP_REL_2_2 + } + + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::~CGSCallPluginModel +// +// Destructor +// ---------------------------------------------------------------------------- +// +CGSCallPluginModel::~CGSCallPluginModel() + { + FeatureManager::UnInitializeLib(); + UninitializeCentralRepository(); + + if ( GetCSPStatus() ) + { + TRAP_IGNORE( SetCSPActiveL( EFalse ) ); + } + + if ( iBackgroundApi ) + { + delete iBackgroundApi; + } + +#if defined(__VOIP) && defined(RD_VOIP_REL_2_2) + delete iSpSettings; +#endif // __VOIP && RD_VOIP_REL_2_2 + } + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::InitializeCentralRepositoryL +// +// Creating and setting keys for the Central Repository +// ---------------------------------------------------------------------------- +// +void CGSCallPluginModel::InitializeCentralRepositoryL() + { + iTelephonyRepository = CRepository::NewL( KCRUidTelephonySettings ); + iCommonTelephonyRepository = + CRepository::NewL( KCRUidCommonTelephonySettings ); + iGSVariationRepository = CRepository::NewL( KCRUidSettingsVariation ); + iRichCallRepository = CRepository::NewL( KCRUidRichCallSettings ); + iLogsRepository = CRepository::NewL( KCRUidLogs ); + } + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::UninitializeCentralRepositoryL +// +// Removes Central Repository objects +// ---------------------------------------------------------------------------- +// +void CGSCallPluginModel::UninitializeCentralRepository() + { + if ( iTelephonyRepository ) + { + delete iTelephonyRepository; + iTelephonyRepository = NULL; + } + if ( iCommonTelephonyRepository ) + { + delete iCommonTelephonyRepository; + iCommonTelephonyRepository = NULL; + } + if ( iGSVariationRepository ) + { + delete iGSVariationRepository; + iGSVariationRepository = NULL; + } + if ( iRichCallRepository ) + { + delete iRichCallRepository; + iRichCallRepository = NULL; + } + if ( iLogsRepository ) + { + delete iLogsRepository; + iLogsRepository = NULL; + } + } + + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::GetCallSettingValue +// Gets one of the call related values (anykey answer, automatic redial, +// summary after call or one key dialing) from Central Repository (Working OK) +// ---------------------------------------------------------------------------- +// +TInt CGSCallPluginModel::GetCallSettingValue( const TCallSettId aCallId, + TInt& aId ) + { + TInt ret = KErrNone; + if ( aCallId == EGSSummaryAfterCall ) + { + ret = + iCommonTelephonyRepository->Get( KSettingsSummaryAfterCall, aId ); + } + else + { + switch ( aCallId ) + { + case EGSOpeningSlideAnswerCall: + ret = iTelephonyRepository-> + Get( KSettingsOpeningSlideAnswer, aId ); + break; + case EGSClosingSlideEndCall: + ret = iTelephonyRepository-> + Get( KSettingsClosingSlideEnd, aId ); + break; + case EGSSoftRejectDefault: + ret = iTelephonyRepository-> + Get( KSettingsSoftRejectDefaultInUse, aId ); + break; + default: + break; + }; + } + return ret; + } + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::SetCallSettingValue +// Sets one of the call related values (anykey answer, automatic redial, +// summary after call or one key dialing) from Central Repository (working OK) +// ---------------------------------------------------------------------------- +// +TInt CGSCallPluginModel::SetCallSettingValue( const TCallSettId aCallId, + TInt aId ) + { + TInt ret = KErrNone; + if ( aCallId == EGSSummaryAfterCall ) + { + ret = + iCommonTelephonyRepository->Set( KSettingsSummaryAfterCall, aId ); + } + else + { + switch ( aCallId ) + { + case EGSOpeningSlideAnswerCall: + ret = iTelephonyRepository-> + Set( KSettingsOpeningSlideAnswer, aId ); + break; + case EGSClosingSlideEndCall: + ret = iTelephonyRepository-> + Set( KSettingsClosingSlideEnd, aId ); + break; + case EGSSoftRejectDefault: + ret = iTelephonyRepository-> + Set( KSettingsSoftRejectDefaultInUse, aId ); + break; + default: + break; + }; + } + + return ret; + } + + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::GetCSPStatus +// +// Get Customer Service Profile status +// ---------------------------------------------------------------------------- +// +TBool CGSCallPluginModel::GetCSPStatus() + { + if ( iCSP ) + { + return ETrue; + } + else + { + return EFalse; + } + } + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::SetCSPActiveL +// +// Set Customer Service Profile active +// ---------------------------------------------------------------------------- +// +void CGSCallPluginModel::SetCSPActiveL( TBool aValue ) + { + if ( aValue ) + { + iCSP = CPsetCustomerServiceProfile::NewL(); + User::LeaveIfError( iCSP->OpenCSProfileL() ); + } + else + { + delete iCSP; + iCSP = NULL; + } + } + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::IsSettingSupported +// +// Check if a given setting is supported +// ---------------------------------------------------------------------------- +// +TBool CGSCallPluginModel::IsSettingSupported( TInt aSettingNumber ) + { + __ASSERT_ALWAYS( iCSP != NULL, User::Panic( KGSNameOfClass, + EGSCallPluinModelPanicNullPtr ) ); + TBool settingSupported = EFalse; + TInt retVal = KErrNone; + + switch ( aSettingNumber ) + { + case EGSCSPCallWaiting: + retVal = iCSP->IsCWSupported( settingSupported ); + break; + case EGSCSPAlternateLine: + retVal = iCSP->IsALSSupported( settingSupported ); + break; + default: + break; + } + if ( retVal != KErrNone ) + { + //if a CSP error occurs, by default service is available + settingSupported = ETrue; + } + + return settingSupported; + } + + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::GetSoftRejectText +// Gets soft reject text from shared data. +// ---------------------------------------------------------------------------- +// +TBool CGSCallPluginModel::GetSoftRejectText( TDes& aText ) + { + TInt ret = iTelephonyRepository->Get( KSettingsSoftRejectText, aText ); + return ret; + } + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::SetSoftRejectText +// Sets user defined text to shared data for soft reject. +// ---------------------------------------------------------------------------- +// +TBool CGSCallPluginModel::SetSoftRejectText( TDes& aText ) + { + TInt ret = iTelephonyRepository->Set( KSettingsSoftRejectText, aText ); + return ret; + } + + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::VTStillImageL +// +// VT Still Image mode. +// ---------------------------------------------------------------------------- +// +TInt CGSCallPluginModel::VTStillImageL() + { + TInt StImg = KGSSettingOff; + + User::LeaveIfError( iTelephonyRepository->Get( KSettingsVTStillImage, + StImg ) ); + return StImg; + } + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::SetVTStillImageL +// +// Sets VT Still Image mode to Shared Data +// ---------------------------------------------------------------------------- +// +void CGSCallPluginModel::SetVTStillImageL( const TInt aValue ) + { + User::LeaveIfError( iTelephonyRepository->Set( KSettingsVTStillImage, + aValue ) ); + } + + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::PrefixChangeModeL +// +// Get the Japanese prefix change mode value from shared data. +// ---------------------------------------------------------------------------- +// +TInt CGSCallPluginModel::PrefixChangeModeL() + { + TInt mode = KGSSettingOff; + User::LeaveIfError( iTelephonyRepository-> + Get( KSettingsDialPrefixChangeMode, mode ) ); + SwitchValue( mode ); + return mode; + } + + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::SetPrefixChangeModeL +// +// Set the Japanese prefix change mode value to shared data. CenRep OK +// ---------------------------------------------------------------------------- +// +void CGSCallPluginModel::SetPrefixChangeModeL( TInt aMode ) + { + SwitchValue( aMode ); + User::LeaveIfError( iTelephonyRepository-> + Set( KSettingsDialPrefixChangeMode, aMode ) ); + } + + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::PrefixChangeDataL +// +// Reads prefix change text from shared data and returns it +// ---------------------------------------------------------------------------- +// +void CGSCallPluginModel::PrefixChangeDataL( TDes& aText ) + { + User::LeaveIfError( iTelephonyRepository-> + Get( KSettingsDialPrefixText, aText ) ); + } + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::SetPrefixChangeDataL +// +// Writes prefix change text to shared data +// ---------------------------------------------------------------------------- +// +void CGSCallPluginModel::SetPrefixChangeDataL( const TDesC& aText ) + { + User::LeaveIfError( iTelephonyRepository-> + Set( KSettingsDialPrefixText, aText ) ); + } + + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::SwitchValue +// +// Switching value from 1 to 0 and back +// ---------------------------------------------------------------------------- +// +void CGSCallPluginModel::SwitchValue( TInt& aValue ) + { + switch( aValue ) + { + case KGSSettingOff: //0 + aValue = KGSIndexOff; //1 + break; + case KGSSettingOn: //1 + aValue = KGSIndexOn; //0 + break; + default: + aValue = KErrNotFound; + }; + } + + +// --------------------------------------------------------- +// CGSCallPluginModel::RestrictedSendCallerIdSupportedL +// +// Check if Restricted Send Caller ID is supported. +// --------------------------------------------------------- +// +TBool CGSCallPluginModel::RestrictedSendCallerIdSupportedL() + { + TBool supported = EFalse; + + if ( iLocalVariationValues & EGSConfigRestrictedSendCallerId ) + { + supported = ETrue; + } + + return supported; + + } + +// --------------------------------------------------------- +// CGSCallPluginModel::SecureSendCallerIdSupportedL +// +// Check if Secure Send Caller ID is supported. +// --------------------------------------------------------- +// +TBool CGSCallPluginModel::SecureSendCallerIdSupportedL() + { + TBool supported = EFalse; + + if ( iLocalVariationValues & EGSConfigSecureSendCallerId ) + { + supported = ETrue; + } + + return supported; + + } + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::GetVoIPCallSettingValue +// Gets one of the VoIP call related values (send my Int. call id, +// Internet call waiting, preferred call type, do not disturb or +// Internet call barring) from Central Repository +// ---------------------------------------------------------------------------- +// +TInt CGSCallPluginModel::GetVoIPCallSettingValue( + const TGSVoIPSetting aVoipSettingId, TInt& aVoipId ) + { + TInt ret( KErrNone ); + + switch ( aVoipSettingId ) + { + case EGSVoIPSendIntCallId: + ret = iRichCallRepository->Get( KRCSEClir, aVoipId ); + break; + case EGSVoIPCW: + ret = iRichCallRepository->Get( KRCSPSCallWaiting, aVoipId ); + break; + case EGSVoIPPreType: + ret = iRichCallRepository->Get( KRCSEPreferredTelephony, aVoipId ); + break; + case EGSVoIPDnd: + ret = iRichCallRepository->Get( KRCSEDoNotDisturb, aVoipId ); + break; + case EGSVoIPBarring: + ret = iRichCallRepository->Get( KRCSEAnonymousCallBlockRule, aVoipId ); + break; + default: + break; + } + + return ret; + } + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::SetVoIPCallSettingValue +// Sets one of the VoIP call related values (send my Int. call id, +// Internet call waiting, preferred call type, do not disturb or +// Internet call barring) from Central Repository +// ---------------------------------------------------------------------------- +// +TInt CGSCallPluginModel::SetVoIPCallSettingValue( + const TGSVoIPSetting aVoipSettingId, TInt aVoipId ) + { + TInt ret( KErrNone ); + + switch( aVoipSettingId ) + { + case EGSVoIPSendIntCallId: + ret = iRichCallRepository->Set( KRCSEClir, aVoipId ); + break; + case EGSVoIPCW: + ret = iRichCallRepository->Set( KRCSPSCallWaiting, aVoipId ); + break; + case EGSVoIPPreType: + ret = iRichCallRepository->Set( KRCSEPreferredTelephony, aVoipId ); + break; + case EGSVoIPDnd: + ret = iRichCallRepository->Set( KRCSEDoNotDisturb, aVoipId ); + break; + case EGSVoIPBarring: + ret = iRichCallRepository->Set( KRCSEAnonymousCallBlockRule, aVoipId ); + break; + default: + break; + } + + return ret; + } + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::GetSCCPStatus +// Gets SCCP status from Central Repository +// ---------------------------------------------------------------------------- +// +TInt CGSCallPluginModel::GetSCCPStatus( TInt& aStatus ) + { + TInt ret( KErrNone ); + ret = iTelephonyRepository->Get( KSCCPinstallUpgrade, aStatus ); + return ret; + } + + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::CallDurationL +// +// Get the Call duration setting value +// ---------------------------------------------------------------------------- +// +TInt CGSCallPluginModel::CallDurationL() + { + TInt value = KGSSettingOff; + User::LeaveIfError( iLogsRepository-> + Get( KLogsShowCallDuration, value ) ); + + SwitchValue ( value ); + + return value; + } + + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::SetCallDurationL +// +// Set the Call duration setting value +// ---------------------------------------------------------------------------- +// +void CGSCallPluginModel::SetCallDurationL( TInt aValue ) + { + SwitchValue ( aValue ); + User::LeaveIfError( iLogsRepository-> + Set( KLogsShowCallDuration, aValue ) ); + } + +// --------------------------------------------------------- +// CGSTelPluginModel::VoIPSupported +// +// Check if VoIP is supported. +// --------------------------------------------------------- +// +TBool CGSCallPluginModel::VoIPSupported() + { + TInt supported( KGSSettingOff ); +#if defined(__VOIP) && defined(RD_VOIP_REL_2_2) + if ( iSpSettings->IsFeatureSupported( ESupportVoIPFeature ) && + iSpSettings->IsFeatureSupported( ESupportVoIPSSFeature ) ) + { + supported = KGSSettingOn; + } +#else // __VOIP && RD_VOIP_REL_2_2 + if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) ) + { + iTelephonyRepository->Get( KDynamicVoIP, supported ); + } +#endif // __VOIP && RD_VOIP_REL_2_2 + return KGSSettingOff != supported; + } + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::LongPressCallKeyL +// +// Get the Long Press Call Key setting value +// 0,1 --> Inactive (Default value is 1 and when RFS Default value is 0) +// 2 --> Video call +// ---------------------------------------------------------------------------- +// +TInt CGSCallPluginModel::LongPressCallKeyL() + { + TInt value = EGSLongPressCallKeyVoiceCall; + #ifdef RD_VT_LONG_SEND_KEY + User::LeaveIfError( iTelephonyRepository-> + Get( KSettingsUiLongCallKeyPress, value ) ); + #endif + return value; + } + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::SetLongPressCallKeyL +// +// Set the Long Press Call Key setting value +// ---------------------------------------------------------------------------- +// +void CGSCallPluginModel::SetLongPressCallKeyL( const TInt aValue ) + { +#ifdef RD_VT_LONG_SEND_KEY + User::LeaveIfError( iTelephonyRepository-> + Set( KSettingsUiLongCallKeyPress, aValue ) ); +#endif + } + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::MapLongPressKeyCallKeyValue +// +// Maps the Long Press Call Key setting value +// NOTE : EGSLongPressCallKeyVoiceCall is the default value normally +// NOTE: When Restore Factory Settings is done, the default value +// is set to EGSLongPressCallKeyInActive +// Three key values are used for a CenRep key though we have two +// two setting items because these values are also been used by +// CallUi and Phone Application. +// ---------------------------------------------------------------------------- +// +void CGSCallPluginModel::MapLongPressKeyCallKeyValue( TInt &aValue ) + { +#ifdef RD_VT_LONG_SEND_KEY + switch ( aValue ) + { + case EGSLongPressCallKeyVoiceCall: + aValue = EGSLongPressCallKeyNotSet; + break; + case EGSLongPressCallKeyVideoCall: + aValue = EGSLongPressCallKeyVoiceCall; + break; + default: + break; + } +#endif + } + + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::OwnImageVtCallStatusL +// +// Get the Own Image sending during vt call setting value +// 0,1 --> Inactive (Default value is 1 and when RFS Default value is 0) +// 2 --> Video call +// ---------------------------------------------------------------------------- +// +TInt CGSCallPluginModel::OwnImageVtCallStatusL() + { + TInt value; + User::LeaveIfError( iTelephonyRepository-> + Get( KSettingsVTVideoSending, value ) ); + return value; + } + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::SetOwnImageVtCallStatusL +// +// Set the Long Press Call Key setting value +// ---------------------------------------------------------------------------- +// +void CGSCallPluginModel::SetOwnImageVtCallStatusL( const TInt aValue ) + { + User::LeaveIfError( iTelephonyRepository-> + Set( KSettingsVTVideoSending, aValue ) ); + } + + +// ---------------------------------------------------------------------------- +// CGSCallPluginModel::SlideSettingsShown +// +// Check if slide settings items should be shown +// ---------------------------------------------------------------------------- +// +TBool CGSCallPluginModel::SlideSettingsShownL() const + { + TInt value( EGSNotShowSlideSettings ); + + User::LeaveIfError( + iTelephonyRepository->Get( KSettingsShowSlideSettings,value ) ); + + if ( EGSShowSlideSettings == value ) + { + return ETrue; + } + else + { + return EFalse; + } + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSConPlugin/GSConPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSConPlugin/GSConPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Project specification file. +* +*/ + +#include // For RESOURCE_FILES_DIR + +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gsconplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10207251 +VENDORID VID_DEFAULT + +SOURCEPATH src +SOURCE GSConPluginImplementationTable.cpp +SOURCE GSConPlugin.cpp + +USERINCLUDE inc +USERINCLUDE data +USERINCLUDE ../Logger +USERINCLUDE ../Data +USERINCLUDE loc + +SYSTEMINCLUDE /epoc32/include/ecom +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH data + +START RESOURCE 10207251.rss +TARGET gsconplugin.rsc +END + +// View resources +START RESOURCE GSConPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // View resources + + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY commonengine.lib// For RConeResourceLoader +LIBRARY gsframework.lib +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY flogger.lib // For GSLogger +LIBRARY gsecomplugin.lib +LIBRARY featmgr.lib // feature manager + +//Documents. Defining these is optional. Used only by IDE's file browser. +SOURCEPATH data +DOCUMENT 10207251.rss +DOCUMENT GSConPluginRsc.rss + +SOURCEPATH inc + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSConPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSConPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSConPlugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSConPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsconplugin.iby ) +../rom/GSConPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsconpluginresources.iby ) +loc/GSConPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsconplugin.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gsconplugin.mif + OPTION HEADERFILE gsconplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_cp_conn +END + + +PRJ_MMPFILES +GSConPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSConPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSConPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSConPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSConPlugin/data/10207251.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSConPlugin/data/10207251.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for GSConPlugin. +* +*/ + +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x10207251; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10207250; + version_no = 1; + display_name = "Connection Settings Plugin"; // Debug name + default_data = "0x1020723B";// Parent UID + #ifdef RD_CONTROL_PANEL + opaque_data = "50";// Order number + #else //RD_CONTROL_PANEL + opaque_data = "2";// Order number + #endif //RD_CONTROL_PANEL + } + }; + } + }; + } + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSConPlugin/data/GSConPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSConPlugin/data/GSConPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for GSConPlugin. +* +*/ + + +// RESOURCE IDENTIFIER +NAME GSCO // 4 letter ID + +// INCLUDES +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// CONSTANTS + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// +// +// Needed or loading the resource fails! +// +//---------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +//---------------------------------------------------- +// +// r_gs_con_view +// Connection settings view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_con_view + { + menubar = r_gs_menubar_open_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN; + } + + +//---------------------------------------------------- +// +// r_gs_con_view_title +// Connection settings view title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_con_view_title + { + #ifdef RD_CONTROL_PANEL + txt = qtn_cp_title_connectivity; + #else //RD_CONTROL_PANEL + txt = qtn_set_title_settings_inet; + #endif //RD_CONTROL_PANEL + } + + +//---------------------------------------------------- +// +// r_gs_con_view_caption +// Connection Plugin caption for plugin +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_con_view_caption + { + #ifdef RD_CONTROL_PANEL + buf = qtn_cp_folder_connectivity; + #else //RD_CONTROL_PANEL + buf = qtn_set_folder_connection; + #endif //RD_CONTROL_PANEL + } + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSConPlugin/inc/GSConPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSConPlugin/inc/GSConPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,138 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for GSConPlugin. +* +*/ + +#ifndef GSCONPLUGIN_H +#define GSCONPLUGIN_H + +// Includes +#include +#include +#include +#include +#include + +// Classes referenced +class CAknViewAppUi; +class RConeResourceLoader; +class CGulIcon; +class CGSTabHelper; + +// Constants +_LIT( KGSConPluginResourceFileName, "z:GSConPluginRsc.rsc" ); +_LIT( KGSConPluginIconDirAndName, "z:GSConPlugin.mbm"); // Use KDC_BITMAP_DIR + +// CLASS DECLARATION + + +/** +* CGSConPlugin. +* +* @since Series60_3.1 +*/ +class CGSConPlugin : public CGSParentPlugin + { + + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return + */ + static CGSConPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSConPlugin(); + + public: // From CAknView + + /** + * See base class. + */ + TUid Id() const; + + /** + * See base class. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + /** + * See base class. + */ + void DoDeactivate(); + + public: // From CGSParentPlugin + + /** + * See base class. + */ + TUid UpperLevelViewUid(); + + /** + * See base class. + */ + TGSListboxTypes ListBoxType(); + + /** + * See base class. + */ + void GetHelpContext( TCoeHelpContext& aContext ); + + public: // From CGSPluginInterface + + /** + * See base class. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * See base class. + */ + TInt PluginProviderCategory() const; + + + protected: // New + + /** + * C++ default constructor. + */ + CGSConPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + private: // Data + + // Resource loader. + RConeResourceLoader iResources; + + // Tab helper. + CGSTabHelper* iTabHelper; + }; + + +#endif // GSCONPLUGIN_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSConPlugin/loc/GSConPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSConPlugin/loc/GSConPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSConPlugin. +* +*/ + + +// LOCALISATION STRINGS + +// **CAPTIONS + +//d:Plugin caption +//d:Long string +//l:title_pane_t2/opt9 +//w: +//r: 3.1 +// +#define qtn_set_title_settings_inet "Connection settings" + +//d:Text of a list item in main view's folder list +//d:Item opens Connection folder +//l:list_single_large_graphic_pane_t1 +//w: +//r: 3.1 +// +#define qtn_set_folder_connection "Connection" + + +// **OPTIONS MENU + +//d:Command in Options list +//d:Opens the highlighted item +//l:list_single_pane_t1_cp2 +//w: +//r: 3.1 +// +#define qtn_set_options_open "Open" + + +//CONTROL PANEL + +//d:Plugin caption +//l: title_pane_t2/opt9 +//w: +//r: 5.0 +// +#define qtn_cp_title_connectivity "Connectivity" + +//d:Text of a list item in main view's folder list +//d:Item opens Connection folder +//l: list_single_large_graphic_pane_t1 +//w: +//r: 5.0 +// +#define qtn_cp_folder_connectivity "Connectivity" + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSConPlugin/src/GSConPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSConPlugin/src/GSConPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,286 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSConPlugin implementation. +* +*/ + + +// Includes +#include "GSConPlugin.h" +#include "GsLogger.h" + +#include // Icons +#include +#include +#include +#include +#include +#include +#include +#include // For TResourceReader +#include +#include +#include +#include +#include + +#ifndef RD_CONTROL_PANEL + #include +#endif //RD_CONTROL_PANEL + +// Constants + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CGSConPlugin::CGSConPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSConPlugin::CGSConPlugin() + : CGSParentPlugin(), iResources( *iCoeEnv ) + { + __GSLOGSTRING( "[CGSConPlugin] CGSConPlugin()" ); + + } + + +// --------------------------------------------------------------------------- +// CGSConPlugin::~CGSConPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSConPlugin::~CGSConPlugin() + { + FeatureManager::UnInitializeLib(); + iResources.Close(); + + #ifndef RD_CONTROL_PANEL + delete iTabHelper; + #endif //RD_CONTROL_PANEL + __GSLOGSTRING( "[CGSConPlugin] ~CGSConPlugin()" ); + } + + +// --------------------------------------------------------------------------- +// CGSConPlugin::ConstructL() +// +// +// --------------------------------------------------------------------------- +// +void CGSConPlugin::ConstructL() + { + __GSLOGSTRING( "[CGSConPlugin] ConstructL()" ); + FeatureManager::InitializeLibL(); + OpenLocalizedResourceFileL( KGSConPluginResourceFileName, iResources ); + BaseConstructL( R_GS_CON_VIEW, R_GS_CON_VIEW_TITLE ); + + #ifndef RD_CONTROL_PANEL + iTabHelper = CGSTabHelper::NewL(); + #endif //RD_CONTROL_PANEL + } + + +// --------------------------------------------------------------------------- +// CGSConPlugin::NewL() +// +// +// --------------------------------------------------------------------------- +// +CGSConPlugin* CGSConPlugin::NewL( TAny* /*aInitParams*/ ) + { + __GSLOGSTRING( "[CGSConPlugin] NewL()" ); + + CGSConPlugin* self = new(ELeave) CGSConPlugin(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSConPlugin::Id() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSConPlugin::Id() const + { + __GSLOGSTRING1( "[CGSConPlugin] Id():0x%X", KGSConPluginUid.iUid ); + return KGSConPluginUid; + } + + +// --------------------------------------------------------------------------- +// CGSConPlugin::DoActivateL() +// +// +// --------------------------------------------------------------------------- +// +void CGSConPlugin::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + CGSParentPlugin::DoActivateL( aPrevViewId, + aCustomMessageId, + aCustomMessage ); + CGSMainView* parent = + static_cast ( AppUi()->View( KGSMainViewUid ) ); + + #ifndef RD_CONTROL_PANEL + // Create tab group for this view (do only if casting parent succeeds): + if( parent ) + { + iTabHelper->CreateTabGroupL( Id(), parent ); + } + #endif //RD_CONTROL_PANEL + + // If AppUid is different or placeholderview is used, this view has been launched from outside GS + if ( iPrevViewId.iAppUid != KUidGS || iPrevViewId.iViewUid == TUid::Uid(0x0DEADBED ) ) + { + CEikButtonGroupContainer* cbaGroup = Cba(); + if(cbaGroup) + { + HBufC* rightSKText = StringLoader::LoadLC (R_GS_CBA_EXIT); + TPtr rskPtr = rightSKText->Des(); + cbaGroup->SetCommandL(2,EAknSoftkeyExit,*rightSKText); + CleanupStack::PopAndDestroy(rightSKText); + } + } + + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoDeactivate() +// +// +// --------------------------------------------------------------------------- +void CGSConPlugin::DoDeactivate() + { + CGSParentPlugin::DoDeactivate(); + + #ifndef RD_CONTROL_PANEL + iTabHelper->RemoveTabGroup(); + #endif //RD_CONTROL_PANEL + } + + +// ========================= From CGSParentPlugin ===================== + + +// --------------------------------------------------------------------------- +// CGSConPlugin::UpperLevelViewUid() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSConPlugin::UpperLevelViewUid() + { + return KGSMainViewUid; + } + + +// ========================= From CGSPluginInterface ================== + + +// --------------------------------------------------------------------------- +// CGSConPlugin::GetCaptionL() +// +// +// --------------------------------------------------------------------------- +// +void CGSConPlugin::GetCaptionL( TDes& aCaption ) const + { + // The resource file is already opened. + HBufC* result = StringLoader::LoadL( R_GS_CON_VIEW_CAPTION ); + aCaption.Copy( *result ); + delete result; + } + + +// --------------------------------------------------------------------------- +// CGSConPlugin::PluginProviderCategory() +// +// +// --------------------------------------------------------------------------- +// +TInt CGSConPlugin::PluginProviderCategory() const + { + return KGSPluginProviderInternal; + } + + +// ----------------------------------------------------------------------------- +// CGSConPlugin::GetHelpContext() +// +// +// ----------------------------------------------------------------------------- +// +void CGSConPlugin::GetHelpContext( TCoeHelpContext& aContext ) + { + aContext.iMajor = KUidGS; + aContext.iContext = KCP_HLP_CONNECTIVITY; + } + + +// --------------------------------------------------------------------------- +// CGSConPlugin::CreateIconL +// +// +// --------------------------------------------------------------------------- +// +CGulIcon* CGSConPlugin::CreateIconL( const TUid aIconType ) + { + //EMbm + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSConPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropCpConn, + fp->FullName(), + EMbmGsconpluginQgn_prop_cp_conn, + EMbmGsconpluginQgn_prop_cp_conn_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + CleanupStack::PopAndDestroy( fp ); + + return icon; + } + +// --------------------------------------------------------------------------- +// CGSConPlugin::ListBoxType() +// +// --------------------------------------------------------------------------- +// +TGSListboxTypes CGSConPlugin::ListBoxType() + { + return EGSListBoxTypeDoubleLarge; + } + + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSConPlugin/src/GSConPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSConPlugin/src/GSConPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for this plugin +* +*/ + + +// System includes +#include +#include + +// User includes +#include "GSConPlugin.h" + +// Constants +const TImplementationProxy KGSConPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x10207250, CGSConPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSConPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSConPluginImplementationTable; + } + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDataCallPlugin/Data/10207437.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDataCallPlugin/Data/10207437.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for Data Call Settings plugin. +* +*/ + +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x10207437; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10207436; + version_no = 1; + display_name = "Data Call Settings Plugin"; + #ifdef RD_CONTROL_PANEL + default_data = "0x10283341"; + opaque_data = "20";//Order number + #else //RD_CONTROL_PANEL + default_data = "0x10207250"; + opaque_data = "110";//Order number + #endif //RD_CONTROL_PANEL + } + }; + } + }; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDataCallPlugin/Data/GsDataCallPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDataCallPlugin/Data/GsDataCallPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,239 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for GsDataCallPlugin +* +*/ + + + +// RESOURCE IDENTIFIER +NAME DCAL // 4 letter ID + +// INCLUDES +#include "GsDataCallPlugin.hrh" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// CONSTANTS + +// RESOURCE DEFINITIONS + +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +RESOURCE TBUF + { + buf="DCAL"; + } + +//---------------------------------------------------- +// +// EIK_APP_INFO +// It contains application information. +// +//---------------------------------------------------- +// +RESOURCE EIK_APP_INFO + { + } + + +//---------------------------------------------------- +// r_gs_datacall_view_caption +// +// Data call view caption for plugin +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_datacall_view_caption + { + buf = qtn_set_folder_conn_data_call; + } + + +// ** DATA CALL (CONNECTION) VIEW + +//---------------------------------------------------- +// +// r_gs_csd_view_title +// Data call view's title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_csd_view_title + { + txt = qtn_set_title_settings_csd; + } + +//---------------------------------------------------- +// +// r_gs_dcall_view +// Data call view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_dcall_view + { + menubar = r_gs_menubar_change_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE; + } + + +//---------------------------------------------------- +// +// r_dcall_lbx +// Data call view's listbox. +// +//---------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_dcall_lbx + { + items = + { + GS_FEATURE + { + txt = " \t"qtn_set_autodiscon"\t\t"; + item = KGSSettIdAutodiscon; + } + }; + } + + + +// AUTODISCONNECT TIME + +//---------------------------------------------------- +// +// r_autodiscon_time_setting_page +// Autodisconnect setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_autodiscon_time_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_set_autodiscon; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +//---------------------------------------------------- +// +// r_autodiscon_time_setting_page_lbx +// Autodisconnect setting page's listbox. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_autodiscon_time_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_set_autodiscon_defined; + }, + LBUF + { + txt = qtn_set_autodiscon_no; + } + }; + } + +//---------------------------------------------------- +// +// r_autodiscon_time_value_no +// Text resource for autodisconnect setting. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_autodiscon_value_no + { + buf = qtn_set_autodiscon_no; + } + +//---------------------------------------------------- +// +// r_autodiscon_time_value_1min +// Text resource for autodisconnect setting. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_autodiscon_value_1min + { + buf = qtn_set_autodiscon_one_min; + } + +//---------------------------------------------------- +// +// r_autodiscon_time_value_min +// Text resource for autodisconnect setting. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_autodiscon_value_min + { + buf = qtn_set_autodiscon_min; + } + +//---------------------------------------------------- +// +// r_autodiscon_time_number_query +// Autodisconnect time query. +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_autodiscon_time_number_query + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_DATA_QUERY + { + layout = ENumberLayout; + label = qtn_set_autodiscon_define_time; + control = AVKON_INTEGER_EDWIN + { + min = 0; + max = 99; + maxlength = 2; + }; + }; + } + }; + } + + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDataCallPlugin/GSDataCallPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDataCallPlugin/GSDataCallPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification file. +* +*/ + + +#include // For RESOURCE_FILES_DIR + +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gsdatacallplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10207437 +VENDORID VID_DEFAULT + + +SOURCEPATH Src +SOURCE GSDataCallPluginImplementationTable.cpp +SOURCE GSDataCallPluginContainer.cpp +SOURCE GSDataCallPlugin.cpp +SOURCE GSDataCallPluginModel.cpp + + +//User include paths +USERINCLUDE Inc +USERINCLUDE Data // For *.rh +USERINCLUDE loc +USERINCLUDE ../Data // For CommonResources.rss + +//System include paths +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/cshelp +// Default system include paths for middleware layer modules. +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH Data + +START RESOURCE 10207437.rss +TARGET gsdatacallplugin.rsc +END + +START RESOURCE GsDataCallPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY egul.lib +LIBRARY eikdlg.lib // eikon dialogs +LIBRARY commdb.lib + +LIBRARY commonengine.lib // For RConeResourceLoader +LIBRARY featmgr.lib // Feature manager +LIBRARY aknskinsrv.lib // for enhanced skinning +LIBRARY aknskins.lib // for enhanced skinning +LIBRARY hlplch.lib // for "Help" options menu +LIBRARY gsframework.lib // For base classes +LIBRARY gslistbox.lib // For CGSListBoxItemTextArray +LIBRARY flogger.lib // For GSLogger +LIBRARY gsecomplugin.lib + +// End of File \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,183 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View for Data call settings. +* +*/ + + +#ifndef GSDATACALLPLUGIN_H +#define GSDATACALLPLUGIN_H + +// INCLUDES +#include +#include +#include +#include + + +//CONSTANTS +const TUid KGSDataCallPluginUid = { 0x10207436 }; +_LIT( KGSDataCallPluginIconDirAndName, "z:GSDataCallPlugin.mbm"); // Use KDC_BITMAP_DIR + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CAknViewAppUi; +class CGSDataCallPluginContainer; +class CGSDataCallPluginModel; + +// CLASS DEFINITION +/** +* CGSDataCallPlugin view class for data call settings +* @since Series 60_3.1 +* +*/ +class CGSDataCallPlugin : public CGSBaseView, + public MAknSettingPageObserver + { + public: + enum TGSSettingIds + { + KGSAutodisconSettingId + }; + + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return GS connection view. + */ + static CGSDataCallPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor + */ + ~CGSDataCallPlugin(); + + public: // From CGSPluginInterface + + /** + * @see CGSPluginInterface header file. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * @see CGSPluginInterface header file. + */ + TInt PluginProviderCategory() const; + + /** + * @see CGSPluginInterface header file. + */ + TBool Visible() const; + + public: // from MAknSettingPageObserver + + /** + * Handle setting page events + */ + virtual void HandleSettingPageEventL( CAknSettingPage* aSettingPage, + TAknSettingPageEvent aEventType ); + + public: // from base classes + + /** + * Returns view id. + * @return TUid + */ + TUid Id() const; + + /** + * Handles commands. + * @param aCommand Command to be handled. + * + */ + void HandleCommandL( TInt aCommand ); + + public: // new + + /** + * Updates listbox's item's value. + * @param aItemId An item which is updated. + * + */ + void UpdateListBoxL( TInt aItemId ); + + /** + * Get CGSDataCallPlugin's ccontainer. + */ + CGSDataCallPluginContainer* Container(); + + protected: // From CAknView + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + void DoDeactivate(); + + protected: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + protected: + + /** + * C++ default constructor. + */ + CGSDataCallPlugin(); + + /** + * Symbian OS default constructor. + * + */ + void ConstructL(); + + void HandleClientRectChange(); + + private: // from CGSBaseView + + void NewContainerL(); + void HandleListBoxSelectionL(); + + private: // new methods + + /** + * Display dialup auto disconnect setting page. + */ + void ShowDialupAutodisconSettingPageL(); + + /** + * Display auto disconnect time query dialog. + */ + void ShowAutodisconTimeQueryL(); + + private: + // plugin model + CGSDataCallPluginModel *iModel; + // resource loader + RConeResourceLoader iResourceLoader; + + }; + +#endif //GSDATACALLPLUGIN_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPluginContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPluginContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2002, 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for Data call settings view. +* +*/ + + +#ifndef GSDATACALLPLUGINCONTAINER_H +#define GSDATACALLPLUGINCONTAINER_H + +// INCLUDES +#include +#include + +#include "gssettingid.h" + +// FORWARD DECLARATION +class CGSListBoxItemTextArray; + +// CLASS DECLARATION + +/** +* CGSDataCallPluginContainer container class +* @since Series 60_3.1 +* +*/ +class CGSDataCallPluginContainer : public CGSBaseContainer + { + public: // Constructors and destructor + + /** + * Symbian OS constructor. + * @param aRect Listbox's rect. + * + */ + void ConstructL( const TRect& aRect ); + + /** + * Destructor. + */ + ~CGSDataCallPluginContainer(); + + public: //new + + /** + * Updates listbox's item's value. + * @param aFeatureId An item which is updated. + * + */ + void UpdateListBoxL( TInt aFeatureId ); + + /** + * Retrieves the currently selected listbox feature id + * @return feature id. + */ + TInt CurrentFeatureId() const; + + protected: // from CGSBaseContainer + void ConstructListBoxL( TInt aResLbxId ); + + private: // new + void CreateListBoxItemsL(); + void MakeAutodisconItemL(); + + private: + /** + * Required for help. + * + */ + void GetHelpContext( TCoeHelpContext& aContext ) const; + + private: // data + //Auto disconnect list item + CDesCArrayFlat* iAutodisconValue; + //Listbox item array model + CGSListBoxItemTextArray* iListboxItemArray; + + }; + +#endif //GSDATACALLPLUGINCONTAINER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPluginModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPluginModel.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Data Call Settings model. +* +*/ + + +#ifndef GSDATACALLPLUGINMODEL_H +#define GSDATACALLPLUGINMODEL_H + +// INCLUDES +#include +#include + +// CONSTANTS +// autodisconnect time unlimited +const TUint KGSTimeUnlimited = KMaxTUint; +// autodisconnect time 0 minutes +const TInt KGSZeroMinutes = 0; +// autodisconnect time 1 minute +const TInt KGSOneMinute = 1; + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CCommsDatabase; +class CCommsDbTableView; + +// CLASS DEFINITION +/** +* CGSDataCallPluginModel is the model class of GS display plugin. +* It provides functions to get and set setting values. +* @lib GSDisplayPlugin.lib +* @since Series 60_3.1 + +*/ +class CGSDataCallPluginModel : public CBase + { + public: // Constructor and destructor + /** + * Two-phased constructor + */ + static CGSDataCallPluginModel* NewL(); + + /** + * Destructor + */ + ~CGSDataCallPluginModel(); + + public: // new ones + + /** + * Returns the period after the data call is disconnected + * if it has been unused. + * @return Minutes between 0 and 99. + */ + TInt AutodisconnectTimeL(); + + /** + * Sets the period after the data call is disconnected + * if it has been unused. + * @param aTime Autodisconnect time (minutes). + * @return ETrue: no errors + * EFalse: an error has occurred + */ + TBool SetAutodisconnectTimeL( const TInt aTime ); + + private: // Private constructors + /** + * Default C++ contructor + */ + CGSDataCallPluginModel(); + + /** + * Symbian OS default constructor + * @return void + */ + void ConstructL(); + + private: + //handle to CommsDB + CCommsDatabase* iCommDb; + + }; + +#endif //GSDATACALLPLUGINMODEL_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDataCallPlugin/Inc/GsDataCallPlugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDataCallPlugin/Inc/GsDataCallPlugin.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains common definitions for menu id:s +* +*/ + + +#ifndef GSDATACALLPLUGIN_HRH +#define GSDATACALLPLUGIN_HRH + +// commands +enum TGSDataCallMenuCommands + { + EAppCmdChange = 1 + }; + + +enum TSettingId + { + KGSSettIdAutodiscon + }; + +#endif // GSDATACALLPLUGIN_HRH + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,483 @@ +/* +* Copyright (c) 2002, 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View for Data call sub-folder +* +*/ + + +// INCLUDE FILES +#include "GSDataCallPlugin.h" +#include "GSDataCallPluginModel.h" +#include "GSDataCallPluginContainer.h" +#include "GsDataCallPlugin.hrh" +#include // Icons +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // For HlpLauncher + +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS +const TInt KGSAutodTimeIndex = 0; + +_LIT( KGSDataCallPluginResourceFileName, "z:GSDataCallPluginRsc.rsc" ); + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS ============================== + +// ========================= MEMBER FUNCTIONS ================================ + +// ---------------------------------------------------------------------------- +// CGSDataCallPlugin::CGSDataCallPlugin() +// +// Constructor +// ---------------------------------------------------------------------------- +// +CGSDataCallPlugin::CGSDataCallPlugin() + : iResourceLoader( *iCoeEnv ) + { + } + + +// --------------------------------------------------------------------------- +// CGSDataCallPlugin::NewL() +// +// Symbian OS default constructor +// --------------------------------------------------------------------------- +CGSDataCallPlugin* CGSDataCallPlugin::NewL( TAny* /*aInitParams*/ ) + { + CGSDataCallPlugin* self = new( ELeave ) CGSDataCallPlugin (); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + + +// --------------------------------------------------------------------------- +// CGSDataCallPlugin::ConstructL() +// +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +void CGSDataCallPlugin::ConstructL() + { + FeatureManager::InitializeLibL(); + // Find the resource file + TParse parse; + parse.Set( KGSDataCallPluginResourceFileName, + &KDC_RESOURCE_FILES_DIR, NULL ); + TFileName fileName( parse.FullName() ); + + // Get language of resource file + BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName ); + + // Open resource file + iResourceLoader.OpenL( fileName ); + + iModel = CGSDataCallPluginModel::NewL(); + + BaseConstructL( R_GS_DCALL_VIEW ); + } + + +// ---------------------------------------------------------------------------- +// CGSDataCallPlugin::~CGSDataCallPlugin +// +// Destructor +// ---------------------------------------------------------------------------- +CGSDataCallPlugin::~CGSDataCallPlugin() + { + FeatureManager::UnInitializeLib(); + iResourceLoader.Close(); + if ( iModel ) + { + delete iModel; + } + } + + +// --------------------------------------------------------------------------- +// TUid CGSDataCallPlugin::Id() +// +// Returns view's ID. +// --------------------------------------------------------------------------- +TUid CGSDataCallPlugin::Id() const + { + return KGSDataCallPluginUid; + } + + +// ========================= From CGSPluginInterface ================== + +// ---------------------------------------------------------------------------- +// CGSDataCallPlugin::GetCaption +// +// Return application/view caption. +// ---------------------------------------------------------------------------- +// +void CGSDataCallPlugin::GetCaptionL( TDes& aCaption ) const + { + // the resource file is already opened. + HBufC* result = StringLoader::LoadL( R_GS_DATACALL_VIEW_CAPTION ); + + aCaption.Copy( *result ); + delete result; + } + + +// ---------------------------------------------------------------------------- +// CGSDataCallPlugin::PluginProviderCategory +// +// A means to identify the location of this plug-in in the framework. +// ---------------------------------------------------------------------------- +// +TInt CGSDataCallPlugin::PluginProviderCategory() const + { + //To identify internal plug-ins. + return KGSPluginProviderInternal; + } + + +// ---------------------------------------------------------------------------- +// CGSDataCallPlugin::Visible +// +// Provides the visibility status of self to framework. +// ---------------------------------------------------------------------------- +// +TBool CGSDataCallPlugin::Visible() const + { + TBool visible = EFalse; + + if ( FeatureManager::FeatureSupported( KFeatureIdAppCsdSupport ) ) + { + visible = ETrue; + } + + return visible; + } + + +// --------------------------------------------------------------------------- +// CGSDataCallPlugin::HandleCommandL(TInt aCommand) +// +// Handles commands directed to this class. +// --------------------------------------------------------------------------- +void CGSDataCallPlugin::HandleCommandL( TInt aCommand ) + { + switch ( aCommand ) + { + case EGSMSKCmdAppChange: + case EGSCmdAppChange: + HandleListBoxSelectionL(); + break; + case EAknSoftkeyBack: + #ifdef RD_CONTROL_PANEL + iAppUi->ActivateLocalViewL( KGSAdminPluginUid ); + #else //RD_CONTROL_PANEL + iAppUi->ActivateLocalViewL( KGSConPluginUid ); + #endif //RD_CONTROL_PANEL + break; + case EAknCmdHelp: + { + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), iAppUi->AppHelpContextL() ); + } + break; + } + default: + iAppUi->HandleCommandL( aCommand ); + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSDataCallPlugin::UpdateListBoxL +// +// Updates listbox items. +// --------------------------------------------------------------------------- +// +void CGSDataCallPlugin::UpdateListBoxL( TInt aItemId ) + { + if( Container() ) + { + Container()->UpdateListBoxL( aItemId ); + } + } + + +// ---------------------------------------------------------------------------- +// CGSDataCallPlugin::Container +// +// Return handle to container class. +// ---------------------------------------------------------------------------- +// +CGSDataCallPluginContainer* CGSDataCallPlugin::Container() + { + return static_cast( iContainer ); + } + + +// --------------------------------------------------------------------------- +// CGSDataCallPlugin::NewContainerL() +// +// Creates new iContainer. +// --------------------------------------------------------------------------- +// +void CGSDataCallPlugin::NewContainerL() + { + iContainer = new( ELeave ) CGSDataCallPluginContainer; + } + + +// ---------------------------------------------------------------------------- +// CGSDataCallPlugin::DoActivateL +// +// First method called by the Avkon framwork to invoke a view. +// ---------------------------------------------------------------------------- +// +void CGSDataCallPlugin::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + } + + +// ---------------------------------------------------------------------------- +// CGSDataCallPlugin::DoDeactivate +// +// Called by the Avkon view framework when closing. +// ---------------------------------------------------------------------------- +// +void CGSDataCallPlugin::DoDeactivate() + { + CGSBaseView::DoDeactivate(); + } + + +// --------------------------------------------------------------------------- +// CGSDataCallPlugin::HandleListBoxSelectionL() +// +// Handles events raised through a rocker key. +// --------------------------------------------------------------------------- +void CGSDataCallPlugin::HandleListBoxSelectionL() + { + const TInt currentFeatureId = Container()->CurrentFeatureId(); + + switch ( currentFeatureId ) + { + case KGSSettIdAutodiscon: + ShowDialupAutodisconSettingPageL(); + break; + default: + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSDataCallPlugin::HandleSettingPageEventL +// +// Handle any setting page related events +// --------------------------------------------------------------------------- +// +void CGSDataCallPlugin::HandleSettingPageEventL( CAknSettingPage* aSettingPage, + TAknSettingPageEvent aEventType ) + { + TInt settingId = aSettingPage->SettingId(); + + if ( aEventType == EEventSettingOked ) + { + TInt current; + + switch ( settingId ) + { + case KGSAutodisconSettingId: + current = + static_cast ( aSettingPage )-> + ListBoxControl()->CurrentItemIndex(); + if ( current == KGSAutodTimeIndex ) + { + ShowAutodisconTimeQueryL(); + } + break; + default: + break; + } + } + } + + + +// --------------------------------------------------------------------------- +// CGSDataCallPlugin::ShowDialupAutodisconSettingPageL +// +// Display dialup auto disconnect setting page. +// --------------------------------------------------------------------------- +// +void CGSDataCallPlugin::ShowDialupAutodisconSettingPageL() + { + TInt value = iModel->AutodisconnectTimeL(); + TInt currentValue = 0; // magic number (user defined) + + if ( value == static_cast ( KGSTimeUnlimited ) ) + { + currentValue = 1; // magic number (unlimited) + } + + CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( + R_AUTODISCON_TIME_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + + CAknRadioButtonSettingPage* dlg = new( ELeave ) CAknRadioButtonSettingPage( + R_AUTODISCON_TIME_SETTING_PAGE, + currentValue, items ); + + dlg->SetSettingId( KGSAutodisconSettingId ); + dlg->SetSettingPageObserver( this ); + + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { + if ( currentValue == 1 ) // magic number (unlimited) + { + iModel->SetAutodisconnectTimeL( KGSTimeUnlimited ); + } + + UpdateListBoxL( KGSSettIdAutodiscon ); + } + + CleanupStack::PopAndDestroy( items ); + } + +// --------------------------------------------------------------------------- +// CGSDataCallPlugin::ShowAutodisconTimeQueryL() +// +// Display auto disconnect time query dialog. +// --------------------------------------------------------------------------- +// +void CGSDataCallPlugin::ShowAutodisconTimeQueryL() + { + TInt time = iModel->AutodisconnectTimeL(); + if ( time == static_cast ( KGSTimeUnlimited ) ) + { + time = KGSZeroMinutes; + } + + CAknNumberQueryDialog* dlg = new( ELeave ) CAknNumberQueryDialog( time ); + dlg->PrepareLC( R_AUTODISCON_TIME_NUMBER_QUERY ); + CAknQueryControl *ctrl = ( CAknQueryControl* )dlg->Control( EGeneralQuery ); + CEikEdwin *edwin = ( CEikEdwin* )ctrl->ControlByLayoutOrNull( ENumberLayout ); + edwin->SetAknEditorNumericKeymap( EAknEditorPlainNumberModeKeymap ); + + if( dlg->RunLD() ) + { + if ( time == KGSZeroMinutes ) + { + time = static_cast ( KGSTimeUnlimited ); + } + + iModel->SetAutodisconnectTimeL( time ); + } + } + + +// ----------------------------------------------------------------------------- +// CGSDataCallPlugin::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CGSDataCallPlugin::CreateIconL( const TUid aIconType ) + { + //EMbm + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSDataCallPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropSetConnData, + fp->FullName(), + EMbmGsdatacallpluginQgn_prop_set_conn_data, + EMbmGsdatacallpluginQgn_prop_set_conn_data_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + CleanupStack::PopAndDestroy( fp ); + + return icon; + } + + +// ----------------------------------------------------------------------------- +// CGSDataCallPlugin::DynInitMenuPaneL() +// +// dynamically handle help item if not supported +// ----------------------------------------------------------------------------- +// +void CGSDataCallPlugin::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + if( aResourceId == R_GS_MENU_ITEM_HELP ) + { + User::LeaveIfNull( aMenuPane ); + + if ( FeatureManager::FeatureSupported( KFeatureIdHelp )) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,191 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for the Data sub-folder +* +*/ + + +// INCLUDE FILES +#include "GSDataCallPluginContainer.h" +#include "GSDataCallPluginModel.h" +#include "GsDataCallPlugin.hrh" + +#include +#include +#include +#include +#include +#include +#include +#include + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSDataCallPluginContainer::ConstructL() +// +// Symbian OS two phased constructor +// --------------------------------------------------------------------------- +// +void CGSDataCallPluginContainer::ConstructL( const TRect& aRect ) + { + iListBox = new( ELeave ) CAknSettingStyleListBox; + + BaseConstructL( aRect, R_GS_CSD_VIEW_TITLE, R_DCALL_LBX ); + } + + +// --------------------------------------------------------------------------- +// CGSDataCallPluginContainer::~CGSDataCallPluginContainer() +// +// Destructor +// --------------------------------------------------------------------------- +// +CGSDataCallPluginContainer::~CGSDataCallPluginContainer() + { + delete iAutodisconValue; + delete iListboxItemArray; + } + + +// --------------------------------------------------------------------------- +// CGSDataCallPluginContainer::ConstructListBoxL() +// +// Construct the listbox from resource array. +// --------------------------------------------------------------------------- +// +void CGSDataCallPluginContainer::ConstructListBoxL( TInt aResLbxId ) + { + iListBox->ConstructL( this, EAknListBoxSelectionList ); + + iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, + *iListBox, *iCoeEnv ); + iListBox->Model()->SetItemTextArray( iListboxItemArray ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + + CreateListBoxItemsL(); + } + + +// --------------------------------------------------------------------------- +// CGSDataCallPluginContainer::CreateListBoxItemsL() +// +// Create listbox items. +// --------------------------------------------------------------------------- +// +void CGSDataCallPluginContainer::CreateListBoxItemsL() + { + MakeAutodisconItemL(); + } + + +// --------------------------------------------------------------------------- +// CGSDataCallPluginContainer::UpdateListBoxL() +// +// Update listbox item. +// --------------------------------------------------------------------------- +// +void CGSDataCallPluginContainer::UpdateListBoxL( TInt aFeatureId ) + { + switch( aFeatureId ) + { + case KGSSettIdAutodiscon: + MakeAutodisconItemL(); + break; + default: + break; + } + + iListBox->HandleItemAdditionL(); + } + + +// --------------------------------------------------------------------------- +// CGSDataCallPluginContainer::MakeAutodisconItemL() +// +// Create auto disconnect list item +// --------------------------------------------------------------------------- +// +void CGSDataCallPluginContainer::MakeAutodisconItemL() + { + CGSDataCallPluginModel* model = CGSDataCallPluginModel::NewL(); + + TInt time = model->AutodisconnectTimeL(); + delete model; + + HBufC* buf = NULL; + + switch( time ) + { + case KGSTimeUnlimited: + buf = iEikonEnv->AllocReadResourceL( R_AUTODISCON_VALUE_NO ); + break; + case KGSOneMinute: + { + buf = iEikonEnv->AllocReadResourceL( R_AUTODISCON_VALUE_1MIN ); + // for A&H number conversion + TPtr bufPtr( buf->Des() ); + if( AknTextUtils::DigitModeQuery( + AknTextUtils::EDigitModeShownToUser ) ) + { + AknTextUtils::LanguageSpecificNumberConversion( bufPtr ); + } + } + break; + default: + buf = StringLoader::LoadL( R_AUTODISCON_VALUE_MIN, + time, iEikonEnv ); + break; + } + + TPtr bufPtr( buf->Des() ); + iListboxItemArray->SetDynamicTextL( KGSSettIdAutodiscon, bufPtr ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( KGSSettIdAutodiscon, + CGSListBoxItemTextArray::EVisible ); + + + delete buf; + } + + +// --------------------------------------------------------------------------- +// CGSDataCallPluginContainer::GetHelpContext() const +// +// Gets Help +// --------------------------------------------------------------------------- +// +void CGSDataCallPluginContainer::GetHelpContext( + TCoeHelpContext& aContext ) const + { + aContext.iMajor = KUidGS; + aContext.iContext = KSET_HLP_CONNEC_DATA; + } + + +// --------------------------------------------------------------------------- +// CGSDataCallPluginContainer::CurrentFeatureId() +// +// Return the feature id of selected listitem +// --------------------------------------------------------------------------- +// +TInt CGSDataCallPluginContainer::CurrentFeatureId( ) const + { + return iListboxItemArray->CurrentFeature( ); + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for GSDataCallPlugin +* +*/ + + +// INCLUDES +#include "GSDataCallPlugin.h" + +#include +#include + + +// CONSTANTS +const TImplementationProxy KGSDataCallPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x10207436, CGSDataCallPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// +// Gate/factory function +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSDataCallPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSDataCallPluginImplementationTable; + } + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginModel.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,188 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Data Call Settings model implementation. +* +*/ + + +// INCLUDE FILES +#include "GSDataCallPluginModel.h" + +#include +#include + +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS +// Autodisconnect time +const TUint8 KGSOneSecond = 1; +const TUint8 KGSSecondsInMinute = 60; +const TUint KGSMaxTimeInSeconds = 5940; +//const TUint8 KGSMaxTimeInMinutes = 99; + +_LIT( KGSCSDModem, "CSD Modem" ); + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS ============================== + +// ========================= MEMBER FUNCTIONS ================================= + +// ---------------------------------------------------------------------------- +// CGSDataCallPluginModel::NewL +// +// Symbian OS two-phased constructor +// ---------------------------------------------------------------------------- +// +CGSDataCallPluginModel* CGSDataCallPluginModel::NewL() + { + CGSDataCallPluginModel* self = new( ELeave ) CGSDataCallPluginModel; + CleanupStack::PushL( self ); + self->ConstructL(); + + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CGSDataCallPluginModel::CGSDataCallPluginModel +// +// +// C++ default constructor can NOT contain any code, that might leave. +// ---------------------------------------------------------------------------- +// +CGSDataCallPluginModel::CGSDataCallPluginModel() + { + } + + +// ---------------------------------------------------------------------------- +// CGSDataCallPluginModel::ConstructL +// +// Symbian OS default constructor can leave. +// ---------------------------------------------------------------------------- +// +void CGSDataCallPluginModel::ConstructL() + { + iCommDb = CCommsDatabase::NewL( EDatabaseTypeIAP ); + } + + +// ---------------------------------------------------------------------------- +// CGSDataCallPluginModel::~CGSDataCallPluginModel +// +// Destructor +// ---------------------------------------------------------------------------- +// +CGSDataCallPluginModel::~CGSDataCallPluginModel() + { + delete iCommDb; + } + + +// ---------------------------------------------------------------------------- +// CGSDataCallPluginModel::AutodisconnectTimeL +// +// Gets autodisconnect time. +// ---------------------------------------------------------------------------- +// +TInt CGSDataCallPluginModel::AutodisconnectTimeL() + { + CCommsDbTableView* table = iCommDb->OpenViewMatchingTextLC( + TPtrC( MODEM_BEARER ), + TPtrC( COMMDB_NAME ), KGSCSDModem ); + + User::LeaveIfError( table->GotoFirstRecord() ); + + TUint32 timeOutValue = 0; + table->ReadUintL( TPtrC( LAST_SOCKET_ACTIVITY_TIMEOUT ), timeOutValue ); + CleanupStack::PopAndDestroy( table ); + + TInt timeInMinutes; + + if ( timeOutValue < KGSOneSecond ) + { + timeInMinutes = static_cast ( KGSTimeUnlimited ); + + if ( timeOutValue != KGSTimeUnlimited ) + { + SetAutodisconnectTimeL( KGSTimeUnlimited ); + } + } + else if ( timeOutValue < KGSSecondsInMinute ) + { + timeInMinutes = KGSOneMinute; + } + else if ( timeOutValue < KGSMaxTimeInSeconds ) + { + timeInMinutes = timeOutValue/KGSSecondsInMinute; + } + else + { + timeInMinutes = static_cast ( KGSTimeUnlimited ); + } + return timeInMinutes; + } + + +// ---------------------------------------------------------------------------- +// CGSDataCallPluginModel::SetAutodisconnectTimeL +// +// Sets autodisconnect time. +// ---------------------------------------------------------------------------- +// +TBool CGSDataCallPluginModel::SetAutodisconnectTimeL( const TInt aTime ) + { + TInt time; + + if ( aTime >= KGSOneMinute ) + { + time = aTime * KGSSecondsInMinute; + } + else + { + time = static_cast ( KGSTimeUnlimited ); + } + + CCommsDbTableView* table = iCommDb->OpenViewMatchingTextLC( + TPtrC( MODEM_BEARER ), + TPtrC( COMMDB_NAME ), KGSCSDModem ); + + User::LeaveIfError( table->GotoFirstRecord() ); + User::LeaveIfError( table->UpdateRecord() ); + table->WriteUintL( TPtrC( LAST_SOCKET_ACTIVITY_TIMEOUT ), time ); + table->WriteUintL( TPtrC( LAST_SOCKET_CLOSED_TIMEOUT ), time ); + User::LeaveIfError( table->PutRecordChanges() ); + CleanupStack::PopAndDestroy( table ); + + return ETrue; + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDataCallPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDataCallPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSDataCallPlugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSDataCallPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsdatacallplugin.iby ) +../rom/GSDataCallPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsdatacallpluginresources.iby ) +loc/GSDataCallPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsdatacallplugin.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gsdatacallplugin.mif + OPTION HEADERFILE gsdatacallplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_set_conn_data +END + + +PRJ_MMPFILES +GSDataCallPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDataCallPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDataCallPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSDataCallPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDataCallPlugin/loc/GSDataCallPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDataCallPlugin/loc/GSDataCallPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSDataCallPlugin. +* +*/ + + +// LOCALISATION STRINGS + +// NEW + +//d:Text of a list item in Connection view's folder list +//d:Item opens Data Call folder +//l:list_single_large_graphic_pane_t1 +//w: +//r: 3.1 +// +#define qtn_set_folder_conn_data_call "Data call" + + +// **DATA CALL (CONNECTION) VIEW + +//d:Text in title pane +//d:Data call setting list view +//l:title_pane_t2/opt9 +//w: +//r: 3.1 +// +#define qtn_set_title_settings_csd "Data call" + +//d:Text of a list item in Data call setting list view's list +//d:Item opens Autodisconnect time setting page +//l:list_setting_pane_t1 +//w: +//r: 3.1 +// +#define qtn_set_autodiscon "Autodisconnect time" + + +// AUTODISCONNECT TIME + +//d:Item in Autodisconnect time setting page's list +//d:Setting value User defined +//l:list_set_graphic_pane_t1 +//w: +//r: 3.1 +// +#define qtn_set_autodiscon_defined "User defined" + +//d:Text in setting list item's current value field +//d:Autodisconnect time list item +//d:Item in Autodisconnect time setting page's list +//d:Setting value No limit or 0 min +//l:list_set_graphic_pane_t1 +//w: +//r: 3.1 +// +#define qtn_set_autodiscon_no "No limit" + +//d:Promt text in Autodisconnect time number query +//d:Data query +//l:popup_query_data_window +//w: +//r: 3.1 +// +#define qtn_set_autodiscon_define_time "Autodisconnect time (min):" + +//d:Text in setting list item's current value field +//d:Autodisconnect time list item +//d:Current value field text when current value is 1 min +//l:list_set_graphic_pane_t1 +//w: +//r: 3.1 +// +#define qtn_set_autodiscon_one_min "1 min" + +//d:Text in setting list item's current value field +//d:Autodisconnect time list item +//d:Current value field text when current value is > 1 min +//l:list_set_graphic_pane_t1 +//w: +//r: 3.1 +// +#define qtn_set_autodiscon_min "%N min" + + + +// End of File + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDeviceManagementPlugin/GSDeviceManagementPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/GSDeviceManagementPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSDeviceManagementPlugin project specification file. +* +*/ + + +#include // For RESOURCE_FILES_DIR + +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gsdevicemanagementplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10283316 +VENDORID VID_DEFAULT + +SOURCEPATH src +SOURCE GSDeviceManagementPluginImplementationTable.cpp +SOURCE GSDeviceManagementPlugin.cpp + +USERINCLUDE inc +USERINCLUDE data +USERINCLUDE loc +USERINCLUDE ../Logger +USERINCLUDE ../Data + +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + +SOURCEPATH data + +START RESOURCE 10283316.rss +TARGET gsdevicemanagementplugin.rsc +END + +// View resources +START RESOURCE GSDeviceManagementPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // View resources + + +// Libraries + +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY commonengine.lib// For RConeResourceLoader +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY egul.lib // CGulIcon +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY euser.lib +LIBRARY flogger.lib // For GSLogger +LIBRARY gsframework.lib +LIBRARY gsecomplugin.lib +LIBRARY gslistbox.lib// For CGSListBoxItemTextArray +LIBRARY ws32.lib // For RWsSession + +//Documents. Defining these is optional. Used only by IDE's file browser. +SOURCEPATH data +DOCUMENT 10283316.rss +DOCUMENT GSDeviceManagementPluginRsc.rss + +SOURCEPATH inc + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDeviceManagementPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSDeviceManagementPlugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSDeviceManagementPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsdevicemanagementplugin.iby ) +../rom/GSDeviceManagementPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsdevicemanagementpluginresources.iby ) +loc/GSDeviceManagementPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsdevicemanagementplugin.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gsdevicemanagementplugin.mif + OPTION HEADERFILE gsdevicemanagementplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_cp_dev_man +END + + +PRJ_MMPFILES +GSDeviceManagementPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDeviceManagementPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSDeviceManagementPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDeviceManagementPlugin/data/10283316.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/data/10283316.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for GSDeviceManagementPlugin. +* +*/ + +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x10283316; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10283317; + version_no = 1; + display_name = "GSDeviceManagementPlugin"; // Debug name + default_data = "0x10207237";// Parent UID + opaque_data = "90";// Order number + } + }; + } + }; + } + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDeviceManagementPlugin/data/GSDeviceManagementPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/data/GSDeviceManagementPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file GSDeviceManagementPlugin. +* +*/ + + +// RESOURCE IDENTIFIER +NAME DEMA // 4 letter ID + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// CONSTANTS + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// +// +// Needed or loading the resource fails! +// +//---------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +//---------------------------------------------------- +// +// r_gs_devicemanagement_view +// Device management view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_devicemanagement_view + { + menubar = r_gs_menubar_open_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN; + } + + +//---------------------------------------------------- +// +// r_gs_devicemanagement_view_title +// Device management view title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_devicemanagement_view_title + { + txt = qtn_cp_title_device_management; + } + + +//---------------------------------------------------- +// r_gs_devicemanagement_view_caption +// +// gen view caption for plugin +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_devicemanagement_view_caption + { + buf = qtn_cp_folder_device_management; + } + + + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDeviceManagementPlugin/inc/GSDeviceManagementPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/inc/GSDeviceManagementPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSDeviceManagementPlugin header. +* +*/ + + +#ifndef GSDEVICEMANAGEMENTPLUGIN_H +#define GSDEVICEMANAGEMENTPLUGIN_H + +// Includes +#include +#include +#include +#include + +// Classes referenced +class CAknViewAppUi; +class RConeResourceLoader; + +// Constants +_LIT( KGSDeviceManagementPluginResourceFileName, "z:GSDeviceManagementPluginRsc.rsc" ); +_LIT( KGSDeviceManagementPluginIconDirAndName, "z:GSDeviceManagementPlugin.mbm"); // Use KDC_BITMAP_DIR + +// CLASS DECLARATION + +/** +* CGSDeviceManagementPlugin view class. +* +* @since Series60_3.2 +*/ +class CGSDeviceManagementPlugin : public CGSParentPlugin + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return + */ + static CGSDeviceManagementPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSDeviceManagementPlugin(); + + public: // From CAknView + + /** + * See base class. + */ + TUid Id() const; + + /** + * See base class. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + /** + * See base class. + */ + void DoDeactivate(); + + public: // From CGSParentPlugin + + /** + * See base class. + */ + TUid UpperLevelViewUid(); + + /** + * See base class. + */ + void GetHelpContext( TCoeHelpContext& aContext ); + + public: // From CGSPluginInterface + + /** + * See base class. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * See base class. + */ + TInt PluginProviderCategory() const; + + protected: // New + /** + * C++ default constructor. + */ + CGSDeviceManagementPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + private: // Data + + // Resource loader. + RConeResourceLoader iResourceLoader; + }; + + +#endif // GSDEVICEMANAGEMENTPLUGIN_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDeviceManagementPlugin/loc/GSDeviceManagementPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/loc/GSDeviceManagementPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSDeviceManagementPlugin. +* +*/ + + +// LOCALISATION STRINGS + +// **CAPTIONS + +//d:Plugin title. +//d:Long string. +//l:title_pane_t2/opt9 +//w: +//r:5.0 +// +#define qtn_cp_title_device_management "Device management" + +//d:Plugin caption. +//d:Used by GS FW. +//l:list_single_large_graphic_pane_t1 +//w: +//r:5.0 +// +#define qtn_cp_folder_device_management "Device management" + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDeviceManagementPlugin/src/GSDeviceManagementPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/src/GSDeviceManagementPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,247 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSDeviceManagementPlugin source code. +* +*/ + + +// Includes +#include "GSDeviceManagementPlugin.h" +#include "GsLogger.h" +#include +#include // Icons +#include +#include +#include +#include + + +#include +#include +#include +#include // For TResourceReader + + +// Constants + + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CGSDeviceManagementPlugin::CGSDeviceManagementPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSDeviceManagementPlugin::CGSDeviceManagementPlugin() + : CGSParentPlugin(), iResourceLoader( *iCoeEnv ) + { + __GSLOGSTRING( "[CGSDeviceManagementPlugin] CGSDeviceManagementPlugin()" ); + + } + + +// --------------------------------------------------------------------------- +// CGSDeviceManagementPlugin::~CGSDeviceManagementPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSDeviceManagementPlugin::~CGSDeviceManagementPlugin() + { + __GSLOGSTRING( "[CGSDeviceManagementPlugin] ~CGSDeviceManagementPlugin()|->" ); + iResourceLoader.Close(); + __GSLOGSTRING( "[CGSDeviceManagementPlugin] ~CGSDeviceManagementPlugin()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSDeviceManagementPlugin::ConstructL() +// +// +// --------------------------------------------------------------------------- +// +void CGSDeviceManagementPlugin::ConstructL() + { + __GSLOGSTRING( "[CGSDeviceManagementPlugin] ConstructL()|->" ); + OpenLocalizedResourceFileL( KGSDeviceManagementPluginResourceFileName, + iResourceLoader ); + BaseConstructL( R_GS_DEVICEMANAGEMENT_VIEW, R_GS_DEVICEMANAGEMENT_VIEW_TITLE ); + __GSLOGSTRING( "[CGSDeviceManagementPlugin] ConstructL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSDeviceManagementPlugin::NewL() +// +// +// --------------------------------------------------------------------------- +// +CGSDeviceManagementPlugin* CGSDeviceManagementPlugin::NewL( TAny* /*aInitParams*/ ) + { + __GSLOGSTRING( "[CGSDeviceManagementPlugin] NewL()" ); + + CGSDeviceManagementPlugin* self = new(ELeave) CGSDeviceManagementPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::Id() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSDeviceManagementPlugin::Id() const + { + __GSLOGSTRING1( "[CGSDeviceManagementPlugin] Id():0x%X", KGSDeviceManagementPluginUid.iUid ); + return KGSDeviceManagementPluginUid; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoActivateL() +// +// +// --------------------------------------------------------------------------- +// +void CGSDeviceManagementPlugin::DoActivateL + ( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + __GSLOGSTRING( "[CGSDeviceManagementPlugin] DoActivateL()|->" ); + CGSParentPlugin::DoActivateL( aPrevViewId, + aCustomMessageId, + aCustomMessage ); + CGSMainView* parent = + static_cast ( AppUi()->View( KGSMainViewUid ) ); + + // Create tab group for this view (do only if casting parent succeeds): + __GSLOGSTRING( "[CGSDeviceManagementPlugin] DoActivateL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoDeactivate() +// +// +// --------------------------------------------------------------------------- +// +void CGSDeviceManagementPlugin::DoDeactivate() + { + __GSLOGSTRING( "[CGSDeviceManagementPlugin] DoDeactivate()|->" ); + CGSParentPlugin::DoDeactivate(); + __GSLOGSTRING( "[CGSDeviceManagementPlugin] DoDeactivate()-|" ); + } + + +// ========================= From CGSParentPlugin ===================== + + +// --------------------------------------------------------------------------- +// CGSDeviceManagementPlugin::UpperLevelViewUid() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSDeviceManagementPlugin::UpperLevelViewUid() + { + return KGSGenPluginUid; + } + + +// ========================= From CGSPluginInterface ================== + + +// --------------------------------------------------------------------------- +// CGSDeviceManagementPlugin::GetCaptionL() +// +// +// --------------------------------------------------------------------------- +// +void CGSDeviceManagementPlugin::GetCaptionL( TDes& aCaption ) const + { + __GSLOGSTRING( "[CGSDeviceManagementPlugin] GetCaptionL()|->" ); + // The resource file is already opened by iResourceLoader. + HBufC* result = StringLoader::LoadL( R_GS_DEVICEMANAGEMENT_VIEW_CAPTION ); + aCaption.Copy( *result ); + delete result; + __GSLOGSTRING( "[CGSDeviceManagementPlugin] GetCaptionL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSDeviceManagementPlugin::PluginProviderCategory() +// +// +// --------------------------------------------------------------------------- +// +TInt CGSDeviceManagementPlugin::PluginProviderCategory() const + { + return KGSPluginProviderInternal; + } + + +// ----------------------------------------------------------------------------- +// CGSDeviceManagementPlugin::GetHelpContext() +// +// +// ----------------------------------------------------------------------------- +// +void CGSDeviceManagementPlugin::GetHelpContext( TCoeHelpContext& aContext ) + { + aContext.iMajor = KUidGS; + aContext.iContext = KCP_HLP_DEVICE_MANAGEMENT; + } + + +// ----------------------------------------------------------------------------- +// CGSDeviceManagementPlugin::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CGSDeviceManagementPlugin::CreateIconL( const TUid aIconType ) + { + //EMbm + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSDeviceManagementPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropCpDevMan, + fp->FullName(), + EMbmGsdevicemanagementpluginQgn_prop_cp_dev_man, + EMbmGsdevicemanagementpluginQgn_prop_cp_dev_man_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + CleanupStack::PopAndDestroy( fp ); + + return icon; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDeviceManagementPlugin/src/GSDeviceManagementPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDeviceManagementPlugin/src/GSDeviceManagementPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for GSDeviceManagementPlugin. +* +*/ + + +// System includes +#include +#include + +// User includes +#include "GSDeviceManagementPlugin.h" + +// Constants +const TImplementationProxy KGSDeviceManagementPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x10283317, CGSDeviceManagementPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSDeviceManagementPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSDeviceManagementPluginImplementationTable; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDiagnosticsPlugin/GSDiagnosticsPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/GSDiagnosticsPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification file for GSDiagnosticsPlugin. +* +*/ + +#ifndef _DEBUG + #define _DEBUG //REMOVE +#endif + +#include //this is needed for RESOURCE_FILES_DIR +#include "../logger/GsLoggingConfiguration.h" + +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gsdiagnosticsplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x102750D3 +VENDORID VID_DEFAULT + +SOURCEPATH src +SOURCE GSDiagnosticsPlugin.cpp +SOURCE GSDiagnosticsPluginImplementationTable.cpp + +USERINCLUDE ../Logger +USERINCLUDE ../data +USERINCLUDE data +USERINCLUDE inc + +SYSTEMINCLUDE . +SYSTEMINCLUDE /epoc32/include/cshelp +SYSTEMINCLUDE /epoc32/include/ecom +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH data + +//ECOM resource definition +START RESOURCE 102750D3.rss +TARGET gsdiagnosticsplugin.rsc +TARGETPATH ECOM_RESOURCE_DIR +END // ECOM resource definition + +//OperatorLogo resources +START RESOURCE GSDiagnosticsPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // OperatorLogo resources + + +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY centralrepository.lib +LIBRARY commdb.lib +LIBRARY commonengine.lib // RConeResourceLoader +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY egul.lib // CGulIcon +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY etel.lib // RPhone +LIBRARY etelpckt.lib // RPacketService +LIBRARY euser.lib +LIBRARY FeatMgr.lib // FeatureManager +LIBRARY flogger.lib // RFileLogger +LIBRARY gsecomplugin.lib +LIBRARY gsframework.lib // Base classes +LIBRARY gslistBox.lib // CGSListBoxItemTextArray +LIBRARY hlplch.lib // HlpLauncher +LIBRARY charconv.lib // CnvUtfConverter + +//Documents. Defining these is optional. Used only by IDE's file browser. +SOURCEPATH data +DOCUMENT 102750D3.rss +DOCUMENT GSDiagnosticsPluginRsc.rss + +SOURCEPATH inc +DOCUMENT GSDiagnosticsPlugin.loc + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDiagnosticsPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Information required for building GSDiagnosticsPlugin. +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +GSDiagnosticsPlugin.mmp + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDiagnosticsPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSDiagnosticsPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDiagnosticsPlugin/data/102750D3.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/data/102750D3.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for GSDiagnosticsPlugin. +* +*/ + +#include + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x102750D3; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x102750D4; + version_no = 1; + display_name = "Diagnostics Plugin"; + default_data = "0x10207239"; // Parent UID + opaque_data = "4"; // Order number + } + }; + } + }; + } + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDiagnosticsPlugin/data/GSDiagnosticsPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/data/GSDiagnosticsPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for GSDiagnosticsPlugin. +* +*/ + + +// RESOURCE IDENTIFIER +NAME DGPL // 4 letter ID + +// INCLUDES +#include "GSDiagnosticsPlugin.loc" // OperatorLogo localized strings + +#include +#include +#include // Avkon localized strings +#include +#include +#include +#include +#include + +// CONSTANTS + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// +// +// Needed or loading the resource fails! +// +//---------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +//---------------------------------------------------- +// +// r_gs_diagnostics_view_title +// Operator logo view's title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_diagnostics_view_title + { + txt = qtn_set_title_settings_operatorlogo; + } + +//---------------------------------------------------- +// +// r_gs_diagnostics_plugin_caption +// Operator logo Plugin caption. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_diagnostics_plugin_caption + { + buf = qtn_set_diagnostics_caption; + } + +//---------------------------------------------------- +// +// r_gs_diagnostics_view +// Operator logo view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_diagnostics_view + { + menubar = r_gs_menubar_change_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN; + } + + + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDiagnosticsPlugin/inc/GSDiagnosticsPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/inc/GSDiagnosticsPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,166 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSDiagnosticsPlugin implementation. +* +*/ + +#ifndef GSDIAGNOSTICSPLUGIN_H +#define GSDIAGNOSTICSPLUGIN_H + +// User includes + +// System includes +#include +#include +#include +#include + +// Classes referenced +class CImplementationInformation; + + +// Constants +const TUid KGSDiagnosticsPluginUID = { 0x102750D4 }; +_LIT( KOperatorLogoResourceFileName, "z:GSDiagnosticsPluginRsc.rsc" ); + +// CLASS DECLARATION + +/** +* This is a utility plugin used to find errors in GS plugins. +* - Crashes on construction/deletion +* - Memory leaks on construction/deletion +* +*/ +class CGSDiagnosticsPlugin : public CGSPluginInterface + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return + */ + static CGSDiagnosticsPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSDiagnosticsPlugin(); + + public: // From CAknView + + /** + * See base class. + */ + TUid Id() const; + + public: // From CGSPluginInterface + + /** + * See base class. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + TInt PluginProviderCategory() const; + + /** + * See base class. + */ + TGSListboxItemTypes ItemType(); + + /** + * See base class. + */ + void GetValue( const TGSPluginValueKeys aKey, + TDes& aValue ); + + /** + * See base class. + */ + void HandleSelection( const TGSSelectionTypes aSelectionType ); + + /** + * See base class. + */ + TBool Visible() const; + + protected: // New + + /** + * C++ default constructor. + */ + CGSDiagnosticsPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + protected: // From CAknView + + /** + * This implementation is empty because this class, being just a dialog, + * does not implement the CAknView finctionality. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * This implementation is empty because this class, being just a dialog, + * does not implement the CAknView finctionality. + */ + void DoDeactivate(); + + private: // New + + /** + * Opens localized resource file. + */ + void OpenLocalizedResourceFileL( + const TDesC& aResourceFileName, + RConeResourceLoader& aResourceLoader ); + + /** + * Prints debug info. + * @param aInfo info to be printed. + */ + void PrintInfoDebug( CImplementationInformation* aInfo ); + + /** + * Checks plugin implementations. Uses __UHEAP_MARK and __UHEAP_MARKEND + * so will panic if plugin leaks memory. + */ + void CheckInfoL( TUid aInterfaceUid ); + + protected: // Data + + // Resource loader. + RConeResourceLoader iResources; + + // Print implementation info. + TBool iPrintInfo; + + // Try loading and deleting each plugin. + TBool iTestLoad; + + // Check heap change in case iTEstLoad in true. + TBool iCheckHeap; + + }; + +#endif // GSDIAGNOSTICSPLUGIN_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDiagnosticsPlugin/inc/GSDiagnosticsPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/inc/GSDiagnosticsPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSDiagnosticsPlugin. +* +*/ + +// LOCALISATION STRINGS + +// **OPTIONS MENU + +//d:Operator logo plugin caption +//d:Operator logo +//l:title_pane_t2/opt9 +//w: +//r:3.1 +// +#define qtn_set_diagnostics_caption "GS Diagnostics" + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDiagnosticsPlugin/src/GSDiagnosticsPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/src/GSDiagnosticsPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,337 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSDiagnosticsPlugin implementation. +* +*/ + + +// User includes +#include "GSDiagnosticsPlugin.h" +#include +#include +#include // GUI Resource +#include +#include +#include "GSLogger.h" + +// System includes +#include +#include +#include +#include +#include +#include +#include +#include // HlpLauncher +#include + +#include +#include // CnvUtfConverter + +// Constants + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSDiagnosticsPlugin::CGSDiagnosticsPlugin() +// Constructor +// +// --------------------------------------------------------------------------- +// +CGSDiagnosticsPlugin::CGSDiagnosticsPlugin() + : iResources( *iCoeEnv ) + { + } + + +// --------------------------------------------------------------------------- +// CGSDiagnosticsPlugin::~CGSDiagnosticsPlugin() +// Destructor +// +// --------------------------------------------------------------------------- +// +CGSDiagnosticsPlugin::~CGSDiagnosticsPlugin() + { + iResources.Close(); + } + + +// --------------------------------------------------------------------------- +// CGSDiagnosticsPlugin::ConstructL(const TRect& aRect) +// Symbian OS two-phased constructor +// +// --------------------------------------------------------------------------- +// +void CGSDiagnosticsPlugin::ConstructL() + { + OpenLocalizedResourceFileL( KOperatorLogoResourceFileName, iResources ); + BaseConstructL( R_GS_DIAGNOSTICS_VIEW ); + __GSLOGSTRING( "[CGSDiagnosticsPlugin] ConstructL()" ); + } + + +// --------------------------------------------------------------------------- +// CGSDiagnosticsPlugin::NewL() +// Static constructor +// +// --------------------------------------------------------------------------- +// +CGSDiagnosticsPlugin* CGSDiagnosticsPlugin::NewL( TAny* /*aInitParams*/ ) + { + CGSDiagnosticsPlugin* self = new( ELeave ) CGSDiagnosticsPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + +// ----------------------------------------------------------------------------- +// CGSDiagnosticsPlugin::Id +// +// +// ----------------------------------------------------------------------------- +// +TUid CGSDiagnosticsPlugin::Id() const + { + return KGSDiagnosticsPluginUID; + } + + +// ----------------------------------------------------------------------------- +// CGSDiagnosticsPlugin::DoActivateL +// +// +// ----------------------------------------------------------------------------- +// +void CGSDiagnosticsPlugin::DoActivateL( const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + // Update these values to define what is tested. + iPrintInfo = ETrue; + iTestLoad = EFalse; + iCheckHeap = EFalse; + + CheckInfoL( KGSPluginInterfaceUid ); + } + + +// ----------------------------------------------------------------------------- +// CGSDiagnosticsPlugin::DoDeactivate +// +// +// ----------------------------------------------------------------------------- +// +void CGSDiagnosticsPlugin::DoDeactivate() + { + } + + +// ========================= From CGSPluginInterface ================== + + +// ----------------------------------------------------------------------------- +// CGSDiagnosticsPlugin::GetCaptionL +// +// +// ----------------------------------------------------------------------------- +// +void CGSDiagnosticsPlugin::GetCaptionL( TDes& aCaption ) const + { + HBufC* result = StringLoader::LoadL( R_GS_DIAGNOSTICS_PLUGIN_CAPTION ); + aCaption.Copy( *result ); + delete result; + } + + +// ----------------------------------------------------------------------------- +// CGSDiagnosticsPlugin::PluginProviderCategory +// +// +// ----------------------------------------------------------------------------- +// +TInt CGSDiagnosticsPlugin::PluginProviderCategory() const + { + return KGSPluginProviderInternal; + } + + +// ----------------------------------------------------------------------------- +// CGSDiagnosticsPlugin::ItemType() +// +// +// ----------------------------------------------------------------------------- +// +TGSListboxItemTypes CGSDiagnosticsPlugin::ItemType() + { + return EGSItemTypeSettingDialog; + } + + +// ----------------------------------------------------------------------------- +// CGSDiagnosticsPlugin::GetValue() +// +// +// ----------------------------------------------------------------------------- +// +void CGSDiagnosticsPlugin::GetValue( const TGSPluginValueKeys /*aKey*/, + TDes& /*aValue*/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// CGSDiagnosticsPlugin::HandleSelection() +// +// +// ----------------------------------------------------------------------------- +// +void CGSDiagnosticsPlugin::HandleSelection( + const TGSSelectionTypes aSelectionType ) + { + TRAP_IGNORE( CheckInfoL( KGSPluginInterfaceUid ) ); + } + + +// ----------------------------------------------------------------------------- +// CGSDiagnosticsPlugin::Visible() +// +// +// ----------------------------------------------------------------------------- +// +TBool CGSDiagnosticsPlugin::Visible() const + { + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// CGSDiagnosticsPlugin::OpenLocalizedResourceFileL() +// +// +// ----------------------------------------------------------------------------- +// +void CGSDiagnosticsPlugin::OpenLocalizedResourceFileL( + const TDesC& aResourceFileName, + RConeResourceLoader& aResourceLoader ) + { + RFs fsSession; + User::LeaveIfError( fsSession.Connect() ); + + // Find the resource file: + TParse parse; + parse.Set( aResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL ); + TFileName fileName( parse.FullName() ); + + // Get language of resource file: + BaflUtils::NearestLanguageFile( fsSession, fileName ); + + // Open resource file: + aResourceLoader.OpenL( fileName ); + + // If leave occurs before this, close is called automatically when the + // thread exits. + fsSession.Close(); + } + + +// ---------------------------------------------------------------------------- +// CGSDiagnosticsPlugin::PrintInfoDebug +// Print CImplementationInformation to log. Used for debugging. +// +// ---------------------------------------------------------------------------- +// +void CGSDiagnosticsPlugin::PrintInfoDebug( CImplementationInformation* aInfo ) + { + TBuf16<256> dataType; + TBuf16<256> opaqueData; + CnvUtfConverter::ConvertToUnicodeFromUtf8( + dataType, aInfo->DataType() ); + CnvUtfConverter::ConvertToUnicodeFromUtf8( + opaqueData, aInfo->OpaqueData() ); + + __GSLOGSTRING( "." ); + __GSLOGSTRING1( " DisplayName: %S", &aInfo->DisplayName() ); + __GSLOGSTRING1( " ImplementationUid: 0x%X", aInfo->ImplementationUid() ); + __GSLOGSTRING1( " DataType: %S", &dataType ); + __GSLOGSTRING1( " OpaqueData: %S", &opaqueData ); + + } + + +// ----------------------------------------------------------------------------- +// CGSDiagnosticsPlugin::CheckInfoL() +// +// +// ----------------------------------------------------------------------------- +// +void CGSDiagnosticsPlugin::CheckInfoL( TUid aInterfaceUid ) + { + RImplInfoPtrArray implInfoArray; + + REComSession::ListImplementationsL( aInterfaceUid, implInfoArray ); + + if( iPrintInfo ) + { + __GSLOGSTRING( "[CGSDiagnosticsPlugin implementation information]" ); + for( TInt i = 0; i < implInfoArray.Count(); i++ ) + { + PrintInfoDebug( implInfoArray[i] ); + } + __GSLOGSTRING( "[End of implementation information]" ); + } + + CImplementationInformation* info; + CGSPluginInterface* plugin; + + if( iTestLoad ) + { + __GSLOGSTRING( "[CGSDiagnosticsPlugin plugin load/delete checks...]" ); + for( TInt i = 0; i < implInfoArray.Count(); i++ ) + { + info = implInfoArray[i]; + __GSLOGSTRING1( "[CGSDiagnosticsPlugin] Checking: %S", + &info->DisplayName() ); + + if ( iCheckHeap ) + { + __UHEAP_MARK; + } + + //Load plugin: + plugin = CGSPluginInterface::NewL( + info->ImplementationUid(), + AppUi() ); + + // Delete plugin: + delete plugin; + plugin = NULL; + + if ( iCheckHeap ) + { + __UHEAP_MARKEND; + } + + __GSLOGSTRING1( "[CGSDiagnosticsPlugin] %S OK", + &info->DisplayName() ); + } + } + + implInfoArray.ResetAndDestroy();// This is needed + } + + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDiagnosticsPlugin/src/GSDiagnosticsPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDiagnosticsPlugin/src/GSDiagnosticsPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for GSDiagnosticsPlugin. +* +*/ + + +// User includes +#include "GSDiagnosticsPlugin.h" + +// System includes +#include +#include + + +// Constants +const TImplementationProxy KGSDiagnosticsSettingsPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x102750D4, CGSDiagnosticsPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSDiagnosticsSettingsPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSDiagnosticsSettingsPluginImplementationTable; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/Data/10207440.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/Data/10207440.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for Display Settings plugin. +* +*/ + +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x10207440; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10207441; + version_no = 1; + display_name = "Display Settings Plugin"; + #ifdef RD_CONTROL_PANEL + default_data = "0x10207237"; // Parent UID + opaque_data = "30"; // Order number + #else //RD_CONTROL_PANEL + default_data = "0x10207252"; // Parent UID + opaque_data = "0"; // Order number + #endif //RD_CONTROL_PANEL + } + }; + }, + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = 0x2000B189; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x2000B592; + version_no = 1; + display_name = "PSMDisplayPlugin"; + default_data = ""; + opaque_data = ""; + } + }; + } + + }; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/Data/2000B591.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/Data/2000B591.xml Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/Data/GsDisplayPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/Data/GsDisplayPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,770 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for General Settings +* +*/ + + + +// RESOURCE IDENTIFIER +NAME DISP // 4 letter ID + +// INCLUDES +#include "GsDisplayPlugin.hrh" +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// CONSTANTS + +// RESOURCE DEFINITIONS + +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + + +RESOURCE TBUF + { + buf="DISP"; + } + +//---------------------------------------------------- +// +// EIK_APP_INFO +// It contains application information. +// +//---------------------------------------------------- +// +RESOURCE EIK_APP_INFO + { + } + + +// **COMMON RESOURCES + +//---------------------------------------------------- +// +// r_not_enough_memory_query +// Not enough memory note. +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_not_enough_memory_query + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = qtn_memlo_not_enough_memory; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_image_load_wait_note +// Image loading wait note. +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_image_load_wait_note + { + flags = EAknWaitNoteFlags; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EImageLoadWaitNote; + control= AVKON_NOTE + { + layout = EWaitLayout; + singular_label = qtn_set_loading_image; + imagefile = AVKON_ICON_FILE; + imageid = EMbmAvkonQgn_note_progress; + imagemask = EMbmAvkonQgn_note_progress_mask; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_gs_image_corrupted +// Image corrupted information note. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_corrupted + { + buf = qtn_set_image_format_wrong; + } + +//---------------------------------------------------- +// +// r_gs_image_too_large +// Image corrupted information note. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_too_large + { + buf = qtn_set_image_too_large; + } + + +//---------------------------------------------------- +// r_gs_display_view_caption +// +// Display view caption for plugin +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_display_view_caption + { + buf = qtn_set_device_display; + } + + +// **DISPLAY VIEW + +//---------------------------------------------------- +// +// r_gs_display_view_title +// Display view's title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_display_view_title + { + txt = qtn_set_title_display; + } + + +//---------------------------------------------------- +// +// r_gs_displ_view +// Display view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_displ_view + { + menubar = r_gs_menubar_change_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE; + } + +//---------------------------------------------------- +// +// r_displ_lbx +// Display view's listbox. +// +//---------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_displ_lbx + { + items = + { + GS_FEATURE + { + // the current value is a slider bitmap (1. icon in the icon array) + txt = " \t"qtn_set_display_contrast"\t0"; + item = EGSSettIdContrast; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + // the current value is a slider bitmap (1. icon in the icon array) + txt = " \t"qtn_set_disp_brightness"\t1"; + item = EGSSettIdBrightness; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + // the current value is a slider bitmap (1. icon in the icon array) + txt = " \t"qtn_set_light_sensor_mode"\t2"; + item = EGSSettIdAmbientLightSensor; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = " \t"qtn_set_disp_text_size"\t\t"; + item = EGSSettIdDisplayTextSize; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = " \t"qtn_sanim_time_out"\t\t"; + item = EGSSettIdSSP; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = " \t"qtn_sanim_object"\t\t"; + item = EGSSettIdSSO; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = " \t"qtn_set_uwn"\t\t"; + item = EGSSettIdWNI; + }, + GS_FEATURE + { + txt = " \t"qtn_sanim_objec_power_save_led"\t\t"; + item = EGSSettIdPowerSaveLed; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = " \t"qtn_set_light_time"\t\t"; + item = EGSSettIdBacklight; + }, + GS_FEATURE + { + txt = "\t"qtn_set_oper_logo"\t\t"; + item = EGSSettIdOperatorLogo; + type = EGSListBoxItemTypeIsDynamic; + } + }; + } + + +// **CONTRAST + +//---------------------------------------------------- +// +// r_contrast_slider +// Contrast slider. +// +//---------------------------------------------------- +// +RESOURCE SLIDER r_contrast_slider + { + layout = EAknSettingsItemSliderLayoutWithGraphics; + minvalue = -15; + maxvalue = 15; + step = 1; + valuetype = EAknSliderValuePercentage; + minlabel = qtn_set_contrast_light; + maxlabel = qtn_set_contrast_dark; + } + +//---------------------------------------------------- +// +// r_contrast_setting_page +// Contrast setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_contrast_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_set_display_contrast; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknCtSlider; + editor_resource_id = r_contrast_slider; + } + + +// **BRIGHTNESS + +//---------------------------------------------------- +// +// r_brightness_slider +// Brightness slider. +// +//---------------------------------------------------- +// +RESOURCE SLIDER r_brightness_slider + { + layout = EAknSettingsItemSliderLayoutWithGraphics; + minvalue = 1; + maxvalue = 31; + step = 1; + valuetype = EAknSliderValuePercentage; + minlabel = qtn_set_brightness_dark; + maxlabel = qtn_set_brightness_bright; + } + +//---------------------------------------------------- +// +// r_brightness_setting_page +// Brightness setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_brightness_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_set_disp_brightness; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknCtSlider; + editor_resource_id = r_brightness_slider; + } + + +// **AMBIENT LIGHT SENSOR + +//---------------------------------------------------- +// +// r_ambient_light_sensor_slider +// Ambient Light Sensor slider. +// +//---------------------------------------------------- +// +RESOURCE SLIDER_WITH_FEEDBACK_STYLE r_ambient_light_sensor_slider + { + feedbackstyle = EAknSliderFbDynamic; + layout = EAknSettingsItemSliderLayoutWithGraphics; + minvalue = 1; + maxvalue = 5; + step = 1; + valuetype = EAknSliderValuePercentage; + minlabel = qtn_set_light_sensor_dark; + maxlabel = qtn_set_light_sensor_bright; + } + +//---------------------------------------------------- +// +// r_ambient_light_sensor_setting_page +// Ambient Light Sensor setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_ambient_light_sensor_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_set_light_sensor_mode; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknCtSlider; + editor_resource_id = r_ambient_light_sensor_slider; + } + + +// **SCREEN SAVER + +//---------------------------------------------------- +// +// r_setting_screen_saver_slider +// Screen saver time setting slider +// +//---------------------------------------------------- +// +RESOURCE SLIDER_WITH_FEEDBACK_STYLE r_setting_screen_saver_slider + { + feedbackstyle = EAknSliderFbDynamic; + layout = EAknSettingsItemSliderLayout; + minvalue = 1; + maxvalue = 30; + step = 1; + valuetype = EAknSliderValueBareFigure; + minlabel = qtn_sanim_time_out_slider_min_value; + maxlabel = qtn_sanim_time_out_slider_max_value; + valuelabel = qtn_sanim_time_out_slider_cur_value; + singular_valuelabel = qtn_sanim_time_out_slider_cur_value_singular; + } + +//---------------------------------------------------- +// +// r_screen_saver_period_setting_page +// Screen saver period setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_screen_saver_period_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_sanim_time_out; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknCtSlider; + editor_resource_id = r_setting_screen_saver_slider; + } + + +// **BACKLIGHT TIMEOUT + +//---------------------------------------------------- +// +// r_setting_backlight_slider +// Backlight timeout setting slider +// +//---------------------------------------------------- +// +RESOURCE SLIDER_WITH_FEEDBACK_STYLE r_setting_backlight_slider + { + feedbackstyle = EAknSliderFbDynamic; + layout = EAknSettingsItemSliderLayout; + minvalue = 5; + maxvalue = 60; + step = 5; + valuetype = EAknSliderValueBareFigure; + singular_valuelabel = qtn_backlight_time_out_slider_cur; + minlabel = qtn_backlight_time_out_slider_min; + maxlabel = qtn_backlight_time_out_slider_max; + valuelabel = qtn_backlight_time_out_slider_cur; + } + +//---------------------------------------------------- +// +// r_backlight_period_setting_page +// Backlight period setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_backlight_period_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_set_light_time; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknCtSlider; + editor_resource_id = r_setting_backlight_slider; + } + + +// **DISPLAY TEXT SIZE + +//---------------------------------------------------- +// +// r_display_text_size_setting_page +// Display text size setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_display_text_size_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_set_disp_text_size; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +//---------------------------------------------------- +// +// r_display_text_size_setting_page_lbx +// Display text size setting page's listbox. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_display_text_size_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_set_disp_text_size_large; + }, + LBUF + { + txt = qtn_set_disp_text_size_normal; + }, + LBUF + { + txt = qtn_set_disp_text_size_small; + } + }; + } + + +// **WELCOME NOTE SETTING PAGE + +//---------------------------------------------------- +// +// r_welcome_note_setting_page +// Welcome note setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_welcome_note_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_set_uwn; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +//---------------------------------------------------- +// +// r_welcome_note_text_query +// Welcome note text query. +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_welcome_note_text_query + { + flags = EAknDialogGenericQueryFlags | EEikDialogFlagNoShadow; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + itemflags=EEikDlgItemTakesEnterKey; + control = AVKON_DATA_QUERY + { + layout = EDataLayout; + label = qtn_set_uwn_enter_text; + control = EDWIN + { + flags=0; + width=5; + lines=5; + maxlength=50; + avkon_flags = EAknEditorFlagEnablePictographInput; + allowed_input_modes = EAknEditorAllInputModes; + default_input_mode = EAknEditorTextInputMode; + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_welcome_note_setting_page_lbx +// Welcome note setting page's listbox. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_welcome_note_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_set_uwn_default; + }, + LBUF + { + txt = qtn_set_uwn_text; + }, + LBUF + { + txt = qtn_set_uwn_image; + } + }; + } + + +// *BACKGROUND IMAGE + +//---------------------------------------------------- +// +// r_background_image_setting_page +// Background image setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_background_image_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_set_bgimage; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +//---------------------------------------------------- +// +// r_background_image_setting_page_lbx +// Background image setting page's listbox. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_background_image_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_set_bgimage_no; + }, + LBUF + { + txt = qtn_set_bgimage_image; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_drm_not_allowed +// DRM protected image cannot be selected as welcome note iamge. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_drm_not_allowed + { + buf = qtn_drm_not_allowed; + } + + +// **POWER SAVE LED MODE + +//---------------------------------------------------- +// +// r_power_save_led_setting_page +// Power Save LED mode setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_power_save_led_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_sanim_objec_power_save_led; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +//---------------------------------------------------- +// +// r_power_save_led_setting_page_lbx +// Power Save LED mode setting page's listbox. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_power_save_led_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_sanim_power_save_on; + }, + LBUF + { + txt = qtn_sanim_power_save_off; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_power_saving_protected_settings_infonote +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_power_saving_protected_settings_infonote + { + buf = qtn_power_saving_protected_settings_infonote; + } + +//---------------------------------------------------- +// +// r_gs_operatorlogo_plugin_caption +// Operator logo Plugin caption. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_operatorlogo_plugin_caption + { + buf = qtn_set_oper_logo; + } + +//---------------------------------------------------- +// +// r_gs_operatorlogo_on_text +// Operator logo text for operator logo value on. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_operatorlogo_on_text + { + buf = qtn_set_oper_logo_on; + } + +//---------------------------------------------------- +// +// r_gs_operatorlogo_off_text +// Operator logo text for operator logo value off. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_operatorlogo_off_text + { + buf = qtn_set_oper_logo_off; + } + +//---------------------------------------------------- +// +// r_operator_logo_setting_page +// Operator Logo setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_operator_logo_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_set_oper_logo; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +//---------------------------------------------------- +// +// r_oplogo_on_off_setting_page_lbx +// Operator Logo on/off setting page items list box +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_oplogo_on_off_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_set_oper_logo_on; + }, + LBUF + { + txt = qtn_set_oper_logo_off; + } + }; + } + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/GSDisplayPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/GSDisplayPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification file. +* +*/ + + +#include // For RESOURCE_FILES_DIR +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gsdisplayplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10207440 +VENDORID VID_DEFAULT + +SOURCEPATH Src +SOURCE GSDisplayPluginImplementationTable.cpp +SOURCE GSDisplayPluginContainer.cpp +SOURCE GSDisplayPlugin.cpp +SOURCE GSDisplayPluginModel.cpp + +#ifdef FF_POWER_SAVE + SOURCE PSMDisplayPlugin.cpp + SOURCE GSDisplayPluginAO.cpp +#endif // FF_POWER_SAVE + +//User include paths +USERINCLUDE Inc +USERINCLUDE Data // For *.rh +USERINCLUDE loc +USERINCLUDE ../Data // For CommonResources.rss +USERINCLUDE ../Logger +USERINCLUDE ../Cenrep + +//System include paths +SYSTEMINCLUDE /epoc32/include/ecom +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH Data + +START RESOURCE 10207440.rss +TARGET gsdisplayplugin.rsc +END + +START RESOURCE GsDisplayPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY egul.lib +LIBRARY eikdlg.lib // eikon dialogs +LIBRARY hal.lib // contrast +LIBRARY ws32.lib + +LIBRARY commonengine.lib // For RConeResourceLoader +LIBRARY featmgr.lib // Feature manager +LIBRARY centralrepository.lib +LIBRARY aknskinsrv.lib // for enhanced skinning +LIBRARY aknskins.lib // for enhanced skinning + +LIBRARY aknnotify.lib // for CAknGlobalNote.h +LIBRARY hlplch.lib // for "Help" options menu +LIBRARY gsframework.lib // For base classes +LIBRARY backgroundimage.lib +LIBRARY gslistbox.lib // For CGSListBoxItemTextArray +LIBRARY mgfetch.lib // for image selection list +LIBRARY drmcommon.lib +LIBRARY aknswallpaperutils.lib +LIBRARY flogger.lib // For GSLogger +LIBRARY gsecomplugin.lib +LIBRARY imageconversion.lib +LIBRARY apparc.lib +LIBRARY cenrepnotifhandler.lib + +#ifdef FF_POWER_SAVE + LIBRARY psmclient.lib +#ifndef WINS + LIBRARY power_save_display_mode.lib +#endif // WINS + +#endif // FF_POWER_SAVE + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,335 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View for Display settings. +* +*/ + + +#ifndef GSDISPLAYPLUGIN_H +#define GSDISPLAYPLUGIN_H + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef FF_POWER_SAVE + #include +#endif // FF_POWER_SAVE + +// CONSTANTS +const TUid KGSDisplayPluginUid = { 0x10207441 }; +_LIT( KGSDefaultDisplayIconFileName, "Z:\\resource\\apps\\GSDisplayplugin.mbm"); +_LIT( KGSDisplayPluginIconFileName, "\\resource\\apps\\GSDisplayplugin.mif"); + +const TInt KGSOpLogoLbxIndexOn = 0; +const TInt KGSOpLogoLbxIndexOff = 1; +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD CLASS DECLARATION +class CAknViewAppUi; +class CAknWaitDialog; +class CAknRadioButtonSettingPage; +//class CAknQueryDialog; +class CGSDisplayPluginContainer; +class CGSDisplayPluginModel; + +#ifdef FF_POWER_SAVE + class CGSDisplayPluginAO; +#endif // FF_POWER_SAVE + +// CLASS DECLARATION +/** +* CGSDisplayPlugin view class +* +* Plugin implementation for Display settings +* @lib GSDisplayPlugin.lib +* @since Series 60_3.1 +*/ +class CGSDisplayPlugin : public CGSBaseView, + public MAknSettingPageObserver, + public MMGFetchVerifier, + public MGSAsyncImageHandlingObserver + { + public: + + enum TGSSettingIds + { + KGSContrastSettingId, + KGSBrightnessSettingId, + KGSSaverObjectSettingId, + KGSAutodisconSettingId, + KGSWelcomeNoteSettingId, + KGSAmbientLightSensorId + }; + + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return GS connection view. + */ + static CGSDisplayPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSDisplayPlugin(); + + public: // from base classes + + /** + * Returns view id. + * @return TUid + */ + TUid Id() const; + + /** + * Handles commands. + * @param aCommand Command to be handled. + * + */ + void HandleCommandL( TInt aCommand ); + + public: // From CGSPluginInterface + + /** + * @see CGSPluginInterface header file. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * @see CGSPluginInterface header file. + */ + TInt PluginProviderCategory() const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + public: // from MAknSettingPageObserver + + /** + * Handle setting page events + */ + virtual void HandleSettingPageEventL( CAknSettingPage* aSettingPage, + TAknSettingPageEvent aEventType ); + + public: //new + + /** + * Updates listbox's item's value. + * @param aItemId An item which is updated. + * + */ + void UpdateListBoxL( TInt aItemId ); + + /** + * Get CGSDisplayPlugin's ccontainer. + */ + CGSDisplayPluginContainer* Container(); + + + /** + * Updates display plugin view. + */ + void UpdateViewL(); + void CloseDialog(); + + protected: // From CAknView + + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + void DoDeactivate(); + + protected: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + protected: + + /** + * C++ default constructor. + */ + CGSDisplayPlugin(); + + /** + * Symbian OS default constructor. + * + */ + void ConstructL(); + + void HandleClientRectChange(); + + private: // from CGSBaseView + + void NewContainerL(); + void HandleListBoxSelectionL(); + + private: //from MMGFetchVerifier + + /** + * Display Backlight setting page + */ + TBool VerifySelectionL( const MDesCArray* aSelectedFiles ); + + private: //from MGSSyncImageHandlingObserver + /** + * Display Welcome note image list from media gallery + */ + void ImageHandlingCompleteL( TInt aError ); + + private: //new methods + + /** + * Display Constrast setting page + */ + void ShowContrastSettingPageL(); + + /** + * Display Brightness setting page + */ + void ShowBrightnessSettingPageL(); + + /** + * Display ALS setting page + */ + void ShowAmbientLightSensorSettingPageL(); + + /** + * Display Screen saver timeout setting page + */ + void ShowScreenSaverPeriodSettingPageL(); + + /** + * Display Backlight setting page + */ + void ShowBacklightSettingPageL(); + + /** + * Display Welcome note setting page + */ + void ShowWelcomeNoteSettingPageL(); + + /** + * Display Welcome note text input dialog + */ + void ShowWelcomeNoteTextQueryL(); + + /** + * Display Welcome note image list from media gallery + */ + void ShowWelcomeNoteImageListL(); + + + /** + * Show display text size setting page + */ + void ShowDisplayTextSizeSettingPageL(); + + + /** + * Display Power save LED setting page + * @param aSettingPage ETrue if setting page is to be shown + * EFalse, otherwise + */ + void ShowPowerSaveLedSettingPageL( TBool aSettingPage ); + + /** + * Display load wait-note dialog during image loading + */ + void ShowImageLoadWaitNoteL(); + + /** + * Hide load wait-note dialog after the image is loaded + */ + void HideImageLoadWaitNoteL(); + + /** + * Check if the input file is DRM protected + * @param aOriginalFileName Path of the bitmap file + * @return ETrue if file is DRM protected. + * EFalse otherwise. + */ + TBool CheckDRMProtectionL( const TDesC& aOriginalFileName ); + + /** + * Handle any errors during image processing + * @param aError system wide error code + */ + void HandleImageErrorsL( TInt aError ); + + /** + * Changes operator logo value. + * @param aUseSettingPage ETrue if setting page should be used. + * EFalse is just switch between the values. + */ + void ChangeOperatorLogoSettingL( TBool aUseSettingPage ); + + /** + * Displays operator logo setting page. + * @param aOperatorLogoValue current operator logo value. + */ + TBool ShowOperatorLogoSettingPageL( TInt& aOperatorLogoValue ); +#ifdef FF_POWER_SAVE + /** + * Displays blocking note. Used if PSM is on. + */ + void DisplayBlockNoteL(); +#endif // FF_POWER_SAVE + + protected: + //check if screen saver text is to be updated + TBool iUpdateSSText; + //check if welcome note is supported + TBool iUpdateWNote; + // for load wait dialog + CAknWaitDialog* iWaitDialog; + CAknRadioButtonSettingPage* iOprtLogoSettingPage; + + private: + // plugin model + CGSDisplayPluginModel *iModel; + // resource loader + RConeResourceLoader iResourceLoader; + //for image handling + CGSAsyncImageHandling* iImageHandler; + //welcome note type: none, text, image + TInt iWelcomeNoteType; + TBool iReshowOprtSetPage; +#ifdef FF_POWER_SAVE + // Active object for handling PSM realted CenRep events. + CGSDisplayPluginAO* iPsmActive; +#endif // FF_POWER_SAVE + // Prevent multiple launch the MFetch. + TBool iLaunchedImageFetch; + + }; + + + #endif // GSDISPLAYPLUGIN_H + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginAO.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginAO.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active object for handling PSM related CenRep changes. +* +*/ + + +#ifndef GSDISPLAYPLUGINAO_H +#define GSDISPLAYPLUGINAO_H + +// INCLUDES +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD CLASS DECLARATION + +// CLASS DECLARATION + +/** +* CGSDisplayPluginAO. Acts as a CenRep observer for PSM related state +* changes. +* +* @lib GSDisplayPlugin.lib +* @since Series 60_3.2 +*/ +class CGSDisplayPluginAO : public CActive + { + public: + + static CGSDisplayPluginAO* NewL(); + ~CGSDisplayPluginAO(); + + /** + * Set view which should be updated when PSM mode changes. + */ + void SetView( CGSDisplayPlugin* aDisplayView ); + + /** + * @return PSM mode. See TPsmsrvMode. + */ + TInt Mode(); + + protected: // From CActive + + void DoCancel(); + void RunL(); + TInt RunError( TInt aError ); + + private: + + CGSDisplayPluginAO(); + void ConstructL(); + + private: // Data + + CRepository* iPsmRepository; + TInt iPsmMode; + CGSDisplayPlugin* iDisplayView; + }; + + +#endif // GSDISPLAYPLUGINAO_H + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,167 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for the Display sub-folder +* +*/ + + +#ifndef GSDISPLAYPLUGINCONTAINER_H +#define GSDISPLAYPLUGINCONTAINER_H + +// INCLUDES +#include "GSDisplayPluginModel.h" + +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CGSListBoxItemTextArray; +class CGulIcon; + + +// CLASS DECLARATION + +/** +* GSDisplayPluginContainer container class +* +* container class for Device settings view +* @lib GSDisplayPlugin.lib +* @since Series 60_3.1 +*/ +class CGSDisplayPluginContainer : public CGSBaseContainer + { + public: // Constructors and destructor + + /** + * Symbian OS constructor. + * @param aRect Listbox's rect. + * + */ + void ConstructL( const TRect& aRect ); + + /** + * Destructor. + */ + ~CGSDisplayPluginContainer(); + + /** + * Constructor + */ + CGSDisplayPluginContainer(); + + public: //new + + /** + * Updates listbox's item's value. + * @since Series 60_3.1 + * @param aItemId An item which is updated. + */ + void UpdateListBoxL( TInt aFeatureId ); + + /** + * Retrieves the currently selected listbox feature id + * @since Series 60_3.1 + * @return feature id. + */ + TInt CurrentFeatureId() const; + + /** + * Converts the value from Model's Avkon to setting page item index + * @param aCurrentZoom value from TAknUiZoom in AknDef.hrh + */ + void MapZoomLevelToUi( TInt& aCurrentZoom ); + + /** + * Converts the value from setting page item index to Model's Avkon value + * @param aCurrentZoom value from TZoomLevel in CPP file for this header + */ + void MapZoomLevelFromUi ( TInt& aCurrentZoom ); + + /** + * Return its member variable iMode + * @param + */ + CGSDisplayPluginModel* Model(); + void CloseDialog(); + + protected: // from CGSBaseContainer + void ConstructListBoxL( TInt aResLbxId ); + + protected: // from CCoeControl + /** + * Handles skin changes to resources + * @since Series 60_3.1 + * @param aType type of the event to handle + */ + void HandleResourceChange( TInt aType ); + + private: // new + // create listbox from resource + void CreateListBoxItemsL(); + // create contrast item + void MakeContrastItemL(); + // create brightness item + void MakeBrightnessItemL(); + // create screen saver time-out item + void MakeSSPItemL(); + // create backlight timeout item + void MakeBacklightItemL(); + // create ALS item + void MakeAmbientLightSensorItemL(); + // create Display text size item + void MakeDisplayTextSizeItemL(); + // create welcome note item + void MakeWNIItemL(); + //PowerSave LED item + void MakePowerSaveLedItemL(); + //Operator logo item + void MakeOperatorLogoItemL(); + // create static bitmap for contrast and brightness + void CreateBitmapL( TInt aValue, TInt aResourceId, TInt aIndex ); + + private: // from CGSBaseContainer + /** + * Required for help. + */ + void GetHelpContext( TCoeHelpContext& aContext ) const; + + private: // Data + //display text size setting page items + CDesCArrayFlat* iDispTxtSizeItems; + //welcome note setting page items + CDesCArrayFlat* iWelcomeItems; + //power save led setting page items + CDesCArrayFlat* iLedItems; + //operator logo on/off + CDesCArrayFlat* iOperatorLogoItems; + //icons for contrast & brightness + CArrayPtr* iIconArray; + //listbox item array + CGSListBoxItemTextArray* iListboxItemArray; + // plugin model + CGSDisplayPluginModel* iModel; + + }; + +#endif //GSDISPLAYPLUGINCONTAINER_H + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginModel.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,358 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Display Settings model. +* +*/ + + +#ifndef GSDISPLAYPLUGINMODEL_H +#define GSDISPLAYPLUGINMODEL_H + +#include +#include +#include +#include +#include + +class CGSDisplayPluginContainer; + +// CONSTANTS +// maximum string sizes +const TInt KGSMaxImagePath = 256; // max lenght of image paths +const TInt KGSMaxWNText = 50; // max length of welcome note text +const TInt KGSMaxSSText = 15; // max lenght of screen saver text +const TInt KGSWelcomeNoteTypeValue = 0; +const TInt KGSScreenSaverObjectValue = 0; +const TInt KGSScreenSaverPeriodValue = 5; +const TInt KGSWNTextIndex = 1; +const TInt KGSWNImageIndex = 2; +const TInt KGSBgImageIndex = 1; +const TInt KGSSSTextObjectIndex = 0; + +//for switching values in SwitchValue() +const TInt KGSSettingOff = 0; +const TInt KGSSettingOn = 1; + +// Setting values for Background and Welcome note image +const TInt KGSUWNoteSupportedValue = 1; // default is show the item +const TInt KGSWelcomeNoteTypeImage = 2; + +_LIT( KGSWelcomeNoteImgPath, "c:\\private\\100058ec\\welcomeimage.mbm" ); + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CGSBackgroundImage; + +// CLASS DEFINITION +/** +* CGSDisplayPluginModel is the model class of GS display plugin. +* It provides functions to get and set setting values. +* @lib GSDisplayPlugin.lib +* @since Series 60_3.1 + +*/ +NONSHARABLE_CLASS( CGSDisplayPluginModel ): public CBase, + public MCenRepNotifyHandlerCallback + { + public: // Constructor and destructor + /** + * Two-phased constructor + * @param aInitBackgrooundApi Set to ETrue if CGSBackgroundImage is to + * be initialized. This is not to possible if model is created in + * a process without a Avkon UI. + */ + static CGSDisplayPluginModel* NewL( TBool aInitBackgroundApi ); + static CGSDisplayPluginModel* NewL(); + + /** + * Destructor + */ + ~CGSDisplayPluginModel(); + + public: // new ones + + /** + * Returns welcome note type. + * @return 0: default + * 1: text + * 2: image + */ + TInt WelcomeNoteTypeL(); + + /** + * Sets welcomenote type. + * @param aType Type of the welcome note. + */ + void SetWelcomeNoteTypeL( TInt aType ); + + /** + * Gets welcome note text from shared data. + * @param aNote Descriptor which will contain the welcome note text. + * Max length is KGSMaxWNText. + */ + void WelcomeNoteTextL( TDes& aNote ); + + /** + * Stores welcome note text to shared data. + * @param aNote Descriptor which contains the welcome note text. + * Max length is KGSMaxWNText. + */ + void SetWelcomeNoteTextL( const TDesC& aNote ); + + /** + * Returns the deviation from the calibrated contrast value. + * @return Deviation from the calibrated contrast value. + * Min value is -15 and max value is 15. + */ + TInt ContrastL(); + + /** + * Sets the deviation from the calibrated contrast value. + * @param aContrast Deviation from the calibrated contrast value. + * Min value is -15 and max value is 15. + */ + void SetContrastL( const TInt aContrast ); + + /** + * Return value tells what is screen saver object. + * @return 0: text + * 1: time and date + */ + TInt ScreenSaverObjectL(); + + /** + * Sets screen saver object. + * @param aObject screen saver object. + */ + void SetScreenSaverObjectL( const TInt aObject ); + + /** + * Gets screen saver text from shared data. + * @param aText Descriptor which will contain the screen saver text. + * Max length is KGSMaxSSText. + */ + void GetScreenSaverTextL( TDes& aText ); + + /** + * Stores screen saver text to shared data. + * @param aText Descriptor which contains the screen saver text. + * Max length is KGSMaxSSText. + */ + void SetScreenSaverTextL( const TDesC& aText ); + + /** + * Returns the period of time after which the screen saver starts + * if the keys are not pressed. + * @return Minutes between 1 and 30. + */ + TInt ScreenSaverAndKeyguardPeriodL(); + + /** + * Sets the period of time after which the screen saver starts + * if the keys are not pressed. + * @param aPeriod Screen saver period (minutes between 1 and 30). + */ + void SetScreenSaverAndKeyguardPeriodL( const TInt aPeriod ); + + /** + * Returns the period of time after which the backlight fades out + * if the keys are not pressed. + * @return Seconds between 5 and 60. + */ + TInt BacklightPeriodL(); + + /** + * Sets the period of time after which the backlights fades out + * if the keys are not pressed. + * @param aPeriod backlight period (seconds between 5 and 60). + */ + void SetBacklightPeriodL( const TInt aPeriod ); + + /** + * Checks whether the user welcome note is supported + * @return TInt + */ + TInt IsUWNoteSupportedL(); + + /** + * Returns the deviation from the calibrated brightness value. + * @return Deviation from the calibrated brightness value. + * Min value is 1 and max value is 31. + */ + TInt BrightnessL(); + + /** + * Sets the deviation from the calibrated brightness value. + * @param aBrightness Deviation from the calibrated brightness value. + * Min value is 1 and max value is 31. + */ + void SetBrightnessL( const TInt aBrightness ); + + /** + * Returns the deviation from the calibrated light sensor value. + * @return Deviation from the calibrated light sensor value. + * Min value is 1 and max value is 5. + */ + TInt AmbientLightSensorL(); + + /** + * Sets the deviation from the calibrated light sensor value. + * @param aSensorSensivity Deviation from the calibrated brightness value. + * Min value is 1 and max value is 5. + */ + void SetAmbientLightSensorL( const TInt aSensorSensitivity ); + + /** + * Returns the current display text size. + * @return One of the following values: + * Large + * Normal (default) + * Small + */ + TInt DisplayTextSizeL(); + + /** + * Set the new display text size. + * @param aSize. One of the following values: + * Large + * Normal (default) + * Small + */ + void SetDisplayTextSizeL( TInt aSize ); + + + /** + * Get the Power Save Led value + * @return: + * 0: Disabled + * 1: Enabled + */ + TInt PowerSaveLedL(); + + /** + * Set the Power Save Led value + * @param aPowerLedState + * 0: Disabled + * 1: Enabled + */ + void SetPowerSaveLedL( const TInt aPowerLedState ); + + /** + * Checks Power Save Led support + * @return: + * 0: Disabled + * 1: Enabled + */ + TInt CheckPowerSaveLedSupportL(); + + /** + * @return pointer to background image. Does not transfer ownership. + */ + CGSBackgroundImage* BackgroundImage(); + + /** + * Checks ScreenSaver timeout support + * @return: + * ETrue: ScreenSaver timeout setting is supported + * EFalse: ScreenSaver timeout setting is not supported + */ + TBool CheckScreenSaverTimeoutSupportL(); + + /** + * Checks if Operator Logo setting item is to be made visible. + * @return ETrue if setting item is to be shown. + * EFalse if setting item is not to be shown. + */ + TBool ShowOperatorLogoSettingL(); + + /** + * Gets operator logo state. + * @return KGSSettingOn if logo is used. + * KGSSettingOff if logo is not used. + */ + TInt OperatorLogoL(); + + /** + * @param + */ + void SetOperatorLogoL( TInt aOperatorLogo ); + + /** + * @param + */ + void SetOwner( CGSDisplayPluginContainer* aPlugin); + + private: // Private constructors + + /** + * Default C++ contructor + */ + CGSDisplayPluginModel(); + + /** + * Symbian OS default constructor + * @return void + */ + void ConstructL( TBool aInitBackgroundApi ); + + /** + * Initialize CenRep keys used in this class + */ + void InitializeCentralRepositoryL(); + + /** + * Un-initialize CenRep keys used in this class + */ + void UninitializeCentralRepository(); + + private: // new ones + + void SetBackLightValueL(); + TInt ScaleIntensityValues( TInt aValue, TBool aSample ); + TInt ScaleLightSensorValues( TInt aValue, TBool aDirection ); + + // From MCenRepNotifyHandlerCallback + void HandleNotifyInt( TUint32 aId, TInt aNewValue); + + private: + //Central repository objects + CRepository* iPersonalizationRepository; + CRepository* iStartupConfRepository; + CRepository* iScreensaverRepository; + CRepository* iLightRepository; + CRepository* iSecurityRepository; + CRepository* iGSVariationRepository; + CRepository* iAvkonRepository; + // Used for OperatorLogo + CCenRepNotifyHandler* iNotifyHandlerForOpLogo; + CCenRepNotifyHandler* iNotifyHandlerForOpLogoVisible; + CGSDisplayPluginContainer* iContainer; + + //P&S keys + RProperty* iCoreAppProperty; + + //local variated constants + TInt iLocalVariationValues; + + CGSBackgroundImage* iBackgroundApi; + }; + +#endif //GSDISPLAYPLUGINMODEL_H + +// End of File \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/Inc/GsDisplayPlugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/Inc/GsDisplayPlugin.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains common definitions for menu id:s +* +*/ + + +#ifndef GSDISPLAYPLUGIN_HRH +#define GSDISPLAYPLUGIN_HRH + +// commands +enum TGSDispMenuCommands + { + EGSCmdDispAppChange = 1, + EGSCmdWNSelect, + EGSCmdWNEdit, + EGSCmdShowWelcomeNoteSettingPage, + EGSCmdShowContrastSettingPage, + EGSCmdShowColorPaletteSettingPage, + EGSCmdShowScreenSaverObjectSettingPage, + EGSCmdShowScreenSaverPeridSettingPage, + EGSCmdShowLightSensorSettingPage, + EGSCmdShowBacklightSettingPage, + EGSCmdShowBrightnessSettingPage, + EGSCmdShowAmbientLightSensorSettingPage, + EGSCmdShowPowerSaveLedSettingPage, + EGSCmdShowOperatorLogoSettingPage + }; + +// device display +enum { + EGSSettIdContrast, + EGSSettIdBrightness, + EGSSettIdAmbientLightSensor, + EGSSettIdDisplayTextSize, + EGSSettIdSSP, + EGSSettIdSSO, + EGSSettIdWNI, + EGSSettIdBacklight, + EGSSettIdPowerSaveLed, + EGSSettIdOperatorLogo + }; + +// own notes +enum TOwnNotes { + EImageLoadWaitNote = 1 + }; + + +#endif // GSDISPLAYPLUGIN_HRH + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/Inc/PSMDisplayPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/Inc/PSMDisplayPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef PSMDISPLAYPLUGIN_H +#define PSMDISPLAYPLUGIN_H + +// INCLUDES +#include +#include + +#include +#include + +class MPsmSettingsProvider; +class MPsmPluginCallback; +class CGSDisplayPluginModel; +class CPowerSaveDisplayMode; + +/** +* PSMDisplay plugin stub +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +class CPSMDisplayPlugin : public CPsmPluginBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @return The created object. + */ + static CPSMDisplayPlugin* NewL( TPsmPluginCTorParams& initParams ); + + /** + * Destructor. + */ + virtual ~CPSMDisplayPlugin(); + + public: + + // From CPsmPluginBase + void NotifyModeChange( const TInt aMode ); + + private: + + CPSMDisplayPlugin( TPsmPluginCTorParams& aInitParams ); + void ConstructL(); + + /** + * Internal leaving function calleb from non-leaving NotifyModeChange. + */ + void DoModeChangeL( const TInt aMode ); + + private: // data + + CGSDisplayPluginModel *iModel; + + // For automatic brigthness control + CPowerSaveDisplayMode *iDisplayModel; + + }; + +#endif // PSMDISPLAYPLUGIN_H diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,1340 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View for Display sub-folder +* +*/ + + +// INCLUDE FILES +#include "GSDisplayPlugin.h" + +#ifdef FF_POWER_SAVE + #include "GSDisplayPluginAO.h" +#endif // FF_POWER_SAVE + +#include "GSDisplayPluginModel.h" +#include "GSDisplayPluginContainer.h" +#include "GsDisplayPlugin.hrh" +#include "GsLogger.h" + +#include +#include // For HlpLauncher +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // Image selection +#include +#include +#include +#include +#include +#include +#include // Icons + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS +const TInt KGSImageWelcomeNote = 2; +// MACROS + +// LOCAL CONSTANTS AND MACROS +//_LIT( KGSWelcomeNoteTextValue, "" ); +//_LIT( KGSScreenSaverTextValue, "" ); + +_LIT( KGSDisplayPluginResourceFileName, "z:GSDisplayPluginRsc.rsc" ); + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS ============================== + +// ========================= MEMBER FUNCTIONS ================================= + +// ---------------------------------------------------------------------------- +// CGSDisplayPlugin::CGSDisplayPlugin() +// +// Constructor +// ---------------------------------------------------------------------------- +// +CGSDisplayPlugin::CGSDisplayPlugin() + : iUpdateSSText( EFalse ), + iUpdateWNote( ETrue ), + iReshowOprtSetPage( EFalse ), + iResourceLoader( *iCoeEnv ) + { + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPlugin::NewL() +// +// Symbian OS default constructor +// ---------------------------------------------------------------------------- +CGSDisplayPlugin* CGSDisplayPlugin::NewL( TAny* /*aInitParams*/ ) + { + CGSDisplayPlugin* self = new( ELeave ) CGSDisplayPlugin(); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPlugin::ConstructL() +// +// Symbian OS two-phased constructor +// ---------------------------------------------------------------------------- +void CGSDisplayPlugin::ConstructL() + { + FeatureManager::InitializeLibL(); + + // Find the resource file + TParse parse; + parse.Set( KGSDisplayPluginResourceFileName, + &KDC_RESOURCE_FILES_DIR, NULL ); + TFileName fileName( parse.FullName() ); + + // Get language of resource file + BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName ); + + // Open resource file + iResourceLoader.OpenL( fileName ); + + BaseConstructL( R_GS_DISPL_VIEW ); + +#ifdef FF_POWER_SAVE + iPsmActive = CGSDisplayPluginAO::NewL(); + iPsmActive->SetView( this ); +#endif // FF_POWER_SAVE + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPlugin::~CGSDisplayPlugin +// +// Destructor +// ---------------------------------------------------------------------------- +CGSDisplayPlugin::~CGSDisplayPlugin() + { + CloseDialog(); + FeatureManager::UnInitializeLib(); + iResourceLoader.Close(); + +#ifdef FF_POWER_SAVE + delete iPsmActive; +#endif // FF_POWER_SAVE + + if ( iImageHandler ) + { + delete iImageHandler; + } + + if ( iModel ) + { + iModel = NULL; + } + } + + +// ---------------------------------------------------------------------------- +// TUid CGSDisplayPlugin::Id() +// +// Returns plug-in's ID. +// ---------------------------------------------------------------------------- +TUid CGSDisplayPlugin::Id() const + { + return KGSDisplayPluginUid; + } + +// ---------------------------------------------------------------------------- +// CGSDisplayPlugin::HandleCommandL +// +// Handles commands directed to this class. +// ---------------------------------------------------------------------------- +void CGSDisplayPlugin::HandleCommandL( TInt aCommand ) + { + switch ( aCommand ) + { + case EGSMSKCmdAppChange: + if ( EGSSettIdOperatorLogo == Container()->CurrentFeatureId() ) + { + ChangeOperatorLogoSettingL( EFalse ); + break; + } + case EGSCmdAppChange: + HandleListBoxSelectionL(); + break; + case EAknSoftkeyBack: + #ifdef RD_CONTROL_PANEL + iAppUi->ActivateLocalViewL( KGSGenPluginUid ); + #else //RD_CONTROL_PANEL + iAppUi->ActivateLocalViewL( KGSPrslnPluginUid ); + #endif //RD_CONTROL_PANEL + break; + case EGSCmdShowPowerSaveLedSettingPage: + ShowPowerSaveLedSettingPageL( ETrue ); + break; + case EAknCmdHelp: + { + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), iAppUi->AppHelpContextL() ); + } + break; + } + default: + iAppUi->HandleCommandL( aCommand ); + break; + } + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPlugin::UpdateListBoxL +// +// +// ---------------------------------------------------------------------------- +// +void CGSDisplayPlugin::UpdateListBoxL( TInt aItemId ) + { + if( Container() ) + { + Container()->UpdateListBoxL( aItemId ); + } + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPlugin::Container +// +// Return handle to container class. +// ---------------------------------------------------------------------------- +// +CGSDisplayPluginContainer* CGSDisplayPlugin::Container() + { + return static_cast( iContainer ); + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPlugin::NewContainerL() +// Creates new iContainer. +// +// ---------------------------------------------------------------------------- +// +void CGSDisplayPlugin::NewContainerL() + { + // container takes a CAknView pointer + iContainer = new( ELeave ) CGSDisplayPluginContainer( /* *this*/ ); + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPlugin::DoActivateL +// +// First method called by the Avkon framwork to invoke a view. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPlugin::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + iModel = Container()->Model(); + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPlugin::DoDeactivate +// +// Called by the Avkon view framework when closing. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPlugin::DoDeactivate() + { + CGSBaseView::DoDeactivate(); + } + +// ---------------------------------------------------------------------------- +// CGSDisplayPlugin::HandleListBoxSelectionL() +// +// Handles events raised through a rocker key +// ---------------------------------------------------------------------------- +void CGSDisplayPlugin::HandleListBoxSelectionL() + { + const TInt currentFeatureId = Container()->CurrentFeatureId(); + + switch ( currentFeatureId ) + { + case EGSSettIdContrast: + if( iModel->ContrastL() != KErrNotSupported ) + { +#ifdef FF_POWER_SAVE + if ( iPsmActive->Mode() == EPsmsrvModePowerSave ) + { + // If PSM is on, block setting: + DisplayBlockNoteL(); + } + else + { +#endif // FF_POWER_SAVE + ShowContrastSettingPageL(); +#ifdef FF_POWER_SAVE + } +#endif // FF_POWER_SAVE + } + + + break; + case EGSSettIdBrightness: + if( FeatureManager::FeatureSupported( KFeatureIdBrightnessControl) ) + { +#ifdef FF_POWER_SAVE + if ( iPsmActive->Mode() == EPsmsrvModePowerSave ) + { + // If PSM is on, block setting: + DisplayBlockNoteL(); + } + else + { +#endif // FF_POWER_SAVE + ShowBrightnessSettingPageL(); +#ifdef FF_POWER_SAVE + } +#endif // FF_POWER_SAVE + } + break; + case EGSSettIdSSP: +#ifdef FF_POWER_SAVE + if ( iPsmActive->Mode() == EPsmsrvModePowerSave ) + { + // If PSM is on, block setting: + DisplayBlockNoteL(); + } + else + { +#endif // FF_POWER_SAVE + ShowScreenSaverPeriodSettingPageL(); +#ifdef FF_POWER_SAVE + } +#endif // FF_POWER_SAVE + break; + case EGSSettIdBacklight: +#ifdef FF_POWER_SAVE + if ( iPsmActive->Mode() == EPsmsrvModePowerSave ) + { + // If PSM is on, block setting: + DisplayBlockNoteL(); + } + else + { +#endif // FF_POWER_SAVE + ShowBacklightSettingPageL ( ); +#ifdef FF_POWER_SAVE + } +#endif // FF_POWER_SAVE + break; + case EGSSettIdAmbientLightSensor: + { +#ifdef FF_POWER_SAVE + if ( iPsmActive->Mode() == EPsmsrvModePowerSave ) + { + // If PSM is on, block setting: + DisplayBlockNoteL(); + } + else + { +#endif // FF_POWER_SAVE + ShowAmbientLightSensorSettingPageL(); +#ifdef FF_POWER_SAVE + } +#endif // FF_POWER_SAVE + } + break; + case EGSSettIdWNI: + ShowWelcomeNoteSettingPageL(); + break; + case EGSSettIdDisplayTextSize: + if ( FeatureManager::FeatureSupported ( KFeatureIdUiZoom ) ) + { + ShowDisplayTextSizeSettingPageL(); + } + break; + case EGSSettIdPowerSaveLed: + { +#ifdef FF_POWER_SAVE + if ( iPsmActive->Mode() == EPsmsrvModePowerSave ) + { + // If PSM is on, block setting: + DisplayBlockNoteL(); + } + else + { +#endif // FF_POWER_SAVE + ShowPowerSaveLedSettingPageL( EFalse ); +#ifdef FF_POWER_SAVE + } +#endif // FF_POWER_SAVE + } + break; + case EGSSettIdOperatorLogo: + do + { + iReshowOprtSetPage = EFalse; + ChangeOperatorLogoSettingL( ETrue ); + } + while ( iReshowOprtSetPage ); + break; + default: + break; + } + } + +// ========================= From CGSPluginInterface ================== + +// ---------------------------------------------------------------------------- +// CGSDisplayPlugin::GetCaption +// +// Return application/view caption. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPlugin::GetCaptionL( TDes& aCaption ) const + { + // the resource file is already opened. + HBufC* result = StringLoader::LoadL( R_GS_DISPLAY_VIEW_CAPTION ); + + aCaption.Copy( *result ); + delete result; + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPlugin::PluginProviderCategory +// +// A means to identify the location of this plug-in in the framework. +// ---------------------------------------------------------------------------- +// +TInt CGSDisplayPlugin::PluginProviderCategory() const + { + //To identify internal plug-ins. + return KGSPluginProviderInternal; + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::ShowContrastSettingPageL() +// +// Display the contrast setting page. +// --------------------------------------------------------------------------- +// +void CGSDisplayPlugin::ShowContrastSettingPageL() + { + TInt currentValue; + TInt oldValue; + oldValue = iModel->ContrastL(); + + currentValue = oldValue; + + CAknSliderSettingPage* dlg = new( ELeave ) CAknSliderSettingPage( + R_CONTRAST_SETTING_PAGE, currentValue ); + + dlg->SetSettingId( KGSContrastSettingId ); + dlg->SetSettingPageObserver( this ); + + if ( !dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { +#ifdef FF_POWER_SAVE + if ( iPsmActive->Mode() != EPsmsrvModePowerSave ) + { +#endif //FF_POWER_SAVE + iModel->SetContrastL( oldValue ); +#ifdef FF_POWER_SAVE + } +#endif //FF_POWER_SAVE + } + UpdateListBoxL( EGSSettIdContrast ); + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::ShowBrightnessSettingPageL() +// +// Display the brightness setting page. +// --------------------------------------------------------------------------- +// +void CGSDisplayPlugin::ShowBrightnessSettingPageL() + { + TInt currentValue; + TInt oldValue = iModel->BrightnessL(); + + currentValue = oldValue; + + CAknSliderSettingPage* dlg = new( ELeave ) CAknSliderSettingPage( + R_BRIGHTNESS_SETTING_PAGE, currentValue ); + + dlg->SetSettingId( KGSBrightnessSettingId ); + dlg->SetSettingPageObserver( this ); + + if ( !dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged ) ) + { +#ifdef FF_POWER_SAVE + if ( iPsmActive->Mode() != EPsmsrvModePowerSave ) + { +#endif //FF_POWER_SAVE + iModel->SetBrightnessL( oldValue ); +#ifdef FF_POWER_SAVE + } +#endif //FF_POWER_SAVE + } + UpdateListBoxL( EGSSettIdBrightness ); + } + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::ShowAmbientLightSensorSettingPageL() +// +// Display the ambient light sensor setting page. +// --------------------------------------------------------------------------- +// +void CGSDisplayPlugin::ShowAmbientLightSensorSettingPageL() + { + TInt currentValue; + TInt oldValue = iModel->AmbientLightSensorL(); + + currentValue = oldValue; + + CAknSliderSettingPage* dlg = new( ELeave ) CAknSliderSettingPage( + R_AMBIENT_LIGHT_SENSOR_SETTING_PAGE, currentValue ); + + dlg->SetSettingId( KGSAmbientLightSensorId ); + dlg->SetSettingPageObserver( this ); + + if ( !dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { +#ifdef FF_POWER_SAVE + if ( iPsmActive->Mode() != EPsmsrvModePowerSave ) + { +#endif //FF_POWER_SAVE + iModel->SetAmbientLightSensorL( oldValue ); +#ifdef FF_POWER_SAVE + } +#endif //FF_POWER_SAVE + } + UpdateListBoxL( EGSSettIdAmbientLightSensor ); + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::ShowScreenSaverPeriodSettingPageL() +// +// Display the screen saver period (time out) setting page. +// --------------------------------------------------------------------------- +// +void CGSDisplayPlugin::ShowScreenSaverPeriodSettingPageL() + { + TInt sliderValue = iModel->ScreenSaverAndKeyguardPeriodL(); + + CAknSettingPage* dlg = new( ELeave ) CAknSliderSettingPage( + R_SCREEN_SAVER_PERIOD_SETTING_PAGE, sliderValue ); + + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { +#ifdef FF_POWER_SAVE + if ( iPsmActive->Mode() == EPsmsrvModePowerSave ) + { + DisplayBlockNoteL(); + } + else + { +#endif //FF_POWER_SAVE + iModel->SetScreenSaverAndKeyguardPeriodL( sliderValue ); +#ifdef FF_POWER_SAVE + } +#endif //FF_POWER_SAVE + UpdateListBoxL( EGSSettIdSSP ); + } + } + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::ShowBacklightSettingPageL() +// +// Display the backlight time-out setting page. +// --------------------------------------------------------------------------- +// +void CGSDisplayPlugin::ShowBacklightSettingPageL() + { + TInt sliderValue = iModel->BacklightPeriodL(); + + CAknSettingPage* dlg = new( ELeave ) CAknSliderSettingPage( + R_BACKLIGHT_PERIOD_SETTING_PAGE, sliderValue ); + + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { +#ifdef FF_POWER_SAVE + if ( iPsmActive->Mode() == EPsmsrvModePowerSave ) + { + DisplayBlockNoteL(); + } + else + { +#endif //FF_POWER_SAVE + iModel->SetBacklightPeriodL( sliderValue ); +#ifdef FF_POWER_SAVE + } +#endif //FF_POWER_SAVE + UpdateListBoxL( EGSSettIdBacklight ); + } + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::HandleSettingPageEventL +// +// Handle any setting page related events +// --------------------------------------------------------------------------- +// +void CGSDisplayPlugin::HandleSettingPageEventL( CAknSettingPage* aSettingPage, + TAknSettingPageEvent aEventType ) + { + TInt id = aSettingPage->SettingId(); + + if ( aEventType == EEventSettingChanged ) + { + switch ( id ) + { + case KGSContrastSettingId: + if( iModel->ContrastL() != KErrNotSupported ) + { +#ifdef FF_POWER_SAVE + if ( iPsmActive->Mode() == EPsmsrvModePowerSave ) + { + DisplayBlockNoteL(); + static_cast( aSettingPage )-> + SliderControl()->SetValueL( iModel->ContrastL() ); + } + else + { +#endif //FF_POWER_SAVE + iModel->SetContrastL( static_cast + ( aSettingPage )->SliderControl()->Value() ); +#ifdef FF_POWER_SAVE + } +#endif //FF_POWER_SAVE + } + break; + case KGSBrightnessSettingId: + if( FeatureManager::FeatureSupported( + KFeatureIdBrightnessControl) ) + { +#ifdef FF_POWER_SAVE + if ( iPsmActive->Mode() == EPsmsrvModePowerSave ) + { + DisplayBlockNoteL(); + static_cast( aSettingPage )-> + SliderControl()->SetValueL( iModel->BrightnessL() ); + } + else + { +#endif //FF_POWER_SAVE + iModel->SetBrightnessL( static_cast + ( aSettingPage )->SliderControl()->Value() ); +#ifdef FF_POWER_SAVE + } +#endif //FF_POWER_SAVE + } + break; + case KGSAmbientLightSensorId: +#ifdef FF_POWER_SAVE + if ( iPsmActive->Mode() == EPsmsrvModePowerSave ) + { + DisplayBlockNoteL(); + static_cast( aSettingPage )-> + SliderControl()->SetValueL( iModel->AmbientLightSensorL() ); + } + else + { +#endif //FF_POWER_SAVE + iModel->SetAmbientLightSensorL( static_cast + ( aSettingPage )->SliderControl()->Value() ); +#ifdef FF_POWER_SAVE + } +#endif //FF_POWER_SAVE + break; + default: + break; + } + } + + if ( aEventType == EEventSettingOked ) + { + TInt current; + + switch ( id ) + { + case KGSWelcomeNoteSettingId: + current = + static_cast ( aSettingPage )-> + ListBoxControl()->CurrentItemIndex(); + if ( current == KGSWNTextIndex ) + { + ShowWelcomeNoteTextQueryL(); + } + else if ( current == KGSWNImageIndex ) + { + aSettingPage->MakeVisible(EFalse); + ShowWelcomeNoteImageListL(); + } + break; + default: + break; + } + } + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::VerifySelectionL() +// +// An overloaded method from MMGFetchVerifier interface class +// --------------------------------------------------------------------------- +// +TBool CGSDisplayPlugin::VerifySelectionL( const MDesCArray* aSelectedFiles ) + { + const TBool KGSDrmProtectedContent = ETrue; + + TBool ret = ETrue; + // + if ( aSelectedFiles->MdcaCount() == 1 ) + { + const TPtrC fileName( aSelectedFiles->MdcaPoint( 0 ) ); + + // First, check if the selected file is DRM protected + if ( ret && CheckDRMProtectionL( fileName ) == + KGSDrmProtectedContent ) + { + // display the note to user + // Show information note + HBufC* prompt = iCoeEnv->AllocReadResourceLC( + R_GS_DRM_NOT_ALLOWED ); + + CAknInformationNote* note = + new( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *prompt ); + + CleanupStack::PopAndDestroy( prompt ); + ret = EFalse; + } + + // Next, check whether the image header is valid + if ( ret ) + { + CImageDecoder* imageDecoder = NULL; + TRAPD( err, imageDecoder = CImageDecoder::FileNewL( + iCoeEnv->FsSession(), fileName, ContentAccess::EPeek ) ); + + if ( err != KErrNone ) + { + // Show information note + HBufC* prompt = iCoeEnv->AllocReadResourceLC( + R_GS_IMAGE_CORRUPTED ); + CAknInformationNote* note = + new( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD(*prompt); + CleanupStack::PopAndDestroy( prompt ); + + ret = EFalse; + } + delete imageDecoder; + } + } + + return ret; + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::ShowWelcomeNoteSettingPageL() +// +// Display welcome note setting page +// --------------------------------------------------------------------------- +// +void CGSDisplayPlugin::ShowWelcomeNoteSettingPageL() + { + iUpdateWNote = ETrue; + + CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( + R_WELCOME_NOTE_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + + TInt currentItem = iModel->WelcomeNoteTypeL(); + iWelcomeNoteType = currentItem; + + CAknSettingPage* dlg = new( ELeave ) CAknRadioButtonSettingPage( + R_WELCOME_NOTE_SETTING_PAGE, + currentItem, items ); + + dlg->SetSettingId( KGSWelcomeNoteSettingId ); + dlg->SetSettingPageObserver(this); + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) + && iUpdateWNote && currentItem != KGSImageWelcomeNote + ) + { + iModel->SetWelcomeNoteTypeL( currentItem ); + UpdateListBoxL( EGSSettIdWNI ); + } + + CleanupStack::PopAndDestroy( items ); + } + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::ShowWelcomeNoteTextQueryL() +// +// Display welcome note text input dialog +// --------------------------------------------------------------------------- +// +void CGSDisplayPlugin::ShowWelcomeNoteTextQueryL() + { + TBuf note; + iModel->WelcomeNoteTextL( note ); + + CAknTextQueryDialog* dlg = new ( ELeave ) CAknTextQueryDialog( note ); + if( dlg->ExecuteLD( R_WELCOME_NOTE_TEXT_QUERY ) ) + { + iModel->SetWelcomeNoteTextL( note ); + iUpdateWNote = ETrue; + } + else + { + iUpdateWNote = EFalse; + } + } + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::ShowWelcomeNoteImageListL() +// +// Display welcome note image list from media gallery +// --------------------------------------------------------------------------- +// +void CGSDisplayPlugin::ShowWelcomeNoteImageListL() + { + // If the MGFetch already launched, return. + if ( iLaunchedImageFetch ) + { + return; + } + CDesCArray* selectedFiles = new ( ELeave ) CDesCArrayFlat( 1 ); + CleanupStack::PushL( selectedFiles ); + + iLaunchedImageFetch = ETrue; + TBool ret = MGFetch::RunL( *selectedFiles, EImageFile, EFalse, this ); + iLaunchedImageFetch = EFalse; + + if ( ret && selectedFiles->MdcaCount() == 1 ) + { + iImageHandler = CGSAsyncImageHandling::NewL( iCoeEnv->FsSession(), + this, KGSWelcomeNoteImgPath ); + + TPtrC imagePath = selectedFiles->MdcaPoint( 0 ); + + //attempting to create private directory + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + TInt ret = fs.CreatePrivatePath( 2 ); + CleanupStack::PopAndDestroy(); //fs + + TRAPD( error, + iModel->BackgroundImage()->SetWelcomeNoteImageL( imagePath, *iImageHandler ) + ); + + if ( error == KErrNone ) + { + // Show wait note + ShowImageLoadWaitNoteL(); + } + else + { + HandleImageErrorsL( error ); + } + } + else + { + iUpdateWNote = EFalse; + } + + CleanupStack::PopAndDestroy( selectedFiles ); + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::ShowDisplayTextSizeSettingPageL() +// +// Display display text size setting page +// --------------------------------------------------------------------------- +// +void CGSDisplayPlugin::ShowDisplayTextSizeSettingPageL() + { + CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( + R_DISPLAY_TEXT_SIZE_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + + TInt currentItem = iModel->DisplayTextSizeL(); + // get the UI index from container + Container()->MapZoomLevelToUi( currentItem ); + // store the current value for comparison + TInt oldItem = currentItem; + + CAknSettingPage* dlg = new( ELeave ) CAknRadioButtonSettingPage( + R_DISPLAY_TEXT_SIZE_SETTING_PAGE, + currentItem, items ); + + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { + if( currentItem != oldItem ) + { + // get the Avkon value from UI index + Container()->MapZoomLevelFromUi( currentItem ); + // set Avkon value to CenRep. As an additional check, confirm + // from feature manager that zooming is supported. + if ( FeatureManager::FeatureSupported ( KFeatureIdUiZoom ) ) + { + iModel->SetDisplayTextSizeL( currentItem ); + } + // now inform all open apps of the switch + // note that app needs software event capability to call this API + TWsEvent event; + event.SetType( KEikDynamicLayoutVariantSwitch ); + iEikonEnv->WsSession().SendEventToAllWindowGroups( event ); + } + + UpdateListBoxL( EGSSettIdDisplayTextSize ); + } + + CleanupStack::PopAndDestroy( items ); + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::ShowPowerSaveLedSettingPageL() +// +// Display the screen saver object setting page. +// --------------------------------------------------------------------------- +// +void CGSDisplayPlugin::ShowPowerSaveLedSettingPageL( TBool aSettingPage ) + { + + CDesCArrayFlat* items = + iCoeEnv->ReadDesC16ArrayResourceL( R_POWER_SAVE_LED_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + + TInt currentItem = iModel->PowerSaveLedL(); + + if( aSettingPage ) + { + CAknRadioButtonSettingPage* dlg = + new ( ELeave ) CAknRadioButtonSettingPage( + R_POWER_SAVE_LED_SETTING_PAGE, + currentItem, items ); + + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { + iModel->SetPowerSaveLedL( currentItem ); + UpdateListBoxL( EGSSettIdPowerSaveLed ); + } + } + else + { + iModel->SetPowerSaveLedL( !currentItem ); + UpdateListBoxL( EGSSettIdPowerSaveLed ); + } + CleanupStack::PopAndDestroy( items ); + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::ImageHandlingComplete() +// +// Method derived from MGSSyncImageHandlingObserver +// Run when the asynchronous image converting is complete +// --------------------------------------------------------------------------- +// +void CGSDisplayPlugin::ImageHandlingCompleteL( TInt aError ) + { + if ( aError != KErrNone ) + { + HandleImageErrorsL( aError ); + } + else + { + iModel->SetWelcomeNoteTypeL( KGSImageWelcomeNote ); + UpdateListBoxL( EGSSettIdWNI ); + } + HideImageLoadWaitNoteL(); + + if( iImageHandler ) + { + delete iImageHandler; + iImageHandler = NULL; + } + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::ShowImageLoadWaitNoteL() +// +// Display image load wait note dialog. +// --------------------------------------------------------------------------- +// +void CGSDisplayPlugin::ShowImageLoadWaitNoteL() + { + if ( !iWaitDialog ) + { + iWaitDialog = new( ELeave ) CAknWaitDialog( + ( REINTERPRET_CAST(CEikDialog**, + &iWaitDialog ) ), ETrue ); + + iWaitDialog->ExecuteDlgLD( CAknNoteDialog::ENoTone, + R_IMAGE_LOAD_WAIT_NOTE ); + } + } + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::HideImageLoadWaitNoteL() +// +// Hide image load wait note dialog. +// --------------------------------------------------------------------------- +// +void CGSDisplayPlugin::HideImageLoadWaitNoteL() + { + if ( iWaitDialog ) + { + iWaitDialog->ProcessFinishedL(); // deletes the dialog + iWaitDialog = NULL; + } + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::CheckDRMProtectionL +// +// Check if the selected image file is DRM protected. +// --------------------------------------------------------------------------- +// +TBool CGSDisplayPlugin::CheckDRMProtectionL( const TDesC& aOriginalFileName ) + { + TBool isProtected( EFalse ); + DRMCommon* drmClient = DRMCommon::NewL(); + CleanupStack::PushL( drmClient ); + TInt error = drmClient->Connect(); + if ( error != DRMCommon::EOk ) + { + User::Leave( KErrCorrupt ); + } + + if ( aOriginalFileName != KNullDesC ) + { + error = drmClient->IsProtectedFile( aOriginalFileName, isProtected ); + if ( error != DRMCommon::EOk ) + { + User::Leave( KErrCorrupt ); + } + } + + CleanupStack::PopAndDestroy( drmClient ); + return isProtected; + } + +// --------------------------------------------------------------------------- +// CGSDisplayPlugin::HandleImageErrorsL +// +// Prompt image related errors to the user +// --------------------------------------------------------------------------- +// +void CGSDisplayPlugin::HandleImageErrorsL( TInt aError ) + { + if ( aError ) + { + TInt resourceId; + switch( aError ) + { + case KErrNotSupported: + case KErrUnderflow: + // Image is corrupted or in wrong format + resourceId = R_GS_IMAGE_CORRUPTED; + break; + case KErrDiskFull: + case KErrNoMemory: + // Image is too large + resourceId = R_GS_IMAGE_TOO_LARGE; + break; + default: + // Better to give some error message than result in CONE5 panic: + resourceId = R_GS_IMAGE_CORRUPTED; + //User::LeaveIfError( aError ); + break; + } + + // Show information note + HBufC* prompt = iCoeEnv->AllocReadResourceLC( resourceId ); + CAknInformationNote* note = new( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *prompt ); + + // Restoring previous welcome note value + iModel->SetWelcomeNoteTypeL( iWelcomeNoteType ); + UpdateListBoxL( EGSSettIdWNI ); + CleanupStack::PopAndDestroy( prompt ); + } + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPlugin::DynInitMenuPaneL() +// +// Display the dynamic menu +// ---------------------------------------------------------------------------- +void CGSDisplayPlugin::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + // show or hide the 'help' menu item when supported + if( aResourceId == R_GS_MENU_ITEM_HELP ) + { + User::LeaveIfNull( aMenuPane ); + + if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// +// ---------------------------------------------------------------------------------- +// CGSDisplayPlugin::UpdateViewL() +// ---------------------------------------------------------------------------------- +// +void CGSDisplayPlugin::UpdateViewL() + { + // Check what view is active, update if needed. + // If displaying main view, update all PSM changed items. + TVwsViewId activeView; + CEikonEnv::Static()->EikAppUi()->GetActiveViewId( activeView ); +// if( activeView.iViewUid == Id() ) + { + __GSLOGSTRING( "[CGSDisplayPlugin] I am active!!!" ); + // Not too elegant - update only items that are affected by PSM + UpdateListBoxL( EGSSettIdContrast ); + UpdateListBoxL( EGSSettIdBrightness ); + UpdateListBoxL( EGSSettIdAmbientLightSensor ); +// UpdateListBoxL( EGSSettIdDisplayTextSize ); + UpdateListBoxL( EGSSettIdSSP ); +// UpdateListBoxL( EGSSettIdSSO ); +// UpdateListBoxL( EGSSettIdWNI ); + UpdateListBoxL( EGSSettIdBacklight ); +// UpdateListBoxL( EGSSettIdPowerSaveLed ); + UpdateListBoxL( EGSSettIdOperatorLogo ); + } + } + +#ifdef FF_POWER_SAVE +// ---------------------------------------------------------------------------------- +// CGSDisplayPlugin::DisplayBlockNoteL() +// ---------------------------------------------------------------------------------- +void CGSDisplayPlugin::DisplayBlockNoteL() + { + HBufC* prompt = iCoeEnv->AllocReadResourceLC( + R_GS_POWER_SAVING_PROTECTED_SETTINGS_INFONOTE ); + CAknInformationNote* note = new ( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *prompt ); + CleanupStack::PopAndDestroy( prompt ); + } +#endif // FF_POWER_SAVE + + +// ----------------------------------------------------------------------------- +// CGSDisplayPlugin::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CGSDisplayPlugin::CreateIconL( const TUid aIconType ) + { + //EMbm + CGulIcon* icon; + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropCpDevDisp, + KGSDefaultDisplayIconFileName, + EMbmGsdisplaypluginQgn_prop_cp_dev_disp, + EMbmGsdisplaypluginQgn_prop_cp_dev_disp_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + return icon; + } + + +// ----------------------------------------------------------------------------- +// CGSDisplayPlugin::ChangeOperatorLogoSettingL() +// +// +// ----------------------------------------------------------------------------- +// +void CGSDisplayPlugin::ChangeOperatorLogoSettingL( TBool aUseSettingPage ) + { + TInt currentValue = iModel->OperatorLogoL(); + TBool isValueUpdated = EFalse; + + if ( aUseSettingPage ) + { + isValueUpdated = ShowOperatorLogoSettingPageL( currentValue ); + } + else + { + if( currentValue == KGSSettingOff ) + { + currentValue = KGSSettingOn; + } + else + { + currentValue = KGSSettingOff; + } + isValueUpdated = ETrue; + } + // Value has been changed -> store it: + if ( isValueUpdated ) + { + iModel->SetOperatorLogoL( currentValue ); + + UpdateListBoxL( EGSSettIdOperatorLogo ); + } + } + + +// ----------------------------------------------------------------------------- +// CGSDisplayPlugin::ShowOperatorLogoSettingPageL() +// +// Note: Lbx index of each value is only internal to this function. The +// parameter given and modified is the actual operator logo value. +// ----------------------------------------------------------------------------- +// +TBool CGSDisplayPlugin::ShowOperatorLogoSettingPageL( + TInt& aOperatorLogoValue ) + { + TBool isValueUpdated = EFalse; + TInt previousValue = aOperatorLogoValue; + TInt selectedIndex; + + // Match aOperatorLogoValue value to lbx item index: + switch( aOperatorLogoValue ) + { + case KGSSettingOn: + selectedIndex = KGSOpLogoLbxIndexOn; + break; + case KGSSettingOff: + selectedIndex = KGSOpLogoLbxIndexOff; + break; + } + + CDesCArrayFlat* items = + iCoeEnv->ReadDesC16ArrayResourceL( R_OPLOGO_ON_OFF_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + + if ( !iOprtLogoSettingPage ) + { + iOprtLogoSettingPage = new (ELeave) CAknRadioButtonSettingPage( + R_OPERATOR_LOGO_SETTING_PAGE, + selectedIndex, + items ); + } + + TBool ret = iOprtLogoSettingPage->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); + iOprtLogoSettingPage = NULL; + CleanupStack::PopAndDestroy( items ); + + // Match selected lbx item index to aOperatorLogoValue: + switch( selectedIndex ) + { + case KGSOpLogoLbxIndexOn: + aOperatorLogoValue = KGSSettingOn; + break; + case KGSOpLogoLbxIndexOff: + aOperatorLogoValue = KGSSettingOff; + break; + } + + if( aOperatorLogoValue != previousValue ) + { + isValueUpdated = ETrue; + } + return isValueUpdated; + } + +// ----------------------------------------------------------------------------- +// CGSDisplayPlugin::CloseDialog +// +// +// ----------------------------------------------------------------------------- +// +void CGSDisplayPlugin::CloseDialog() + { + //Send ESC key sequence to setting dialog, so that it closes itself. + if ( iOprtLogoSettingPage ) + { + iReshowOprtSetPage = ETrue; + TKeyEvent event; + event.iCode = EKeyEscape; + event.iScanCode = EStdKeyEscape; + event.iRepeats = 0; + TRAP_IGNORE( iCoeEnv->SimulateKeyEventL( event, EEventKeyDown ); + iCoeEnv->SimulateKeyEventL( event, EEventKey ); + iCoeEnv->SimulateKeyEventL( event, EEventKeyUp ); ); + } + } +// End of File + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginAO.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginAO.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// INCLUDE FILES +#include "GSDisplayPlugin.h" +#include "GSDisplayPluginAO.h" +#include "GsLogger.h" +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// ---------------------------------------------------------------------------------- +// CGSDisplayPluginAO::CGSDisplayPluginAO +// ---------------------------------------------------------------------------------- +CGSDisplayPluginAO::CGSDisplayPluginAO() : CActive( EPriorityStandard ) + { + + } + + +// ---------------------------------------------------------------------------------- +// CGSDisplayPluginAO::~CGSDisplayPluginAO +// ---------------------------------------------------------------------------------- +CGSDisplayPluginAO::~CGSDisplayPluginAO() + { + Cancel(); + delete iPsmRepository; + } + + +// ---------------------------------------------------------------------------------- +// CGSDisplayPluginAO::DoCancel +// ---------------------------------------------------------------------------------- +void CGSDisplayPluginAO::DoCancel() + { + iPsmRepository->NotifyCancel( KPsmCurrentMode ); + } + +// ---------------------------------------------------------------------------------- +// CGSDisplayPluginAO::RunL +// ---------------------------------------------------------------------------------- +void CGSDisplayPluginAO::RunL() + { + // Request complete, notify request again and get new value + iPsmRepository->Get( KPsmCurrentMode, iPsmMode ); + iPsmRepository->NotifyRequest( KPsmCurrentMode, iStatus ); + SetActive(); + __GSLOGSTRING1( "[CGSDisplayPluginAO::RunL] iPsmMode:%d", iPsmMode ); + + // Update display view when PSM mode has changed + iDisplayView->UpdateViewL(); + } + +// ---------------------------------------------------------------------------------- +// CGSDisplayPluginAO::RunError +// ---------------------------------------------------------------------------------- +TInt CGSDisplayPluginAO::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + + +// ---------------------------------------------------------------------------------- +// CGSDisplayPluginAO::NewL +// ---------------------------------------------------------------------------------- +CGSDisplayPluginAO* CGSDisplayPluginAO::NewL() + { + CGSDisplayPluginAO* self = new( ELeave ) CGSDisplayPluginAO(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------------- +// CGSDisplayPluginAO::ConstructL +// ---------------------------------------------------------------------------------- +void CGSDisplayPluginAO::ConstructL() + { + CActiveScheduler::Add ( this ); + iPsmRepository = CRepository::NewL( KCRUidPowerSaveMode ); + // Read from CenRep so iPsmMode gets correct init value + iPsmRepository->Get( KPsmCurrentMode, iPsmMode ); + iPsmRepository->NotifyRequest( KPsmCurrentMode, iStatus ); + SetActive(); + } + + +// ---------------------------------------------------------------------------------- +// CGSDisplayPluginAO::SetView +// ---------------------------------------------------------------------------------- +void CGSDisplayPluginAO::SetView( CGSDisplayPlugin* aDisplayView ) + { + iDisplayView = aDisplayView; + } + + +// ---------------------------------------------------------------------------------- +// CGSDisplayPluginAO::Mode +// ---------------------------------------------------------------------------------- +TInt CGSDisplayPluginAO::Mode() + { + return iPsmMode; + } + + +// End of File + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,701 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for the Display sub-folder +* +*/ + + + +// INCLUDE FILES +#include "GSDisplayPluginContainer.h" +#include "GSDisplayPluginModel.h" +#include "GsDisplayPlugin.hrh" +#include "GSDisplayPlugin.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // for KUidGS +#include +#include +#include //for determining skin change +#include +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS +const TInt KGSBufSize128 = 128; +const TInt KGSNumberOfIcons = 3; +const TInt KGSContrastIndex = 0; +const TInt KGSBrightnessIndex = 1; +const TInt KGSAmbientLightSensorIndex = 2; +const TInt KGSSliderIndexMin = 0; +const TInt KGSBrightnessMax = 31; +const TInt KGSALSMax = 5; + +// MODULE DATA STRUCTURES +// current ordering is based on the resource structure. +enum TZoomLevel + { + EZoomLargeInUi, + EZoomNormalInUi, + EZoomSmallInUi + }; + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS ============================== + +// ========================== MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::ConstructL(const TRect& aRect) +// Symbian OS two phased constructor +// +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::ConstructL( const TRect& aRect ) + { + iListBox = new ( ELeave ) CAknSettingStyleListBox; + iModel = CGSDisplayPluginModel::NewL(); + iModel->SetOwner( this ); + + BaseConstructL( aRect, R_GS_DISPLAY_VIEW_TITLE, R_DISPL_LBX ); + } + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::~CGSDisplayPluginContainer() +// +// Destructor +// --------------------------------------------------------------------------- +// +CGSDisplayPluginContainer::~CGSDisplayPluginContainer() + { + if ( FeatureManager::FeatureSupported ( KFeatureIdUiZoom ) ) + { + delete iDispTxtSizeItems; + } + + if ( iWelcomeItems ) + { + delete iWelcomeItems; + } + + if ( iLedItems ) + { + delete iLedItems; + } + + if ( iOperatorLogoItems) + { + delete iOperatorLogoItems; + iOperatorLogoItems = NULL; + } + + if ( iModel ) + { + delete iModel; + iModel = NULL; + } + + if ( iListboxItemArray ) + { + delete iListboxItemArray; + } + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::CGSDisplayPluginContainer() +// +// Constructor +// --------------------------------------------------------------------------- +// +CGSDisplayPluginContainer::CGSDisplayPluginContainer() + { + } + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::ConstructListBoxL() +// Destructor +// +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::ConstructListBoxL( TInt aResLbxId ) + { + iListBox->ConstructL( this, EAknListBoxSelectionList ); + iListboxItemArray = + CGSListBoxItemTextArray::NewL( aResLbxId, *iListBox, *iCoeEnv ); + iListBox->Model()->SetItemTextArray( iListboxItemArray ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + + if ( FeatureManager::FeatureSupported ( KFeatureIdUiZoom ) ) + { + iDispTxtSizeItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_DISPLAY_TEXT_SIZE_SETTING_PAGE_LBX ); + } + + iWelcomeItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_WELCOME_NOTE_SETTING_PAGE_LBX ); + iLedItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_POWER_SAVE_LED_SETTING_PAGE_LBX ); + iOperatorLogoItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_OPLOGO_ON_OFF_SETTING_PAGE_LBX ); + + + CArrayPtr* icons = + new( ELeave ) CAknIconArray( KGSNumberOfIcons ); + CleanupStack::PushL( icons ); + + CGulIcon* icon = CGulIcon::NewL(); + CleanupStack::PushL( icon ); + + CGulIcon* icon2 = CGulIcon::NewL(); + CleanupStack::PushL( icon2 ); + + CGulIcon* icon3 = CGulIcon::NewL(); + CleanupStack::PushL( icon3 ); + + icons->AppendL( icon ); + icons->AppendL( icon2 ); + icons->AppendL( icon3 ); + + CEikFormattedCellListBox* listbox = + static_cast( iListBox ); + listbox->ItemDrawer()->FormattedCellData()->SetIconArray( icons ); + CleanupStack::Pop( 4, icons ); // icons, icon & icon2 & icon3 + iIconArray = listbox->ItemDrawer()->FormattedCellData()->IconArray(); + + CreateListBoxItemsL(); + } + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::CreateListBoxItemsL() +// +// +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::CreateListBoxItemsL() + { + if( iModel->ContrastL() != KErrNotSupported ) + { + MakeContrastItemL(); + } + + TInt pslnStatus = iModel->BackgroundImage()->GetPlnsStatus(); + + if ( FeatureManager::FeatureSupported( KFeatureIdBrightnessControl) ) + { + MakeBrightnessItemL(); + } + + if( iModel->CheckScreenSaverTimeoutSupportL() ) + { + MakeSSPItemL(); + } + + MakeBacklightItemL(); + + if ( FeatureManager::FeatureSupported( KFeatureIdAmbientLightSensor ) ) + { + MakeAmbientLightSensorItemL(); + } + + if( iModel->IsUWNoteSupportedL() ) + { + MakeWNIItemL(); + } + + if ( FeatureManager::FeatureSupported ( KFeatureIdUiZoom ) ) + { + MakeDisplayTextSizeItemL(); + } + + if ( iModel->CheckPowerSaveLedSupportL() ) + { + MakePowerSaveLedItemL(); + } + + if ( iModel->ShowOperatorLogoSettingL() ) + { + // Make item to show operator logo + MakeOperatorLogoItemL(); + } + } + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::UpdateListBoxL(TInt aItemId) +// +// +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::UpdateListBoxL( TInt aFeatureId ) + { + switch ( aFeatureId ) + { + case EGSSettIdContrast: + if( iModel->ContrastL() != KErrNotSupported ) + { + MakeContrastItemL(); + } + break; + case EGSSettIdBrightness: + if ( FeatureManager::FeatureSupported( + KFeatureIdBrightnessControl ) ) + { + MakeBrightnessItemL(); + } + break; + case EGSSettIdSSP: + if( iModel->CheckScreenSaverTimeoutSupportL() ) + { + MakeSSPItemL(); + } + break; + case EGSSettIdBacklight: + MakeBacklightItemL(); + break; + case EGSSettIdAmbientLightSensor: + if ( FeatureManager::FeatureSupported( + KFeatureIdAmbientLightSensor ) ) + { + MakeAmbientLightSensorItemL(); + } + break; + case EGSSettIdWNI: + if( iModel->IsUWNoteSupportedL() ) + { + MakeWNIItemL(); + } + break; + case EGSSettIdDisplayTextSize: + if ( FeatureManager::FeatureSupported ( KFeatureIdUiZoom ) ) + { + MakeDisplayTextSizeItemL(); + } + break; + case EGSSettIdPowerSaveLed: + if ( iModel->CheckPowerSaveLedSupportL() ) + { + MakePowerSaveLedItemL(); + } + break; + case EGSSettIdOperatorLogo: + if ( iModel->ShowOperatorLogoSettingL() ) + { + // Update operator logo settings + MakeOperatorLogoItemL(); + } + default: + break; + } + + iListBox->HandleItemAdditionL(); + } + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::MakeContrastItemL() +// +// +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::MakeContrastItemL() + { + TInt currentPos = iModel->ContrastL(); + + CreateBitmapL( currentPos, R_CONTRAST_SLIDER, KGSContrastIndex ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSSettIdContrast, + CGSListBoxItemTextArray::EVisible ); + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::MakeBrightnessItemL() +// +// +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::MakeBrightnessItemL() + { + TInt currentPos = iModel->BrightnessL(); + + if ( currentPos > KGSSliderIndexMin && + currentPos <= KGSBrightnessMax ) + { + CreateBitmapL( currentPos, R_BRIGHTNESS_SLIDER, KGSBrightnessIndex ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSSettIdBrightness, + CGSListBoxItemTextArray::EVisible ); + } + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::MakeAmbientLightSensorItemL() +// +// +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::MakeAmbientLightSensorItemL() + { + TInt currentPos = iModel->AmbientLightSensorL(); + + if ( currentPos > KGSSliderIndexMin && + currentPos <= KGSALSMax ) + { + CreateBitmapL( currentPos, R_AMBIENT_LIGHT_SENSOR_SLIDER, + KGSAmbientLightSensorIndex ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSSettIdAmbientLightSensor, + CGSListBoxItemTextArray::EVisible ); + + } + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::MakeSSPItemL() +// +// +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::MakeSSPItemL() + { + TInt timeOut = iModel->ScreenSaverAndKeyguardPeriodL(); + HBufC* dynamicText = CAknSlider::CreateValueTextInHBufCL( timeOut, + R_SETTING_SCREEN_SAVER_SLIDER ); + + // for A&H number conversion + TPtr bufPtr = dynamicText->Des(); + if( AknTextUtils::DigitModeQuery( AknTextUtils::EDigitModeShownToUser ) ) + { + AknTextUtils::LanguageSpecificNumberConversion( bufPtr ); + } + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSSettIdSSP, dynamicText->Des() ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSSettIdSSP, + CGSListBoxItemTextArray::EVisible ); + + delete dynamicText; + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::MakeBackLightItemL() +// +// Backlight timeout item +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::MakeBacklightItemL() + { + TInt timeOut = iModel->BacklightPeriodL(); + HBufC* dynamicText = CAknSlider::CreateValueTextInHBufCL( timeOut, + R_SETTING_BACKLIGHT_SLIDER ); + + // for A&H number conversion + TPtr bufPtr = dynamicText->Des(); + if( AknTextUtils::DigitModeQuery( AknTextUtils::EDigitModeShownToUser ) ) + { + AknTextUtils::LanguageSpecificNumberConversion( bufPtr ); + } + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSSettIdBacklight, + dynamicText->Des() ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSSettIdBacklight, + CGSListBoxItemTextArray::EVisible ); + + delete dynamicText; + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::MakeDisplayTextSizeItemL() +// +// Display text size item +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::MakeDisplayTextSizeItemL() + { + HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 ); + TPtr ptrBuffer ( dynamicText->Des() ); + + TInt textSize = iModel->DisplayTextSizeL(); + // value is changed through the below method + MapZoomLevelToUi( textSize ); + + ptrBuffer = ( *iDispTxtSizeItems )[ textSize ]; + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSSettIdDisplayTextSize, ptrBuffer ); + CleanupStack::PopAndDestroy( dynamicText ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSSettIdDisplayTextSize, + CGSListBoxItemTextArray::EVisible ); + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::MakeWNIItemL() +// +// Welcome note item +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::MakeWNIItemL() + { + HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 ); + TPtr ptrBuffer ( dynamicText->Des() ); + + const TInt welcomeNoteTypeIndex = iModel->WelcomeNoteTypeL(); + ptrBuffer = ( *iWelcomeItems )[ welcomeNoteTypeIndex ]; + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSSettIdWNI, ptrBuffer ); + CleanupStack::PopAndDestroy( dynamicText ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSSettIdWNI, + CGSListBoxItemTextArray::EVisible ); + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::MakePowerSaveLedItemL() +// +// +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::MakePowerSaveLedItemL() + { + + HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 ); + TPtr ptrBuffer ( dynamicText->Des() ); + + TInt objectSel = iModel->PowerSaveLedL(); + ptrBuffer = ( *iLedItems )[ objectSel ]; + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSSettIdPowerSaveLed, ptrBuffer ); + CleanupStack::PopAndDestroy( dynamicText ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSSettIdPowerSaveLed, + CGSListBoxItemTextArray::EVisible ); + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::MakeOperatorLogoItemL() +// +// +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::MakeOperatorLogoItemL() + { + HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 ); + TPtr ptrBuffer ( dynamicText->Des() ); + + TInt selectedItem = iModel->OperatorLogoL(); + ptrBuffer = ( *iOperatorLogoItems )[ 1 - selectedItem ]; + + iListboxItemArray->SetDynamicTextL( EGSSettIdOperatorLogo, ptrBuffer ); + CleanupStack::PopAndDestroy( dynamicText ); + + iListboxItemArray->SetItemVisibilityL( EGSSettIdOperatorLogo, + CGSListBoxItemTextArray::EVisible ); + } + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::CreateBitmapL() +// +// +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::CreateBitmapL( TInt aValue, TInt aResourceId, + TInt aIndex ) + { + CGulIcon* icon = + CAknSlider::CreateSetStyleListBoxIconL( aValue, aResourceId ); + + if( icon ) + { + delete iIconArray->At( aIndex ); + iIconArray->At( aIndex ) = icon; + } + } + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::CurrentFeatureId() +// +// --------------------------------------------------------------------------- +// +TInt CGSDisplayPluginContainer::CurrentFeatureId( ) const + { + return iListboxItemArray->CurrentFeature( ); + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::GetHelpContext() const +// Gets Help +// +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::GetHelpContext( TCoeHelpContext& aContext ) const + { + aContext.iMajor = KUidGS; + aContext.iContext = KCP_HLP_DISPLAY; + } + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::HandleResourceChange() +// +// Handling changing of the skin +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::HandleResourceChange( TInt aType ) + { + CCoeControl::HandleResourceChange( aType ); + if ( aType == KAknsMessageSkinChange || + aType == KEikDynamicLayoutVariantSwitch ) + { + TRAP_IGNORE + ( + if( iModel->ContrastL() != KErrNotSupported ) + { + MakeContrastItemL(); + } + ); + + if ( FeatureManager::FeatureSupported( KFeatureIdBrightnessControl) ) + { + TRAP_IGNORE( MakeBrightnessItemL() ); + } + + if ( FeatureManager::FeatureSupported( KFeatureIdAmbientLightSensor ) ) + { + TRAP_IGNORE( MakeAmbientLightSensorItemL() ); + } + } + if ( aType == KEikDynamicLayoutVariantSwitch ) + { + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + mainPaneRect); + SetRect( mainPaneRect ); + } + } + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::MapZoomLevelToUi() +// +// Converts the value from Model's Avkon to setting page item index +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::MapZoomLevelToUi( TInt& aCurrentZoom ) + { + TInt textSize = EZoomNormalInUi; + + switch( aCurrentZoom ) + { + case EAknUiZoomSmall: + textSize = EZoomSmallInUi; + break; + case EAknUiZoomLarge: + textSize = EZoomLargeInUi; + break; + case EAknUiZoomNormal: + default: + textSize = EZoomNormalInUi; + break; + } + + aCurrentZoom = textSize; + } + + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::MapZoomLevelFromUi() +// +// Converts the value from setting page item index to Model's Avkon value +// --------------------------------------------------------------------------- +// +void CGSDisplayPluginContainer::MapZoomLevelFromUi ( TInt& aCurrentZoom ) + { + TInt textSize = 0; + + switch( aCurrentZoom ) + { + case EZoomSmallInUi: + textSize = EAknUiZoomSmall; + break; + case EZoomLargeInUi: + textSize = EAknUiZoomLarge; + break; + case EZoomNormalInUi: + default: + textSize = EAknUiZoomNormal; + break; + } + + aCurrentZoom = textSize; + } + +// --------------------------------------------------------------------------- +// CGSDisplayPluginContainer::Model() +// +// Return its member variable iModel. +// --------------------------------------------------------------------------- +// +CGSDisplayPluginModel* CGSDisplayPluginContainer::Model() + { + return iModel; + } + +void CGSDisplayPluginContainer::CloseDialog() + { + CAknViewAppUi* appUi = static_cast( CCoeEnv::Static()->AppUi() ); + CGSDisplayPlugin* view = static_cast( appUi->View(KGSDisplayPluginUid) ); + view->CloseDialog(); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for GSDisplayPlugin +* +*/ + + +// INCLUDES +#include "GSDisplayPlugin.h" + +#ifdef FF_POWER_SAVE + #include "PSMDisplayPlugin.h" +#endif // FF_POWER_SAVE + +#include +#include + + +// CONSTANTS +const TImplementationProxy KGSDisplayPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x10207441, CGSDisplayPlugin::NewL ) +#ifdef FF_POWER_SAVE + , + IMPLEMENTATION_PROXY_ENTRY( 0x2000B592, CPSMDisplayPlugin::NewL ) +#endif // FF_POWER_SAVE + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// +// Gate/factory function +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSDisplayPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSDisplayPluginImplementationTable; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginModel.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,802 @@ +/* +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Display Settings model implementation. +* +*/ + + +// INCLUDE FILES +#include "GSDisplayPluginModel.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include // for zooming +#include +#include "GsLogger.h" +#include "SettingsPrivateCRKeys.h" + +// Used for OperatorLogo +#include +#include +#include "GSDisplayPluginContainer.h" +#include "GsDisplayPlugin.hrh" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS ============================== + +// ========================= MEMBER FUNCTIONS ================================= + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::NewL +// +// Symbian OS two-phased constructor +// ---------------------------------------------------------------------------- +// +CGSDisplayPluginModel* CGSDisplayPluginModel::NewL() + { + return CGSDisplayPluginModel::NewL( ETrue ); + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::NewL +// +// Symbian OS two-phased constructor +// ---------------------------------------------------------------------------- +// +CGSDisplayPluginModel* CGSDisplayPluginModel::NewL( TBool aInitBackgroundApi ) + { + CGSDisplayPluginModel* self = new( ELeave ) CGSDisplayPluginModel; + CleanupStack::PushL( self ); + self->ConstructL( aInitBackgroundApi ); + + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::CGSDisplayPluginModel +// +// +// C++ default constructor can NOT contain any code, that might leave. +// ---------------------------------------------------------------------------- +// +CGSDisplayPluginModel::CGSDisplayPluginModel() + { + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::ConstructL +// +// EPOC default constructor can leave. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::ConstructL( TBool aInitBackgroundApi ) + { + //__GSENGINELOGSTRING("CGSDisplayPluginModel::ConstructL begin"); + FeatureManager::InitializeLibL(); + + InitializeCentralRepositoryL(); + + //Background image DLL initializing + if( aInitBackgroundApi ) iBackgroundApi = CGSBackgroundImage::NewL(); + + User::LeaveIfError( iGSVariationRepository->Get( + KSettingsVariationFlags, iLocalVariationValues ) ); + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::~CGSDisplayPluginModel +// +// Destructor +// ---------------------------------------------------------------------------- +// +CGSDisplayPluginModel::~CGSDisplayPluginModel() + { + UninitializeCentralRepository(); + FeatureManager::UnInitializeLib(); + if( iBackgroundApi ) delete iBackgroundApi; + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::InitializeCentralRepositoryL +// +// Creating and setting keys for the Central Repository +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::InitializeCentralRepositoryL() + { + iStartupConfRepository = CRepository::NewL( KCRUidStartupConf ); + iScreensaverRepository = CRepository::NewL( KCRUidScreenSaver ); + iPersonalizationRepository = + CRepository::NewL( KCRUidPersonalizationSettings ); + iLightRepository = CRepository::NewL( KCRUidLightSettings ); + iSecurityRepository = CRepository::NewL( KCRUidSecuritySettings ); + iGSVariationRepository = CRepository::NewL( KCRUidSettingsVariation ); + iAvkonRepository = CRepository::NewL( KCRUidAvkon ); + + // start listening to CenRep key changes for Operator Logo on/off + iNotifyHandlerForOpLogo = CCenRepNotifyHandler::NewL( *this, + *iPersonalizationRepository, + CCenRepNotifyHandler::EIntKey, + KSettingsDisplayOperatorLogo ); + iNotifyHandlerForOpLogo->StartListeningL(); + iNotifyHandlerForOpLogoVisible = CCenRepNotifyHandler::NewL( *this, + *iPersonalizationRepository, + CCenRepNotifyHandler::EIntKey, + KSettingsShowOperatorLogoSetting ); + iNotifyHandlerForOpLogoVisible->StartListeningL(); + } + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::UninitializeCentralRepositoryL +// +// Removes Central Repository objects +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::UninitializeCentralRepository() + { + if ( iStartupConfRepository ) + { + delete iStartupConfRepository; + iStartupConfRepository = NULL; + } + if ( iScreensaverRepository ) + { + delete iScreensaverRepository; + iScreensaverRepository = NULL; + } + if ( iNotifyHandlerForOpLogo ) + { + iNotifyHandlerForOpLogo->StopListening(); + delete iNotifyHandlerForOpLogo; + } + if ( iNotifyHandlerForOpLogoVisible ) + { + iNotifyHandlerForOpLogoVisible->StopListening(); + delete iNotifyHandlerForOpLogoVisible; + } + if ( iPersonalizationRepository ) + { + delete iPersonalizationRepository; + iPersonalizationRepository = NULL; + } + if ( iLightRepository ) + { + delete iLightRepository; + iLightRepository = NULL; + } + if ( iGSVariationRepository ) + { + delete iGSVariationRepository; + iGSVariationRepository = NULL; + } + if ( iAvkonRepository ) + { + delete iAvkonRepository; + iAvkonRepository = NULL; + } + delete iSecurityRepository; + iSecurityRepository = NULL; + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::WelcomeNoteTypeL +// +// Returns user welcome note type. +// ---------------------------------------------------------------------------- +// +TInt CGSDisplayPluginModel::WelcomeNoteTypeL() + { + TInt type; + User::LeaveIfError( iStartupConfRepository->Get( KStartupWelcomeNoteType, + type ) ); + + return type; + } + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::SetWelcomeNoteTypeL +// +// Sets user welcome note type. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::SetWelcomeNoteTypeL( const TInt aType ) + { + User::LeaveIfError( iStartupConfRepository-> + Set( KStartupWelcomeNoteType, aType ) ); + + if ( aType != KGSWelcomeNoteTypeImage ) + { + // It doesn't matter much if the image deletion fails, + // so no need to handle the error. + TRAP_IGNORE( iBackgroundApi->DeleteImageL( KGSWelcomeNoteImgPath ) ); + } + } + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::GetWelcomeNoteTextL +// +// Reads welcome note text from shared data and returns it +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::WelcomeNoteTextL( TDes& aNote ) + { + User::LeaveIfError( iStartupConfRepository->Get( KStartupWelcomeNoteText, + aNote ) ); + } + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::SetWelcomeNoteTextL +// +// Writes welcome note text to shared data +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::SetWelcomeNoteTextL( const TDesC& aNote ) + { + User::LeaveIfError( iStartupConfRepository->Set( KStartupWelcomeNoteText, + aNote ) ); + } + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::ContrastL +// +// Returns contrast value. +// ---------------------------------------------------------------------------- +// +TInt CGSDisplayPluginModel::ContrastL() + { + TInt contrast = 0; +#ifndef __WINS__ + if( HAL::Get( HAL::EDisplayContrast, contrast ) == KErrNotSupported ) + { + return KErrNotSupported; + } +#endif //__WINS__ + return contrast; + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::SetContrastL +// +// sets contrast value. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::SetContrastL( const TInt aContrast ) + { +#ifndef __WINS__ + __GSLOGSTRING1("[CGSDisplayPluginModel::SetContrastL(%d)]", aContrast ); + User::LeaveIfError( HAL::Set( HAL::EDisplayContrast, aContrast ) ); +#endif //__WINS__ + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::ScreenSaverObjectL +// +// Returns screen saver mode. +// ---------------------------------------------------------------------------- +// +TInt CGSDisplayPluginModel::ScreenSaverObjectL() + { + TInt object = KErrNone; + + User::LeaveIfError( iScreensaverRepository->Get( KScreenSaverObject, + object ) ); + + return object; + } + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::SetScreenSaverObjectL +// +// Sets screen saver mode. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::SetScreenSaverObjectL( const TInt aObject ) + { + User::LeaveIfError( iScreensaverRepository->Set( KScreenSaverObject, + aObject ) ); + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::GetScreenSaverTextL +// +// Reads screen saver text from shared data and returns it. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::GetScreenSaverTextL( TDes& aText ) + { + User::LeaveIfError( iScreensaverRepository->Get( KScreenSaverText, + aText ) ); + } + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::SetScreenSaverTextL +// +// Writes screen saver text to shared data. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::SetScreenSaverTextL( const TDesC& aText ) + { + User::LeaveIfError( iScreensaverRepository->Set( KScreenSaverText, + aText ) ); + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::ScreenSaverAndKeyguardPeriodL +// +// Reads screen saver period from shared data and returns it. +// ---------------------------------------------------------------------------- +// +TInt CGSDisplayPluginModel::ScreenSaverAndKeyguardPeriodL() + { + TInt period = KGSSettingOff; + User::LeaveIfError( iSecurityRepository-> + Get( KSettingsAutomaticKeyguardTime, period ) ); + + // period is stored in seconds, but the user setting is in minutes + return period / 60; + } + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::SetScreenSaverAndKeyguardPeriodL +// +// Writes screen saver text to shared data. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::SetScreenSaverAndKeyguardPeriodL( const TInt aPeriod ) + { + // value is in minutes but keyguard uses seconds + User::LeaveIfError( iSecurityRepository-> + Set( KSettingsAutomaticKeyguardTime, aPeriod * 60 ) ); + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::BacklightPeriodL +// +// Reads backlight timeout value from shared data and returns it. +// ---------------------------------------------------------------------------- +// +TInt CGSDisplayPluginModel::BacklightPeriodL() + { + TInt period = KGSSettingOff; + User::LeaveIfError( iLightRepository-> + Get( KDisplayLightsTimeout, period ) ); + + return period; + } + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::SetBacklightPeriodL +// +// Writes new backlight timeout value to shared data. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::SetBacklightPeriodL( const TInt aPeriod ) + { + __GSLOGSTRING1("[CGSDisplayPluginModel::SetBacklightPeriodL(%d)]", aPeriod ); + User::LeaveIfError( iLightRepository-> + Set( KDisplayLightsTimeout, aPeriod ) ); + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::AmbientLightSensorL +// +// Returns Ambient Light Sensor value. +// ---------------------------------------------------------------------------- +// +TInt CGSDisplayPluginModel::AmbientLightSensorL() + { + TInt ret; + User::LeaveIfError( iLightRepository->Get( KLightSensorSensitivity, + ret ) ); + + return ScaleLightSensorValues( ret, ETrue ); + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::SetAmbientLightSensorL +// +// Sets Ambient Light Sensor value. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::SetAmbientLightSensorL( + const TInt aSensorSensitivity ) + { + TInt sensitivity; + sensitivity = ScaleLightSensorValues( aSensorSensitivity, EFalse ); + + User::LeaveIfError( iLightRepository-> + Set( KLightSensorSensitivity, sensitivity ) ); + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::ScaleLightSensorValues +// +// Scaling Ambient Light Sensor values +// ---------------------------------------------------------------------------- +// +TInt CGSDisplayPluginModel::ScaleLightSensorValues( TInt aValue, + TBool aDirection ) + { + TInt coeff = 25; + TInt ret = 0; + + if( aDirection ) //scaling to slider steps + { + ret = ( aValue / coeff ) + 1; + } + else //scaling to sensor percentage + { + ret = ( aValue - 1 ) * coeff; + } + + return ret; + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::HandleNotifyInt +// +// Handle notification from MCenRepNotifyHandlerCallback +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::HandleNotifyInt( TUint32 aId, TInt /*aNewValue*/) + { + if ( aId == KSettingsDisplayOperatorLogo || + aId == KSettingsShowOperatorLogoSetting ) + { + iContainer->UpdateListBoxL(EGSSettIdOperatorLogo); + iContainer->CloseDialog(); + } + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::ScaleIntensityValues +// +// Converts the slider control steps to Intensity values +// ---------------------------------------------------------------------------- +// +TInt CGSDisplayPluginModel::ScaleIntensityValues( TInt aValue, TBool aSample ) + { + TReal sampledValue; + TReal intResult; + TReal sampleCoeff = 3.226; //100 by 31 + TInt aDecimalPlaces = 0; + TInt32 result; + + if( aSample ) + { + intResult = sampleCoeff * aValue; + } + else + { + intResult = aValue / sampleCoeff; + } + + if( intResult > 1 ) + { + Math::Round( sampledValue, intResult, aDecimalPlaces ); + Math::Int( result, sampledValue ); + } + else + { + result = 1; + } + return result; + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::SetBackLightValueL +// +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::SetBackLightValueL() + { + iCoreAppProperty->Attach( KPSUidCoreApplicationUIs, KLightsControl ); + + TLightsControl value = ELightsUninitialized; + iCoreAppProperty->Set( KPSUidCoreApplicationUIs, + KLightsControl, value ); + + iCoreAppProperty->Cancel(); + + delete iCoreAppProperty; + iCoreAppProperty = NULL; + } + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::IsUWNoteSupportedL +// +// Allow user welcome note item to be disabled, if required +// ---------------------------------------------------------------------------- +// +TInt CGSDisplayPluginModel::IsUWNoteSupportedL() + { + TInt value = KGSSettingOff; + User::LeaveIfError( iPersonalizationRepository-> + Get( KSettingsWelcomeNoteSupported, value ) ); + + return value; + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::BrightnessL +// +// Returns brightness value from DosLights. +// ---------------------------------------------------------------------------- +// +TInt CGSDisplayPluginModel::BrightnessL() + { + if( FeatureManager::FeatureSupported( KFeatureIdBrightnessControl ) ) + { + TInt brightness; + User::LeaveIfError( iLightRepository->Get( KLightIntensity, + brightness ) ); + + return ScaleIntensityValues( brightness, EFalse ); + } + else + { + return KErrNotSupported; + } + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::SetBrightnessL +// +// Sets brightness value to DosLights. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::SetBrightnessL( const TInt aBrightness ) + { + if( FeatureManager::FeatureSupported( KFeatureIdBrightnessControl ) ) + { + TInt brightness; + + brightness = ScaleIntensityValues( aBrightness, ETrue ); + __GSLOGSTRING1("[CGSDisplayPluginModel::SetBrightnessL(%d)]", aBrightness ); + User::LeaveIfError( iLightRepository->Set( KLightIntensity, + brightness ) ); + } + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::DisplayTextSizeL +// +// Return current display text size. +// ---------------------------------------------------------------------------- +// +TInt CGSDisplayPluginModel::DisplayTextSizeL() + { + TInt textSize = EAknUiZoomNormal; + + if ( FeatureManager::FeatureSupported ( KFeatureIdUiZoom ) ) + { + User::LeaveIfError( iAvkonRepository->Get( KAknGlobalUiZoom, + textSize ) ); + } + + return textSize; + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::SetDisplayTextSizeL +// +// Sets new display text size. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::SetDisplayTextSizeL( TInt aSize ) + { + // not checking for feature manager constant to avoid compiler + // warning for the input parameter. + User::LeaveIfError( iAvkonRepository->Set( KAknGlobalUiZoom, aSize ) ); + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::PowerSaveLedL +// +// Returns Tracking Transaction state value. +// ---------------------------------------------------------------------------- +// +TInt CGSDisplayPluginModel::PowerSaveLedL() + { + TInt ret = 0; + User::LeaveIfError( iPersonalizationRepository->Get( + KSettingsDisplayTurnoffTimeout, ret ) ); + return ret; + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::SetPowerSaveLedL +// +// Sets Tracking Transaction state value. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::SetPowerSaveLedL( const TInt aPowerLedState ) + { + User::LeaveIfError( iPersonalizationRepository-> + Set( KSettingsDisplayTurnoffTimeout, aPowerLedState ) ); + + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::CheckPowerSaveLedSupportL +// +// Checks local variation flag for supporting Power Save Led feature. +// ---------------------------------------------------------------------------- +// +TInt CGSDisplayPluginModel::CheckPowerSaveLedSupportL() + { + TInt value = 0; + User::LeaveIfError( iGSVariationRepository->Get( + KSettingsVariationFlags, value ) ); + + TBool supported = EFalse; + + if ( value & EGSConfigPowerSaveLed ) + { + supported = ETrue; + } + + return supported; + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::BackgroundImage +// ---------------------------------------------------------------------------- +// +CGSBackgroundImage* CGSDisplayPluginModel::BackgroundImage() + { + return iBackgroundApi; + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::CheckScreenSaverTimeoutSupportL +// +// Checks ScreenSaver timeout support +// ---------------------------------------------------------------------------- +// +TBool CGSDisplayPluginModel::CheckScreenSaverTimeoutSupportL() + { + TInt value = 0; + User::LeaveIfError( iPersonalizationRepository->Get( + KSettingsScreensaverTimeoutItemVisibility, value ) ); + + if ( value ) + { + return ETrue; + } + else + { + return EFalse; + } + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::ShowOperatorLogoSettingL +// +// Checks if Operator Logo item is to be made visible. +// ---------------------------------------------------------------------------- +// +TBool CGSDisplayPluginModel::ShowOperatorLogoSettingL() + { + TInt opLogoSettingState = KGSSettingOff; + TBool showSetting = EFalse; + + User::LeaveIfError( iPersonalizationRepository-> + Get( KSettingsShowOperatorLogoSetting, opLogoSettingState ) ); + switch( opLogoSettingState ) + { + case KGSSettingOn: + showSetting = ETrue; + break; + case KGSSettingOff: + showSetting = EFalse; + default: + break; + } + return showSetting; + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::OperatorLogoL +// +// Returns operator logo value from shared data. +// ---------------------------------------------------------------------------- +// +TInt CGSDisplayPluginModel::OperatorLogoL() + { + TInt opLogo = KGSSettingOff; + User::LeaveIfError( iPersonalizationRepository-> + Get( KSettingsDisplayOperatorLogo, opLogo ) ); + return opLogo; + } + + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::SetOperatorLogoL +// +// Sets operator logo value to shared data. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::SetOperatorLogoL( TInt aOperatorLogo ) + { + User::LeaveIfError( iPersonalizationRepository-> + Set( KSettingsDisplayOperatorLogo, aOperatorLogo ) ); + } + +// ---------------------------------------------------------------------------- +// CGSDisplayPluginModel::SetOwner +// +// Sets its owner. +// ---------------------------------------------------------------------------- +// +void CGSDisplayPluginModel::SetOwner( CGSDisplayPluginContainer* aContainer) + { + iContainer = aContainer; + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/Src/PSMDisplayPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/Src/PSMDisplayPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,218 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Stub imlementation +* +*/ + + +// INCLUDE FILES +#include +#include "PSMDisplayPlugin.h" +#include "GSDisplayPluginModel.h" +#include "GsLogger.h" +#include +#include +#include + +#ifndef __WINS__ +#include +#endif + +// CONSTANT DEFINITIONS +const TUint32 KPSMDisplayPluginStorageId = 0x2000B591; + +enum TPsmDisplayPluginKeys + { + EContrast = 1, + EBacklightPeriod, + EBrightness, + EAmbientLightSensor, + EScreenSaverPeriod, + EAutomaticBrightnessControl + }; +// +// ---------------------------------------------------------------------------------- +// CPSMDisplayPlugin::CPSMDisplayPlugin() +// ---------------------------------------------------------------------------------- +// +CPSMDisplayPlugin::CPSMDisplayPlugin( TPsmPluginCTorParams& aInitParams ) : + CPsmPluginBase( aInitParams ) + { + } + +// ----------------------------------------------------------------------------- +// CPSMDisplayPlugin::ConstructL( +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CPSMDisplayPlugin::ConstructL() + { + iModel = CGSDisplayPluginModel::NewL( EFalse ); +#ifndef __WINS__ + iDisplayModel = CPowerSaveDisplayMode::NewL(); +#endif + } + +// +// ---------------------------------------------------------------------------------- +// CPSMDisplayPlugin::NewL() +// ---------------------------------------------------------------------------------- +// +// Two-phased constructor. +CPSMDisplayPlugin* CPSMDisplayPlugin::NewL( TPsmPluginCTorParams& aInitParams ) + { + CPSMDisplayPlugin* self = new ( ELeave ) CPSMDisplayPlugin( aInitParams ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ---------------------------------------------------------------------------------- +// CPSMDisplayPlugin::~CPSMDisplayPlugin() +// ---------------------------------------------------------------------------------- +// +// Destructor. +CPSMDisplayPlugin::~CPSMDisplayPlugin() + { + __GSLOGSTRING( "[CPSMDisplayPlugin::~CPSMDisplayPlugin]" ); + if( iModel ) delete iModel; + +#ifndef __WINS__ + if ( iDisplayModel ) + { + delete iDisplayModel; + } +#endif + + } + +// ---------------------------------------------------------------------------------- +// CPSMDisplayPlugin::NotifyModeChange() +// ---------------------------------------------------------------------------------- +// +void CPSMDisplayPlugin::NotifyModeChange( const TInt aMode ) + { + TInt err = KErrNone; + TRAP( err, DoModeChangeL( aMode ) ); + __GSLOGSTRING2( "[CPSMDisplayPlugin::NotifyModeChange]: Mode:%d Err:%d", aMode, err ); + + } + + +// ---------------------------------------------------------------------------------- +// CPSMDisplayPlugin::NotifyModeChange() +// ---------------------------------------------------------------------------------- +// +void CPSMDisplayPlugin::DoModeChangeL( const TInt aMode ) + { + RConfigInfoArray infoArray; + + TPsmsrvConfigInfo info1; + info1.iConfigId = EContrast; + info1.iConfigType = EConfigTypeInt; + info1.iIntValue = iModel->ContrastL(); + infoArray.Append( info1 ); + + TPsmsrvConfigInfo info2; + info2.iConfigId = EBacklightPeriod; + info2.iConfigType = EConfigTypeInt; + info2.iIntValue = iModel->BacklightPeriodL(); + infoArray.Append( info2 ); + + TPsmsrvConfigInfo info3; + info3.iConfigId = EBrightness; + info3.iConfigType = EConfigTypeInt; + info3.iIntValue = iModel->BrightnessL(); + infoArray.Append( info3 ); + + TPsmsrvConfigInfo info4; + info4.iConfigId = EAmbientLightSensor; + info4.iConfigType = EConfigTypeInt; + info4.iIntValue = iModel->AmbientLightSensorL(); + infoArray.Append( info4 ); + + TPsmsrvConfigInfo info5; + info5.iConfigId = EScreenSaverPeriod; + info5.iConfigType = EConfigTypeInt; + info5.iIntValue = iModel->ScreenSaverAndKeyguardPeriodL(); + infoArray.Append( info5 ); + +#ifndef __WINS__ + TPsmsrvConfigInfo info6; + info6.iConfigId = EAutomaticBrightnessControl; + info6.iConfigType = EConfigTypeInt; + info6.iIntValue = iDisplayModel->GetPowerSaveLevel(); + infoArray.Append( info6 ); +#endif + + __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL] Switching to mode:%d", aMode ); + + // Print old values from array + __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: oldValue info1: %d", infoArray[0].iIntValue ); + __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: oldValue info2: %d", infoArray[1].iIntValue ); + __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: oldValue info3: %d", infoArray[2].iIntValue ); + __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: oldValue info4: %d", infoArray[3].iIntValue ); + __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: oldValue info5: %d", infoArray[4].iIntValue ); +#ifndef __WINS__ + __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: oldValue info6: %d", infoArray[5].iIntValue ); +#endif + + iSettingsProvider.BackupAndGetSettingsL( infoArray, KPSMDisplayPluginStorageId ); + + // Print new values from array + __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: newValue info1: %d", infoArray[0].iIntValue ); + __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: newValue info2: %d", infoArray[1].iIntValue ); + __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: newValue info3: %d", infoArray[2].iIntValue ); + __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: newValue info4: %d", infoArray[3].iIntValue ); + __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: newValue info5: %d", infoArray[4].iIntValue ); +#ifndef __WINS__ + __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: newValue info6: %d", infoArray[5].iIntValue ); +#endif + + if ( iModel->ContrastL ( )!= KErrNotSupported ) + { + iModel->SetContrastL ( infoArray[0].iIntValue ); + } + + if ( FeatureManager::FeatureSupported ( KFeatureIdBrightnessControl ) ) + { + iModel->SetBrightnessL ( infoArray[2].iIntValue ); + } + + if ( iModel->CheckScreenSaverTimeoutSupportL() ) + { + iModel->SetScreenSaverAndKeyguardPeriodL( infoArray[4].iIntValue ); + } + + iModel->SetBacklightPeriodL( infoArray[1].iIntValue ); + iModel->SetAmbientLightSensorL( infoArray[3].iIntValue ); + +#ifndef __WINS__ + if ( FeatureManager::FeatureSupported( KFeatureIdFfAbcAgressiveUi ) ) + { + iDisplayModel->SetPowerSaveLevel( + (CPowerSaveDisplayMode::TPowerSaveLevel)infoArray[5].iIntValue ); + __GSLOGSTRING1( "[CPSMDisplayPlugin::NotifyModeChangeL]: level: %d", + iDisplayModel->GetPowerSaveLevel() ); + } +#endif + + infoArray.Reset(); + } + + +//End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSDisplayPlugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSDisplayPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsdisplayplugin.iby ) +../rom/GSDisplayPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsdisplaypluginresources.iby ) +loc/GsDisplPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsdisplplugin.loc ) + +#ifdef FF_POWER_SAVE + // PSM Config files for emulator use + Data/2000B591.xml /epoc32/release/winscw/urel/z/private/2000b187/2000b591.xml + Data/2000B591.xml /epoc32/release/winscw/udeb/z/private/2000b187/2000b591.xml + + // PSM Config files for HW use + Data/2000B591.xml /epoc32/data/z/private/2000b187/2000b591.xml +#endif // FF_POWER_SAVE + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gsdisplayplugin.mif + OPTION HEADERFILE gsdisplayplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_cp_dev_disp +END + + + + +PRJ_MMPFILES +GSDisplayPlugin.mmp + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSDisplayPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSDisplayPlugin/loc/GsDisplPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSDisplayPlugin/loc/GsDisplPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,412 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSDsplPlugin. +* +*/ + + +// LOCALISATION STRINGS + +//d:Text of a list item in device view's list +//d:Item opens Display setting view +//l:list_setting_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_device_display "Display" + +//d:Text in title pane +//d:Display setting list view +//l:title_pane_t2/opt9 +//w: +//r:3.1 +// +#define qtn_set_title_display "Display settings" + +//d:Text of a list item in Display setting list view's list +//d:Item opens Contrast setting page +//l:list_setting_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_display_contrast "Contrast" + +//d:Text of a list item in Display setting list view's list +//d:Item opens Brightness setting page +//l:list_setting_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_disp_brightness "Brightness" + +//d:Text of a list item in Display setting list view's list +//d:Item opens Color palette setting page +//l:list_setting_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_color_palette "Color palette" + +//d:Text of a list item in Display setting list view's list +//d:Item opens Screen saver time-out setting page +//l:list_setting_pane_t1 +//w: +//r:3.1 +// +#define qtn_sanim_time_out "Screen and keyguard time-out" + + +//d:Text of a list item in Display setting list view's list +//d:Item opens Backlight time-out setting page +//l:list_setting_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_light_time "Backlight time-out" + + +// **CONTRAST + +//d:Text in slider control +//d:Contrast setting page +//d:Minimum value +//l:setting_slider_pane_t2 +//w: +//r:3.1 +// +#define qtn_set_contrast_light "lighter" + +//d:Text in slider control +//d:Contrast setting page +//d:Maximum value +//l:setting_slider_pane_t2 +//w: +//r:3.1 +// +#define qtn_set_contrast_dark "darker" + + +// **BRIGHTNESS + +//d:Text in slider control +//d:Brightness setting page +//d:Minimum value +//l:setting_slider_pane_t2 +//w: +//r:3.1 +// +#define qtn_set_brightness_bright "bright" + +//d:Text in slider control +//d:Brightness setting page +//d:Maximum value +//l:setting_slider_pane_t2 +//w: +//r:3.1 +// +#define qtn_set_brightness_dark "dark" + + +// **SCREEN SAVER + +//d:Text in setting list item's current value field +//d:Screen saver time-out setting item +//d:Current value +//l:list_set_graphic_pane_t1 +//w: +//r:3.2 +// +#define qtn_sanim_time_out_slider_cur_value "%U minutes" + +//d:The singular text in setting list item's current value field +//d:Screen saver time-out setting item +//d:Current value +//l:list_set_graphic_pane_t1 +//w: +//r:5.2 +// +#define qtn_sanim_time_out_slider_cur_value_singular "%U minute" + + +//d:Text in slider control +//d:Screen saver time-out setting page +//d:Minimum value +//l:setting_slider_pane_t2 +//w: +//r:3.2 +// +#define qtn_sanim_time_out_slider_min_value "1 min." + +//d:Text in slider control +//d:Screen saver time-out setting page +//d:Maximum value +//l:setting_slider_pane_t2 +//w: +//r:3.2 +// +#define qtn_sanim_time_out_slider_max_value "30 min." + + +// ************************************ + +// **BACKLIGHT TIMEOUT + +//d:Text in setting list item's current value field +//d:Backlight time-out setting item +//d:Current value when it's > 1 minute (?) +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +// +#define qtn_backlight_time_out_slider_cur "%U seconds" + + +//d:Text in slider control +//d:Backlight time-out setting page +//d:Minimum value +//l:setting_slider_pane_t2 +//w: +//r:3.1 +// +#define qtn_backlight_time_out_slider_min "5sec" + +//d:Text in slider control +//d:Backlight time-out setting page +//d:Maximum value +//l:setting_slider_pane_t2 +//w: +//r:3.1 +// +#define qtn_backlight_time_out_slider_max "60sec" + + +// **AMBIENT LIGHT SENSOR + +//d:Text of a list item in display setting list view's list +//d:Item opens Ambient Light Sensor settings page +//l:list_setting_pane_t1 +//w: +//r:3.0 +// +#define qtn_set_light_sensor_mode "Light sensor" + +//d:Text in slider control +//d:Ambient Light Sensor setting page +//d:Maximum value +//l:setting_slider_pane_t2 +//w: +//r:3.0 +// +#define qtn_set_light_sensor_bright "Bright" + +//d:Text in slider control +//d:Ambient Light Sensor setting page +//d:Minimum value +//l:setting_slider_pane_t2 +//w: +//r:3.0 +// +#define qtn_set_light_sensor_dark "Dark" + + +// **WELCOME NOTE SETTING PAGE + +//d:Text of a list item in general setting list view's list +//d:Item opens Welcome note or image setting page +//l:list_setting_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_uwn "Welcome note or image" + +//d:Text in setting list item's current value field +//d:Item in Welcome note setting page's list +//d:Setting value Default +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_uwn_default "Default" + +//d:Text in setting list item's current value field +//d:Item in Welcome note setting page's list +//d:Setting value Text +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_uwn_text "Text" + +//d:Text in setting list item's current value field +//d:Item in Welcome note setting page's list +//d:Setting value Image +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_uwn_image "Image" + + +//d:Promt text in Welcome note text query +//d:Data query +//l:popup_query_data_window +//w: +//r:3.1 +// +#define qtn_set_uwn_enter_text "Enter welcome note:" + + +// **BACKGROUND IMAGE + +//d:Text of a list item in idle state setting list view's list +//d:Item opens Background image setting page +//l:list_setting_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_bgimage "Background image" + +//d:Text in setting list item's current value field +//d:Item in Background image setting page's list +//d:Setting value No image +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_bgimage_no "No image" + +//d:Text in setting list item's current value field +//d:Item in Background image setting page's list +//d:Setting value Image +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_bgimage_image "Image" + + +// ****************** NEW ****************** +// **DISPLAY TEXT SIZE + +//d:Text of a list item in display setting list view's list +//d:Item opens Display text size settings page +//l:list_setting_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_disp_text_size "Display text size" + +//d:Text in setting list item's current value field +//d:Item in Display text size setting page's list +//d:Setting value Large +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_disp_text_size_large "Large" + +//d:Text in setting list item's current value field +//d:Item in Display text size setting page's list +//d:Setting value Normal +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_disp_text_size_normal "Normal" + +//d:Text in setting list item's current value field +//d:Item in Display text size setting page's list +//d:Setting value Small +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_disp_text_size_small "Small" + + +// **POWER SAVE LED MODE + +//d:Text of a list item in display setting list view's list +//d:Item opens Powersave LED setting page +//l:list_setting_pane_t1 +//w: +//r:3.0 +// +#define qtn_sanim_objec_power_save_led "Power save LED" + +//d:Text in setting list item's current value field +//d:Item in Powersave LED setting page's list +//d:Setting value ON +//l:list_set_graphic_pane_t1 +//w: +//r:3.0 +// +#define qtn_sanim_power_save_on "On" + +//d:Text in setting list item's current value field +//d:Item in Powersave LED setting page's list +//d:Setting value OFF +//l:list_set_graphic_pane_t1 +//w: +//r:3.0 +// +#define qtn_sanim_power_save_off "Off" + +//d:Text for image too large information note +//d:Shown when selected background or welcome note image is too large to be opened +// in memory +//l:popup_note_window +// +#define qtn_set_image_too_large "Image size is too large. Image can not be selected." + + +//CONTROL PANEL + +//d:Text when settings item is blocked. +//l:popup_note_window +//w: +//r:3.2 +// +#define qtn_power_saving_protected_settings_infonote "Power saving is active. Unable to edit." + + +//d:Operator logo plugin caption +//d:Operator logo +//l:list_setting_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_oper_logo "Operator logo" + + +//d:Operator logo off text +//d:Operator logo +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_oper_logo_off "Off" + + +//d:Operator logo on text +//d:Operator logo +//l:list_set_graphic_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_oper_logo_on "On" + +// End of File + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/GSEcomPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/GSEcomPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This is project specification file for GSEcomPlugin.dll. +* +*/ + +#include "../Logger/GsLoggingConfiguration.h" +#include +#include + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT +TARGET gsecomplugin.dll +TARGETTYPE DLL +UID 0x1000008d 0x1020723C + +// Source files +SOURCEPATH src +SOURCE GSPluginInterface.cpp + +// User include paths +//USERINCLUDE ../data +//USERINCLUDE data +//USERINCLUDE ../Logger +USERINCLUDE inc + +// System include paths + +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + +SOURCEPATH data +// CGSPluginInterface icon resources +START RESOURCE GSFrameworkRsc.rss +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + + +// Libraries required by framework +LIBRARY aknskins.lib // for enhanced skinning +LIBRARY aknskinsrv.lib // for enhanced skinning +LIBRARY apgrfx.lib // for RApaLsSession +LIBRARY apparc.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY charconv.lib //for CnvUtfConverter used in CGSPluginLoader +LIBRARY commonengine.lib // for RConeResourceLoader +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY egul.lib // CGulIcon +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY eikctl.lib // CEikColumnListBox +LIBRARY euser.lib +LIBRARY fbscli.lib // for CFbsBitmap +LIBRARY featmgr.lib // feature manager +LIBRARY flogger.lib // logging +LIBRARY hlplch.lib // for "Help" options menu +LIBRARY ws32.lib + + +SOURCEPATH data + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/GSFramework.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/GSFramework.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This is project specification file for GSFramework. +* +*/ + +#include "../Logger/GsLoggingConfiguration.h" +#include +#include + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT +TARGET gsframework.dll +TARGETTYPE DLL +UID 0x1000008d 0x1020723F + +// Source files +SOURCEPATH src +SOURCE GSBaseContainer.cpp +SOURCE GSBaseView.cpp +SOURCE GSParentContainer.cpp +SOURCE GSParentPlugin.cpp +SOURCE GSPluginLoader.cpp +SOURCE GSTabHelper.cpp +SOURCE GSPluginWrapper.cpp +SOURCE GSBaseDocument.cpp +SOURCE GSPluginAndViewIdCache.cpp +SOURCE GSPlaceholderView.cpp +SOURCE GSShimmedView.cpp +SOURCE GSPubSubsListener.cpp +SOURCE GSWatchDog.cpp +SOURCE GSEComNotifier.cpp + +// User include paths +USERINCLUDE data +USERINCLUDE inc +USERINCLUDE ../Logger +USERINCLUDE ../Data +USERINCLUDE ../Cenrep + +// System include paths + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + +// Parent plugin resources +SOURCEPATH data +START RESOURCE GSParentPluginRsc.rss +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +// CGSPluginInterface icon resources +SOURCEPATH data +START RESOURCE GSFrameworkRsc.rss +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +// Libraries required by framework +LIBRARY aknskins.lib // for enhanced skinning +LIBRARY aknskinsrv.lib // for enhanced skinning +LIBRARY apgrfx.lib // for RApaLsSession +LIBRARY apparc.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY charconv.lib //for CnvUtfConverter used in CGSPluginLoader +LIBRARY commonengine.lib // for RConeResourceLoader +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY egul.lib // CGulIcon +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY eikctl.lib // CEikColumnListBox +LIBRARY euser.lib +LIBRARY fbscli.lib // for CFbsBitmap +LIBRARY featmgr.lib // feature manager +LIBRARY flogger.lib // logging +LIBRARY gsecomplugin.lib +LIBRARY hlplch.lib // for "Help" options menu +LIBRARY ws32.lib +LIBRARY estor.lib +LIBRARY centralrepository.lib // GSWatchDog +LIBRARY CdlEngine.lib +SOURCEPATH data +DOCUMENT GSFrameworkRsc.rss +DOCUMENT GSParentPluginRsc.rss + +SOURCEPATH ../Data +DOCUMENT GSCommonResources.rss + +SOURCEPATH src +SOURCE GsContainerExt.cpp + +//End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building framework. +* +* +*/ + + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +//#ifdef __SERIES60_HELP +../GSFramework/inc/conset.hlp.hrh /epoc32/include/cshelp/conset.hlp.hrh +../GSFramework/inc/div.hlp.hrh /epoc32/include/cshelp/div.hlp.hrh +//../GSFramework/inc/set.hlp.hrh /epoc32/include/cshelp/set.hlp.hrh +//#endif //__SERIES60_HELP + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gsfwicon.mif + OPTION HEADERFILE gsfwicon.mbg + OPTION SOURCES -c8,8 qgn_prop_set_default_sub -c8,1 qgn_prop_set_device_tab4 +END + +PRJ_MMPFILES + +GSEcomPlugin.mmp +GSFramework.mmp + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSFramework_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/data/GSFrameworkRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/data/GSFrameworkRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for GS framework. +* +*/ + + +// RESOURCE IDENTIFIER +NAME GSFW // 4 letter ID + +// INCLUDES +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +// CONSTANTS + +RESOURCE RSS_SIGNATURE + { + } + +//---------------------------------------------------- +// +// r_gs_plugin_default_icon_array +// Default icons used by the CGSPluginInterface. +// +//---------------------------------------------------- +// +RESOURCE AKN_ICON_ARRAY r_gs_plugin_default_icon_array + { + bmpfile = KGsBitmap; + + icons = + { + AKN_ICON + { + iconId = EMbmGsfwiconQgn_prop_set_default_sub; + maskId = EMbmGsfwiconQgn_prop_set_default_sub_mask; + } + }; + } + + +//End of File + + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/data/GSParentPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/data/GSParentPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for GSParentPlugin. +* +*/ + + +// RESOURCE IDENTIFIER +NAME GSPP // 4 letter ID + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include + +// CONSTANTS + +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +// ----------------------------------------------------------------------------- +// +// r_gs_parentplugin_lbx +// GSParentPlugin listbox. +// +// ----------------------------------------------------------------------------- +// +RESOURCE LISTBOX r_gs_parentplugin_lbx + { + flags = EEikListBoxMultipleSelection; + } + +RESOURCE TBUF r_gs_parentplugin_cba_exit { buf = text_softkey_exit; } +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/inc/GSBaseDocument.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/inc/GSBaseDocument.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Base Document class required by Symbian OS architecture. +* +*/ + + +#ifndef GSBASEDOCUMENT_H +#define GSBASEDOCUMENT_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// FORWARD DECLARATIONS +class CEikAppUi; +class CGSPluginWrapper; +class CGSPluginAndViewIdCache; +class MGSWatchDog; +class CGSWatchDog; + + +// CLASS DECLARATION + +/** +* CGSBaseDocument application class. +* @since Series60_3.1 +*/ +class CGSBaseDocument : public CAknDocument +{ + public: // Constructor and destructor + + /** + * Destructor. + */ + IMPORT_C ~CGSBaseDocument(); + + public: // New + + /** + * + */ + IMPORT_C CGSPluginWrapper* NewPluginUnloadWrapperLC(); + + /** + * + */ + IMPORT_C void PreparePluginCacheL( CEikAppUi& aAppUi ); + + /** + * + */ + IMPORT_C void PrepareForUIDestruction(); + + /** + * @return Pointer to GS application-wide watchdog. Does not transfer + * ownership. + */ + IMPORT_C MGSWatchDog* WatchDog(); + + /** + * Stored array of GS plugin implementation infos. Use this instead of + * repeatedly using REComSession::ListImplementationsL (performance). + * + * @ return reference to plugin inplementation info array. + * Does not transfer ownership. + */ + IMPORT_C RImplInfoPtrArray GetImplInfo(); + + IMPORT_C void CreateShimmedViewL(const TUid aViewUid); + + public: // API - but not exported + CGSPluginAndViewIdCache& PluginViewIdCache(); + const CGSPluginAndViewIdCache& PluginViewIdCache() const; + + protected: + + /** + * C++ constructor + */ + IMPORT_C CGSBaseDocument( CEikApplication& aApp ); + + /** + * Second phase constructor + */ + IMPORT_C void ConstructL(); + + private: // Cleanup support + static void CleanupPluginWrapperObject( TAny* aWrapper ); + void DoCleanupPluginWrapper( CGSPluginWrapper* aWrapper ); + static void PrintImplInfoArray( const RImplInfoPtrArray& aImplInfoArray ); + static void PrintImplInfo( const CImplementationInformation& aInfo ); + + private: // Data + + // Plugin view id cache + CGSPluginAndViewIdCache* iPluginViewIdCache; + + // Asynchronous loader for the GS plug-ins. + RPointerArray iUnloadWrapperObjects; + + // Watchdog used GS application-wide. Owned. + CGSWatchDog* iWatchDog; + + // Array of GS plugin implementation info-objects. Array is created on + // GS startup for better performance. Use this instead of repeatedly + // querying from ECOM. + RImplInfoPtrArray iImplInfoArray; +}; + +#endif // GSBASEDOCUMENT_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/inc/GSEComNotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/inc/GSEComNotifier.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,141 @@ +/* +* 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: GS utilities. +* +*/ + + +#ifndef GSECOMNOTIFIER_H +#define GSECOMNOTIFIER_H + +#include +#include + + + +/** + * Utility class to capsulate active object observing ECOM events. + * MGSEComObserver is provided as easy callback when GS related ECOM events + * occur. + * + * @lib GSFramework.lib + * @since S60 5.0 + */ +class MGSEComObserver + { +public: + + /** + * Not really used yet. To provide more extendability. + */ + enum TEComEvent + { + EPluginRemoved, + EPluginAdded + }; + +public: + virtual void HandleEComEvent( TEComEvent aEvent ) = 0; + }; + + +/** + * Utility class capsulating active object for observing ECOM events. + * + * @lib GSFramework.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( CGSEComNotifier ) : public CActive + { +public: + + /** + * Two-phased constructor. + * + * @param aObserver Callback object. + * @param aImplInfo Initial list of ECOM interfaces against which new list + * is compared when ECOM events occur. + */ + IMPORT_C static CGSEComNotifier* NewL( MGSEComObserver* aObserver, + RImplInfoPtrArray aImplInfo ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CGSEComNotifier(); + +protected: // from CActive + + /** + * See base class. + */ + void DoCancel(); + + /** + * See base class. + */ + void RunL(); + + /** + * See base class. + */ + TInt RunError( TInt aError ); + +protected: + +private: + + /** + * C++ Constructor. + * + * @param aObserver Callback object. + * @param aImplInfo Initial list of ECOM interfaces against which new list + * is compared when ECOM events occur. + */ + CGSEComNotifier( MGSEComObserver* aObserver, + RImplInfoPtrArray aImplInfo ); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * Issues new request. + */ + void IssueRequest(); + + /** + * @return Difference between old and new list of GS-plugins. Negative + * number means plugins are removed, positive means plugins are + * added, 0 means no change in plugin count. + */ + TInt PluginCountDeltaL(); + +private: // data + + // Callback. + MGSEComObserver* iObserver; + + // ECom handle. + REComSession iEComSession; + + // Stored original plugin info. This will be compared against latest info + // for any changes. + RImplInfoPtrArray iOriginalImplInfo; + + }; + + +#endif // GSECOMNOTIFIER_H diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/inc/GSPlaceholderView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/inc/GSPlaceholderView.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Placeholder view during synchronous view activation +* +*/ + + +#ifndef GSPLACEHOLDERVIEW_H +#define GSPLACEHOLDERVIEW_H + +// INCLUDES +#include +#include +#include + +// CONSTANTS + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Dummy view class used by CGSPluginAndViewIdCache view switching between two +* actual views. See CGSPluginAndViewIdCache for details. +* +* @since Series60_3.1 +* +*/ +class CGSPlaceholderView : public CBase, public MCoeView + { + public: // Constructor and destructor + + /** + * + */ + static CGSPlaceholderView* NewL( CCoeAppUi& aAppUi ); + + /** + * Destructor. + */ + ~CGSPlaceholderView(); + + private: + + /** + * C++ constructor + */ + CGSPlaceholderView( CCoeAppUi& aAppUi ); + + /** + * Second phase constructor + */ + void ConstructL(); + + public: // API + + /** + * + */ + void ActivateL(); + + /** + * + */ + const TVwsViewId& PreviouslyActiveViewId() const; + + /** + * + */ + void SetPreviouslyActiveViewId( const TVwsViewId& aViewId ); + + private: // From MCoeView + TVwsViewId ViewId() const; + void ViewActivatedL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage ); + void ViewDeactivated(); + + private: // Internal methods + + private: // Data + CCoeAppUi& iAppUi; + TVwsViewId iPreviouslyActiveViewId; + }; + + +#endif // GSPLACEHOLDERVIEW_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/inc/GSPluginAndViewIdCache.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/inc/GSPluginAndViewIdCache.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,239 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Plugin and view id caching support +* +*/ + + +#ifndef GSPLUGINANDVIEWIDCACHE_H +#define GSPLUGINANDVIEWIDCACHE_H + +// INCLUDES +#include +#include +#include +#include + +// CONSTANTS + +// FORWARD DECLARATIONS +class CEikAppUi; +class CGSShimmedView; +class CGSPluginInterface; +class CGSPlaceholderView; + +// CLASS DECLARATION + +/** +* CGSPluginAndViewIdCache application class. +* - Creates/Loads a list of CGSShimmedViews from a cache file on GS start-up. +* - Inserts CGSShimmedViews into view-framework view list. +* +* +* Problem/rationale: +* Launching GS plugin view outside GS application when GS application is not +* already running may fail. This was caused by application inter working +* combined with GS application's asynchronized plugin loading. High level +* functionality for external view launching goes: +* 1. Application framework starts desired application +* 2. Application framework calls view-activation on the desired application view. +* 3. Desired view handles the activation call-back by drawing itself on +* screen or whatever required. +* +* Starting from phase 2, things can go wrong: when GS start-up call returns, GS +* has not yet loaded all the plugins and the views owned by plugins are not +* added yet to the view-framework view list. Calling non-existing view will +* naturally fail. +* +* +* Solution: +* When GS start-up is called, populate view-frameworks view list with all the +* views provided by GS application before function return. Kind of: This would +* ruin GS's asynchronous plugin loading and would cause devastating freeze-up +* times on GS start-up. Hence, on GS start-up we're not actually loading the +* plugins nor the real views. We use light-weight dummy views +* (aka CGSShimmedView) wich we add into view-framework view list immedieately +* on start-up. If it happens so, that the view framework-decides to call view +* activation on one of these dummy views, dummy view will load manually the +* real plugin view and switch it with the dummy view. Dummy views are created +* by CGSPluginAndViewIdCache on GS-application start-up. +* +* +* Different use scenarios: +* +* 1. First GS-application start on a new device, create cache & save as file. +* +* 2. Launch GS-application second time. Always populate CCoeAppUi with +* CGSShimmedView instances created from cache file (cache maps view uid +* to ecom plugin implementation uid). +* - When pluginloader loads plugin, it replaces dummy view (shim) with the real +* view from the plugin. The shim is then destroyed. +* +* 3. GS plugin view is activated externally when GS is not running: +* - Uses normal application framework to launch GS application. +* - Same functionality as in scenario 2 but if shimmed view is requested +* before actual view is created, load actual plugin manually and +* synchronously. +* - CGSPlaceholderView: View-FW will only switch between two different view +* uids. This is why we need to switch between 3 different views. +* -> Will result in 3x fold different view activation. +* - Used view activations are: +* 1. Shimmed view DoActivate for view uid . +* 2. Shimmed view calls Placeholder::DoActivate with a dummy "uid DEADBED". +* 3. Placeholder view calls actual plugin::DoActivate with actual view uid +* . +* +* +* NOTE: Requirements: +* - Cache: GS has to be launched once successfully for the cache to work. +* -> otherwise error if launching from external application. +* - Views which need to be used externally (external view launch) must be +* implemented as a GS-plugin. Those cannot be implemented as a local view. +* +* +* @since Series60_3.1 +* +*/ +class CGSPluginAndViewIdCache : public CBase + { + public: // Constructor and destructor + + /** + * + */ + static CGSPluginAndViewIdCache* NewL( CEikAppUi& aAppUi ); + + /** + * Destructor. + */ + ~CGSPluginAndViewIdCache(); + + private: + + /** + * C++ constructor + */ + CGSPluginAndViewIdCache( CEikAppUi& aAppUi ); + + /** + * Second phase constructor + */ + void ConstructL(); + + public: // API - placeholder view related + + /** + * + */ + void ActivatePlaceholderViewL(); + + /** + * + */ + const TVwsViewId& PriorToPlaceholderActiveViewId() const; + + /** + * + */ + void SetPriorToPlaceholderActiveViewId( const TVwsViewId& aViewId ); + + public: // API - caching + + /** + * + */ + void RegisterViewAndImplementationAssociationL( TUid aViewId, TUid aImplementationUid ); + + /** + * + */ + void RegisterViewAndImplementationAssociationL( TUid aViewId, TUid aImplementationUid, TBool aCreateShim ); + + /** + * + */ + void PrepareToRegisterPluginInstanceLC( TUid aViewId ); + + /** + * + */ + void RegisterPluginInstanceL( TUid aViewId, CGSPluginInterface& aPluginInstance ); + + /** + * + */ + TBool IsPluginLoaded( TUid aViewId ) const; + + /** + * + */ + CGSPluginInterface* PluginInstance( TUid aViewId ) const; + + /** + * + */ + TUid PluginImplementationUidForView( TUid aViewId ) const; + + /** + * + */ + void PrepareForUIDestruction(); + + /** + * + */ + void HandleShimDestruction( TUid aViewId ); + + private: // Internal methods + void DestroyShims(); + void RestoreL(); + void StoreL(); + void GetCacheFileNameL( TDes& aFileName ); + void GetCachePathL( TDes& aPath ); + static void ReRegisterShimWithUi( TAny* aSelf ); + + private: // Hash function support + static TUint32 HashFunction( const TUid& aViewId ); + static TBool HashIdentityRelation( const TUid& aLeft, const TUid& aRight ); + + private: // Internal object + + struct TCacheEntry + { + TUid iImplementationUid; + CGSShimmedView* iShim; + CGSPluginInterface* iLoadedPluginImplementation; + }; + + private: // Data + + // UI - not owned + CEikAppUi& iAppUi; + + // File server session - ref + RFs& iFsSession; + + // Cache table - owned + RHashMap< TUid /* KEY = view id */, TCacheEntry /* VALUE */ > iLookupTable; + + // Placeholder view - owned + CGSPlaceholderView* iPlaceholderView; + + // Transient variable used during plugin registration preparation. + TUid iTransientCleanupViewUid; + }; + + +#endif // GSBASEDOCUMENT_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/inc/GSPluginWrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/inc/GSPluginWrapper.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef GSPLUGINWRAPPER_H +#define GSPLUGINWRAPPER_H + +// System includes +#include + +// Classes referenced +class CGSBaseDocument; + + +/** + * Utility class for separating ECOM plugin destruction from view-framework + * view cleanup. + * + * Owned by CGSBaseDocument which has the longest lifetime during GS + * application run. This will ensure that ECOM resources are not deleted + * before view cleanup. + * + * Problem/rationale: + * Before the functionality provided by this class, GS would occasionally + * crash in exit. This was caused by the dual nature of CGSPluginInterface + * class: It is both ECOM-plugin having individual dll and view-framework + * dependant CAknView owned by CCoeAppUi. When exiting GS, it was possible + * that a plugin still had local views (CAknViews) which were owned + * by view-framework. + * + * When the view framework destroys the registered views, it would cause + * the ECOM plugin dll to be unloaded. Should this happen before all the views + * owned and implemented by the plugin have been destroyed, an access + * violation would occur because the code needed to call the view's destructor + * was no longer loaded into memory within the GS process. + * + * Solution: + * Purpose of CGSPluginWrapper is to move ECOM-related memory cleanup outside + * the scope of CGSPluginInterface destructor. This way view-framework can + * call destructor in an arbitrary order on all it's owned views even though + * plugins which had local views were already deleted. + * + */ +NONSHARABLE_CLASS( CGSPluginWrapper ) : public CBase + { + public: + CGSPluginWrapper( CGSBaseDocument& aDocument ); + IMPORT_C ~CGSPluginWrapper(); + + public: + IMPORT_C void SetDetails( TUid aDestructorIdKey ); + inline CGSBaseDocument& Document() { return iDocument; } + + private: + TUid iDestructorIdKey; + CGSBaseDocument& iDocument; + }; + + + + +#endif // GSPLUGINWRAPPER_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/inc/GSShimmedView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/inc/GSShimmedView.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Shim view +* +*/ + + +#ifndef GSSHIMMEDVIEW_H +#define GSSHIMMEDVIEW_H + +// INCLUDES +#include +#include +#include + +// CONSTANTS + +// FORWARD DECLARATIONS +class CGSPluginAndViewIdCache; + +// CLASS DECLARATION + +/** +* CGSShimmedView is used by CGSPluginAndViewIdCache to provide view-framework +* with all existing plugin views immediately in GS start-up. Shimmed views +* are used to cache actual views: in case GS view is opened outside GS +* application while GS is not running in the background, view-framework needs +* the requested view to exist immediately after GS start-up. This is a problem +* as GS loads plugins asynchronously after GS start-up. Therefore we provide +* view-framework with shimmed views in the GS start-up instead of the actual +* views. Afterwards, when each plugin is loaded, we replace the shimmed view +* representing the plugin with a real view provided by the loaded plugin. +* (Each plugin is normally also a view). +* +* Shimmed views are only used and needed for enabling external GS plugin +* view launch. +* +* See CGSPluginAndViewIdCache for details. +* +* @since Series60_3.1 +* +*/ +class CGSShimmedView : public CActive, public MCoeView + { + public: // Constructor and destructor + + /** + * + */ + static CGSShimmedView* NewLC( TUid aViewId, CGSPluginAndViewIdCache& aCache, CCoeAppUi& aAppUi ); + + /** + * Destructor. + */ + ~CGSShimmedView(); + + private: + + /** + * C++ constructor + */ + CGSShimmedView( TUid aViewId, CGSPluginAndViewIdCache& aCache, CCoeAppUi& aAppUi ); + + /** + * Second phase constructor + */ + void ConstructL(); + + public: // API + + /** + * + */ + void RegisterViewL(); + + /** + * + */ + void DeregisterView(); + + public: // From MCoeView + TVwsViewId ViewId() const; + void ViewActivatedL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage ); + void ViewDeactivated(); + + private: // State + enum TState + { + EStateInactive = 0, + EStateActivatingPlaceholderView, + EStateLoadingPlugin, + EStateDeletingSelf + }; + + void SetState( TState aState, TBool aCompleteRequest = ETrue ); + void StateActivatePlaceholderViewL(); + void StateLoadPluginL(); + + private: // From CActive + void RunL(); + void DoCancel(); + + private: // Data + TUid iViewId; + CGSPluginAndViewIdCache& iCache; + CCoeAppUi& iAppUi; + TState iState; + TBool iIsRegistered; + HBufC8* iCustomMessage; + TUid iCustomMessageId; + }; + + +#endif // GSSHIMMEDVIEW_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/inc/GSWatchDog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/inc/GSWatchDog.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,293 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef GSWATCHDOG_H +#define GSWATCHDOG_H + +// System includes +#include +#include + +// CONSTANTS + + +/** +* Maximum number of GS runs during which plugin is held in blacklist. After +* this plugin is allowed normal execution unless it crashes again. +* +* Used only in case no CenRep value is defined. +*/ +const TInt KGSDefaultMaxPluginBlackListedRuns = 5; + + +/** +* Defines how many crashes are observed before watchdog is activated. The +* bigger the value, more tolerant behaviour towards crashing plugins. +* +* -1 = Watchdog is completely disabled regardless any crash +* (KGSWatchdogActivationDisabled). +* 1 = In practise, the fastest reaction, meaning watchdog is enabled the next +* run GS starts after a crash. +* 2 = GS can have 1 crash without watchdog being enabled = 2nd GS crash in a +* row will enable watchdog. +* n = GS can have n-1 crashes before watchdog being activated etc. +* +* Used only in case no CenRep value is defined. +*/ +const TInt KGSDefaultWatchdogActivationLimit = 1; + +/** +* Watchdog is completely disabled. +*/ +const TInt KGSWatchdogActivationDisabled = -1; + + +// FORWARD DECLARATIONS +class CRepository; +class RReadStream; +class RWriteStream; + +// CLASS DECLARATION + + + +/** +* Container class for quarantined plugin data. +*/ +class TGSPluginQuarantine + { + public: + /** + * Read data from aStream. + * @param aStream read stream. + */ + void InternalizeL( RReadStream& aStream ); + + /** + * Write data to aStream. + * @param aStream write stream. + */ + void ExternalizeL( RWriteStream& aStream ) const; + + public: + + /** + * Uid of the plugin. + */ + TUid iUid; + + /** + * Counter which is incremented each time GS is started and the plugin + * is in blacklist. This is used for removing plugin from blacklist + * after certain number of GS runs (iMaxPluginBlackListedRuns). This + * means plugins are not in blacklist for ever but it is possible to try + * running the plugin after a number of GS runs. This is needed in case + * of ramdom crash while some essential plugin is in quarantine. + */ + TInt iRunsAfterCrash; + }; + +/** +* CGSWatchDog is responsible for quarantining plugins and updating blacklist +* for crashing GS plugins. This is the class responsible for keeping GS +* application functional even if some plugin to panics all the time. +* +* @since Series60_3.2 +*/ +NONSHARABLE_CLASS( CGSWatchDog ) : public CBase, + public MGSWatchDog + { + public: // Constructor and destructor + + /** + * Symbian OS two-phased constructor + * @return CGSWatchDog. + */ + static CGSWatchDog* NewL(); + + /** + * Destructor. + */ + ~CGSWatchDog(); + + public: // From MGSWatchDog + + /** + * Adds plugin to quarantine. In case GS crashes, quarantined plugin + * will be blacklisted so it is not loaded in next GS run. Same plugin + * can be quarantined multiple times or even have several uid instances + * in quarantine if needed as long as all these are removed + * correspondingly. + * + * NOTE: Plugin must ALWAYS be removed from quarantine after plugin's + * function execution. + * 1. QuarantineL(). + * 2. Call quarantined plugin function. + * 3. RemoveFromQuarantineL(). + * + * @param aPluginUid uid of the quarantined plugin. + */ + void QuarantineL( TUid aPluginUid ); + + /** + * Removes plugin from quarantine. In case plugin is not removed from + * quarantine before GS exits, the plugin will be blacklisted during + * next GS startup. + * + * @param aPluginUid uid of the plugin to be removed from quarantine. + */ + void RemoveFromQuarantineL( TUid aPluginUid ); + + /** + * @return ETrue if GS exited cleanly last time. + * EFalse if GS crashed during last execution. + */ + TBool WasCleanExitL(); + + /** + * This must be called in all the cases GS exits normally. If GS panics, + * this will not be called resulting in banning of all quarantined + * plugins.Increments iRunsAfterCrash counter for blacklisted plugins. + * Sets iGSAppRunning to EFalse. + */ + void ReportCleanExitL(); + + /** + * Checks if plugin is in blacklist. This can be used to determine if + * plugin should be loaded. + * + * @return ETrue in case plugin is in blacklist and should not be loaded. + * EFalse in case plugin should not be loaded + */ + TBool IsInBlackList( TUid aPluginUid ); + + protected: // New + + /** + * C++ constructor + */ + CGSWatchDog(); + + /** + * Second phase constructor + */ + void ConstructL(); + + /** + * Reads previous state from persistent data storage. + */ + void ReadStateL(); + + /** + * Stores iGSAppRunning, iQuarantinedPluginUid and iBlackList data to + * persistent storage. + */ + void StoreStateL(); + + /** + * Sets state values to default values and stores these. + */ + void InitStateL(); + + /** + * Reads quarantine data from persistent storage. + */ + void ReadQuarantineL(); + + /** + * Stores quarantine data to persistent storage. + */ + void StoreQuarantineL(); + + /** + * Reads blacklist data from persistent storage. + */ + void ReadBlackListL(); + + /** + * Stores blacklist data to persistent storage. + */ + void StoreBlackListL(); + + /** + * Updates run counter of each blacklisted plugin. Removes plugin from + * blacklist if it has been there long enough + * (KGSDefaultMaxPluginBlackListedRuns). + */ + void UpdateBlackListedPluginRunCounters(); + + private: // Data + + /** + * ETrue if WatchDog is active (GS has crashed in previous run). + */ + TBool iIsActive; + + /** + * Counter for GS crashes in a row. This is used to customize watchdog + * behaviour. Defines how many crashes are observed before watchdog is + * activated. The bigger the value, more tolerant behaviour towards crashing + * plugins. See iWatchdogActivationLimit. + * + * -1 = Watchdog is completely disabled regardless any crash. + * 1 = In paractise the fastest reaction, meaning watchdog is enabled the next + * run GS starts after a crash. + * 2 = GS can have 1 crash without watchdog being enabled = 2nd GS crash in a + * row will enable watchdog. + * n = GS can have n-1 crashes before watchdog being activated etc. + */ + TInt iCrashCounter; + + /** + * Emulates stored data. Set on when GS running, off when GS exits + * cleanly. Check this when starting GS to see if last exit was clean. + */ + TBool iGSAppRunning; + + /** + * Uids for plugins which should be banned. They caused GS crash in + * previous runs. + */ + RArray iBlackList; + + /** + * Run time quarantine for plugins. + */ + RArray iQuarantine; + + /** + * Persistent storage. + */ + CRepository* iStore; + + /** + * Defines how long a plugin is held in blacklist. + * KGSDefaultMaxPluginBlackListedRuns is used if no CenRep value is defined. + */ + TInt iMaxPluginBlackListedRuns; + + /** + * Defines how many crashes is needed to activate watchdog. + * KGSDefaultWatchdogActivationLimit is used in case no CenRep value is + * defined. + */ + TInt iWatchdogActivationLimit; + }; + +#endif // GSWATCHDOG_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/inc/GsContainerExt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/inc/GsContainerExt.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for GSParentPlugin. +* +*/ + +#ifndef GSCONTAINEREXT_H +#define GSCONTAINEREXT_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION +class MGSWatchDog; + +/* + * Double click preventer. + */ +class CGsDoubleClickPreventer : public CTimer + { +public: + IMPORT_C static CGsDoubleClickPreventer* NewL(); + + CGsDoubleClickPreventer(); + IMPORT_C void Start(); +private: + void ConstructL(); +protected: + void RunL() {}; + }; + +/** + * Extension for container. + * + */ +class CGsContainerExt : public CBase + { +public: + IMPORT_C static CGsContainerExt* NewL(); + ~CGsContainerExt() + { + iDblClickPreventer->Cancel(); + delete iDblClickPreventer; + } +private: + void ConstructL(); +public: + MGSWatchDog* iGSWatchDog; + CGsDoubleClickPreventer* iDblClickPreventer; + + }; + +#endif // GSCONTAINEREXT_H diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/inc/conset.hlp.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/inc/conset.hlp.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// +// conset.hlp.hrh +// + +// +// File generated by cshlpcmp Version 011 +// + +#ifndef __CONSET_HLP_HRH__ +#define __CONSET_HLP_HRH__ + + +_LIT(KSET_HLP_CONNEC_AP_VIEW,"SET_HLP_CONNEC_AP_VIEW"); //Access points item of Connection settings +_LIT(KSET_HLP_AP_SETTING_DATA,"SET_HLP_AP_SETTING_DATA"); //Data call access point settings +_LIT(KSET_HLP_AP_SETTING_GPRS,"SET_HLP_AP_SETTING_GPRS"); //GPRS access point settings +_LIT(KSET_HLP_AP_SETTING_WLAN,"SET_HLP_AP_SETTING_WLAN"); //WLAN access point settings +_LIT(KSET_HLP_WLAN_WEP_MAIN,"SET_HLP_WLAN_WEP_MAIN"); //WLAN security settings for WEP +_LIT(KSET_HLP_WLAN_WEP_KEY_SETT,"SET_HLP_WLAN_WEP_KEY_SETT"); //WEP key parameters +_LIT(KSET_HLP_WLAN_8021X_MAIN,"SET_HLP_WLAN_8021X_MAIN"); //WLAN security settings for 802.1 +_LIT(KSET_HLP_WLAN_WPA_MAIN,"SET_HLP_WLAN_WPA_MAIN"); //WLAN security settings for WPA +_LIT(KSET_HLP_AP_SETTING_GPRS_AS,"SET_HLP_AP_SETTING_GPRS_AS"); //GPRS access point settings, Advanced +_LIT(KSET_HLP_AP_SETTING_DATA_AS,"SET_HLP_AP_SETTING_DATA_AS"); //Data call access point settings, Advanced +_LIT(KSET_HLP_AP_SETTING_WLAN_AS,"SET_HLP_AP_SETTING_WLAN_AS"); //WLAN access point settings, Advanced +_LIT(KSET_HLP_AP_DATA_AS_IPV4,"SET_HLP_AP_DATA_AS_IPV4"); //IPv4 data call ap settings +_LIT(KSET_HLP_AP_WLAN_AS_IPV4,"SET_HLP_AP_WLAN_AS_IPV4"); //IPv4 WLANl ap settings +_LIT(KSET_HLP_AP_DATA_AS_IPV6,"SET_HLP_AP_DATA_AS_IPV6"); //IPv6 data call ap settings +_LIT(KSET_HLP_AP_WLAN_AS_IPV6,"SET_HLP_AP_WLAN_AS_IPV6"); //IPv6 data call ap settings +_LIT(KSET_HLP_CONNEC_GPRS,"SET_HLP_CONNEC_GPRS"); //GPRS item of Connection settings +_LIT(KSET_HLP_WLAN_SETTINGS,"SET_HLP_WLAN_SETTINGS"); //WLAN settings view +_LIT(KSET_HLP_WLAN_ADV_SETTINGS,"SET_HLP_WLAN_ADV_SETTINGS"); //WLAN advanced settings +_LIT(KSET_HLP_CONNEC_DATA,"SET_HLP_CONNEC_DATA"); //Data call item of Connection settings +_LIT(KPROV_HLP_CONFCONT,"PROV_HLP_CONFCONT"); //Configurations contexts list +_LIT(KSET_HLP_VPN_AP_VIEW,"SET_HLP_VPN_AP_VIEW"); //VPN access points view +_LIT(KSET_HLP_VPN_AP_SETTINGS_VIEW,"SET_HLP_VPN_AP_SETTINGS_VIEW"); //VPN access point settings view +_LIT(KSIP_HLP_MAIN,"SIP_HLP_MAIN"); //SIP settings, main view +_LIT(KSIP_HLP_PROF_PARAMS,"SIP_HLP_PROF_PARAMS"); //SIP profile parameters +_LIT(KSIP_HLP_PROXY_PARAMS,"SIP_HLP_PROXY_PARAMS"); //Proxy server parameters view +_LIT(KSIP_HLP_REGISTRAR_PARAM,"SIP_HLP_REGISTRAR_PARAM"); //Registrar server parameters view +_LIT(KACL_HLP_MAIN,"ACL_HLP_MAIN"); //ACL main view + +#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/inc/div.hlp.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/inc/div.hlp.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2002, 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Help text context for Divert. +* +*/ + + +#ifndef __DIV_HLP_HRH__ +#define __DIV_HLP_HRH__ + +//Call divert/forwarding +_LIT(KDIV_HLP_CALL_FORW,"DIV_HLP_CALL_FORW"); + +#endif + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/inc/set.hlp.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/inc/set.hlp.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2002 - 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* All the help IDs are declared here +* +*/ + +// +// File generated by cshlpcmp Version 011 +// + +#ifndef __SET_HLP_HRH__ +#define __SET_HLP_HRH__ + + +_LIT(KSET_HLP_SETTINGS_MAIN_VIEW,"SET_HLP_SETTINGS_MAIN_VIEW"); //General settings, Main view +_LIT(KSET_HLP_GENERAL_LIST,"SET_HLP_GENERAL_LIST"); //General settings list +_LIT(KSET_HLP_PERSONAL_LIST,"SET_HLP_PERSONAL_LIST"); //Personalisation list view +_LIT(KSET_HLP_PERSONAL_DISPLAY,"SET_HLP_PERSONAL_DISPLAY"); //Display settings view +_LIT(KSET_HLP_PERSONAL_IDLE,"SET_HLP_PERSONAL_IDLE"); //Idle settings view +_LIT(KSET_HLP_PERSONAL_LANGUAGE,"SET_HLP_PERSONAL_LANGUAGE"); //Language settings view +_LIT(KSET_HLP_ACCESSORIES_LIST,"SET_HLP_ACCESSORIES_LIST"); //Accessories list +_LIT(KSET_HLP_ACCESSORIES_HEADSET,"SET_HLP_ACCESSORIES_HEADSET"); //Accessories; Headset settings +_LIT(KSET_HLP_ACCESSORIES_LOOPSET,"SET_HLP_ACCESSORIES_LOOPSET"); //Accessories; Loopset settings +_LIT(KSET_HLP_ACCESS_WIRED_CK,"SET_HLP_ACCESS_WIRED_CK"); //Wired carkit accessory settings +_LIT(KSET_HLP_ACCESS_WIRELESS_CK,"SET_HLP_ACCESS_WIRELESS_CK"); //Wireless carkit accessory settings +_LIT(KSET_HLP_ACCESSORIES_TTY,"SET_HLP_ACCESSORIES_TTY"); //Accessories; TTY settings +_LIT(KSET_HLP_ACCESSORIES_MUSIC_ST,"SET_HLP_ACCESSORIES_MUSIC_ST"); //Music stand settings +_LIT(KSET_HLP_SECURITY_LIST,"SET_HLP_SECURITY_LIST"); //Security settings list +_LIT(KSET_HLP_SECURITY_DEVICE_SIM,"SET_HLP_SECURITY_DEVICE_SIM"); //Device & SIM security +_LIT(KSET_HLP_TRANSACTION_TRACKING,"SET_HLP_TRANSACTION_TRACKING"); //Transaction tracking security settings +_LIT(KSET_HLP_GENERAL_ORIG_SET,"SET_HLP_GENERAL_ORIG_SET"); //Restore original settings view +_LIT(KSET_HLP_TELEPHONE_LIST,"SET_HLP_TELEPHONE_LIST"); //Telephone settings list view +_LIT(KSET_HLP_TELEP_CALL_SET,"SET_HLP_TELEP_CALL_SET"); //Call settings +_LIT(KCCBS_HLP_QUEUE_LIST,"CCBS_HLP_QUEUE_LIST"); //CCBS queue view +_LIT(KDIV_HLP_CALL_FORW_MAIN,"DIV_HLP_CALL_FORW_MAIN"); //Call divert settings, main view +_LIT(KDIV_HLP_CALL_FORW_VOI,"DIV_HLP_CALL_FORW_VOI"); //Call divert/forward for voice calls +_LIT(KDIV_HLP_CALL_FORW_DAT,"DIV_HLP_CALL_FORW_DAT"); //Call divert/forward for data and video calls +_LIT(KDIV_HLP_CALL_FORW_FAX,"DIV_HLP_CALL_FORW_FAX"); //Call divert/forward for fax calls +_LIT(KDIV_HLP_BARRING_MAIN,"DIV_HLP_BARRING_MAIN"); //Call barring settings +_LIT(KDIV_HLP_CALL_FORW_VOIP,"DIV_HLP_CALL_FORW_VOIP"); //Internet call barring +_LIT(KSET_HLP_BARRING_SETTINGS,"SET_HLP_BARRING_SETTINGS"); //Regular call barring settings +_LIT(KSET_HLP_TELEP_NETWORK_SET,"SET_HLP_TELEP_NETWORK_SET"); //GSM Network settings +_LIT(KSET_HLP_CONN_LIST,"SET_HLP_CONN_LIST"); //Connection settings list +_LIT(KVOIP_HLP_SETTING,"VOIP_HLP_SETTING"); //VOip settings +_LIT(KVOIP_HLP_CONNECTION_SETTING,"VOIP_HLP_CONNECTION_SETTING"); //VoIP connection set view +_LIT(KSET_HLP_APPLICATIONS_LIST,"SET_HLP_APPLICATIONS_LIST"); //Application settings list view +_LIT(KSET_HLP_ACCESSORIES_TVOUT,"SET_HLP_ACCESSORIES_TVOUT"); //Accessories; TvOut settings +_LIT(KSET_HLP_ACCESSORIES_HEADPHONE,"SET_HLP_ACCESSORIES_HEADPHONE"); //Accessories; TvOut settings + +#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/src/GSBaseContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/src/GSBaseContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,255 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Base container for GS some views. +* +*/ + + +// INCLUDE FILES +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CGSBaseContainer::BaseConstructL +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSBaseContainer::BaseConstructL( const TRect& aRect, + TInt aResTitleId, + TInt aResLbxId ) + { + CEikStatusPane* sp = iAvkonAppUi->StatusPane(); + + CAknTitlePane* title = + static_cast ( + sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); + + TResourceReader rReader; + iCoeEnv->CreateResourceReaderLC( rReader, aResTitleId ); + title->SetFromResourceL( rReader ); + CleanupStack::PopAndDestroy(); // rReader + + + CreateWindowL(); // Makes the control a window-owning control + + // Set iListBox to be contained in this container: + iListBox->SetContainerWindowL( *this ); + + ConstructListBoxL( aResLbxId ); + + iListBox->CreateScrollBarFrameL( ETrue ); + iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, + CEikScrollBarFrame::EAuto ); + + SetRect( aRect ); + ActivateL(); + } + + +// --------------------------------------------------------------------------- +// CGSBaseContainer::CGSBaseContainer +// Constructor +// +// --------------------------------------------------------------------------- +// +EXPORT_C CGSBaseContainer::CGSBaseContainer() + { + iElaf = ( AknLayoutUtils::Variant() == EEuropeanVariant ); + } + + +// --------------------------------------------------------------------------- +// CGSBaseContainer::~CGSBaseContainer +// Destructor +// +// --------------------------------------------------------------------------- +// +EXPORT_C CGSBaseContainer::~CGSBaseContainer() + { + if ( iListBox ) + { + delete iListBox; + } + } + + +// --------------------------------------------------------------------------- +// CGSBaseContainer::ConstructListBoxL +// +// Construct's ListBox from Resource ID +// --------------------------------------------------------------------------- +// +void CGSBaseContainer::ConstructListBoxL( TInt aResLbxId ) + { + TResourceReader rReader; + iCoeEnv->CreateResourceReaderLC( rReader, aResLbxId ); + + // Construct's iListBox from resource file + iListBox->ConstructFromResourceL( rReader ); + CleanupStack::PopAndDestroy(); // rReader + } + + +// --------------------------------------------------------------------------- +// CGSBaseContainer::SizeChanged +// called by framwork when the view size is changed +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSBaseContainer::SizeChanged() + { + if ( iListBox ) + { + iListBox->SetRect( Rect() ); + } + } + + +// --------------------------------------------------------------------------- +// CGSBaseContainer::CountComponentControls +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CGSBaseContainer::CountComponentControls() const + { + return 1; + } + + +// --------------------------------------------------------------------------- +// CGSBaseContainer::ComponentControl +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C CCoeControl* CGSBaseContainer::ComponentControl( TInt /*aIndex*/ ) + const + { + return iListBox; + } + + +// --------------------------------------------------------------------------- +// CGSMainContainer::TKeyResponse OfferKeyEventL +// Called when a key is pressed. +// +// --------------------------------------------------------------------------- + +EXPORT_C TKeyResponse CGSBaseContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + switch ( aKeyEvent.iCode ) + { + case EKeyLeftArrow: + case EKeyRightArrow: + // Listbox takes all event even if it doesn't use them: + return EKeyWasNotConsumed; + default: + break; + } + + // Now it's iListBox's job to process the key event + return iListBox->OfferKeyEventL( aKeyEvent, aType ); + } + + +// --------------------------------------------------------------------------- +// CGSMainContainer::HandleResourceChange +// +// --------------------------------------------------------------------------- +EXPORT_C void CGSBaseContainer::HandleResourceChange( TInt aType ) + { + CCoeControl::HandleResourceChange( aType ); + if ( aType == KAknsMessageSkinChange || + aType == KEikDynamicLayoutVariantSwitch ) + { + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + mainPaneRect); + SetRect( mainPaneRect ); + } + } + + +// ----------------------------------------------------------------------------- +// CGSBaseContainer::SetSelectedItem() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CGSBaseContainer::SetSelectedItem( TInt aIndex ) + { + if( iListBox && aIndex >= 0 ) + { + iListBox->SetCurrentItemIndexAndDraw( aIndex ); + } + } + + +// ----------------------------------------------------------------------------- +// CGSBaseContainer::SelectedItem() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CGSBaseContainer::SelectedItem() + { + TInt selectedItem = 0; + if( iListBox ) + { + selectedItem = iListBox->CurrentItemIndex(); + } + return selectedItem; + } + + +// --------------------------------------------------------------------------- +// CGSContainer::FocusChanged +// +// Set focus on the selected listbox. For animated skins feature. +// --------------------------------------------------------------------------- +EXPORT_C void CGSBaseContainer::FocusChanged( TDrawNow /*aDrawNow*/ ) + { + if( iListBox ) + { + iListBox->SetFocus( IsFocused() ); + } + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/src/GSBaseDocument.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/src/GSBaseDocument.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,269 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base Document for the General Settings Application +* +*/ + +#include "GSBaseDocument.h" + +// User includes +#include "GSPluginWrapper.h" +#include "GSPluginAndViewIdCache.h" +#include "GSWatchDog.h" +#include "gsplugininterface.h" +#include "GsLogger.h" + +// Constants +const TInt KGSPluginWrapperObjectGranularity = 10; + + +// ================= MEMBER FUNCTIONS ======================= + +// ---------------------------------------------------- +// CGSBaseDocument::CGSBaseDocument() +// constructor +// +// ---------------------------------------------------- +// +EXPORT_C CGSBaseDocument::CGSBaseDocument( CEikApplication& aApp ) +: CAknDocument( aApp ), + iUnloadWrapperObjects( KGSPluginWrapperObjectGranularity ), + iWatchDog ( NULL ) + { + } + + +// ---------------------------------------------------- +// CGSBaseDocument::~CGSBaseDocument() +// destructor +// +// ---------------------------------------------------- +// +EXPORT_C CGSBaseDocument::~CGSBaseDocument() + { + // This physically unloads the plugin dlls if their ECOM + // reference count is zero. This must be the last thing to + // occur to any plugin object (i.e. all of its code must have + // finished running by the time this next line takes place). + const TInt count = iUnloadWrapperObjects.Count(); + for( TInt i=count-1; i>=0; i-- ) + { + CGSPluginWrapper* object = iUnloadWrapperObjects[ i ]; + (void) object; + delete object; + } + + iUnloadWrapperObjects.Close(); + delete iPluginViewIdCache; +#ifdef GS_ENABLE_WATCH_DOG + delete iWatchDog; +#endif + + iImplInfoArray.ResetAndDestroy();// This is needed + iImplInfoArray.Close(); + } + + +// ---------------------------------------------------- +// CGSBaseDocument::ConstructL() +// Symbian OS second phase constructor +// +// ---------------------------------------------------- +// +EXPORT_C void CGSBaseDocument::ConstructL() + { +#ifdef GS_ENABLE_WATCH_DOG + iWatchDog = CGSWatchDog::NewL(); +#endif + + REComSession::ListImplementationsL( + KGSPluginInterfaceUid, + iImplInfoArray ); +#ifdef _DEBUG + PrintImplInfoArray( iImplInfoArray ); +#endif //_DEBUG + + __GSLOGSTRING1( + "[CGSBaseDocument::ConstructL] iImplInfoArray count:%d", + iImplInfoArray.Count() ); + } + + +// ---------------------------------------------------- +// CGSBaseDocument::NewPluginUnloadWrapperLC() +// +// +// ---------------------------------------------------- +// +EXPORT_C CGSPluginWrapper* CGSBaseDocument::NewPluginUnloadWrapperLC() + { + CGSPluginWrapper* wrapper = new(ELeave) CGSPluginWrapper( *this ); + TCleanupItem wrapperCleanupItem( CleanupPluginWrapperObject, wrapper ); + CleanupStack::PushL( wrapperCleanupItem ); + iUnloadWrapperObjects.AppendL( wrapper ); + // + return wrapper; + } + + +// ---------------------------------------------------- +// CGSBaseDocument::PreparePluginCacheL() +// +// +// ---------------------------------------------------- +// +EXPORT_C void CGSBaseDocument::PreparePluginCacheL( CEikAppUi& aAppUi ) + { + iPluginViewIdCache = CGSPluginAndViewIdCache::NewL( aAppUi ); + } + + +// ---------------------------------------------------- +// CGSBaseDocument::PrepareForUIDestruction() +// +// +// ---------------------------------------------------- +// +EXPORT_C void CGSBaseDocument::PrepareForUIDestruction() + { + if ( iPluginViewIdCache ) + { + iPluginViewIdCache->PrepareForUIDestruction(); + } + } + + +// ---------------------------------------------------- +// CGSBaseDocument::CleanupPluginWrapperObject() +// Cleanup support +// +// ---------------------------------------------------- +// +void CGSBaseDocument::CleanupPluginWrapperObject( TAny* aWrapper ) + { + CGSPluginWrapper* wrapper = + reinterpret_cast< CGSPluginWrapper* >( aWrapper ); + CGSBaseDocument& document = wrapper->Document(); + document.DoCleanupPluginWrapper( wrapper ); + } + + +// ---------------------------------------------------- +// CGSBaseDocument::DoCleanupPluginWrapper() +// Cleanup support - called when loading a plugin fails +// +// ---------------------------------------------------- +// +void CGSBaseDocument::DoCleanupPluginWrapper( CGSPluginWrapper* aWrapper ) + { + const TInt index = iUnloadWrapperObjects.Find( aWrapper ); + if ( index >= 0 && index < iUnloadWrapperObjects.Count() ) + { + iUnloadWrapperObjects.Remove( index ); + delete aWrapper; + } + } + + +// ---------------------------------------------------- +// CGSBaseDocument::PluginViewIdCache() +// +// +// ---------------------------------------------------- +// +CGSPluginAndViewIdCache& CGSBaseDocument::PluginViewIdCache() + { + ASSERT( iPluginViewIdCache ); + return *iPluginViewIdCache; + } + + +// ---------------------------------------------------- +// CGSBaseDocument::PluginViewIdCache() +// +// +// ---------------------------------------------------- +// +const CGSPluginAndViewIdCache& CGSBaseDocument::PluginViewIdCache() const + { + ASSERT( iPluginViewIdCache ); + return *iPluginViewIdCache; + } + + + +// ---------------------------------------------------- +// CGSBaseDocument::WatchDog() +// +// +// ---------------------------------------------------- +// +EXPORT_C MGSWatchDog* CGSBaseDocument::WatchDog() + { + return iWatchDog; + } + +// ---------------------------------------------------- +// CGSBaseDocument::GetImplInfos() +// +// +// ---------------------------------------------------- +// +EXPORT_C RImplInfoPtrArray CGSBaseDocument::GetImplInfo() + { + return iImplInfoArray; + } + +EXPORT_C void CGSBaseDocument::CreateShimmedViewL(const TUid aViewUid) + { + ASSERT(iPluginViewIdCache); + if ( !iPluginViewIdCache->PluginInstance(aViewUid) ) + { + iPluginViewIdCache->RegisterViewAndImplementationAssociationL(aViewUid, aViewUid, ETrue); + } + } + +void CGSBaseDocument::PrintImplInfoArray( const RImplInfoPtrArray& aImplInfoArray ) + { + for( TInt i = 0; i < aImplInfoArray.Count(); i++ ) + { + PrintImplInfo( *aImplInfoArray[ i ] ); + } + } + + +void CGSBaseDocument::PrintImplInfo( const CImplementationInformation& aInfo ) + { + __GSLOGSTRING1( "[CGSBaseDocument] --Plugin 0x%X info--", &aInfo); + __GSLOGSTRING1( "[CGSBaseDocument] DisplayName:%S", &aInfo.DisplayName() ); + __GSLOGSTRING1( "[CGSBaseDocument] ImplementationUid:0x%X", + aInfo.ImplementationUid() ); + + const TInt KMaxEComDataLength = 256; + + HBufC* dataType = HBufC::New( KMaxEComDataLength ); + HBufC* opaqueData = HBufC::New( KMaxEComDataLength ); + + dataType->Des().Copy( aInfo.DataType() ); + opaqueData->Des().Copy( aInfo.OpaqueData() ); + __GSLOGSTRING1( "[CGSBaseDocument] DataType:%S", dataType ); + __GSLOGSTRING1( "[CGSBaseDocument] OpaqueData:%S", opaqueData ); + + delete opaqueData; + delete dataType; + } + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/src/GSBaseView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/src/GSBaseView.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,303 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base view for all General Settings views. +* +*/ + + +// INCLUDE FILES +#include +#include + +#include +#include +#include +#include +#include +#include +#include // BaflUtils +#include +#include + + +//Disabling warning caused by KGSDoActivateError constant +#pragma diag_suppress 177 +// CONSTANTS +_LIT( KGSDoActivateError, "DoActivateL" ); + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSBaseView::CGSBaseView +// +// C++ constructor +// --------------------------------------------------------------------------- +EXPORT_C CGSBaseView::CGSBaseView() + : iResourceLoader( *iCoeEnv ) + { + iAppUi = AppUi(); + iElaf = ( AknLayoutUtils::Variant() == EEuropeanVariant ); + } + + +// --------------------------------------------------------------------------- +// CGSBaseView::~CGSBaseView +// +// Destructor +// --------------------------------------------------------------------------- +EXPORT_C CGSBaseView::~CGSBaseView() + { + iResourceLoader.Close(); + if (iContainer) + { + AppUi()->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + } + if ( iNaviPaneContext ) + { + delete iNaviPaneContext; + } + } + + +// --------------------------------------------------------------------------- +// CGSBaseView::Container +// +// +// --------------------------------------------------------------------------- +EXPORT_C CGSBaseContainer* CGSBaseView::Container() + { + return iContainer; + } + + +// --------------------------------------------------------------------------- +// CGSBaseView::SetCurrentItem +// +// +// --------------------------------------------------------------------------- +EXPORT_C void CGSBaseView::SetCurrentItem( TInt aIndex ) + { + iCurrentItem = aIndex; + } + + +// --------------------------------------------------------------------------- +// CGSBaseView::HandleListBoxEventL +// +// +// --------------------------------------------------------------------------- + +EXPORT_C void CGSBaseView::HandleListBoxEventL( CEikListBox* /*aListBox*/, + TListBoxEvent aEventType ) + { + switch ( aEventType ) + { + case EEventEnterKeyPressed: + case EEventItemSingleClicked: + HandleListBoxSelectionL(); + break; + default: + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSBaseView::SetNaviPaneL +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSBaseView::SetNaviPaneL() + { + CAknNavigationControlContainer* naviControlContainer = + NaviControlContainerL(); + if ( iNaviPaneContext ) + { + naviControlContainer->PushL( *iNaviPaneContext ); + } + else + { + naviControlContainer->PushDefaultL(); + } + } + + +// --------------------------------------------------------------------------- +// CGSBaseView::CreateNaviPaneContextL +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSBaseView::CreateNaviPaneContextL( TInt aResourceId ) + { + TResourceReader reader; + iCoeEnv->CreateResourceReaderLC( reader, aResourceId ); + CAknNavigationControlContainer* naviControlContainer = + NaviControlContainerL(); + iNaviPaneContext = naviControlContainer->CreateMessageLabelL( reader ); + CleanupStack::PopAndDestroy(); // reader + } + + +// --------------------------------------------------------------------------- +// CGSBaseView::NaviControlContainerL +// +// +// --------------------------------------------------------------------------- +// +CAknNavigationControlContainer* CGSBaseView::NaviControlContainerL() + { + CAknNavigationControlContainer* control = NULL; + if( !iNaviControlContainer ) + { + iNaviControlContainer = + static_cast( + AppUi()->StatusPane()->ControlL( TUid::Uid( + EEikStatusPaneUidNavi ) ) ); + } + else + { + control = iNaviControlContainer; + } + + return control; + } + + +// --------------------------------------------------------------------------- +// CGSBaseView::HandleClientRectChange +// +// +// --------------------------------------------------------------------------- +void CGSBaseView::HandleClientRectChange() + { + if ( iContainer && iContainer->iListBox ) + { + iContainer->SetRect( ClientRect() ); + } + } + + +// --------------------------------------------------------------------------- +// CGSBaseView::DoActivateL +// Activates the view. +// +// --------------------------------------------------------------------------- +EXPORT_C void CGSBaseView::DoActivateL( const TVwsViewId& aPrevViewId, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + iPrevViewId = aPrevViewId; +// if( iContainer ) +// { +// AppUi()->RemoveFromViewStack( *this, iContainer ); +// +// delete iContainer; +// iContainer = NULL; +// } + if ( !iContainer ) + { + CreateContainerL(); + AppUi()->AddToViewStackL( *this, iContainer ); + iContainer->iListBox->SetListBoxObserver( this ) ; + iContainer->iListBox->SetTopItemIndex( iTopItemIndex ); + iContainer->SetSelectedItem( iCurrentItem ); + } + } + + +// --------------------------------------------------------------------------- +// CGSBaseView::DoDeactivate() +// +// +// --------------------------------------------------------------------------- +EXPORT_C void CGSBaseView::DoDeactivate() + { + if ( iContainer ) + { + iCurrentItem = iContainer->SelectedItem(); + AppUi()->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + iContainer = NULL; + } + } + + +// --------------------------------------------------------------------------- +// CGSBaseView::CreateContainerL() +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSBaseView::CreateContainerL() + { + NewContainerL(); + __ASSERT_DEBUG( + iContainer, User::Panic( KGSDoActivateError, EGSViewPanicNullPtr ) ); + iContainer->SetMopParent( this ); + + TRAPD( error, iContainer->ConstructL( ClientRect() ) ); + + if ( error ) + { + delete iContainer; + iContainer = NULL; + User::Leave( error ); + } + } + + +// --------------------------------------------------------------------------- +// CGSBaseView::OpenLocalizedResourceFileL() +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSBaseView::OpenLocalizedResourceFileL( + const TDesC& aResourceFileName, + RConeResourceLoader& aResourceLoader ) + { + RFs &fsSession = CCoeEnv::Static()->FsSession(); + + // Find the resource file: + TParse parse; + parse.Set( aResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL ); + TFileName fileName( parse.FullName() ); + + // Get language of resource file: + BaflUtils::NearestLanguageFile( fsSession, fileName ); + + // Open resource file: + aResourceLoader.OpenL( fileName ); + } + + +// ----------------------------------------------------------------------------- +// CGSBaseView::ResetSelectedItemIndex() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CGSBaseView::ResetSelectedItemIndex() + { + iCurrentItem = 0; + if( iContainer ) + { + iContainer->SetSelectedItem( iCurrentItem ); + } + } + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/src/GSEComNotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/src/GSEComNotifier.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,172 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include +#include "GSEComNotifier.h" +#include "GsLogger.h" + +// ======== MEMBER FUNCTIONS ======== + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CGSEComNotifier::CGSEComNotifier( MGSEComObserver* aObserver, + RImplInfoPtrArray aImplInfo ) + : CActive( EPriorityStandard ), + iObserver( aObserver ), + iOriginalImplInfo( aImplInfo ) + { + CActiveScheduler::Add( this ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CGSEComNotifier::ConstructL() + { + iEComSession = REComSession::OpenL(); + IssueRequest(); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CGSEComNotifier* CGSEComNotifier::NewL( MGSEComObserver* aObserver, + RImplInfoPtrArray aImplInfo ) + { + CGSEComNotifier* self = new( ELeave ) CGSEComNotifier( + aObserver, + aImplInfo ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CGSEComNotifier::~CGSEComNotifier() + { + Cancel(); + iEComSession.Close(); + } + + +// --------------------------------------------------------------------------- +// See base class. +// --------------------------------------------------------------------------- +// +void CGSEComNotifier::DoCancel() + { + iEComSession.CancelNotifyOnChange( iStatus ); + } + + +// --------------------------------------------------------------------------- +// See base class. +// --------------------------------------------------------------------------- +// +void CGSEComNotifier::RunL() + { + __GSLOGSTRING1( "[CGSEComNotifier::RunL] iStatus:%d", iStatus ); + + if( PluginCountDeltaL() < 0 ) + { + iObserver->HandleEComEvent( MGSEComObserver::EPluginRemoved ); + } + + IssueRequest(); + + __GSLOGSTRING1( "[CGSEComNotifier::RunL] iStatus:%d", iStatus ); + } + + +// --------------------------------------------------------------------------- +// See base class. +// --------------------------------------------------------------------------- +// +TInt CGSEComNotifier::RunError( TInt aError ) + { + __GSLOGSTRING2( + "[CGSEComNotifier::RunError] aError:%d iStatus:%d", + aError, iStatus ); + + // Special case: Application can throw KLeaveExit basically anytime so we + // have to forward it upwards to app framework. + if( aError == KLeaveExit ) + { + return aError; + } + return KErrNone; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CGSEComNotifier::IssueRequest() + { + if( !IsActive() ) + { + // NotifyOnChange is single shot. + iEComSession.NotifyOnChange( iStatus ); + SetActive(); + } + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CGSEComNotifier::PluginCountDeltaL() + { + // Owned + RImplInfoPtrArray newImplInfo; + + REComSession::ListImplementationsL( + KGSPluginInterfaceUid, + newImplInfo ); + + TInt oldInfoCount = iOriginalImplInfo.Count(); + TInt newInfoCount = newImplInfo.Count(); + + __GSLOGSTRING2( + "[CGSEComNotifier::PluginCountDeltaL] iOriginalImplInfo:%d newImplInfo:%d", + oldInfoCount, newInfoCount ); + + newImplInfo.ResetAndDestroy(); + newImplInfo.Close(); + + // Count the delta between old and current infos: + return newInfoCount - oldInfoCount; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/src/GSParentContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/src/GSParentContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,891 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for GSParentPlugin. +* +*/ + +// INCLUDE FILES +#include +#include +#include +#include "GsLogger.h" +#include +#include +#include "GSBaseDocument.h" +#include + +#include //for loading icons +#include +#include //for loading icons +#include +#include +#include +#include // For TResourceReader +#include +#include +#include +#include "GsContainerExt.h" //For CGsContainerExt + +//CONSTANTS +const TInt KGSPluginArrayInitSize = 10; +const TInt KGSCaptionBufSize = 256; + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSParentContainer::ConstructL(const TRect& aRect) +// Symbian OS two phased constructor +// +// --------------------------------------------------------------------------- +// +void CGSParentContainer::ConstructL( + const TRect& aRect, + CAknViewAppUi* aAppUi, + CArrayPtrFlat* aPluginArray, + TInt aTitleRscId, + CGSParentPlugin* aParentPlugin, + TGSListboxTypes aListBoxType ) + { + iAppUi = aAppUi; + iPluginArray = aPluginArray; + iListBoxType = aListBoxType; + iParentPlugin = aParentPlugin; + + CGSBaseDocument* doc = static_cast< CGSBaseDocument* >( iAppUi->Document() ); + iExt = CGsContainerExt::NewL(); + iExt->iGSWatchDog = doc->WatchDog(); + + // Initialize the array containing pointers to plugins that are actually + // displayed in lbx. + iVisiblePlugins = new (ELeave) CArrayPtrFlat( KGSPluginArrayInitSize ); + + __GSLOGSTRING( "[CGSParentContainer] ConstructL" ); + + // Set view title from resource: + CEikStatusPane* sp = iAppUi->StatusPane(); + CAknTitlePane* title = static_cast + ( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); + TResourceReader rReader; + iCoeEnv->CreateResourceReaderLC( rReader, aTitleRscId ); + title->SetFromResourceL( rReader ); + CleanupStack::PopAndDestroy(); // rReader + + CreateWindowL(); //makes this control a window-owning control + + CreateListBoxL( iListBoxType ); + + SetRect( aRect ); + ActivateL(); + } + + +// --------------------------------------------------------------------------- +// CGSParentContainer::~CGSParentContainer() +// Destructor +// +// --------------------------------------------------------------------------- +// +CGSParentContainer::~CGSParentContainer() + { + __GSLOGSTRING( "[CGSParentContainer] ~CGSParentContainer()|->" ); + if ( iVisiblePlugins ) + { + iVisiblePlugins->Reset(); + } + delete iVisiblePlugins; + if ( iListBox ) + { + delete iListBox; + } + delete iExt; + __GSLOGSTRING( "[CGSParentContainer] ~CGSParentContainer()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSParentContainer::UpdateListboxL +// +// Updates listbox from iPluginArray. Uses switch statement to handle different +// listbox types from TGSListboxTypes because the list item format +// and icon numbers depend on the listbox type. +// --------------------------------------------------------------------------- +// +void CGSParentContainer::UpdateListBoxL() + { + __GSLOGSTRING( "[CGSParentContainer::UpdateListBoxL]" ); + iItemTextArray->Reset(); + + // Empty the array because it will be updated. + iVisiblePlugins->Reset(); + + // Array for icons in the listbox. Array owns the icons. + CAknIconArray* icons = NULL; + + // Create icon array if required by the listbox type: + switch( iListBoxType ) + { + case EGSListBoxTypeSingleLarge: + case EGSListBoxTypeDouble2Large: + case EGSListBoxTypeDoubleLarge: + icons = new (ELeave) CAknIconArray( KGSPluginArrayInitSize ); + CleanupStack::PushL( icons ); + break; + + default: + break; + } + + // Counter for created icons. This is used to maintain corrext indexing for + // each plugin's icons in case a plugin has multiple icons and icon indexes + // can not be mapped directly to plugin index. + TInt iconCounter = 0; + + // 1) Add each plugin's data to listbox if the plugin is visible. + for( TInt i = 0; i < iPluginArray->Count(); i++ ) + { + CGSPluginInterface* plugin = iPluginArray->operator[]( i ); + + // Adding plugin data to lbx has a lot of CGSPluginInterface API calls. + // -> A good place to use quarantine to catch panicking plugins in + // any of these calls. + #ifdef GS_ENABLE_WATCH_DOG + iExt->iGSWatchDog->QuarantineL( plugin->Id() ); + #endif + + if( plugin->Visible() ) + { + AddPluginDataToLbxL( plugin, + iItemTextArray, + icons, + iconCounter ); + } + #ifdef GS_ENABLE_WATCH_DOG + iExt->iGSWatchDog->RemoveFromQuarantineL( plugin->Id() ); + #endif + } + + // 2) Replace old icon array if needed. + switch( iListBoxType ) + { + case EGSListBoxTypeSingleLarge: + { + // Temporary variable needed to use casted lbx. + CAknSingleLargeStyleListBox* lbx = + STATIC_CAST( CAknSingleLargeStyleListBox*, iListBox ); + // Destroy the old icons because SetIconArray() does not destroy them. + CArrayPtr* oldIcons + = lbx->ItemDrawer()->ColumnData()->IconArray(); + if( oldIcons ) + { + __GSLOGSTRING( "[CGSParentContainer] Destroying old icons." ); + oldIcons->ResetAndDestroy(); + delete oldIcons; + } + // Transfer ownership of icon array to the lbx. + // SetIconArray() does not delete the old icon array + lbx->ItemDrawer()->ColumnData()->SetIconArray( icons ); + CleanupStack::Pop( icons ); + } + break; + case EGSListBoxTypeDouble2Large: + case EGSListBoxTypeDoubleLarge: + { + // Temporary variable needed to use casted lbx. + CEikFormattedCellListBox* lbx = + STATIC_CAST( CEikFormattedCellListBox*, iListBox ); + // Destroy the old icons because SetIconArray() does not destroy them. + CArrayPtr* oldIcons + = lbx->ItemDrawer()->ColumnData()->IconArray(); + if( oldIcons ) + { + __GSLOGSTRING( "[CGSParentContainer] Destroying old icons." ); + oldIcons->ResetAndDestroy(); + delete oldIcons; + } + // Transfer ownership of icon array to the lbx. + // SetIconArray() does not delete the old icon array + lbx->ItemDrawer()->ColumnData()->SetIconArray( icons ); + CleanupStack::Pop( icons ); + } + break; + + case EGSListBoxTypeSettings: + break; + + default: + break; + } + +#ifdef _GS_PARENTPLUGIN_LBX_FORMAT_TRACES +#pragma message("_GS_PARENTPLUGIN_LBX_FORMAT_TRACES activated") + __GSLOGSTRING( "[CGSParentContainer::UpdateListBoxL] iItemTextArray:" ); + for( TInt i = 0; i < iItemTextArray->Count(); i++ ) + { + __GSLOGSTRING1( "%S", &iItemTextArray->operator[]( i ) ); + } +#endif // _GS_PARENTPLUGIN_LBX_FORMAT_TRACES + + // 3) Draw listbox again + iListBox->HandleItemAdditionL(); + __GSLOGSTRING( "[CGSParentContainer] UpdateListBoxL()-|" ); + } + + +// ----------------------------------------------------------------------------- +// CGSParentContainer::AddPluginDataToLbxL() +// +// +// ----------------------------------------------------------------------------- +// +void CGSParentContainer::AddPluginDataToLbxL( CGSPluginInterface* aPlugin, + CDesCArray* aItemTextArray, + CAknIconArray* aIconArray, + TInt& aIconCounter ) + { + // Used to disable icon + const TInt KIconNotSupported = -1; + + // Index of icon used in AB-column + TInt iconIndexAB = KIconNotSupported; + + // Index of icon used in D-column + TInt iconIndexD = KIconNotSupported; + +#pragma message("TODO: The HBufC buffer sizes could be optimized if possible:") + + // First line of lbx item text (plugin caption) + HBufC* firstLabelBuf = HBufC::NewLC( KGSCaptionBufSize ); + TPtr firstLabel = firstLabelBuf->Des(); + + // Second line of lbx item text (optional) + HBufC* secondLabelBuf = HBufC::NewLC( KGSCaptionBufSize ); + TPtr secondLabel = secondLabelBuf->Des(); + + // The complete formatted lbx item string which is added to lbx + HBufC* lbxItemStringBuf = HBufC::NewLC( KGSCaptionBufSize * 2 ); + TPtr lbxItemString = lbxItemStringBuf->Des(); + + // Separates lbx item elements + _LIT( KTab, "\t" ); + + // Normal icon in AB-Column + CGulIcon* iconAB = NULL; + + // Small icon used in D-column (optional) + CGulIcon* iconD = NULL; + + // Add the plugin to visible plugins array: + iVisiblePlugins->AppendL( aPlugin ); + + // 1) Read item descriptor from plugin: + TRAPD( captionErr, + aPlugin->GetCaptionL( firstLabel ); + ) + + // If plugin caption fails, set caption to error string. + if( captionErr != KErrNone ) + { + _LIT( KGSParentPluginCaptionErrorTxt, "Error" ); + firstLabel.Append( KGSParentPluginCaptionErrorTxt ); + } + else + { + __GSLOGSTRING2( "[CGSParentContainer] 0x%X::GetCaptionL Error: %d", + aPlugin->Id().iUid, captionErr ); + } + + // 2) Add icons if listbox uses them: + // - AB-column icon + // - D-column icon + switch( iListBoxType ) + { + case EGSListBoxTypeSingleLarge: + case EGSListBoxTypeDouble2Large: + case EGSListBoxTypeDoubleLarge: + { + // This might fail because plugin implementors might do funny stuff. + // GS Must still behave well... + TRAPD( iconErr, + iconAB = aPlugin->CreateIconL( KGSIconTypeLbxItem ); + ) + if( iconErr != KErrNone ) + { + // Use default icon because plugin implementor's CreateIconL + // failed. If this fails, everything is lost anyway so might as + // well leave (abort GS). + iconAB = aPlugin->CGSPluginInterface::CreateIconL( KGSIconTypeLbxItem ); + __GSLOGSTRING2( "[CGSParentContainer] CreateIconL for 0x%X failed:%d", + aPlugin->Id().iUid, + iconErr ); + } + if( iconAB ) // Append only if not NULL (not supported) + { + CleanupStack::PushL( iconAB ); + aIconArray->AppendL( iconAB ); + CleanupStack::Pop( iconAB ); + iconIndexAB = aIconCounter; + aIconCounter++; + } + + TRAPD( iconDColErr, + iconD = aPlugin->CreateIconL( KGSIconTypeDColumn ); + ) + if( iconDColErr != KErrNone ) + { + iconD = aPlugin->CGSPluginInterface::CreateIconL( KGSIconTypeDColumn ); + __GSLOGSTRING2( "[CGSParentContainer] CreateIconL for 0x%X failed:%d", + aPlugin->Id().iUid, + iconErr ); + } + if( iconD ) // Append only if not NULL (not supported) + { + CleanupStack::PushL( iconD ); + aIconArray->AppendL( iconD ); + CleanupStack::Pop( iconD ); + iconIndexD = aIconCounter; + aIconCounter++; + } + break; + } + case EGSListBoxTypeSettings: + break; + + default: + break; + } + + /** + * 3) Create formatted item string. Lbx item's format string depends + * on lbx type. + */ + switch( iListBoxType ) + { + /** + * list_single_large_pane: + * list item string format: "1\tTextLabel\t0\t0" + * where 0 is an index to icon array + */ + case EGSListBoxTypeSingleLarge: + { + if( iconIndexAB != KIconNotSupported ) lbxItemString.AppendNum( iconIndexAB ); // AB-Column icon + lbxItemString.Append( KTab ); + lbxItemString.Append( firstLabel ); + break; + } + /** + * list_setting_pane and list_big_single_setting_pane: + * list item string format: "\tFirstLabel\t\tValueText" + * list item string format: "\tFirstLabel\t0\t" + * list item string format: "\tFirstLabel\t\tValueText\t*" + * list item string format: "\tFirstLabel\t\t\t\tSecondLabel" + * where 0 is an index to icon array + */ + case EGSListBoxTypeSettings: + { + aPlugin->GetValue( EGSPluginKeySettingsItemValueString, secondLabel ); + + lbxItemString.Append( KTab ); + lbxItemString.Append( firstLabel ); + lbxItemString.Append( KTab ); + lbxItemString.Append( KTab ); + lbxItemString.Append( secondLabel ); + break; + } + /** + * list_double2_large_graphic_pane: + * list item string format: "1\tFirstLabel\tSecondLabel\t0" + * where 0 is an index of small (13x13) icon in icon array + * and 1 is an index of a thumbnail image + */ + case EGSListBoxTypeDouble2Large: + case EGSListBoxTypeDoubleLarge: + { + aPlugin->GetValue( EGSPluginKeySettingsItemValueString, secondLabel ); + + if( iconIndexAB != KIconNotSupported ) lbxItemString.AppendNum( iconIndexAB ); // AB-Column icon + lbxItemString.Append( KTab ); + lbxItemString.Append( firstLabel ); // FirstLabel + lbxItemString.Append( KTab ); + lbxItemString.Append( secondLabel ); // SecondLabel + lbxItemString.Append( KTab ); + if( iconIndexD != KIconNotSupported ) lbxItemString.AppendNum( iconIndexD ); // D-Column Icon + break; + } + } + aItemTextArray->AppendL( lbxItemString ); + + CleanupStack::PopAndDestroy( lbxItemStringBuf ); + CleanupStack::PopAndDestroy( secondLabelBuf ); + CleanupStack::PopAndDestroy( firstLabelBuf ); + } + + +// --------------------------------------------------------------------------- +// CGSParentContainer::ListBox() +// +// +// --------------------------------------------------------------------------- +// +CEikListBox* CGSParentContainer::ListBox() + { + return iListBox; + } + + +// --------------------------------------------------------------------------- +// CGSParentContainer::SizeChanged +// called by framework when the view size is changed +// +// --------------------------------------------------------------------------- +// +void CGSParentContainer::SizeChanged() + { + if ( iListBox ) + { + iListBox->SetRect( Rect() ); + } + } + + +// --------------------------------------------------------------------------- +// CGSParentContainer::CountComponentControls +// +// +// --------------------------------------------------------------------------- +// +TInt CGSParentContainer::CountComponentControls() const + { + return 1; + } + + +// --------------------------------------------------------------------------- +// CGSParentContainer::ComponentControl +// +// +// --------------------------------------------------------------------------- +// +CCoeControl* CGSParentContainer::ComponentControl(TInt /*aIndex*/) const + { + return iListBox; + } + + +// --------------------------------------------------------------------------- +// CGSParentContainer::TKeyResponse OfferKeyEventL +// Called when a key is pressed. +// +// --------------------------------------------------------------------------- +// +TKeyResponse CGSParentContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + switch ( aKeyEvent.iCode ) + { + case EKeyUpArrow: + case EKeyDownArrow: + { + TKeyResponse listboxResp = + iListBox->OfferKeyEventL( aKeyEvent, aType ); + if ( iParentPlugin ) + { + iParentPlugin->CheckMiddleSoftkeyLabelL(); + } + return listboxResp; + } + case EKeyLeftArrow: + case EKeyRightArrow: + // Listbox takes all events even if it doesn't use them + return EKeyWasNotConsumed; + default: + break; + } + // now it's iListBox's job to process the key event + return iListBox->OfferKeyEventL( aKeyEvent, aType ); + } + + +// --------------------------------------------------------------------------- +// CGSParentContainer::HandleListBoxEventL +// +// +// --------------------------------------------------------------------------- +void CGSParentContainer::HandleListBoxEventL( CEikListBox* aListBox, + TListBoxEvent aEventType ) + { + __GSLOGSTRING1( + "[CGSParentContainer] HandleListBoxEventL aEventType:%d", + aEventType); + switch (aEventType) + { + case EEventEnterKeyPressed: + case EEventItemSingleClicked: + { + __GSLOGSTRING1( + "[CGSParentContainer] Activating view plugin in index[%d]", + aListBox->CurrentItemIndex() ); + + if( aListBox->CurrentItemIndex() < 0 ) + { + // Negative listbox value -> no item selected? + break; + } + + if(iExt->iDblClickPreventer->IsActive()) + { + break; + } + iExt->iDblClickPreventer->Start(); + CGSPluginInterface* selectedPlugin = iVisiblePlugins->operator[]( + aListBox->CurrentItemIndex() ); + + // Different command is used depending on the plugin type. + switch( selectedPlugin->ItemType() ) + { + // In these cases the plugin is a view: + case EGSItemTypeSingleLarge: + case EGSItemTypeSetting: + case EGSItemTypeSettingIcon: + iAppUi->ActivateLocalViewL( selectedPlugin->Id() ); + break; + // In these cases the plugin is a dialog: + case EGSItemTypeSettingDialog: + case EGSItemTypeSingleLargeDialog: + selectedPlugin->HandleSelection( + EGSSelectionBySelectionKey ); + UpdateListBoxL(); // Refrest the listbox if value changed. + break; + } + } + break; + + default: + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSParentContainer::HandleResourceChange() +// +// +// --------------------------------------------------------------------------- +// +void CGSParentContainer::HandleResourceChange( TInt aType ) + { + CCoeControl::HandleResourceChange( aType ); + //Handle layout orientation or skin change + if ( aType == KAknsMessageSkinChange || + aType == KEikDynamicLayoutVariantSwitch ) + { + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + mainPaneRect); + SetRect( mainPaneRect ); + if ( aType == KAknsMessageSkinChange ) + { + TRAP_IGNORE( UpdateListBoxL() ); + } + } + } + + +// --------------------------------------------------------------------------- +// CGSParentContainer::CreateListBoxL() +// +// +// --------------------------------------------------------------------------- +// +void CGSParentContainer::CreateListBoxL( + TGSListboxTypes aListBoxType ) + { + switch( aListBoxType ) + { + case EGSListBoxTypeSingleLarge: + { + CAknSingleLargeStyleListBox* lbx = + new( ELeave ) CAknSingleLargeStyleListBox; + iListBox = lbx; + lbx->ConstructL( this ); + lbx->SetContainerWindowL( *this ); + lbx->SetListBoxObserver( this ); + lbx->CreateScrollBarFrameL( ETrue ); + lbx->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); + // Obtain reference to listbox model's item text array: + iItemTextArray = STATIC_CAST( CDesCArray*, + lbx->Model()->ItemTextArray() ); + } + break; + + case EGSListBoxTypeSettings: + { + CAknSettingStyleListBox* lbx = + new( ELeave ) CAknSettingStyleListBox; + iListBox = lbx; + lbx->ConstructL( this, EAknListBoxSelectionList ); + lbx->SetContainerWindowL( *this ); + lbx->SetListBoxObserver( this ); + lbx->CreateScrollBarFrameL( ETrue ); + lbx->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); + // Obtain reference to listbox model's item text array: + iItemTextArray = STATIC_CAST( CDesCArray*, + lbx->Model()->ItemTextArray() ); + } + break; + + case EGSListBoxTypeDouble2Large: + { + TInt flags = 0; + CAknDouble2LargeStyleListBox* lbx = + new( ELeave ) CAknDouble2LargeStyleListBox; + iListBox = lbx; + lbx->ConstructL( this, flags ); + lbx->SetContainerWindowL( *this ); + lbx->SetListBoxObserver( this ); + lbx->CreateScrollBarFrameL( ETrue ); + lbx->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); + // Obtain reference to listbox model's item text array: + iItemTextArray = STATIC_CAST( CDesCArray*, + lbx->Model()->ItemTextArray() ); + } + break; + + case EGSListBoxTypeDoubleLarge: + { + TInt flags = 0; + CAknDoubleLargeStyleListBox* lbx = + new( ELeave ) CAknDoubleLargeStyleListBox; + iListBox = lbx; + lbx->ConstructL( this, flags ); + lbx->SetContainerWindowL( *this ); + lbx->SetListBoxObserver( this ); + lbx->CreateScrollBarFrameL( ETrue ); + lbx->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); + // Obtain reference to listbox model's item text array: + iItemTextArray = STATIC_CAST( CDesCArray*, + lbx->Model()->ItemTextArray() ); + } + break; + + default: + break; + } + } + + +// ----------------------------------------------------------------------------- +// CGSParentContainer::SelectedPlugin() +// +// +// ----------------------------------------------------------------------------- +// +CGSPluginInterface* CGSParentContainer::SelectedPlugin() + { + CGSPluginInterface* plugin = NULL; + const TInt index = iListBox->CurrentItemIndex(); + if ( index >= 0 && index < iVisiblePlugins->Count() ) + { + plugin = iVisiblePlugins->operator[]( index ); + __GSLOGSTRING2( "[CGSParentContainer] SelectedPlugin 0x%X in index %d", + plugin->Id().iUid, index ); + } + return plugin; + } + + +// ----------------------------------------------------------------------------- +// CGSParentContainer::SetSelectedItem() +// +// +// ----------------------------------------------------------------------------- +// +void CGSParentContainer::SetSelectedItem( TUid aSelectedItemUid ) + { + __GSLOGSTRING1( "[CGSParentContainer] SetSelectedItem(0x%X)", + aSelectedItemUid.iUid ); + + if( aSelectedItemUid != KGSNoneSelected ) + { + TInt selectedItemIndex = 0; + for( TInt i = 0; i < iVisiblePlugins->Count(); i++ ) + { + CGSPluginInterface* plugin = iVisiblePlugins->operator[]( i ); + __GSLOGSTRING2( "[CGSParentContainer] Checking [%d] 0x%X)", + i, plugin->Id().iUid ); + // If plugin is found, select it: + if( plugin->Id() == aSelectedItemUid ) + { + __GSLOGSTRING2( "[CGSParentContainer] Match 0x%X in index %d", + plugin->Id().iUid, i ); + selectedItemIndex = i; + break; + } + } + iListBox->SetCurrentItemIndexAndDraw( selectedItemIndex ); + } + } + + +// ----------------------------------------------------------------------------- +// CGSParentContainer::GetHelpContext() +// +// +// ----------------------------------------------------------------------------- +// +void CGSParentContainer::GetHelpContext( TCoeHelpContext& aContext ) const + { + // This is forwarded to the CGSParentPlugin type class that actually knows + // the help context but does not have its own CCoeControl class. + iParentPlugin->GetHelpContext( aContext ); + } + + +// --------------------------------------------------------------------------- +// CGSParentContainer::FocusChanged +// +// Set focus on the selected listbox. For animated skins feature. +// --------------------------------------------------------------------------- +EXPORT_C void CGSParentContainer::FocusChanged( TDrawNow /*aDrawNow*/ ) + { + if( iListBox ) + { + iListBox->SetFocus( IsFocused() ); + } + } + + +// --------------------------------------------------------------------------- +// CGSParentContainer::HandleSelectionKeyL +// +// Behaves like a selection key. +// --------------------------------------------------------------------------- +void CGSParentContainer::HandleSelectionKeyL() + { + HandleListBoxEventL( iListBox,EEventEnterKeyPressed ); + } + + +// ----------------------------------------------------------------------------- +// CGSParentContainer::TopPlugin() +// +// +// ----------------------------------------------------------------------------- +// +CGSPluginInterface* CGSParentContainer::TopPlugin() + { + CGSPluginInterface* plugin = NULL; + const TInt index = iListBox->TopItemIndex(); + if ( index >= 0 && index < iVisiblePlugins->Count() ) + { + plugin = iVisiblePlugins->operator[]( index ); + __GSLOGSTRING2( "[CGSParentContainer] TopPlugin 0x%X in index %d", + plugin->Id().iUid, index ); + } + return plugin; + } + + +// ----------------------------------------------------------------------------- +// CGSParentContainer::SetSelectedItem() +// +// +// ----------------------------------------------------------------------------- +// +void CGSParentContainer::SetTopItem( TUid aTopItemUid ) + { + __GSLOGSTRING1( "[CGSParentContainer] SetTopItem(0x%X)", + aTopItemUid.iUid ); + + if( aTopItemUid != KGSNoneSelected ) + { + TInt topItemIndex = 0; + for( TInt i = 0; i < iVisiblePlugins->Count(); i++ ) + { + CGSPluginInterface* plugin = iVisiblePlugins->operator[]( i ); + __GSLOGSTRING2( "[CGSParentContainer] Checking [%d] 0x%X)", + i, plugin->Id().iUid ); + // If plugin is found, select it: + if( plugin->Id() == aTopItemUid ) + { + __GSLOGSTRING2( "[CGSParentContainer] Match 0x%X in index %d", + plugin->Id().iUid, i ); + topItemIndex = i; + break; + } + } + iListBox->SetTopItemIndex( topItemIndex ); + } + } + +// ----------------------------------------------------------------------------- +// CGSParentContainer::SetListBoxEmptyTextL() +// +//Set the empty text of list box. +// ----------------------------------------------------------------------------- +// +void CGSParentContainer::SetListBoxEmptyTextL(const TDes& aEmpty ) + { + if ( iListBox ) + { + iListBox->View()->SetListEmptyTextL( aEmpty ); + } + } + +// ----------------------------------------------------------------------------- +// CGSParentContainer::StoreListBoxPositionL +// +//Store the exact position of listbox. +// ----------------------------------------------------------------------------- +// +void CGSParentContainer::StoreListBoxPositionL( CGSParentPlugin::TListBoxPosition& aPosition ) + { + aPosition.iCurrentItemIndex = iListBox->CurrentItemIndex(); + aPosition.iItemOffsetInPixels = iListBox->View()->ItemOffsetInPixels(); + aPosition.iTopItemIndex = iListBox->View()->TopItemIndex(); + } + +// ----------------------------------------------------------------------------- +// CGSParentContainer::RestoreListBoxPositionL +// +//Restore the exact position of listbox. +// ----------------------------------------------------------------------------- +// +void CGSParentContainer::RestoreListBoxPositionL( const CGSParentPlugin::TListBoxPosition& aPosition, TBool aScreenModeChanged ) + { + if( iListBox->View()->BottomItemIndex()>= aPosition.iCurrentItemIndex ) + + { + + if ( aPosition.iCurrentItemIndex >= 0 ) + { + iListBox->SetCurrentItemIndex( aPosition.iCurrentItemIndex ); + } + + if ( aScreenModeChanged ) + { + iListBox->View()->VerticalMoveToItemL( aPosition.iCurrentItemIndex, + CListBoxView::ESingleSelection ); + } + else + { + iListBox->View()->SetItemOffsetInPixels( aPosition.iItemOffsetInPixels ); + iListBox->View()->SetTopItemIndex( aPosition.iTopItemIndex ); + } + } + } +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/src/GSParentPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/src/GSParentPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,719 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for plugins containing other plugins. Asynchronous +* loading of plugins is used. +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include "GsLogger.h" +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// Middle Softkey control ID. +const TInt KGSMSKControlID = 3; +const TInt KGSMSKLength = 256; +const TInt KGSPluginArrayInitSize = 10; + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSParentPlugin::CGSParentPlugin() +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C CGSParentPlugin::CGSParentPlugin() + : iResourceLoader( *iCoeEnv ) + { + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::BaseConstructL() +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSParentPlugin::BaseConstructL( + TInt aViewRscId, + TInt aTitleRscId ) + { + iTitleRscId = aTitleRscId; + iSelectedPluginUid = KGSNoneSelected; + iTopPluginUid = KGSNoneSelected; + + __GSLOGSTRING( "[CGSParentPlugin] ConstructL()" ); + iAppUi = AppUi(); + iPosition.Reset(); + OpenLocalizedResourceFileL( KGSParentPluginResourceFileName, + iResourceLoader ); + CAknView::BaseConstructL( aViewRscId ); + + if( !iOptionFlags[ EGSLoadChildrenOnActivation ] ) + { + StartAsyncPluginLoadL(); + } + } + +// --------------------------------------------------------------------------- +// CGSParentPlugin::StartAsyncPluginLoadL() +// +// +// --------------------------------------------------------------------------- +// +void CGSParentPlugin::StartAsyncPluginLoadL() + { + //Initialize array and start loading plugins into it. + iPluginArray = new (ELeave) CArrayPtrFlat( KGSPluginArrayInitSize ); + iPluginLoader = CGSPluginLoader::NewL( iAppUi ); + iPluginLoader->SetObserver( this ); + iPluginLoader->LoadAsyncL( KGSPluginInterfaceUid, Id(), iPluginArray ); + } + +// --------------------------------------------------------------------------- +// CGSParentPlugin::UpperLevelViewUid() +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C TUid CGSParentPlugin::UpperLevelViewUid() + { + __GSLOGSTRING( "[CGSParentPlugin] UpperLevelViewUid()" ); + return iPrevViewId.iViewUid; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::~CGSParentPlugin() +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C CGSParentPlugin::~CGSParentPlugin() + { + __GSLOGSTRING( "[CGSParentPlugin] ~CGSParentPlugin" ); + if ( iPluginLoader ) + { + iPluginLoader->AbortAsyncLoad(); + } + delete iPluginLoader; + + if ( iPluginArray ) + { + iPluginArray->Reset();//Do not destroy - Plugins are owned by iAppUi + } + delete iPluginArray; + iResourceLoader.Close(); + + if( iContainer ) + { + iAppUi->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + } + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::OpenLocalizedResourceFileL() +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSParentPlugin::OpenLocalizedResourceFileL( + const TDesC& aResourceFileName, + RConeResourceLoader& aResourceLoader ) + { + RFs &fsSession = CCoeEnv::Static()->FsSession(); + + // Find the resource file: + TParse parse; + parse.Set( aResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL ); + TFileName fileName( parse.FullName() ); + + // Get language of resource file: + BaflUtils::NearestLanguageFile( fsSession, fileName ); + + // Open resource file: + aResourceLoader.OpenL( fileName ); + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoActivateL() +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSParentPlugin::DoActivateL( const TVwsViewId& aPrevViewId, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + __GSLOGSTRING( "[CGSParentPlugin::DoActivateL]" ); + iPrevViewId = aPrevViewId; + + // If iPluginArray does not exist. Lazy loading is enabled and should start + // loading now. + if( !iPluginArray ) + { + StartAsyncPluginLoadL(); + } + + // Set priority only after plugin loader is created in + // StartAsyncPluginLoadL. + iPluginLoader->RequestPriority( CActive::EPriorityHigh ); + + //if( iContainer ) + // { + // iAppUi->RemoveFromViewStack( *this, iContainer ); + // delete iContainer; + // iContainer=NULL; + // } + + if ( !iContainer ) + { + ConstructContainerL(); + + // Set the empty text of list box. + _LIT( KEmptyText, "" ); + TBuf<1> empty( KEmptyText ); + iContainer->SetListBoxEmptyTextL( empty ); + + // Update listbox from already existing iPluginArray: + iContainer->UpdateListBoxL(); + if ( iPosition.iCurrentItemIndex != -1 ) + { + if ( iIsLandscapeOrientation == Layout_Meta_Data::IsLandscapeOrientation() ) + { + iContainer->RestoreListBoxPositionL( iPosition, EFalse ); + } + else + { + iContainer->RestoreListBoxPositionL( iPosition, ETrue ); + } + } + iAppUi->AddToViewStackL(*this, iContainer); + // Navigating to parent view will reset all child plugin selected indexes: + for( TInt i = 0; i < iPluginArray->Count(); i++ ) + { + CGSPluginInterface* plugin = iPluginArray->operator[]( i ); + plugin->ResetSelectedItemIndex(); + } + + iMskCommandId = EAknSoftkeyOpen; + + SetMiddleSoftKeyLabelL( R_QTN_MSK_OPEN, EAknSoftkeyOpen ); + CheckMiddleSoftkeyLabelL(); + + // If this view was launched from external source, use "exit" as RSK + if (iPrevViewId.iAppUid != KUidGS) + { + CEikButtonGroupContainer* cbaGroup = Cba(); + if (cbaGroup) + { + HBufC* rightSKText = StringLoader::LoadLC( + R_GS_PARENTPLUGIN_CBA_EXIT); + TPtr rskPtr = rightSKText->Des(); + cbaGroup->SetCommandL(2, EAknSoftkeyExit, *rightSKText); + CleanupStack::PopAndDestroy(rightSKText); + } + } + + } + } + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoDeactivate() +// +// +// --------------------------------------------------------------------------- +EXPORT_C void CGSParentPlugin::DoDeactivate() + { + __GSLOGSTRING( "[CGSParentPlugin::DoDeactivate]" ); + + iPluginLoader->RequestPriority( CActive::EPriorityLow ); + + if ( iContainer ) + { + iPosition.Reset(); + TRAPD( err, iContainer->StoreListBoxPositionL( iPosition ) ); + iIsLandscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation(); + + iAppUi->RemoveFromViewStack(*this, iContainer); + delete iContainer; + iContainer = NULL; + } + __GSLOGSTRING( "[CGSParentPlugin::DoDeactivate] Done" ); + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::ConstructContainerL() +// +// +// --------------------------------------------------------------------------- +// +void CGSParentPlugin::ConstructContainerL() + { + iContainer = new( ELeave ) CGSParentContainer; + iContainer->SetMopParent( this ); + + TRAPD + ( + error, + iContainer->ConstructL( + ClientRect() , + AppUi(), + iPluginArray, + iTitleRscId, + this, + ListBoxType() ) + ); + + if ( error ) + { + delete iContainer; + iContainer = NULL; + User::Leave( error ); + } + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::HandleCommandL() +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSParentPlugin::HandleCommandL( TInt aCommand ) + { + __GSLOGSTRING1( "[CGSParentPlugin] HandleCommandL(%d)", aCommand ); + + switch ( aCommand ) + { + case EAknSoftkeyBack: + __GSLOGSTRING1( "[CGSParentPlugin] Returning to view 0x%X", + UpperLevelViewUid().iUid ); + iAppUi->ActivateLocalViewL( UpperLevelViewUid() ); + break; + // These all should be handled similarily: + case EAknSoftkeyOpen: + case EGSCmdAppChange: + case EGSCmdAppOpen: + if( iContainer && iPluginArray->Count() > 0 ) + { + CGSPluginInterface* selectedPlugin = + iContainer->SelectedPlugin(); + + if ( NULL != selectedPlugin ) + { + switch( selectedPlugin->ItemType() ) + { + // In these cases the plugin is a view: + case EGSItemTypeSingleLarge: + case EGSItemTypeSetting: + case EGSItemTypeSettingIcon: + iAppUi->ActivateLocalViewL( selectedPlugin->Id() ); + break; + // In these cases the plugin is a dialog: + case EGSItemTypeSettingDialog: + case EGSItemTypeSingleLargeDialog: + selectedPlugin->HandleSelection( + EGSSelectionByMenu ); + break; + } + } + + } + break; + case EGSMSKCmdAppChange: + iContainer->HandleSelectionKeyL(); + break; + case EAknCmdHelp: + { + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), iAppUi->AppHelpContextL() ); + } + break; + } + default: + iAppUi->HandleCommandL( aCommand ); + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::HandlePluginLoaded() +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSParentPlugin::HandlePluginLoaded( KGSPluginLoaderStatus aStatus ) + { + __GSLOGSTRING1( "[CGSParentPlugin::HandlePluginLoaded] aStatus:%d", aStatus ); + + switch( aStatus ) + { + case MGSPluginLoadObserver::EGSSuccess: + // Should not update each time when plugin is loaded, only when + // finished loading spesific view plugins? + break; + case MGSPluginLoadObserver::EGSFinished: + if( iContainer ) + { + TRAPD( ignore, iContainer->UpdateListBoxL(); ); + if( ignore != KErrNone ) + { + __GSLOGSTRING1( + "[CGSParentPlugin] HandlePluginLoaded error:%d", + ignore ); + } + } + break; + default: + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::TransferDynamicPluginL() +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSParentPlugin::TransferDynamicPluginL( CGSPluginInterface* aPlugin ) + { + __GSLOGSTRING1( "[CGSParentPlugin] CGSParentPlugin::TransferDynamicPluginL() - plugin id: 0x%x added to appUi.", aPlugin->Id() ); + + CleanupStack::PushL( aPlugin ); + iAppUi->AddViewL( aPlugin ); + CleanupStack::Pop( aPlugin ); + + // Add to the overall plugin array for this parent plugin + iPluginArray->AppendL( aPlugin ); + + // Resort the plugins so that they are in order + iPluginLoader->SortPluginsL( iPluginArray ); + + // Update the listbox with the new information + HandlePluginLoaded( MGSPluginLoadObserver::EGSSuccess ); + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::ListBoxType() +// Default implementation. Overwrite if different type of listbox is needed. +// +// --------------------------------------------------------------------------- +// +EXPORT_C TGSListboxTypes CGSParentPlugin::ListBoxType() + { + return EGSListBoxTypeSingleLarge; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::UpdateView() +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSParentPlugin::UpdateView() + { + __GSLOGSTRING( "[CGSParentPlugin::UpdateView]" ); + TRAP_IGNORE + ( + if( iContainer ) + { + iContainer->UpdateListBoxL(); + } + ); + } + + +// ----------------------------------------------------------------------------- +// CGSParentPlugin::ResetSelectedItemIndex() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CGSParentPlugin::ResetSelectedItemIndex() + { + iSelectedPluginUid = KGSNoneSelected; + if( iContainer ) + { + iContainer->ListBox()->SetCurrentItemIndex( 0 ); + } + } + + +// ----------------------------------------------------------------------------- +// CGSParentPlugin::SetOptionFlags() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CGSParentPlugin::SetOptionFlags( TBitFlags& aOptionFlags ) + { + iOptionFlags = aOptionFlags; + } + + +// ----------------------------------------------------------------------------- +// CGSParentPlugin::OptionFlags() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const TBitFlags& CGSParentPlugin::OptionFlags() const + { + return iOptionFlags; + } + + +// ----------------------------------------------------------------------------- +// CGSParentPlugin::DynInitMenuPaneL() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CGSParentPlugin::DynInitMenuPaneL( TInt /*aResourceId*/, + CEikMenuPane* aMenuPane ) + { + // Check what is the plugin's desired menu item type for activating the + // plugin. If it doesn't match to the item defined by parent plugin menu + // resource, change the item dynamically. + if ( iContainer->SelectedPlugin() ) + { + CGSPluginInterface* selectedPlugin = iContainer->SelectedPlugin(); + TGSMenuActivationItems desiredItemType = selectedPlugin->MenuActivationItem(); + + // Append new item after this position, delete item in this position. + TInt removableItemPos; + + // MSK command should be identical to the desired activation command in + // options menu. Posibilities are such as 'open' (also as default), + // 'change' or custom text. + // Note: Activation item in options menu is depending on the highlighted + // child plugin's MenuActivationItem() function. + switch( desiredItemType ) + { + case EGSMenuActivationItemDefault: + case EGSMenuActivationItemOpen: + if( aMenuPane->MenuItemExists( EGSCmdAppChange, removableItemPos ) ) + { + aMenuPane->AddMenuItemsL( R_GS_MENU_ITEM_OPEN, removableItemPos ); + aMenuPane->DeleteBetweenMenuItems( removableItemPos, removableItemPos ); + } + break; + + case EGSMenuActivationItemChange: + if( aMenuPane->MenuItemExists( EAknSoftkeyOpen, removableItemPos ) ) + { + aMenuPane->AddMenuItemsL( R_GS_MENU_ITEM_CHANGE, removableItemPos ); + aMenuPane->DeleteBetweenMenuItems( removableItemPos, removableItemPos ); + } + break; + + case EGSMenuActivationItemCustom: + { + // Using EGSCmdAppChange as EGSMenuActivationItemCustom + // functionality is same as for EGSMenuActivationItemChange. + // Here we're replacing EGSCmdAppChange always because we + // cannot be sure whether it's the actual custom command + // already or just EAknSoftkeyOpen. Custom commands will be set + // to use the same command ID (EGSCmdAppChange). + // + CEikMenuPaneItem::SData menuItem; + selectedPlugin->GetValue( EGSCustomMenuActivationText, menuItem.iText ); + menuItem.iCommandId = EGSCmdAppChange; + menuItem.iCascadeId = 0; + menuItem.iFlags = 0; + + if( aMenuPane->MenuItemExists( EGSCmdAppChange, removableItemPos ) ) + { + // Add custom item before 'change' and then remove 'change' + if( menuItem.iText.Length() > 0) + { + aMenuPane->AddMenuItemL( menuItem, EGSCmdAppChange ); + } + aMenuPane->DeleteBetweenMenuItems( removableItemPos, removableItemPos ); + } + else if( aMenuPane->MenuItemExists( EAknSoftkeyOpen, removableItemPos ) ) + { + // Add custom item before 'open' and then remove 'open' + if( menuItem.iText.Length() > 0 ) + { + aMenuPane->AddMenuItemL( menuItem, EAknSoftkeyOpen ); + } + aMenuPane->DeleteBetweenMenuItems( removableItemPos, removableItemPos ); + } + break; + } + default: + break; + } + } + } + + +// ----------------------------------------------------------------------------- +// CGSParentPlugin::GetHelpContext() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CGSParentPlugin::GetHelpContext( TCoeHelpContext& /*aContext*/ ) + { + // Default implementation does nothing. + } + +// ----------------------------------------------------------------------------- +// When this method is called, view checks based on highlight focus, if the MSK +// label is correct. +// ----------------------------------------------------------------------------- +// +void CGSParentPlugin::CheckMiddleSoftkeyLabelL() + { + if ( iContainer->SelectedPlugin() ) + { + // Remove current MSK + RemoveCommandFromMSK( iMskCommandId ); + + CGSPluginInterface* selectedPlugin = iContainer->SelectedPlugin(); + TGSMenuActivationItems desiredItemType = + selectedPlugin->MenuActivationItem(); + + switch( desiredItemType ) + { + case EGSMenuActivationItemChange: + SetMiddleSoftKeyLabelL( R_QTN_MSK_CHANGE, EGSMSKCmdAppChange ); + iMskCommandId = EGSMSKCmdAppChange; + break; + case EGSMenuActivationItemOpen: + case EGSMenuActivationItemDefault: + SetMiddleSoftKeyLabelL( R_QTN_MSK_OPEN, EAknSoftkeyOpen ); + iMskCommandId = EAknSoftkeyOpen; + break; + case EGSMenuActivationItemCustom: + { + HBufC* mskText = HBufC::NewLC( KGSMSKLength ); + TPtr mskPtr = mskText->Des(); + selectedPlugin->GetValue( EGSCustomMenuActivationText, mskPtr ); + SetMiddleSoftKeyLabelTextL( mskPtr, EGSMSKCmdAppChange ); + CleanupStack::PopAndDestroy( mskText ); + break; + } + default: + // Use 'open' as default + SetMiddleSoftKeyLabelL( R_QTN_MSK_OPEN, EAknSoftkeyOpen ); + iMskCommandId = EAknSoftkeyOpen; + break; + } + } + } + +// ----------------------------------------------------------------------------- +// Remove unnecessary commands from Middle softkey. +// ----------------------------------------------------------------------------- +// +void CGSParentPlugin::RemoveCommandFromMSK( TInt aMskCommandId ) + { + CEikButtonGroupContainer* cbaGroup = Cba(); + if ( cbaGroup ) + { + cbaGroup->RemoveCommandFromStack( KGSMSKControlID, aMskCommandId ); + } + } + +// --------------------------------------------------------------------------- +// Sets middle softkey label. +// --------------------------------------------------------------------------- +// +void CGSParentPlugin::SetMiddleSoftKeyLabelL( + const TInt aResourceId, const TInt aCommandId ) + { + CEikButtonGroupContainer* cbaGroup = Cba(); + if ( cbaGroup ) + { + HBufC* middleSKText = StringLoader::LoadLC( aResourceId ); + TPtr mskPtr = middleSKText->Des(); + cbaGroup->AddCommandToStackL( + KGSMSKControlID, + aCommandId, + mskPtr ); + CleanupStack::PopAndDestroy( middleSKText ); + } + } + +// --------------------------------------------------------------------------- +// Sets middle softkey label. +// --------------------------------------------------------------------------- +// +void CGSParentPlugin::SetMiddleSoftKeyLabelTextL( + const TPtr aMskLabel, const TInt aCommandId ) + { + CEikButtonGroupContainer* cbaGroup = Cba(); + if ( cbaGroup ) + { + cbaGroup->AddCommandToStackL( + KGSMSKControlID, + aCommandId, + aMskLabel ); + } + } + +// --------------------------------------------------------------------------- +// Returns selected plugin. +// --------------------------------------------------------------------------- +// +EXPORT_C CGSPluginInterface* CGSParentPlugin::SelectedPlugin() + { + CGSPluginInterface* selectedPlugin = NULL; + if( iContainer ) + { + selectedPlugin = iContainer->SelectedPlugin(); + } + return selectedPlugin; + } + + +void CGSParentPlugin::RequestPriority( CActive::TPriority aPriority ) + { + iPluginLoader->RequestPriority( aPriority ); + __GSLOGSTRING2( "[CGSParentPlugin::RequestPriority] 0x%X aPriority:%d", Id().iUid, aPriority ); + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/src/GSPlaceholderView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/src/GSPlaceholderView.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,156 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* GS plugin wrapper. +* +*/ + +#include "GSPlaceholderView.h" + +// System includes +#include + +// User includes +#include + +// Constants +const TUid KGSInternalPlaceholderViewUid = { 0x0DEADBED }; + + +// ================= MEMBER FUNCTIONS ======================= + +// ---------------------------------------------------------------------------- +// CGSPlaceholderView::CGSPlaceholderView +// +// +// ---------------------------------------------------------------------------- +// +CGSPlaceholderView::CGSPlaceholderView( CCoeAppUi& aAppUi ) +: iAppUi( aAppUi ) + { + } + + +// ---------------------------------------------------------------------------- +// CGSPlaceholderView::~CGSPlaceholderView +// +// +// ---------------------------------------------------------------------------- +// +CGSPlaceholderView::~CGSPlaceholderView() + { + iAppUi.DeregisterView( *this ); + } + + +// ---------------------------------------------------------------------------- +// CGSPlaceholderView::ConstructL +// +// +// ---------------------------------------------------------------------------- +// +void CGSPlaceholderView::ConstructL() + { + iAppUi.RegisterViewL( *this ); + } + + +// ---------------------------------------------------------------------------- +// CGSPlaceholderView::NewL +// +// +// ---------------------------------------------------------------------------- +// +CGSPlaceholderView* CGSPlaceholderView::NewL( CCoeAppUi& aAppUi ) + { + CGSPlaceholderView* self = new(ELeave) CGSPlaceholderView( aAppUi ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CGSPlaceholderView::ActivateL +// +// +// ---------------------------------------------------------------------------- +// +void CGSPlaceholderView::ActivateL() + { + iAppUi.ActivateViewL( ViewId() ); + } + + +// ---------------------------------------------------------------------------- +// CGSPlaceholderView::PreviouslyActiveViewId +// +// +// ---------------------------------------------------------------------------- +// +const TVwsViewId& CGSPlaceholderView::PreviouslyActiveViewId() const + { + return iPreviouslyActiveViewId; + } + + +// --------------------------------------------------------------------------- +// CGSPlaceholderView::SetPreviouslyActiveViewId +// +// +// --------------------------------------------------------------------------- +// +void CGSPlaceholderView::SetPreviouslyActiveViewId( const TVwsViewId& aViewId ) + { + iPreviouslyActiveViewId = aViewId; + } + + +// ---------------------------------------------------------------------------- +// CGSPlaceholderView::ViewId +// +// +// ---------------------------------------------------------------------------- +// +TVwsViewId CGSPlaceholderView::ViewId() const + { + const TVwsViewId ret( KUidGS, KGSInternalPlaceholderViewUid ); + return ret; + } + + +// ---------------------------------------------------------------------------- +// CGSPlaceholderView::ViewActivatedL +// +// +// ---------------------------------------------------------------------------- +// +void CGSPlaceholderView::ViewActivatedL( const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/ ) + { + // NB: aPrevViewId will be the id of the plugin we are trying to load... + } + + +// ---------------------------------------------------------------------------- +// CGSPlaceholderView::ViewDeactivated +// +// +// ---------------------------------------------------------------------------- +// +void CGSPlaceholderView::ViewDeactivated() + { + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/src/GSPluginAndViewIdCache.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/src/GSPluginAndViewIdCache.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,550 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Plugin and view id caching support +* +*/ + + +// INCLUDE FILES +#include "GSPluginAndViewIdCache.h" + +// System includes +#include +#include +#include + +// User includes +#include "GSShimmedView.h" +#include "GSPlaceholderView.h" + +// Constants +_LIT( KGSCacheFileName, "PluginUidToViewIdCache.dat" ); + + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::CGSPluginAndViewIdCache +// C++ constructor. +// +// --------------------------------------------------------------------------- +// +CGSPluginAndViewIdCache::CGSPluginAndViewIdCache( CEikAppUi& aAppUi ) +: iAppUi( aAppUi ), iFsSession(CCoeEnv::Static()->FsSession()),iLookupTable( &HashFunction, &HashIdentityRelation ) + { + } + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::~CGSPluginAndViewIdCache +// C++ destructor. +// +// --------------------------------------------------------------------------- +// +CGSPluginAndViewIdCache::~CGSPluginAndViewIdCache() + { + TRAP_IGNORE( StoreL() ); + // + delete iPlaceholderView; + DestroyShims(); + iLookupTable.Close(); + // + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::ConstructL +// +// +// --------------------------------------------------------------------------- +// +void CGSPluginAndViewIdCache::ConstructL() + { + User::LeaveIfError( iFsSession.CreatePrivatePath( EDriveC ) ); + // + iPlaceholderView = CGSPlaceholderView::NewL( iAppUi ); + // + TRAP_IGNORE( RestoreL() ); + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::NewL +// +// +// --------------------------------------------------------------------------- +// +CGSPluginAndViewIdCache* CGSPluginAndViewIdCache::NewL( CEikAppUi& aAppUi ) + { + CGSPluginAndViewIdCache* self = new(ELeave) CGSPluginAndViewIdCache( aAppUi ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::ActivatePlaceholderViewL +// +// +// --------------------------------------------------------------------------- +// +void CGSPluginAndViewIdCache::ActivatePlaceholderViewL() + { + iPlaceholderView->ActivateL(); + } + + +// ---------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::PriorToPlaceholderActiveViewId +// +// +// ---------------------------------------------------------------------------- +// +const TVwsViewId& CGSPluginAndViewIdCache::PriorToPlaceholderActiveViewId() const + { + return iPlaceholderView->PreviouslyActiveViewId(); + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::SetPriorToPlaceholderActiveViewId +// +// +// --------------------------------------------------------------------------- +// +void CGSPluginAndViewIdCache::SetPriorToPlaceholderActiveViewId( const TVwsViewId& aViewId ) + { + iPlaceholderView->SetPreviouslyActiveViewId( aViewId ); + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::RegisterViewAndImplementationAssociationL +// +// +// --------------------------------------------------------------------------- +// +void CGSPluginAndViewIdCache::RegisterViewAndImplementationAssociationL( TUid aViewId, TUid aImplementationUid ) + { + RegisterViewAndImplementationAssociationL( aViewId, aImplementationUid, EFalse ); + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::PrepareToRegisterPluginInstanceLC +// +// +// --------------------------------------------------------------------------- +// +void CGSPluginAndViewIdCache::PrepareToRegisterPluginInstanceLC( TUid aViewId ) + { + TCacheEntry* value = iLookupTable.Find( aViewId ); + if ( value && value->iShim ) + { + // Store cleanup view uid so that we know which shim to re-register + // if the cleanup item is invoked. + iTransientCleanupViewUid = aViewId; + + // Prepare item + TCleanupItem item( ReRegisterShimWithUi, this ); + CleanupStack::PushL( item ); + + // Unregister shim view + value->iShim->DeregisterView(); + + // If a leave now occurs, the cleanup stack will unwind and will + // invoke our cleanup item. This item will then re-add + // the specified shim to the view framework. See ReRegisterShimWithUiL + // for further details. + } + else + { + // Record not found - just push NULL to ensure cleanup stack + // remains balanced. + CleanupStack::PushL( (CBase*) NULL ); + } + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::RegisterPluginInstanceL +// +// +// --------------------------------------------------------------------------- +// +void CGSPluginAndViewIdCache::RegisterPluginInstanceL( TUid aViewId, CGSPluginInterface& aPluginInstance ) + { + TCacheEntry* value = iLookupTable.Find( aViewId ); + ASSERT( value != NULL ); + + // Can now associate the plugin instance with the cache entry. + value->iLoadedPluginImplementation = &aPluginInstance; + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::PluginImplementationUidForView +// +// +// --------------------------------------------------------------------------- +// +TBool CGSPluginAndViewIdCache::IsPluginLoaded( TUid aViewId ) const + { + CGSPluginInterface* instance = PluginInstance( aViewId ); + + TBool loaded = EFalse; + if ( instance ) + { + loaded = ETrue; + } + + return loaded; + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::PluginInstance +// +// +// --------------------------------------------------------------------------- +// +CGSPluginInterface* CGSPluginAndViewIdCache::PluginInstance( TUid aViewId ) const + { + CGSPluginInterface* ret = NULL; + // + const TCacheEntry* value = iLookupTable.Find( aViewId ); + if ( value ) + { + ret = value->iLoadedPluginImplementation; + } + // + return ret; + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::PluginImplementationUidForView +// +// +// --------------------------------------------------------------------------- +// +TUid CGSPluginAndViewIdCache::PluginImplementationUidForView( TUid aViewId ) const + { + TUid pluginUid = KNullUid; + // + const TCacheEntry* value = iLookupTable.Find( aViewId ); + if ( value ) + { + pluginUid = value->iImplementationUid; + } + // + return pluginUid; + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::DestroyShims +// +// +// --------------------------------------------------------------------------- +// +void CGSPluginAndViewIdCache::DestroyShims() + { + RHashMap< TUid, TCacheEntry >::TIter iterator( iLookupTable ); + FOREVER + { + const TUid* key = iterator.NextKey(); + if ( key ) + { + TCacheEntry* value = iterator.CurrentValue(); + + // Destroy shim instance + delete value->iShim; + value->iShim = NULL; + } + else + { + break; + } + } + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::RestoreL +// +// +// --------------------------------------------------------------------------- +// +void CGSPluginAndViewIdCache::RestoreL() + { + TFileName* cacheFile = new(ELeave) TFileName(); + CleanupStack::PushL( cacheFile ); + GetCacheFileNameL( *cacheFile ); + // + if ( BaflUtils::FileExists( iFsSession, *cacheFile ) ) + { + RFileReadStream cacheStream; + TInt error = cacheStream.Open( iFsSession, *cacheFile, EFileRead ); + User::LeaveIfError( error ); + CleanupClosePushL( cacheStream ); + + // Now read in cache hash table + TUid key = KNullUid; + TUid value = KNullUid; + + const TInt entryCount = cacheStream.ReadInt32L(); + for( TInt i=0; i::TIter iterator( iLookupTable ); + FOREVER + { + const TUid* key = iterator.NextKey(); + if ( key ) + { + const TCacheEntry* value = iterator.CurrentValue(); + stream.WriteUint32L( key->iUid ); + stream.WriteUint32L( value->iImplementationUid.iUid ); + } + else + { + break; + } + } + + // Finalise the stream + stream.CommitL(); + stream.Close(); // Also closes the file + CleanupStack::PopAndDestroy( &stream ); + + // If we got this far it means we created the cache file successfully. + // Now its okay to replace any pre-existing cache file with the + // file we just created. We're re-use the cachePath variable for the + // ultimate filename since it saves allocating another 1/2kb on the heap. + GetCacheFileNameL( *cachePath ); + if ( BaflUtils::FileExists( iFsSession, *cachePath ) ) + { + error = iFsSession.Delete( *cachePath ); + User::LeaveIfError( error ); + } + + // Now rename intermediate file name to ultimate cache file name. + error = iFsSession.Rename( *intermediateFileName, *cachePath ); + User::LeaveIfError( error ); + + CleanupStack::PopAndDestroy( 2, intermediateFileName ); + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::GetCacheFileNameL +// +// +// --------------------------------------------------------------------------- +// +void CGSPluginAndViewIdCache::GetCacheFileNameL( TDes& aFileName ) + { + GetCachePathL( aFileName ); + aFileName.Append( KGSCacheFileName ); + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::GetCachePathL +// +// +// --------------------------------------------------------------------------- +// +void CGSPluginAndViewIdCache::GetCachePathL( TDes& aPath ) + { + aPath.Zero(); + + // Get private data cage path + TInt err = iFsSession.PrivatePath( aPath ); + User::LeaveIfError( err ); + + // Combine with C: drive + const TDriveUnit cDrive( EDriveC ); + const TDriveName cDriveName( cDrive.Name() ); + aPath.Insert( 0, cDriveName ); + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::RegisterViewAndImplementationAssociationL +// +// +// --------------------------------------------------------------------------- +// +void CGSPluginAndViewIdCache::RegisterViewAndImplementationAssociationL( TUid aViewId, TUid aImplementationUid, TBool aCreateShim ) + { + // Check if aViewId is a key within the look up table, so as to avoid + // adding duplicate entries... + const TCacheEntry* value = iLookupTable.Find( aViewId ); + if ( !value ) + { + // No registration for this view yet, so create a new entry + TCacheEntry cacheEntry; + cacheEntry.iImplementationUid = aImplementationUid; + cacheEntry.iLoadedPluginImplementation = NULL; + + if ( aCreateShim ) + { + // Create a new shim + cacheEntry.iShim = CGSShimmedView::NewLC( aViewId, *this, iAppUi ); + } + else + { + cacheEntry.iShim = NULL; + } + + // Add entry to table - the shim ownership is also transferred + // at this point, since the destructor of this class will + // destroy all shims. + iLookupTable.InsertL( aViewId, cacheEntry ); + + if ( aCreateShim ) + { + CleanupStack::Pop( cacheEntry.iShim ); + } + } + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::PrepareForUIDestruction +// +// +// --------------------------------------------------------------------------- +// +void CGSPluginAndViewIdCache::PrepareForUIDestruction() + { + // Have to remove all UI furniture before the AppUi rug is pulled out + // from underneath us... + DestroyShims(); + // + delete iPlaceholderView; + iPlaceholderView = NULL; + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::HandleShimDestruction +// +// +// --------------------------------------------------------------------------- +// +void CGSPluginAndViewIdCache::HandleShimDestruction( TUid aViewId ) + { + TCacheEntry* value = iLookupTable.Find( aViewId ); + if ( value && value->iShim ) + { + // The shim has been destroyed. + value->iShim = NULL; + } + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::ReRegisterShimWithUi +// +// +// --------------------------------------------------------------------------- +// +void CGSPluginAndViewIdCache::ReRegisterShimWithUi( TAny* aSelf ) + { + CGSPluginAndViewIdCache* self = reinterpret_cast< CGSPluginAndViewIdCache* >( aSelf ); + // + if ( self->iTransientCleanupViewUid != KNullUid ) + { + TCacheEntry* value = self->iLookupTable.Find( self->iTransientCleanupViewUid ); + if ( value && value->iShim ) + { + TRAP_IGNORE( value->iShim->RegisterViewL() ); + } + } + // + self->iTransientCleanupViewUid = KNullUid; + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::HashFunction +// +// +// --------------------------------------------------------------------------- +// +TUint32 CGSPluginAndViewIdCache::HashFunction( const TUid& aViewId ) + { + const TUint32 hash = DefaultHash::Integer( aViewId.iUid ); + return hash; + } + + +// --------------------------------------------------------------------------- +// CGSPluginAndViewIdCache::HashIdentityRelation +// +// +// --------------------------------------------------------------------------- +// +TBool CGSPluginAndViewIdCache::HashIdentityRelation( const TUid& aLeft, const TUid& aRight ) + { + const TBool equal = ( aLeft.iUid == aRight.iUid ); + return equal; + } + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/src/GSPluginInterface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/src/GSPluginInterface.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,245 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CGSPluginInteface implementation. +* +*/ + +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CGSPluginInterface::CGSPluginInterface() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C CGSPluginInterface::CGSPluginInterface() + : iOrder( KGSPluginNotIndexed ) + { + } + + +// ----------------------------------------------------------------------------- +// CGSPluginInterface::~CGSPluginInterface() +// Destructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CGSPluginInterface::~CGSPluginInterface() + { + // We don't unload the plugin object here. The loader + // has to do this for us. Without this kind of destruction idiom, + // the view framework can potentially unload an ECOM plugin dll whilst + // there are still child views (Created by the plugin) that are registered + // with the view framework. If this occurs, the plugin code segment isn't + // loaded anymore and so there is no way to run the subsequent destructor + // code => exception. + } + + +// ----------------------------------------------------------------------------- +// CGSPluginInterface::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CGSPluginInterface* CGSPluginInterface::NewL( TUid aImplementationUid, + TAny* aInitParams ) + { + TAny* ptr; + TInt32 keyOffset = _FOFF( CGSPluginInterface, iDtor_ID_Key ); + ptr = REComSession::CreateImplementationL( aImplementationUid, + keyOffset, + aInitParams ); + + CGSPluginInterface* plugin = REINTERPRET_CAST( CGSPluginInterface*, ptr ); + + return plugin; + } + + +// ----------------------------------------------------------------------------- +// CGSPluginInterface::PluginProviderCategory() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CGSPluginInterface::PluginProviderCategory() const + { + return EGSPluginProvider3rdParty; + } + +// ----------------------------------------------------------------------------- +// CGSPluginInterface::CustomOperationL() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TAny* CGSPluginInterface::CustomOperationL( + TAny* /*aParam1*/, + TAny* /*aParam2*/ ) + { + return NULL; + }; + + +// ----------------------------------------------------------------------------- +// CGSPluginInterface::Visible() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CGSPluginInterface::Visible() const + { + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// CGSPluginInterface::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CGulIcon* CGSPluginInterface::CreateIconL( + const TUid aIconType ) + { + TParse parse; + parse.Set( KGSDefaultIconFileName, &KDC_BITMAP_DIR, NULL ); + TFileName fileName( parse.FullName() ); + CGulIcon* icon = NULL; + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropSetDeviceSub, + fileName, + EMbmGsfwiconQgn_prop_set_default_sub, + EMbmGsfwiconQgn_prop_set_default_sub_mask ); + } + else if( aIconType == KGSIconTypeTab ) + { + } + else if( aIconType == KGSIconTypeDColumn ) + { + } + else // Unknown type + { + } + return icon; + } + + +// ----------------------------------------------------------------------------- +// CGSPluginInterface::GetValue() +// +// Empty implementation just to minimize plugin implementor work. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CGSPluginInterface::GetValue( const TGSPluginValueKeys aKey, + TDes& aValue ) + { + switch( aKey ) + { + case EGSPluginKeySettingsItemValueString: + + _LIT( KStr, "" ); + aValue.Append( KStr ); + break; + + default: + _LIT( KEmptyStr, "" ); + aValue.Append( KEmptyStr ); + break; + } + } + + +// ----------------------------------------------------------------------------- +// CGSPluginInterface::HandleSelection() +// +// Default implementation just to minimize plugin implementor work. +// On default activate plugin. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CGSPluginInterface::HandleSelection( + const TGSSelectionTypes /*aSelectionType*/ ) + { + // There is nothing pluginInterface can do if activating view fails. + TRAP_IGNORE( AppUi()->ActivateLocalViewL( Id() ) ); + + } + + +// ----------------------------------------------------------------------------- +// CGSPluginInterface::ItemType() +// +// Default implementation just to minimize plugin implementor work. +// Default value EGSItemTypeSingleLarge +// ----------------------------------------------------------------------------- +// +EXPORT_C TGSListboxItemTypes CGSPluginInterface::ItemType() + { + return EGSItemTypeSingleLarge; + } + + +// ----------------------------------------------------------------------------- +// CGSPluginInterface::ResetSelectedItemIndex() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CGSPluginInterface::ResetSelectedItemIndex() + { + // Default implementation does nothing. + } + + +// ----------------------------------------------------------------------------- +// CGSPluginInterface::TGSMenuActivationItems() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TGSMenuActivationItems CGSPluginInterface::MenuActivationItem() + { + // This default item will be the one read from the resource file. + return EGSMenuActivationItemDefault; + } + +// ----------------------------------------------------------------------------- +// CGSPluginInterface::SetOrder() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CGSPluginInterface::SetOrder( TInt aOrder ) + { + iOrder = aOrder; + } + + +// ----------------------------------------------------------------------------- +// CGSPluginInterface::GetEcomDestructorKey() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TUid CGSPluginInterface::GetEcomDestructorKey() + { + return iDtor_ID_Key; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/src/GSPluginLoader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/src/GSPluginLoader.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,989 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GS plugin loader. +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include "GsLogger.h" +#include "GSBaseDocument.h" +#include "GSPluginWrapper.h" +#include "GSPluginAndViewIdCache.h" +#include + +#include +#include +#include // CAknSingleLargeStyleListbox +#include // CColumnListBoxData +#include // For CGulIcon +#include // CnvUtfConverter +#include +#include + +//Flag for enabling/disablign compare by category feature +#undef RD_GS_COMPARE_BY_CATEGORY + +// ================= MEMBER FUNCTIONS ======================= + +#ifdef _DEBUG + #pragma message("-----_DEBUG ACTIVATED IN GS!-----") +#endif //_GEBUG + +#ifdef _GS_PERFORMANCE_TRACES + #pragma message("-GS plugin load performance measurements activated-") +#endif // _GS_PERFORMANCE_TRACES + +const TInt KGSCaptionSize = 256; + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::NewL +// +// EPOC two-phased constructor +// ---------------------------------------------------------------------------- +// +EXPORT_C CGSPluginLoader* CGSPluginLoader::NewL( CAknViewAppUi* aAppUi ) + { + CGSPluginLoader* self = new( ELeave ) CGSPluginLoader; + CleanupStack::PushL( self ); + self->ConstructL( aAppUi ); + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::CGSPluginLoader +// +// C++ default constructor can NOT contain any code, that +// might leave. +// +// Uses low priority for Active Object so that more bandwith is available for +// the most important pluginloaders. +// ---------------------------------------------------------------------------- +// +CGSPluginLoader::CGSPluginLoader() + : CActive( EPriorityLow ), + iRequestedPriority( EPriorityLow ) + { + __GSLOGSTRING( "[GSPlgLoader] CGSPluginLoader()" ); + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::ConstructL +// +// EPOC default constructor can leave. +// ---------------------------------------------------------------------------- +// +EXPORT_C void CGSPluginLoader::ConstructL( CAknViewAppUi* aAppUi ) + { + __GSLOGSTRING( "[GSPlgLoader] ConstructL()" ); + iAppUi = aAppUi; + iDocument = static_cast( iAppUi->Document() ); + iImplInfoArray = iDocument->GetImplInfo(); + + CActiveScheduler* scheluder = CActiveScheduler::Current(); + __GSLOGSTRING1( "[GSPlgLoader] Current CActiveScheduler:0x%X", scheluder ); + __GSLOGSTRING1( "[GSPlgLoader] CActiveScheduler stackdepth: %d", + scheluder->StackDepth() ); + + CActiveScheduler::Add( this ); + + iWatchDog = iDocument->WatchDog(); + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::~CGSPluginLoader +// +// Destructor +// ---------------------------------------------------------------------------- +// +EXPORT_C CGSPluginLoader::~CGSPluginLoader() + { + __GSLOGSTRING( "[GSPlgLoader] ~CGSPluginLoader()" ); + AbortAsyncLoad(); + Cancel(); + + if( iErrorPopup ) + { + iErrorPopup->HideInfoPopupNote(); + delete iErrorPopup; + iErrorPopup = NULL; + } + //iPluginArray is not owned and therefore not deleted. + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::LoadAsync +// +// +// ---------------------------------------------------------------------------- +// +EXPORT_C void CGSPluginLoader::LoadAsyncL( + TUid aInterfaceUid, + TUid aParentUid, + CArrayPtrFlat* aPluginArray ) + { + iPluginArray = aPluginArray; + iParentUid = aParentUid; + + __GSLOGSTRING3( + "[GSPlgLoader] LoadAsync(). aInterfaceUid:0x%X aParentUid:0x%X, aPluginArray:0x%X", + aInterfaceUid, aParentUid, aPluginArray ); + // Reset iterator: + iImplInfoArrayIterator = 0; + + __GSLOGSTRING1( "[GSPlgLoader] Implementation info count: %d", + iImplInfoArray.Count() ); + + NotifyProgress(); + + //Begin CActive asynchronous loop. + CompleteOwnRequest(); + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::LoadSyncL +// +// +// ---------------------------------------------------------------------------- +// +CGSPluginInterface& CGSPluginLoader::LoadSyncL( TUid aInterfaceUid, + TUid aImplementationUid ) + { + Cancel(); + CGSPluginInterface* ret = NULL; + + // Get a list of all implementations, even though we only want one specific. + // There appears to be no way to otherwise extract a specific implementation + // info object :( + // Search for the implementation that matches aImplementationUid + const TInt impCount = iImplInfoArray.Count(); + for( TInt i=0; iImplementationUid() == aImplementationUid ) + { + ret = &CreatePluginInstanceL( *info ); + break; + } + } + + if ( !ret ) + { + User::Leave( KErrNotFound ); + } + return *ret; + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::AbortAsyncLoad +// +// +// ---------------------------------------------------------------------------- +// +EXPORT_C void CGSPluginLoader::AbortAsyncLoad() + { + __GSLOGSTRING( "[GSPlgLoader] AbortAsyncLoad()" ); + Cancel(); + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::RunL +// +// +// ---------------------------------------------------------------------------- +// +void CGSPluginLoader::RunL() + { + iRunLDebugCount++; + + // This must be done only in RunL or otherwise request might be + // outstanding. + if( iRequestedPriority != Priority() ) + { + __GSLOGSTRING3( + "[CGSPluginLoader::RunL] 0x%X original priority:%d requested priority:%d", + iParentUid.iUid, + Priority(), + iRequestedPriority ); + + SetPriority( iRequestedPriority ); + } + + LoadNextPluginL(); + + // Check if there are still more plugins to be loaded: + if ( iImplInfoArrayIterator < iImplInfoArray.Count() ) + { + NotifyProgress(); + // Continue CActive asynchronous loop. + CompleteOwnRequest(); + } + else + { + // All plugins loaded: + __GSLOGSTRING( "[GSPlgLoader] Loading plugins finished." ); + NotifyFinished(); + } + } + + +// --------------------------------------------------------------------------- +// CScGenreItemConstructionConductor::CompleteOwnRequest +// +// Issue request complete notification. +// --------------------------------------------------------------------------- +void CGSPluginLoader::CompleteOwnRequest() + { + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + SetActive(); + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::RunError +// +// +// ---------------------------------------------------------------------------- +// +TInt CGSPluginLoader::RunError( TInt aError ) + { + // This method is called when a plugin loading fails. + // Always "fake" the return value so that ActiveSchedule + // keeps running and later plugins are continued to be loaded. + // Check if still plugins to be loaded: + if( iImplInfoArrayIterator < iImplInfoArray.Count() ) + { + NotifyProgress(); + + //Continue CActive asynchronous loop. + CompleteOwnRequest(); + } + else // All plugins loaded: + { + NotifyFinished(); + } + + if ( aError == KLeaveExit ) + { + return KLeaveExit; + } + + return KErrNone; + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::DoCancel +// +// +// ---------------------------------------------------------------------------- +// +void CGSPluginLoader::DoCancel() + { + + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::NotifyProgress +// +// +// ---------------------------------------------------------------------------- +// +void CGSPluginLoader::NotifyProgress() + { + if( iObserver ) + { + iObserver->HandlePluginLoaded( MGSPluginLoadObserver::EGSSuccess); + } + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::NotifyFinished +// +// +// ---------------------------------------------------------------------------- +// +void CGSPluginLoader::NotifyFinished() + { + + #ifdef _GS_PLUGINLOADER_FINAL_SORTING_TRACES + TRAP_IGNORE( PrintOrderTracesL( iPluginArray ) ); + #endif // _GS_PLUGINLOADER_FINAL_SORTING_TRACES + + // I have finished loading: No need to keep me in the expensive scheduler + // queue. + Deque(); + + if( iObserver ) + { + iObserver->HandlePluginLoaded( MGSPluginLoadObserver::EGSFinished ); + } + + __GSLOGSTRING1( "[CGSPluginLoader::NotifyFinished] 0x%X", + iParentUid.iUid ); + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::SetObserver +// +// +// ---------------------------------------------------------------------------- +// +EXPORT_C void CGSPluginLoader::SetObserver(MGSPluginLoadObserver* aObserver) + { + __GSLOGSTRING1("[GSPlgLoader] Observer set:0x%X", aObserver); + iObserver = aObserver; + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::ParseToUid +// Parses a UID from descriptor of form '0xNNNNNNNN' where N is hexadecimal. +// +// ---------------------------------------------------------------------------- +// +TInt CGSPluginLoader::ParseToUid( const TDesC8& aSource, TUid& aTarget ) + { + // Remove "0x" from the descriptor if it exists + _LIT8(KHexPrefix, "0x"); + + TPtrC8 pSource( aSource ); + const TInt prefixPosition = pSource.Find( KHexPrefix ); + if ( prefixPosition != KErrNotFound ) + { + pSource.Set( aSource.Mid( prefixPosition + KHexPrefix().Length() ) ); + } + + // Parse to integer + TLex8 lex( pSource ); + TUint integer = 0; + + // Parse using TRadix::EHex as radix: + const TInt err = lex.Val( integer, EHex ); + aTarget.iUid = integer; + + if( err != KErrNone ) + { + // If parsing parent UID failed, do not load plugin: + __GSLOGSTRING1( + "[GSPlgLoader] Parsing parent UID failed. Error code:%d", + err ); + } + return err; + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::ParseOrderNumber +// +// +// ---------------------------------------------------------------------------- +// +TInt CGSPluginLoader::ParseOrderNumber( const TDesC8& aSource, TInt& aOrderNumber ) + { + // Parse plugin's order number from opaque_data: + TLex8 lex( aSource ); + const TInt orderErr = lex.Val( aOrderNumber ); + return orderErr; + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::PrintInfoDebug +// Print CImplementationInformation to log. Used for debugging. +// +// ---------------------------------------------------------------------------- +// +void CGSPluginLoader::PrintInfoDebugL( const CImplementationInformation& aInfo, + TInt aIterator, + TInt aPluginCount ) + { + + + #pragma message("-CGSPluginLoader verbose traces activated-") + __GSLOGSTRING2( "[GSPlgLoader::LoadNextPluginL] %d/%d", + aIterator, + aPluginCount); + + __GSLOGSTRING1( "[GSPlgLoader] --Plugin 0x%X info--", &aInfo); + __GSLOGSTRING1( "[GSPlgLoader] DisplayName:%S", &aInfo.DisplayName() ); + __GSLOGSTRING1( "[GSPlgLoader] ImplementationUid:0x%X", + aInfo.ImplementationUid() ); + + const TInt KMaxEComDataLength = 256; + + HBufC* dataType = HBufC::New( KMaxEComDataLength ); + HBufC* opaqueData = HBufC::New( KMaxEComDataLength ); + + dataType->Des().Copy( aInfo.DataType() ); + opaqueData->Des().Copy( aInfo.OpaqueData() ); + __GSLOGSTRING1( "[GSPlgLoader] DataType:%S", dataType ); + __GSLOGSTRING1( "[GSPlgLoader] OpaqueData:%S", opaqueData ); + + delete opaqueData; + delete dataType; + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::LoadNextPluginL +// Iterate through iImplInfoArray. Load the plugin if it is eligible for +// loading. Loaded plugin is added to iPluginArray. Each time a plugin is +// loaded, iObserver is notified. +// +// ---------------------------------------------------------------------------- +// +EXPORT_C void CGSPluginLoader::LoadNextPluginL() + { + // Iterate through iImplInfoArray. This loop continues between function + // calls. Therefore member variable iImplInfoArrayIterator is used as a + // counter. Loop will break when match is found and continues on next RunL. + for( ; iImplInfoArrayIterator < iImplInfoArray.Count(); ) + { + const CImplementationInformation* info = + iImplInfoArray[ iImplInfoArrayIterator ]; + + iImplInfoArrayIterator++; + + #ifdef _GS_PLUGINLOADER_VERBOSE_TRACES + PrintInfoDebugL( *info, iImplInfoArrayIterator, iImplInfoArray.Count() ); + #endif //_GS_PLUGINLOADER_VERBOSE_TRACES + + // Parse parent UID from default_data: + TUid parentUid; + const TInt uidErr = ParseToUid( info->DataType(), parentUid ); + + if( uidErr == KErrNone && iParentUid == parentUid ) + { + // If this plugin is OK -> load it: + __GSLOGSTRING2( "[GSPlgLoader] %S eligible for parent 0x%X", + &info->DisplayName(), iParentUid.iUid ); + CGSPluginInterface* plugin = NULL; + TInt error = KErrCancel; + #ifdef GS_ENABLE_WATCH_DOG + if( !iWatchDog->IsInBlackList( info->ImplementationUid() ) ) + #endif + { + // Only panics move quarantined plugins to blacklist. Leaving is + // normal programmatic functionality and therefore does not move + // plugin to blacklist. + #ifdef GS_ENABLE_WATCH_DOG + iWatchDog->QuarantineL( info->ImplementationUid() ); + #endif + + #ifdef _GS_PERFORMANCE_TRACES + TTime timeStart; + TTime timeEnd; + timeStart.HomeTime(); + #endif //_GS_PERFORMANCE_TRACES + + // Create plugin. Trap leave for debugging purposes. + TRAP( error, plugin = &CreatePluginInstanceL( *info ); ); + + #ifdef _GS_PERFORMANCE_TRACES + timeEnd.HomeTime(); + TTimeIntervalMicroSeconds funcDuration = timeEnd.MicroSecondsFrom( timeStart ); + __GSLOGSTRING2( "[GSPlgLoader::LoadNextPluginL/perf] %Ld (%S)", funcDuration, &info->DisplayName() ); + #endif //_GS_PERFORMANCE_TRACES + + #ifdef GS_ENABLE_WATCH_DOG + TRAP_IGNORE( iWatchDog->RemoveFromQuarantineL( info->ImplementationUid() ); ); + #endif + } + if( error == KErrNone ) + { + // Plugin ownership is transfered to iPluginArray + InsertPluginInOrderL( plugin, iPluginArray ); + } + else if( error == KLeaveExit ) + { + __GSLOGSTRING( "[GSPlgLoader::LoadNextPluginL] LEAVE: KLeaveExit!!!" ); + // Must pass KLeaveExit through or otherwise Exit-command will + // not be handled. + User::Leave( KLeaveExit ); + } + else + { + // Error note is displayed even if plugin is not loaded + // -> plugin is in blacklist -> blacklist note displayed. + #ifdef _DEBUG + DisplayErrorPopupL( error, info ); + #endif //_DEBUG + } + // Wait for next round + break; + } + } + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::DisplayErrorPopupL +// +// ---------------------------------------------------------------------------- +// +void CGSPluginLoader::DisplayErrorPopupL( + TInt aError, + const CImplementationInformation* aInfo ) + { + + // Log error: + __GSLOGSTRING3( "[GSPlgLoader] %S (0x%X) loading failed with error code %d", + &aInfo->DisplayName(), + aInfo->ImplementationUid().iUid, + aError ); + + // Runtime info message used only in _DEBUG builds. + // Buffer needs space for about 50 chars for debug text + // + 8 chars for hex UID + // + DisplayName().Length() + // + error code 10 chars... + HBufC* buf = HBufC::NewLC( 100 + aInfo->DisplayName().Length() ); + TPtr ptr = buf->Des(); + + if( aError == KErrCancel ) + { + _LIT( KDbgMsgBlacklisted, "Plugin in blacklist:\n%S (0x%X)" ); + ptr.Format( KDbgMsgBlacklisted, + &aInfo->DisplayName(), + aInfo->ImplementationUid().iUid ); + } + else + { + _LIT( KDbgMsg, "Error:\n%S (0x%X)\nloading failed with error code %d" ); + ptr.Format( KDbgMsg, + &aInfo->DisplayName(), + aInfo->ImplementationUid().iUid, + aError ); + } + if( iErrorPopup ) + { + delete iErrorPopup; + iErrorPopup = NULL; + } + iErrorPopup = CAknInfoPopupNoteController::NewL(); + iErrorPopup->SetTextL( ptr ); + CleanupStack::PopAndDestroy( buf ); + iErrorPopup->ShowInfoPopupNote(); + } + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::CreatePluginInstanceL +// +// +// ---------------------------------------------------------------------------- +// +CGSPluginInterface& CGSPluginLoader::CreatePluginInstanceL( + const CImplementationInformation& aImpInfo ) + { + // Create a wrapper for the plugin - this will take + // care of cleaning up the plugin dll. This must be on + // the cleanup stack above the plugin object itself - since + // the cleanup stack will first delete the plugin, then the + // plugin wrapper will be called to unload the ECOM plugin + // dll itself. + CGSPluginWrapper* wrapper = iDocument->NewPluginUnloadWrapperLC(); + + // Now we can load the plugin + const TUid implUid = aImpInfo.ImplementationUid(); + + CGSPluginInterface* plugin = CGSPluginInterface::NewL( implUid, + iAppUi );// Remove iAppUi + CleanupStack::PushL ( plugin ); + + // And now its okay to update the wrapper with the plugin's + // ECOM destructor info. + wrapper->SetDetails( plugin->iDtor_ID_Key ); + + // If plugin's resource definition had a valid order number, + // set it to plugin. + // + // If parent is GSAppsPlugin, this is where the ordering + // could be changed to follow the to-be-implemented resource file + // defining the plugin order. + + // Parse plugin's order number from opaque_data: + TInt orderNumber = 0; + const TInt orderErr = ParseOrderNumber( aImpInfo.OpaqueData(), orderNumber ); + if ( orderErr == KErrNone && orderNumber >= 0 ) + { + plugin->iOrder = orderNumber; + } + + // When a specific view has been activated externally to GS (e.g + // whilst GS is not running) we have to load the view's plugin on-demand. + // This means that the plugin is essentially free-floating and is not bound + // to a parent's CGSParentPlugin::iPluginArray. + // + // In this situation, even though we have activated a specific view, + // the plugin loader(s) continue to operate in the background. + // + // Eventually, as the loaders progress, a second attempt will occur to + // load the same view (that was activated externally). + // + // In this situation, we discard the recently loaded instance of the plugin + // and instead preserve the view that the user is (presumably) already using. + // + // However, we must ensure that we synchronous the parent's iPluginArray + // with the pre-existing view instance. + const TUid viewId = plugin->Id(); + CGSPluginAndViewIdCache& pluginViewIdCache = iDocument->PluginViewIdCache(); + const TBool isAlreadyLoaded = pluginViewIdCache.IsPluginLoaded( viewId ); + + if ( !isAlreadyLoaded ) + { + // Cache the view uid & ECOM plugin dll uid to enable us + // to more quickly handle external view activation requests + // when GS is not already running. + pluginViewIdCache.RegisterViewAndImplementationAssociationL( viewId, implUid ); + + // Prepare to register the plugin with the cache. Pushes a cleanup stack + // item in case adding the view should leave. + pluginViewIdCache.PrepareToRegisterPluginInstanceLC( viewId ); + + // Add loaded view to appUi. At this point, the GS framework + // is no longer responsible for the lifetime of the 'plugin' + // object. + // + // However, to ensure sucessful cleanup of deleted + // views, we have separated the ECOM plugin dll (controlled by + // plugin->iDtor_ID_Key) to a separate object. This object is + // owned by the loader. + iAppUi->AddViewL( plugin ); + + // Pop the cleanup item - all is well now. + CleanupStack::Pop(); // cleanup item from PrepareToRegisterPluginInstanceLC + + CleanupStack::Pop( plugin ); // view framework is now responsible for this memory. + + // Document, when it is destroyed, will handle unloading of ECOM dll. + CleanupStack::Pop( wrapper ); + + // Also register that we have loaded an instance of the specified view + // from a plugin. + pluginViewIdCache.RegisterPluginInstanceL( viewId, *plugin ); + } + else + { + // Plugin is already loaded, presumably due to external view activation + // request. + // + // Discard "just loaded" instance and use the pre-loaded one instead. + CleanupStack::PopAndDestroy( 2, wrapper ); + plugin = pluginViewIdCache.PluginInstance( viewId ); + } + + return *plugin; + } + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::SortPluginsL +// +// ---------------------------------------------------------------------------- +// +EXPORT_C void CGSPluginLoader::SortPluginsL( + CArrayPtrFlat* aPlugins ) + { + RPointerArray plugins; + TLinearOrder order( CGSPluginLoader::Compare ); + + // Insertion will also order + for( TInt i = 0; i < aPlugins->Count(); i++ ) + { + plugins.InsertInOrderL( (*aPlugins)[i], order ); + } + + // Replace original array content with sorted items + aPlugins->Reset(); + for( TInt i = 0; i < plugins.Count(); i++ ) + { + aPlugins->AppendL( plugins[i] ); + } + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::Compare +// +// Compare two plugins. +// Precedence: +// [1. plugin provider category] +// 2. plugin order number +// 3. plugin caption +// Plugin provider gategory is currently disabled (not supported yet). +// ---------------------------------------------------------------------------- +// +TInt CGSPluginLoader::Compare( const CGSPluginInterface& aFirst, + const CGSPluginInterface& aSecond ) + { + TInt comparison = CompareCategory( aFirst, aSecond ); + if( comparison == KGSComparisonEqual ) + { + comparison = CompareIndex( aFirst, aSecond ); + if( comparison == KGSComparisonEqual ) + { + comparison = CompareCaption( aFirst, aSecond ); + } + } + return comparison; + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::InsertPluginInOrderL +// +// ---------------------------------------------------------------------------- +// +void CGSPluginLoader::InsertPluginInOrderL( + CGSPluginInterface* aPlugin, + CArrayPtrFlat* aPlugins ) + { + CGSPluginInterface* comparedPlugin; + TInt comparison = 0; + TBool inserted = EFalse; + + for( TInt i = 0; i < aPlugins->Count(); i++ ) + { + comparedPlugin = (*aPlugins)[i]; + // Optimization: do not call time consuming Compare() multiple times! + comparison = Compare( *aPlugin, *comparedPlugin ); + if( comparison < 0 ) + { + aPlugins->InsertL( i, aPlugin ); + inserted = ETrue; + break; + } + else if( comparison == 0 ) + { + aPlugins->InsertL( i+1, aPlugin ); + inserted = ETrue; + break; + } + } + // Plugin was not before any other plugin - make sure it's appended + if( !inserted ) + { + aPlugins->AppendL( aPlugin ); + } + + #ifdef _GS_PLUGINLOADER_ITERATION_SORTING_TRACES + PrintOrderTracesL( aPlugins ); + #endif // _GS_PLUGINLOADER_ITERATION_SORTING_TRACES + + } + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::CompareCategory +// +// ---------------------------------------------------------------------------- +// +void CGSPluginLoader::PrintOrderTracesL( + CArrayPtrFlat* aPlugins ) + { + __GSLOGSTRING1( "---[CGSPluginLoader] Sorted list for 0x%X---", iParentUid.iUid ); + HBufC* name = HBufC::New( KGSCaptionSize ); + CleanupStack::PushL( name ); + + TPtr ptr = name->Des(); + CGSPluginInterface* plg; + + for( TInt i = 0; i < aPlugins->Count(); i++ ) + { + plg = (*aPlugins)[i]; + plg->GetCaptionL( ptr ); + __GSLOGSTRING4( "[CGSPluginLoader] Sorted list[%d] Category:%d (0x%X) %S", + plg->iOrder, + plg->PluginProviderCategory(), + plg->Id().iUid, + &ptr ); + } + CleanupStack::PopAndDestroy( name ); + + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::CompareCategory +// +// +// ---------------------------------------------------------------------------- +// +TInt CGSPluginLoader::CompareCategory( const CGSPluginInterface& aFirst, + const CGSPluginInterface& aSecond ) + { +#ifdef RD_GS_COMPARE_BY_CATEGORY + TInt comparison = KGSComparisonBefore;//KGSComparisonEqual; + + // Compare if a is before b: + TInt a = aFirst.PluginProviderCategory(); + TInt b = aSecond.PluginProviderCategory(); + + // Cannot use less/greater comparison because int values used in here + // (KGSPluginProviderInternal) must not be revealed to 3rd parties. + if( a != b ) + { + switch ( a ) + { +/* case KGSPluginProviderInternal: + if( b != KGSPluginProviderInternal ) + { + comparison = KGSComparisonAfter; + } + break;*/ + case CGSPluginInterface::EGSPluginProviderOEM: + if( b == KGSPluginProviderInternal ) + { + comparison = KGSComparisonAfter; + } + break; + case CGSPluginInterface::EGSPluginProviderOperator: + if( b == KGSPluginProviderInternal || + b == CGSPluginInterface::EGSPluginProviderOEM ) + { + comparison = KGSComparisonAfter; + } + break; + case CGSPluginInterface::EGSPluginProvider3rdParty: + if( b == KGSPluginProviderInternal || + b == CGSPluginInterface::EGSPluginProviderOEM || + b == CGSPluginInterface::EGSPluginProviderOperator ) + { + comparison = KGSComparisonAfter; + } + break; + default: + comparison = KGSComparisonBefore; + break; + } + } + else + { + comparison = KGSComparisonEqual; + } + + return comparison; + +#else //RD_GS_COMPARE_BY_CATEGORY + #pragma message("Comparing by category DISABLED") + // Force comparison to equal so category comparison will not matter. If + // comparison by gategory is needed, simply remove the line below: + return KGSComparisonEqual; +#endif //RD_GS_COMPARE_BY_CATEGORY + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::CompareCaption +// +// +// ---------------------------------------------------------------------------- +// +TInt CGSPluginLoader::CompareCaption( const CGSPluginInterface& aFirst, + const CGSPluginInterface& aSecond ) + { + HBufC* firstCaptionBuf = HBufC::New( KGSCaptionSize ); + HBufC* secondCaptionBuf = HBufC::New( KGSCaptionSize ); + TPtr firstCaption = firstCaptionBuf->Des(); + TPtr secondCaption = secondCaptionBuf->Des(); + TInt comparison = KGSComparisonEqual; + + TRAPD( err, aFirst.GetCaptionL( firstCaption ); ); + TRAPD( err2, aSecond.GetCaptionL( secondCaption ); ); + + if( err == KErrNone && err2 == KErrNone ) + { + // CompareC return value must be converted to KGSComparisonXXX value. + TInt result = secondCaption.CompareC( firstCaption ); + if( result < 0 ) + { + comparison = KGSComparisonAfter; + } + else if( result > 0 ) + { + comparison = KGSComparisonBefore; + } + } + delete firstCaptionBuf; + delete secondCaptionBuf; + return comparison; + } + + +// ---------------------------------------------------------------------------- +// CGSPluginLoader::CompareIndex +// +// +// ---------------------------------------------------------------------------- +// +TInt CGSPluginLoader::CompareIndex( const CGSPluginInterface& aFirst, + const CGSPluginInterface& aSecond ) + { + TInt comparison = KGSComparisonEqual; + + // The plugin having index is before the one not having one + + if( aFirst.iOrder == KGSPluginNotIndexed && + aSecond.iOrder == KGSPluginNotIndexed ) + { + // Neither have index -> equal + comparison = KGSComparisonEqual; + } + else if( aFirst.iOrder == KGSPluginNotIndexed ) + { + // The plugin having index is before the one not having one + comparison = KGSComparisonAfter; + } + else if( aSecond.iOrder == KGSPluginNotIndexed ) + { + // The plugin having index is before the one not having one + comparison = KGSComparisonBefore; + } + else if( aFirst.iOrder < aSecond.iOrder ) + { + // Compare actual index values + comparison = KGSComparisonBefore; + } + else if( aFirst.iOrder > aSecond.iOrder ) + { + // Compare actual index values + comparison = KGSComparisonAfter; + } + + return comparison; + } + + + +EXPORT_C void CGSPluginLoader::RequestPriority( CActive::TPriority aPriority ) + { + iRequestedPriority = aPriority; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/src/GSPluginWrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/src/GSPluginWrapper.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* GS plugin wrapper. +* +*/ + +#include "GSPluginWrapper.h" + +// System includes +#include + + +// ================= MEMBER FUNCTIONS ======================= + +// ---------------------------------------------------------------------------- +// CGSPluginWrapper::CGSPluginWrapper +// +// +// ---------------------------------------------------------------------------- +// +CGSPluginWrapper::CGSPluginWrapper( CGSBaseDocument& aDocument ) +: iDocument( aDocument ) + { + } + + +// ---------------------------------------------------------------------------- +// CGSPluginWrapper::~CGSPluginWrapper +// +// +// ---------------------------------------------------------------------------- +// +EXPORT_C CGSPluginWrapper::~CGSPluginWrapper() + { + if ( iDestructorIdKey != KNullUid ) + { + REComSession::DestroyedImplementation( iDestructorIdKey ); + } + } + + +// ---------------------------------------------------------------------------- +// CGSPluginWrapper::SetDetails +// +// +// ---------------------------------------------------------------------------- +// +EXPORT_C void CGSPluginWrapper::SetDetails( TUid aDestructorIdKey ) + { + iDestructorIdKey = aDestructorIdKey; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/src/GSPubSubsListener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/src/GSPubSubsListener.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Publish and subscribe settings listener. +* +*/ + + +// INCLUDE FILES +#include +#include + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::CGSPubSubsListener +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CGSPubSubsListener::CGSPubSubsListener( const TUid aUid, const TInt aKey, + MGSSettingPSObserver* aObserver ) + : CActive( CActive::EPriorityStandard ) + { + iUid = aUid; + iId = aKey; + iCallback = aObserver; + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::~CGSPubSubsListener +// Destructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CGSPubSubsListener::~CGSPubSubsListener() + { + Cancel(); + iProperty.Close(); + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::RunL +// From CActive. +// ----------------------------------------------------------------------------- +// +void CGSPubSubsListener::RunL() + { + const TRequestStatus status( iStatus ); + StartListening(); + iCallback->HandleNotifyPSL( iUid, iId, status ); + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::DoCancel +// From CActive. +// ----------------------------------------------------------------------------- +// +void CGSPubSubsListener::DoCancel() + { + iProperty.Cancel(); + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::RunError +// From CActive. +// ----------------------------------------------------------------------------- +// +TInt CGSPubSubsListener::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::NewL +// +// Symbian OS two phased constructor +// ----------------------------------------------------------------------------- +// +EXPORT_C CGSPubSubsListener* CGSPubSubsListener::NewL( const TUid aUid, const TInt aKey, + MGSSettingPSObserver* aObserver ) + { + CGSPubSubsListener* self = new( ELeave ) + CGSPubSubsListener( aUid, aKey, aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::StartListening +// ----------------------------------------------------------------------------- +// +void CGSPubSubsListener::StartListening() + { + iProperty.Subscribe( iStatus ); + SetActive(); + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::ConstructL +// +// Symbian OS default constructor +// ----------------------------------------------------------------------------- +// +void CGSPubSubsListener::ConstructL() + { + CActiveScheduler::Add( this ); + + User::LeaveIfError ( iProperty.Attach( iUid, iId, EOwnerThread ) ); + StartListening(); + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::Get +// Read integer value. +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CGSPubSubsListener::Get( TInt& aVal ) + { + return iProperty.Get( iUid, iId, aVal ); + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::Get +// Read binary value. +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CGSPubSubsListener::Get( TDes8& aVal ) + { + return iProperty.Get( iUid, iId, aVal ); + } + +// ----------------------------------------------------------------------------- +// CGSPubSubsListener::Get +// Read string value. +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CGSPubSubsListener::Get( TDes16& aVal ) + { + return iProperty.Get( iUid, iId, aVal ); + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/src/GSShimmedView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/src/GSShimmedView.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,318 @@ +/* +* Copyright (c) 2006-1008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Shim view +* +*/ + +#include "GSShimmedView.h" + +// System includes +#include +#include + +// User includes +#include "GSPluginAndViewIdCache.h" +#include +#include +#include + +// ================= MEMBER FUNCTIONS ======================= + +// ---------------------------------------------------------------------------- +// CGSShimmedView::CGSShimmedView +// +// +// ---------------------------------------------------------------------------- +// +CGSShimmedView::CGSShimmedView( TUid aViewId, + CGSPluginAndViewIdCache& aCache, + CCoeAppUi& aAppUi ) +: CActive( KMaxTInt ), iViewId( aViewId ), iCache( aCache ), iAppUi( aAppUi ) + { + } + + +// ---------------------------------------------------------------------------- +// CGSShimmedView::~CGSShimmedView +// +// +// ---------------------------------------------------------------------------- +// +CGSShimmedView::~CGSShimmedView() + { + Cancel(); + DeregisterView(); + iCache.HandleShimDestruction( iViewId ); + delete iCustomMessage; + } + + +// ---------------------------------------------------------------------------- +// CGSShimmedView::ConstructL +// +// +// ---------------------------------------------------------------------------- +// +void CGSShimmedView::ConstructL() + { + RegisterViewL(); + } + + +// ---------------------------------------------------------------------------- +// CGSShimmedView::NewLC +// +// +// ---------------------------------------------------------------------------- +// +CGSShimmedView* CGSShimmedView::NewLC( TUid aViewId, + CGSPluginAndViewIdCache& aCache, + CCoeAppUi& aAppUi ) + { + CGSShimmedView* self = new(ELeave) CGSShimmedView( aViewId, aCache, aAppUi ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ---------------------------------------------------------------------------- +// CGSShimmedView::ViewId +// +// +// ---------------------------------------------------------------------------- +// +TVwsViewId CGSShimmedView::ViewId() const + { + const TVwsViewId ret( KUidGS, iViewId ); + return ret; + } + + +// ---------------------------------------------------------------------------- +// CGSShimmedView::ViewActivatedL +// +// +// ---------------------------------------------------------------------------- +// +void CGSShimmedView::ViewActivatedL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + const TBool isLoaded = iCache.IsPluginLoaded( iViewId ); + if ( isLoaded == EFalse ) + { + HBufC8* customMessage = aCustomMessage.AllocL(); + delete iCustomMessage; + iCustomMessage = customMessage; + + iCustomMessageId = aCustomMessageId; + + iCache.SetPriorToPlaceholderActiveViewId( aPrevViewId ); + SetState( EStateActivatingPlaceholderView ); + } + } + + +// ---------------------------------------------------------------------------- +// CGSShimmedView::ViewDeactivated +// +// +// ---------------------------------------------------------------------------- +// +void CGSShimmedView::ViewDeactivated() + { + } + + +// ---------------------------------------------------------------------------- +// CGSShimmedView::RunL +// +// +// ---------------------------------------------------------------------------- +// +void CGSShimmedView::RunL() + { + // NB: At this point, we are the active view. + + switch( iState ) + { + default: + case EStateInactive: + break; + + case EStateActivatingPlaceholderView: + StateActivatePlaceholderViewL(); + break; + + case EStateLoadingPlugin: + StateLoadPluginL(); + break; + + case EStateDeletingSelf: + SetState( EStateInactive, EFalse ); + delete this; + break; + } + } + + +// ---------------------------------------------------------------------------- +// CGSShimmedView::RegisterViewL +// +// +// ---------------------------------------------------------------------------- +// +void CGSShimmedView::RegisterViewL() + { + iAppUi.RegisterViewL( *this ); + iIsRegistered = ETrue; + } + + +// ---------------------------------------------------------------------------- +// CGSShimmedView::DeregisterView +// +// +// ---------------------------------------------------------------------------- +// +void CGSShimmedView::DeregisterView() + { + if ( iIsRegistered ) + { + iAppUi.DeregisterView( *this ); + } + iIsRegistered = EFalse; + } + + + +// ---------------------------------------------------------------------------- +// CGSShimmedView::DoCancel +// +// +// ---------------------------------------------------------------------------- +// +void CGSShimmedView::DoCancel() + { + // Nothing to do here - requests already completed + } + + +// ---------------------------------------------------------------------------- +// CGSShimmedView::SetState +// +// +// ---------------------------------------------------------------------------- +// +void CGSShimmedView::SetState( TState aState, TBool aCompleteRequest ) + { + Cancel(); + // + iState = aState; + // + if ( aCompleteRequest ) + { + if ( !IsAdded() ) + { + // Add only on-demand to avoid cluttering the scheduler + CActiveScheduler::Add( this ); + } + + // Complete ourselves to continue activation process asynchronously + // via RunL(). + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + SetActive(); + } + } + + +// ---------------------------------------------------------------------------- +// CGSShimmedView::StateActivatePlaceholderViewL +// +// +// ---------------------------------------------------------------------------- +// +void CGSShimmedView::StateActivatePlaceholderViewL() + { + iCache.ActivatePlaceholderViewL(); + SetState( EStateLoadingPlugin ); + } + + +//Disabling warning caused by err variable used inside macros +#pragma diag_suppress 550 +// ---------------------------------------------------------------------------- +// CGSShimmedView::StateLoadPluginL +// +// +// ---------------------------------------------------------------------------- +// +void CGSShimmedView::StateLoadPluginL() + { + CAknViewAppUi& appUi = static_cast< CAknViewAppUi& >( iAppUi ); + + // As a fall back, we'll try to activate the view that was being + // displayed prior to us attempting to load a plugin. + TUid viewIdToActivate = iCache.PriorToPlaceholderActiveViewId().iViewUid; + + // Get the implementation uid that contains this view. + const TUid impUid = iCache.PluginImplementationUidForView( iViewId ); + + if ( impUid != KNullUid ) + { + CGSPluginLoader* loader = CGSPluginLoader::NewL( &appUi ); + CleanupStack::PushL( loader ); + + // Now try to load the specific instance of the GS plugin that + // implements the real view's concrete implementation. + // + // Since the act of loading a plugin will also attempt to register + // that plugin with the app ui (since a GS plugin "is a" view) we + // must first unregister the shim view. If there was an error + // loading the plugin, then we'll re-register the shim. + DeregisterView(); + + CGSPluginInterface* plugin = NULL; + TRAPD( loadError, plugin = &loader->LoadSyncL( KGSPluginInterfaceUid, impUid ) ); + CleanupStack::PopAndDestroy( loader ); + + if ( loadError == KErrNone ) + { + // .. and set us up to activate the newly loaded plugin view. + viewIdToActivate = iViewId; + + // Set ourselves up to be destroyed in the next RunL callback + SetState( EStateDeletingSelf ); + } + else + { + // Didn't manage to load plugin. Re-register the view + // and bail out. + SetState( EStateInactive, EFalse ); + RegisterViewL(); + } + } + + appUi.ActivateLocalViewL( viewIdToActivate, iCustomMessageId, *iCustomMessage ); + } +//Enabling warnings +#pragma diag_default 550 + + + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/src/GSTabHelper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/src/GSTabHelper.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,288 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Utility class for creating tab groups. +* +*/ + + +// INCLUDE FILES +#include "gstabhelper.h" +#include "gstabbedview.h" +#include "GsLogger.h" + +#include +#include +#include +#include +#include +#include +#include + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CGSTabHelper::CGSTabHelper +// C++ constructor. +// +// --------------------------------------------------------------------------- +// +CGSTabHelper::CGSTabHelper() + { + } + + +// --------------------------------------------------------------------------- +// CGSTabHelper::NewL() +// Symbian OS two-phased constructor. +// +// --------------------------------------------------------------------------- +// +EXPORT_C CGSTabHelper* CGSTabHelper::NewL() + { + CGSTabHelper* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSTabHelper::NewLC() +// Symbian OS two-phased constructor. +// +// --------------------------------------------------------------------------- +// +EXPORT_C CGSTabHelper* CGSTabHelper::NewLC() + { + CGSTabHelper* self = new(ELeave) CGSTabHelper(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSTabHelper::ConstructL(const TRect& aRect) +// Symbian OS default constuctor. +// +// --------------------------------------------------------------------------- +// +void CGSTabHelper::ConstructL() + { + iNaviDecorator = NULL; + + iAppUi = static_cast( CCoeEnv::Static()->AppUi() ); + + CEikStatusPane* statusPane = iAppUi->StatusPane(); + + // Fetch pointer to the default navi pane container: + iNaviContainer = static_cast + ( statusPane->ControlL( TUid::Uid(EEikStatusPaneUidNavi ) ) ); + } + + +// --------------------------------------------------------------------------- +// CGSTabHelper::~CGSTabHelper() +// Destructor +// +// --------------------------------------------------------------------------- +// +EXPORT_C CGSTabHelper::~CGSTabHelper() + { + RemoveTabGroup(); + } + + +// ----------------------------------------------------------------------------- +// CGSTabHelper::CreateTabGroupL() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CGSTabHelper::CreateTabGroupL( TUid aActiveViewUid, + MGSTabbedViewOwner* aTabOwner ) + { + iTabOwner = aTabOwner; + CreateTabGroupL( aActiveViewUid, iTabOwner->TabbedViews() ); + } + +// --------------------------------------------------------------------------- +// CGSTabHelper::CreateTabGroupL() +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSTabHelper::CreateTabGroupL( + TUid aActiveViewUid, + CArrayPtrFlat* aTabbedViews ) + { + RemoveTabGroup();//Remove possible old tab group. + iNaviDecorator = iNaviContainer->CreateTabGroupL( this ); + iTabGroup = + static_cast ( iNaviDecorator->DecoratedControl() ); + + switch ( aTabbedViews->Count() ) + { + case 1: + iTabGroup->SetTabFixedWidthL( KTabWidthWithOneTab ); + break; + case 2: + iTabGroup->SetTabFixedWidthL( KTabWidthWithTwoTabs ); + break; + case 3: + iTabGroup->SetTabFixedWidthL( KTabWidthWithThreeTabs ); + break; + default: + iTabGroup->SetTabFixedWidthL( KTabWidthWithFourTabs ); + break; + } + + for( TInt i = 0; i < aTabbedViews->Count(); i++ ) + { + CGSPluginInterface* tabbedView = aTabbedViews->operator[]( i ); + CGulIcon* icon = NULL; + TRAPD + ( + err, + icon = tabbedView->CreateIconL( KGSIconTypeTab ); + ) + + // CreateIconL should not leave outside. If creating icon leaves, use + // default icon. + if( err != KErrNone ) + { + __GSLOGSTRING2( + "[CGSTabHelper] ERROR: 0x%X::CreateIconL failed (%d), using default icon.", + tabbedView->Id().iUid, err ); + + icon = + tabbedView->CGSPluginInterface::CreateIconL( KGSIconTypeTab ); + } + CleanupStack::PushL( icon ); + iTabGroup->AddTabL( tabbedView->Id().iUid, + icon->Bitmap(), + icon->Mask() ); + + // Bitmaps are now owned by the tab: + icon->SetBitmapsOwnedExternally( ETrue ); + + // Delete icon object. Bitmaps are not owned by icon anymore and thus + // not deleted: + CleanupStack::PopAndDestroy( icon ); + } + + iNaviContainer->PushL( *iNaviDecorator ); + + // The active tab should be same as active plugin + iTabGroup->SetActiveTabById( aActiveViewUid.iUid ); + } + + +// --------------------------------------------------------------------------- +// CGSTabHelper::CreateTabGroupL() +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSTabHelper::CreateTabGroupL( + TUid aActiveViewUid, + CArrayPtrFlat* aTabbedViews ) + { + RemoveTabGroup();//Remove possible old tab group. + iNaviDecorator = iNaviContainer->CreateTabGroupL( this ); + iTabGroup = + static_cast ( iNaviDecorator->DecoratedControl() ); + + switch ( aTabbedViews->Count() ) + { + case 1: + iTabGroup->SetTabFixedWidthL( KTabWidthWithOneTab ); + break; + case 2: + iTabGroup->SetTabFixedWidthL( KTabWidthWithTwoTabs ); + break; + case 3: + iTabGroup->SetTabFixedWidthL( KTabWidthWithThreeTabs ); + break; + default: + iTabGroup->SetTabFixedWidthL( KTabWidthWithFourTabs ); + break; + } + + for( TInt i = 0; i < aTabbedViews->Count(); i++ ) + { + MGSTabbedView* tabbedView = aTabbedViews->operator[]( i ); + + // Takes icon ownership + CGulIcon* icon = tabbedView->CreateTabIconL(); + CleanupStack::PushL( icon ); + + + iTabGroup->AddTabL( tabbedView->Id().iUid, + icon->Bitmap(), + icon->Mask() ); + + //Bitmaps are now owned by the tab: + icon->SetBitmapsOwnedExternally( ETrue ); + + // Delete icon object. Bitmaps are not owned by icon anymore and thus + // not deleted: + CleanupStack::PopAndDestroy( icon ); + } + + iNaviContainer->PushL( *iNaviDecorator ); + + // The active tab should be same as active plugin + iTabGroup->SetActiveTabById( aActiveViewUid.iUid ); + } + + +// --------------------------------------------------------------------------- +// CGSTabHelper::RemoveTabGroup() +// +// Removes the tab group owned by this class from navi pane. +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSTabHelper::RemoveTabGroup() + { + if( iNaviDecorator ) + { + iNaviContainer->Pop( iNaviDecorator ); + delete iNaviDecorator; + iNaviDecorator = NULL; + } + } + + +// --------------------------------------------------------------------------- +// CGSTabHelper::TabChangedL() +// +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSTabHelper::TabChangedL( TInt aIndex ) + { + TUid uid; + uid.iUid = iTabGroup->TabIdFromIndex( aIndex ); + + // If has a tab owner, notify it: + if( iTabOwner ) + { + iTabOwner->TabChangedL( uid ); + } + + iAppUi->ActivateLocalViewL( uid ); + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/src/GSWatchDog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/src/GSWatchDog.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,565 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// INCLUDE FILES +#include +#include +#include + +// USER INCLUDES +#include "GSWatchDog.h" +#include "GsLogger.h" +#include "settingsinternalcrkeys.h" +#include "SettingsPrivateCRKeys.h" + +#include +#include +#include + +using namespace NCentralRepositoryConstants; + +// CONSTANTS + + +// ========================= MEMBER FUNCTIONS ================================ + +// ---------------------------------------------------------------------------- +// CGSWatchDog::NewL +// +// EPOC two-phased constructor +// ---------------------------------------------------------------------------- +// +CGSWatchDog* CGSWatchDog::NewL() + { + CGSWatchDog* self = new( ELeave ) CGSWatchDog; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CGSWatchDog::ConstructL +// +// EPOC default constructor can leave. +// ---------------------------------------------------------------------------- +// +void CGSWatchDog::ConstructL() + { + __GSLOGSTRING( "[CGSWatchDog] ConstructL()" ); + iStore = CRepository::NewL( KCRUidMiscSettings ); + + // Read last stored state for watchdog... + ReadStateL(); + + // If GS crashed last time, activate watchdog, reset run counter. Watchdog + // will be active as long as exit was not clean (panicked). + if( !WasCleanExitL() && + iWatchdogActivationLimit != KGSWatchdogActivationDisabled ) + { + iCrashCounter++; + iIsActive = ETrue; + +#ifdef _GS_WATCHDOG_VERBOSE_TRACES + #pragma message("-CGSWachDog verbose traces activated-") + User::InfoPrint( _L("Watchdog activated!") ); +#endif //_GS_WATCHDOG_VERBOSE_TRACES + + if( iQuarantine.Count() > 0 ) + { + for( TInt i = 0; i < iQuarantine.Count(); i++ ) + { + // If plugin is not already in blacklist, move it there from + // quarantinelist. + if( !IsInBlackList( iQuarantine[i] ) ) + { + TGSPluginQuarantine quarantinedPlugin; + quarantinedPlugin.iRunsAfterCrash = 0; + quarantinedPlugin.iUid = iQuarantine[i]; + iBlackList.AppendL( quarantinedPlugin ); + iQuarantine.Remove( i ); + } + } + } + } + else + { + iIsActive = EFalse; + iCrashCounter = 0; + +#ifdef _GS_WATCHDOG_VERBOSE_TRACES + User::InfoPrint( _L("Watchdog disabled.") ); +#endif //_GS_WATCHDOG_VERBOSE_TRACES + + // Clean run -> empty quarantine. + iQuarantine.Reset(); + } + + // Continue normal progress, set application to run state... + iGSAppRunning = ETrue; + + // Store watchdog state at this point as panic will not call normal + // destructors and data would be otherwise lost in case of panic. + StoreStateL(); + } + + +// --------------------------------------------------------------------------- +// CGSWatchDog::CGSWatchDog +// +// C++ constructor +// --------------------------------------------------------------------------- +CGSWatchDog::CGSWatchDog() + { + } + + + +// --------------------------------------------------------------------------- +// CGSWatchDog::~CGSWatchDog +// +// Destructor +// --------------------------------------------------------------------------- +CGSWatchDog::~CGSWatchDog() + { + // Update all blacklisted plugins in case no crash FIRST, then store... + UpdateBlackListedPluginRunCounters(); + TRAP_IGNORE( StoreStateL(); ); + iBlackList.Close(); + iQuarantine.Close(); + delete iStore; + } + + +// --------------------------------------------------------------------------- +// CGSWatchDog::Quarantine +// +// +// --------------------------------------------------------------------------- +void CGSWatchDog::QuarantineL( TUid aPluginUid ) + { + if( iIsActive ) + { + iQuarantine.AppendL( aPluginUid ); + StoreQuarantineL(); // Store to persistent storage + +#ifdef _GS_WATCHDOG_VERBOSE_TRACES + __GSLOGSTRING1( "[CGSWatchDog] Quarantined:0x%X", aPluginUid.iUid ); +#endif //_GS_WATCHDOG_VERBOSE_TRACES + + } + } + + +// --------------------------------------------------------------------------- +// CGSWatchDog::RemoveFromQuarantine +// +// +// --------------------------------------------------------------------------- +void CGSWatchDog::RemoveFromQuarantineL( TUid aPluginUid ) + { + if( iIsActive ) + { + for( TInt i = 0; i < iQuarantine.Count(); i++ ) + { + if( iQuarantine[i] == aPluginUid ) + { + iQuarantine.Remove( i ); + +#ifdef _GS_WATCHDOG_VERBOSE_TRACES + __GSLOGSTRING1( "[CGSWatchDog] Removed from quarantine:0x%X", aPluginUid.iUid ); +#endif //_GS_WATCHDOG_VERBOSE_TRACES + + StoreQuarantineL(); + break; + } + } + } + } + +// --------------------------------------------------------------------------- +// CGSWatchDog::WasCleanExit +// +// +// --------------------------------------------------------------------------- +TBool CGSWatchDog::WasCleanExitL() + { + return !iGSAppRunning; + } + +// --------------------------------------------------------------------------- +// CGSWatchDog::ReportCleanExit +// +// +// --------------------------------------------------------------------------- +void CGSWatchDog::ReportCleanExitL() + { + iGSAppRunning = EFalse; + iStore->Set( KWatchDogGSRunning, iGSAppRunning ); + } + + +// --------------------------------------------------------------------------- +// CGSWatchDog::IsInBlackList +// +// +// --------------------------------------------------------------------------- +TBool CGSWatchDog::IsInBlackList( TUid aPluginUid ) + { + TBool found = EFalse; + if( iIsActive ) + { + for( TInt i = 0; i < iBlackList.Count(); i++ ) + { + if( iBlackList[i].iUid == aPluginUid ) + { + found = ETrue; + break; + } + } + } + + return found; + } + + +// --------------------------------------------------------------------------- +// CGSWatchDog::StoreStateL +// +// +// --------------------------------------------------------------------------- +void CGSWatchDog::StoreStateL() + { + //iStore->Set( KWatchDogIsActive, iIsActive ); + iStore->Set( KWatchDogGSRunning, iGSAppRunning ); + iStore->Set( KWatchDogCrashCounter, iCrashCounter ); + iStore->Set( KWatchdogActivationLimit, iWatchdogActivationLimit ); + iStore->Set( KWatchdogMaxPluginBlackListedRuns, iMaxPluginBlackListedRuns ); + + StoreQuarantineL(); + StoreBlackListL(); + +#ifdef _GS_WATCHDOG_VERBOSE_TRACES + // The following is just for debug trace: + __GSLOGSTRING( "[CGSWatchDog] Storing state:" ); + __GSLOGSTRING1( " iIsActive: %d", iIsActive ); + __GSLOGSTRING1( " iGSAppRunning: %d", iGSAppRunning ); + __GSLOGSTRING1( " iCrashCounter: %d", iCrashCounter ); + __GSLOGSTRING1( " iWatchdogActivationLimit: %d", iWatchdogActivationLimit ); + __GSLOGSTRING1( " iMaxPluginBlackListedRuns: %d", iMaxPluginBlackListedRuns ); + + __GSLOGSTRING( "[CGSWatchDog] Stored plugins from quarantine:" ); + for( TInt i = 0; i < iQuarantine.Count(); i++ ) + { + __GSLOGSTRING1( " 0x%X", iQuarantine[i].iUid ); + } + __GSLOGSTRING( "-" ); + + __GSLOGSTRING( "[CGSWatchDog] Stored plugins from blacklist:" ); + for( TInt i = 0; i < iBlackList.Count(); i++ ) + { + __GSLOGSTRING2( " 0x%X %d runs", iBlackList[i].iUid.iUid, iBlackList[i].iRunsAfterCrash ); + } + __GSLOGSTRING( "-" ); +#endif //_GS_WATCHDOG_VERBOSE_TRACES + } + + +// --------------------------------------------------------------------------- +// CGSWatchDog::ReadStateL +// +// +// --------------------------------------------------------------------------- +void CGSWatchDog::ReadStateL() + { + /*TInt isActive = EFalse; // Needed for mapping to TBool value + TInt err = iStore->Get( KWatchDogIsActive, isActive ); + if( isActive == 1 ) + { + iIsActive = ETrue; + } + else + { + iIsActive = EFalse; + }*/ + + TInt appRunning; // Needed for mapping to TBool value + TInt err = iStore->Get( KWatchDogGSRunning, appRunning ); + + if( err ) + { + // CenRep values are uninitialized: first runtime of watchdog + // -> init values + InitStateL(); + } + + if( appRunning ) + { + iGSAppRunning = ETrue; + } + else + { + iGSAppRunning = EFalse; + } + + iStore->Get( KWatchDogCrashCounter, iCrashCounter ); + iStore->Get( KWatchdogActivationLimit, iWatchdogActivationLimit ); + iStore->Get( KWatchdogMaxPluginBlackListedRuns, iMaxPluginBlackListedRuns ); + + ReadQuarantineL(); + ReadBlackListL(); + +#ifdef _GS_WATCHDOG_VERBOSE_TRACES + // The following is just for debug trace: + __GSLOGSTRING( "[CGSWatchDog] Read state:" ); + __GSLOGSTRING1( " iIsActive: %d", iIsActive ); + __GSLOGSTRING1( " iGSAppRunning: %d", iGSAppRunning ); + __GSLOGSTRING1( " iCrashCounter: %d", iCrashCounter ); + __GSLOGSTRING1( " iWatchdogActivationLimit: %d", iWatchdogActivationLimit ); + __GSLOGSTRING1( " iMaxPluginBlackListedRuns: %d", iMaxPluginBlackListedRuns ); + + __GSLOGSTRING( "[CGSWatchDog] Read plugins from quarantine:" ); + for( TInt i = 0; i < iQuarantine.Count(); i++ ) + { + __GSLOGSTRING1( " 0x%X", iQuarantine[i].iUid ); + } + __GSLOGSTRING( "-" ); + + __GSLOGSTRING( "[CGSWatchDog] Read plugins from blacklist:" ); + for( TInt i = 0; i < iBlackList.Count(); i++ ) + { + __GSLOGSTRING2( " 0x%X %d runs", iBlackList[i].iUid.iUid, iBlackList[i].iRunsAfterCrash ); + } + __GSLOGSTRING( "-" ); +#endif //_GS_WATCHDOG_VERBOSE_TRACES + } + + +// --------------------------------------------------------------------------- +// CGSWatchDog::InitStateL +// +// +// --------------------------------------------------------------------------- +void CGSWatchDog::InitStateL() + { + __GSLOGSTRING( "[CGSWatchDog] initializing state..." ); + iIsActive = EFalse; + iGSAppRunning = EFalse; + iCrashCounter = 0; + + // Check CenRep, if values do not exist, use default values: + TInt err; + err = iStore->Get( KWatchDogCrashCounter, iWatchdogActivationLimit ); + if( err ) + { + iWatchdogActivationLimit = KGSDefaultWatchdogActivationLimit; + } + + err = iStore->Get( KWatchdogMaxPluginBlackListedRuns, iMaxPluginBlackListedRuns); + if( err ) + { + iMaxPluginBlackListedRuns = KGSDefaultMaxPluginBlackListedRuns; + } + + StoreStateL(); + } + + +// --------------------------------------------------------------------------- +// CGSWatchDog::ReadQuarantineL +// +// +// --------------------------------------------------------------------------- +void CGSWatchDog::ReadQuarantineL() + { + HBufC8* buf = HBufC8::NewLC( KMaxBinaryLength ); + TPtr8 serializedArr = buf->Des(); + iStore->Get( KWatchDogQuarantine, serializedArr ); + RDesReadStream stream; + stream.Open( serializedArr ); + CleanupClosePushL( stream ); + + // In case CenRep value is uninitialized (less than 16 bits), don't try + //reading it + TInt count = 0; + if( buf->Size() > 0 ) + { + count = stream.ReadUint16L(); + } + for( TInt i = 0; i < count; i++ ) + { + TUid uid; + uid.iUid = stream.ReadInt32L(); + iQuarantine.AppendL( uid ); + } + //stream.Close(); + CleanupStack::PopAndDestroy( &stream ); + CleanupStack::PopAndDestroy( buf ); + } + + +// --------------------------------------------------------------------------- +// CGSWatchDog::StoreQuarantineL +// +// +// --------------------------------------------------------------------------- +void CGSWatchDog::StoreQuarantineL() + { + // Hmmm. KMaxBinaryLength = 1024*2 unicode characters (16bit) + // = 1024*2*16 bits = 32768. + // 32768 - 16(count) bits reserved for 32 bit TUids = 1023.5 TUids + // -> We can store 1023 UIds in quarantine. Should be enought as we have + // about ~50 plugins at the moment and each plugin ought to be listed in + // quarantine only once at a specific point of time. + HBufC8* buf = HBufC8::NewLC( KMaxBinaryLength ); + TPtr8 serializedArr = buf->Des(); + RDesWriteStream stream; + stream.Open( serializedArr ); + CleanupClosePushL( stream ); + + stream.WriteUint16L( iQuarantine.Count() ); + + for( TInt i = 0; i < iQuarantine.Count(); i++ ) + { + stream.WriteInt32L( iQuarantine[i].iUid ); + } + // This also flushes the stream: + CleanupStack::PopAndDestroy( &stream ); + + iStore->Set( KWatchDogQuarantine, serializedArr ); + + CleanupStack::PopAndDestroy( buf ); + } + + +// --------------------------------------------------------------------------- +// CGSWatchDog::ReadBlackListL +// +// +// --------------------------------------------------------------------------- +void CGSWatchDog::ReadBlackListL() + { + HBufC8* buf = HBufC8::NewLC( KMaxBinaryLength ); + TPtr8 serializedArr = buf->Des(); + iStore->Get( KWatchDogBlackList, serializedArr ); + RDesReadStream stream; + stream.Open( serializedArr ); + CleanupClosePushL( stream ); + + // In case CenRep value is uninitialized (less than 16 bits), don't try + //reading it + TInt count = 0; + if( buf->Size() > 0 ) + { + count = stream.ReadUint16L(); + } + for( TInt i = 0; i < count; i++ ) + { + TGSPluginQuarantine plugin; + plugin.InternalizeL( stream ); + iBlackList.AppendL( plugin ); + } + + //stream.Close(); + CleanupStack::PopAndDestroy( &stream ); + CleanupStack::PopAndDestroy( buf ); + } + + +// --------------------------------------------------------------------------- +// CGSWatchDog::StoreBlackListL +// +// +// --------------------------------------------------------------------------- +void CGSWatchDog::StoreBlackListL() + { + HBufC8* buf = HBufC8::NewLC( KMaxBinaryLength ); + TPtr8 serializedArr = buf->Des(); + RDesWriteStream stream; + stream.Open( serializedArr ); + CleanupClosePushL( stream ); + + stream.WriteUint16L( iBlackList.Count() ); + + for( TInt i = 0; i < iBlackList.Count(); i++ ) + { + iBlackList[i].ExternalizeL( stream ); + +#ifdef _GS_WATCHDOG_VERBOSE_TRACES + __GSLOGSTRING1( "[CGSWatchDog] Written to blacklist 0x%X", + iBlackList[i].iUid.iUid ); +#endif //_GS_WATCHDOG_VERBOSE_TRACES + + } + // This also flushes the stream: + CleanupStack::PopAndDestroy( &stream ); + + iStore->Set( KWatchDogBlackList, serializedArr ); + + CleanupStack::PopAndDestroy( buf ); + } + + +// --------------------------------------------------------------------------- +// CGSWatchDog::UpdateBlackListedPluginRunCounters +// +// +// --------------------------------------------------------------------------- +void CGSWatchDog::UpdateBlackListedPluginRunCounters() + { + TInt count = iBlackList.Count(); + for( TInt i = 0; i < count; i++ ) + { + iBlackList[i].iRunsAfterCrash++; + if( iBlackList[i].iRunsAfterCrash > iMaxPluginBlackListedRuns ) + { +//__GSLOGSTRING2( "[CGSWatchDog] 0x%X removed from blacklist (%d runs)", iBlackList[i].iUid.iUid, iBlackList[i].iRunsAfterCrash ); + iBlackList.Remove( i ); + i--; // Item in index i has been removed + count--;// One item has been removed from the array + } + } + } + + +// --------------------------------------------------------------------------- +// TGSPluginQuarantine::InternalizeL +// +// +// --------------------------------------------------------------------------- +void TGSPluginQuarantine::InternalizeL( RReadStream& aStream ) + { + iUid.iUid = aStream.ReadInt32L(); + iRunsAfterCrash = aStream.ReadInt16L(); + } + + +// --------------------------------------------------------------------------- +// TGSPluginQuarantine::ExternalizeL +// +// +// --------------------------------------------------------------------------- +void TGSPluginQuarantine::ExternalizeL( RWriteStream& aStream ) const + { + aStream.WriteInt32L( iUid.iUid ); + aStream.WriteInt16L( iRunsAfterCrash ); + } + + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSFramework/src/GsContainerExt.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/src/GsContainerExt.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for GSParentPlugin. +* +*/ + +#include "GsContainerExt.h" + +const TInt KInterval = 1000000; // 1 seconds + +// ========================= MEMBER FUNCTIONS ================================ +// ----------------------------------------------------------------------------- +// CGsDoubleClickPreventer::CGsDoubleClickPreventer() +// +// +// ----------------------------------------------------------------------------- +// +CGsDoubleClickPreventer::CGsDoubleClickPreventer() + : CTimer(CActive::EPriorityStandard) + { + } + +// ----------------------------------------------------------------------------- +// CGsDoubleClickPreventer::NewL() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CGsDoubleClickPreventer* CGsDoubleClickPreventer::NewL() + { + CGsDoubleClickPreventer* self = new(ELeave) CGsDoubleClickPreventer(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CGsDoubleClickPreventer::ConstructL() +// +// +// ----------------------------------------------------------------------------- +// +void CGsDoubleClickPreventer::ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add(this); + } + +// ----------------------------------------------------------------------------- +// CGsDoubleClickPreventer::Start() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CGsDoubleClickPreventer::Start() + { + if(!IsActive()) + { + After(KInterval); + } + } + +// ----------------------------------------------------------------------------- +// CGsContainerExt::NewL() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CGsContainerExt* CGsContainerExt::NewL() + { + CGsContainerExt* self = new(ELeave) CGsContainerExt; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CGsContainerExt::ConstructL() +// +// +// ----------------------------------------------------------------------------- +// +void CGsContainerExt::ConstructL() + { + iDblClickPreventer = CGsDoubleClickPreventer::NewL(); + } + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSGenPlugin/GSGenPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSGenPlugin/GSGenPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSGenPlugin project specification file. +* +*/ + +#include // For RESOURCE_FILES_DIR + +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gsgenplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10207238 +VENDORID VID_DEFAULT + +SOURCEPATH src +SOURCE GSGenPluginImplementationTable.cpp +SOURCE GSGenPlugin.cpp + +USERINCLUDE inc +USERINCLUDE data +USERINCLUDE ../Data +USERINCLUDE loc +USERINCLUDE ../Logger + +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + +SOURCEPATH data + +START RESOURCE 10207238.rss +TARGET gsgenplugin.rsc +END + +// View resources +START RESOURCE GSGenPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // View resources + + +// Libraries + +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY commonengine.lib// For RConeResourceLoader +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY egul.lib // CGulIcon +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY euser.lib +LIBRARY flogger.lib // For GSLogger +LIBRARY gsframework.lib +LIBRARY gsecomplugin.lib +LIBRARY gslistbox.lib// For CGSListBoxItemTextArray +LIBRARY ws32.lib // For RWsSession +LIBRARY featmgr.lib // feature manager + +//Documents. Defining these is optional. Used only by IDE's file browser. +SOURCEPATH data +DOCUMENT 10207238.rss +DOCUMENT GSGenPluginRsc.rss + +SOURCEPATH inc + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSGenPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSGenPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSGenPlugin. +* +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSGenPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsgenplugin.iby ) +../rom/GSGenPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsgenpluginresources.iby ) +loc/GSGenPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsgenplugin.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gsgenplugin.mif + OPTION HEADERFILE gsgenplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_cp_dev +END + +PRJ_MMPFILES +GSGenPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSGenPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSGenPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSGenPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSGenPlugin/data/10207238.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSGenPlugin/data/10207238.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for GSGenPlugin. +* +*/ + +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x10207238; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10207237; + version_no = 1; + display_name = "General Settings Plugin"; // Debug name + default_data = "0x1020723B";// Parent UID + #ifdef RD_CONTROL_PANEL + opaque_data = "20";// Order number + #else //RD_CONTROL_PANEL + opaque_data = "0";// Order number + #endif //RD_CONTROL_PANEL + } + }; + } + }; + } + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSGenPlugin/data/GSGenPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSGenPlugin/data/GSGenPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file GSGenPlugin. +* +*/ + + +// RESOURCE IDENTIFIER +NAME GENE // 4 letter ID + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// CONSTANTS + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// +// +// Needed or loading the resource fails! +// +//---------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +//---------------------------------------------------- +// +// r_gs_gen_view +// General settings view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_gen_view + { + menubar = r_gs_menubar_open_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN; + } + + +//---------------------------------------------------- +// +// r_gs_gen_view_title +// General settings view title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_gen_view_title + { + #ifdef RD_CONTROL_PANEL + txt = qtn_cp_title_device; + #else //RD_CONTROL_PANEL + txt = qtn_set_title_settings_general; + #endif //RD_CONTROL_PANEL + } + + +//---------------------------------------------------- +// r_gs_gen_view_caption +// +// gen view caption for plugin +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_gen_view_caption + { + #ifdef RD_CONTROL_PANEL + buf = qtn_cp_folder_device; + #else //RD_CONTROL_PANEL + buf = qtn_set_folder_general; + #endif //RD_CONTROL_PANEL + } + + + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSGenPlugin/inc/GSGenPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSGenPlugin/inc/GSGenPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,133 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSGenPlugin header. +* +*/ + + +#ifndef GSGENPLUGIN_H +#define GSGENPLUGIN_H + +// Includes +#include +#include +#include +#include +#include + +// Classes referenced +class CAknViewAppUi; +class RConeResourceLoader; +class CGSTabHelper; + +// Constants +_LIT( KGSGenPluginResourceFileName, "z:GSGenPluginRsc.rsc" ); +_LIT( KGSGenPluginIconDirAndName, "z:GSGenPlugin.mbm"); // Use KDC_BITMAP_DIR + +// CLASS DECLARATION + +/** +* CGSGenPlugin view class. +* +* @since Series60_3.1 +*/ +class CGSGenPlugin : public CGSParentPlugin + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return + */ + static CGSGenPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSGenPlugin(); + + public: // From CAknView + + /** + * See base class. + */ + TUid Id() const; + + /** + * See base class. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + /** + * See base class. + */ + void DoDeactivate(); + + public: // From CGSParentPlugin + + /** + * See base class. + */ + TUid UpperLevelViewUid(); + + /** + * See base class. + */ + void GetHelpContext( TCoeHelpContext& aContext ); + + public: // From CGSPluginInterface + + /** + * See base class. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * See base class. + */ + TInt PluginProviderCategory() const; + + protected: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + protected: // New + /** + * C++ default constructor. + */ + CGSGenPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + private: // Data + + // Resource loader. + RConeResourceLoader iResourceLoader; + + // Tab hepler. + CGSTabHelper* iTabHelper; + }; + + +#endif // GSGENPLUGIN_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSGenPlugin/loc/GSGenPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSGenPlugin/loc/GSGenPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSGenPlugin. +* +*/ + + +// LOCALISATION STRINGS + +// **CAPTIONS + +//d:Plugin caption +//d:Long string +//l:title_pane_t2/opt9 +//w: +//r: 3.1 +// +#define qtn_set_title_settings_general "General" + +// **OPTIONS MENU + +//d:Command in Options list +//d:Opens the highlighted item +//l:list_single_pane_t1_cp2 +//w: +//r: 3.1 +// +#define qtn_set_options_open "Open" + + +//d:Text of a list item in main view list +//d:Item opens General folder +//l:list_single_large_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_set_folder_general "General" + +//CONTROL PANEL + +//d:Plugin caption +//d:Long string +//l:title_pane_t2/opt9 +//w: +//r: 5.0 +// +#define qtn_cp_title_device "Device" + +//d:Text of a list item in main view list +//d:Item opens General folder +//l:list_single_large_graphic_pane_t1 +//w: +//r: 5.0 +#define qtn_cp_folder_device "Device" + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSGenPlugin/src/GSGenPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSGenPlugin/src/GSGenPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,298 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSGenPlugin source code. +* +*/ + + +// Includes +#include "GSGenPlugin.h" +#include "GsLogger.h" +#include +#include // Icons +#include +#include +#include +#include +#include +#include +#include +#include // For TResourceReader +#include + +#ifndef RD_CONTROL_PANEL + #include +#endif //RD_CONTROL_PANEL + +// Constants + + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CGSGenPlugin::CGSGenPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSGenPlugin::CGSGenPlugin() + : CGSParentPlugin(), iResourceLoader( *iCoeEnv ) + { + __GSLOGSTRING( "[CGSGenPlugin] CGSGenPlugin()" ); + + } + + +// --------------------------------------------------------------------------- +// CGSGenPlugin::~CGSGenPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSGenPlugin::~CGSGenPlugin() + { + __GSLOGSTRING( "[CGSGenPlugin] ~CGSGenPlugin()|->" ); + FeatureManager::UnInitializeLib(); + iResourceLoader.Close(); + + #ifndef RD_CONTROL_PANEL + if ( iTabHelper ) + { + delete iTabHelper; + } + #endif //RD_CONTROL_PANEL + __GSLOGSTRING( "[CGSGenPlugin] ~CGSGenPlugin()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSGenPlugin::ConstructL() +// +// +// --------------------------------------------------------------------------- +// +void CGSGenPlugin::ConstructL() + { + __GSLOGSTRING( "[CGSGenPlugin] ConstructL()|->" ); + FeatureManager::InitializeLibL(); + OpenLocalizedResourceFileL( KGSGenPluginResourceFileName, + iResourceLoader ); + BaseConstructL( R_GS_GEN_VIEW, R_GS_GEN_VIEW_TITLE ); + + #ifndef RD_CONTROL_PANEL + iTabHelper = CGSTabHelper::NewL(); + #endif //RD_CONTROL_PANEL + __GSLOGSTRING( "[CGSGenPlugin] ConstructL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSGenPlugin::NewL() +// +// +// --------------------------------------------------------------------------- +// +CGSGenPlugin* CGSGenPlugin::NewL( TAny* /*aInitParams*/ ) + { + __GSLOGSTRING( "[CGSGenPlugin] NewL()" ); + + CGSGenPlugin* self = new(ELeave) CGSGenPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::Id() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSGenPlugin::Id() const + { + __GSLOGSTRING1( "[CGSGenPlugin] Id():0x%X", KGSGenPluginUid.iUid ); + return KGSGenPluginUid; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoActivateL() +// +// +// --------------------------------------------------------------------------- +// +void CGSGenPlugin::DoActivateL + ( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + __GSLOGSTRING( "[CGSGenPlugin] DoActivateL()|->" ); + CGSParentPlugin::DoActivateL( aPrevViewId, + aCustomMessageId, + aCustomMessage ); + CGSMainView* parent = + static_cast ( AppUi()->View( KGSMainViewUid ) ); + + + #ifndef RD_CONTROL_PANEL + // Create tab group for this view (do only if casting parent succeeds): + if( parent ) + { + iTabHelper->CreateTabGroupL( Id(), parent ); + } + #endif //RD_CONTROL_PANEL + __GSLOGSTRING( "[CGSGenPlugin] DoActivateL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoDeactivate() +// +// +// --------------------------------------------------------------------------- +// +void CGSGenPlugin::DoDeactivate() + { + __GSLOGSTRING( "[CGSGenPlugin] DoDeactivate()|->" ); + CGSParentPlugin::DoDeactivate(); + + #ifndef RD_CONTROL_PANEL + iTabHelper->RemoveTabGroup(); + #endif //RD_CONTROL_PANEL + __GSLOGSTRING( "[CGSGenPlugin] DoDeactivate()-|" ); + } + + +// ========================= From CGSParentPlugin ===================== + + +// --------------------------------------------------------------------------- +// CGSGenPlugin::UpperLevelViewUid() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSGenPlugin::UpperLevelViewUid() + { + return KGSMainViewUid; + } + + +// ========================= From CGSPluginInterface ================== + + +// --------------------------------------------------------------------------- +// CGSGenPlugin::GetCaptionL() +// +// +// --------------------------------------------------------------------------- +// +void CGSGenPlugin::GetCaptionL( TDes& aCaption ) const + { + __GSLOGSTRING( "[CGSGenPlugin] GetCaptionL()|->" ); + // The resource file is already opened by iResourceLoader. + HBufC* result = StringLoader::LoadL( R_GS_GEN_VIEW_CAPTION ); + aCaption.Copy( *result ); + delete result; + __GSLOGSTRING( "[CGSGenPlugin] GetCaptionL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSGenPlugin::PluginProviderCategory() +// +// +// --------------------------------------------------------------------------- +// +TInt CGSGenPlugin::PluginProviderCategory() const + { + return KGSPluginProviderInternal; + } + + +// ----------------------------------------------------------------------------- +// CGSGenPlugin::GetHelpContext() +// +// +// ----------------------------------------------------------------------------- +// +void CGSGenPlugin::GetHelpContext( TCoeHelpContext& aContext ) + { + aContext.iMajor = KUidGS; + aContext.iContext = KCP_HLP_DEVICE; + } + + +// ----------------------------------------------------------------------------- +// CGSGenPlugin::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CGSGenPlugin::CreateIconL( const TUid aIconType ) + { + //EMbm + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSGenPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropCpDev, + fp->FullName(), + EMbmGsgenpluginQgn_prop_cp_dev, + EMbmGsgenpluginQgn_prop_cp_dev_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + CleanupStack::PopAndDestroy( fp ); + + return icon; + } + + +// ---------------------------------------------------------------------------- +// CGSGenPlugin::DynInitMenuPaneL() +// +// Display the dynamic menu +// ---------------------------------------------------------------------------- +void CGSGenPlugin::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + // show or hide the 'help' menu item when supported + if( aResourceId == R_GS_MENU_ITEM_HELP ) + { + User::LeaveIfNull( aMenuPane ); + + if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSGenPlugin/src/GSGenPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSGenPlugin/src/GSGenPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for GSGenPlugin. +* +*/ + + +// System includes +#include +#include + +// User includes +#include "GSGenPlugin.h" + +// Constants +const TImplementationProxy KGSGenPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x10207237, CGSGenPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSGenPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSGenPluginImplementationTable; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSIndicatorPlugin/data/200100DD.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSIndicatorPlugin/data/200100DD.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Ecom registration resource for gsindicatorplugin +* +*/ + + + +#include + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x200100DD; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10275092; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x200100DC; + version_no = 1; + display_name = ""; + default_data = "Default"; + opaque_data = ""; + } + }; + } + }; + } + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSIndicatorPlugin/group/GSindicatorplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSIndicatorPlugin/group/GSindicatorplugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification file for GSindicatorplugin. +* +*/ + + +CAPABILITY CAP_ECOM_PLUGIN + +#include +#include + +// Build target +TARGET gsindicatorplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x200100DD +VENDORID VID_DEFAULT + + +// Source files location +SOURCEPATH ../src +SOURCE GSindicatorpluginimplementation.cpp +SOURCE dllmain.cpp + + +// Resources +START RESOURCE ../data/200100DD.rss +TARGET gsindicatorplugin.rsc +TARGETPATH ECOM_RESOURCE_DIR +END + +// Include paths +USERINCLUDE ../inc +USERINCLUDE ../group + +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + +// Dependencies to system components +LIBRARY eikcore.lib +LIBRARY cone.lib +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY avkon.lib +LIBRARY commonengine.lib // stringloader +LIBRARY bafl.lib // baflutils +LIBRARY gslauncher.lib + +// End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSIndicatorPlugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSIndicatorPlugin/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project file for gsindicatorplugin +* +*/ + + + +#include + +// +// Platforms +// +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/gsindicatorplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(gsindicatorplugin.iby) + +PRJ_MMPFILES +GSindicatorplugin.mmp + +// End of file \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSIndicatorPlugin/inc/GSindicatorpluginimplementation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSIndicatorPlugin/inc/GSindicatorpluginimplementation.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSIndicatorplugin plugin implementation +* +*/ + + + +#ifndef CGSINDICATORPLUGINIMPLEMENTATION_H +#define CGSINDICATORPLUGINIMPLEMENTATION_H + + +// INCLUDES +#include // CAknIndicatorPlugin + +/** +* GSIndicatorplugin. When user taps signal pane in indicator pop-up pane +* this component will open general settings. +* +* @lib gsindicatorplugin.lib +* @since 5.0 +*/ +class CGSIndicatorPluginImplementation : public CAknIndicatorPlugin + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CGSIndicatorPluginImplementation* NewL(); + + /** + * Destructor. + */ + ~CGSIndicatorPluginImplementation(); + public: + static TInt Tick(TAny* aObject); + + private: // From CAknIndicatorPlugin + + /** + * @see CAknIndicatorPlugin + */ + void HandleIndicatorTapL( const TInt /*aUid */); + + private: + + /** + * C++ default constructor. + */ + CGSIndicatorPluginImplementation(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // new functions + TInt DoTick(); + + + private: // data + CPeriodic* iTimer; + }; + +#endif // CGSINDICATORPLUGINIMPLEMENTATION_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSIndicatorPlugin/rom/gsindicatorplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSIndicatorPlugin/rom/gsindicatorplugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: includes gsindicatorplugin to ROM +* +*/ + + +#ifndef __GSINDICATORPLUGIN_IBY__ +#define __GSINDICATORPLUGIN_IBY__ + + +#include + +ECOM_PLUGIN( GSIndicatorPlugin.dll, GSIndicatorPlugin.rsc ) + + +#endif // __GSINDICATORPLUGIN_IBY__ + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSIndicatorPlugin/src/GSindicatorpluginimplementation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSIndicatorPlugin/src/GSindicatorpluginimplementation.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: gsIndicatorPlugin plugin implementation +* +*/ + + + +// INCLUDE FILES +#include "GSindicatorpluginimplementation.h" + + +#include // CCoeEnv +#include // CCoeAppUi +#include +#include // KDC_RESOURCE_FILES_DIR +#include + +// CONSTANTS + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CGSIndicatorPluginImplementation::CGSIndicatorPluginImplementation +// C++ default constructor can NOT contain any code, that +// might leave. +// --------------------------------------------------------------------------- +// +CGSIndicatorPluginImplementation::CGSIndicatorPluginImplementation() + { + } + +// --------------------------------------------------------------------------- +// CGSIndicatorPluginImplementation::ConstructL +// Symbian 2nd phase constructor can leave. +// --------------------------------------------------------------------------- +// +void CGSIndicatorPluginImplementation::ConstructL() + { + iTimer = CPeriodic::NewL(CActive::EPriorityStandard); + } + +// ----------------------------------------------------------------------------- +// CGSIndicatorPluginImplementation::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CGSIndicatorPluginImplementation* CGSIndicatorPluginImplementation::NewL() + { + CGSIndicatorPluginImplementation* self = + new( ELeave ) CGSIndicatorPluginImplementation; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// Destructor +CGSIndicatorPluginImplementation::~CGSIndicatorPluginImplementation() + { + if ( iTimer ) + { + iTimer->Cancel(); + delete iTimer; + } + } + + +// --------------------------------------------------------------------------- +// CGSIndicatorPluginImplementation::HandleIndicatorTapL +// --------------------------------------------------------------------------- +// +void CGSIndicatorPluginImplementation::HandleIndicatorTapL( const TInt /*aUid */) + { + if ( iTimer->IsActive() ) + { + iTimer->Cancel(); + } + iTimer->Start(10, 10, TCallBack(Tick, this)); + // Launch connection view +// CGSLauncher* l = CGSLauncher::NewLC(); +// l->LaunchGSViewL ( KGSConPluginUid, TUid::Uid(0), KNullDesC8 ); +// CleanupStack::PopAndDestroy(l); + } + +TInt CGSIndicatorPluginImplementation::Tick(TAny* aObject) + { + return static_cast(aObject)->DoTick(); + } + +TInt CGSIndicatorPluginImplementation::DoTick() + { + if ( iTimer ) + { + iTimer->Cancel(); + } + + // Launch connection view + CGSLauncher* l = CGSLauncher::NewLC(); + TInt error = KErrNone; + TRAP(error, l->LaunchGSViewL ( KGSConPluginUid, TUid::Uid(0), KNullDesC8 )); + CleanupStack::PopAndDestroy(l); + return error; + } + + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSIndicatorPlugin/src/dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSIndicatorPlugin/src/dllmain.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for DllMain. +* +*/ + + + +#include "GSindicatorpluginimplementation.h" + +#include + +// Define the interface UIDs +// Map the interface implementation UIDs to implementation factory functions +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x200100DC, + CGSIndicatorPluginImplementation::NewL ) + }; + +// Exported proxy for instantiation method resolution. +EXPORT_C const TImplementationProxy* ImplementationGroupProxy + (TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(ImplementationTable[0]); + return ImplementationTable; + } + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSInstallationsPlugin/GSInstallationsPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSInstallationsPlugin/GSInstallationsPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSInstallationsPlugin project specification file. +* +*/ + +#include // For RESOURCE_FILES_DIR + +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gsinstallationsplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10283320 +VENDORID VID_DEFAULT + +SOURCEPATH src +SOURCE GSInstallationsPluginImplementationTable.cpp +SOURCE GSInstallationsPlugin.cpp + +USERINCLUDE inc +USERINCLUDE data +USERINCLUDE ../Data +USERINCLUDE loc +USERINCLUDE ../Logger + +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + +SOURCEPATH data + +START RESOURCE 10283320.rss +TARGET gsinstallationsplugin.rsc +END + +// View resources +START RESOURCE GSInstallationsPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // View resources + + +// Libraries + +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY commonengine.lib// For RConeResourceLoader +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY egul.lib // CGulIcon +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY euser.lib +LIBRARY flogger.lib // For GSLogger +LIBRARY gsframework.lib +LIBRARY gsecomplugin.lib +LIBRARY gslistbox.lib// For CGSListBoxItemTextArray +LIBRARY ws32.lib // For RWsSession + +//Documents. Defining these is optional. Used only by IDE's file browser. +SOURCEPATH data +DOCUMENT 10283320.rss +DOCUMENT GSInstallationsPluginRsc.rss + +SOURCEPATH inc + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSInstallationsPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSInstallationsPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSInstallationsPlugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSInstallationsPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsinstallationsplugin.iby ) +../rom/GSInstallationsPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsinstallationspluginresources.iby ) +loc/GSInstallationsPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsinstallationsplugin.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE GSInstallationsPlugin.mif + OPTION HEADERFILE GSInstallationsPlugin.mbg + OPTION SOURCES -c8,8 qgn_prop_cp_inst +END + + +PRJ_MMPFILES +GSInstallationsPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSInstallationsPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSInstallationsPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSInstallationsPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSInstallationsPlugin/data/10283320.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSInstallationsPlugin/data/10283320.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for GSInstallationsPlugin. +* +*/ + +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x10283320; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10283321; + version_no = 1; + display_name = "GSInstallationsPlugin"; // Debug name + default_data = "0x1020723B";// Parent UID + opaque_data = "30";// Order number + } + }; + } + }; + } + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSInstallationsPlugin/data/GSInstallationsPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSInstallationsPlugin/data/GSInstallationsPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file GSInstallationsPlugin. +* +*/ + + +// RESOURCE IDENTIFIER +NAME INST // 4 letter ID + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// CONSTANTS + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// +// +// Needed or loading the resource fails! +// +//---------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +//---------------------------------------------------- +// +// r_gs_installations_view +// Installations view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_installations_view + { + menubar = r_gs_menubar_open_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN; + } + + +//---------------------------------------------------- +// +// r_gs_installations_view_title +// Installations view title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_installations_view_title + { + txt = qtn_cp_title_installations; + } + + +//---------------------------------------------------- +// r_gs_installations_view_caption +// +// gen view caption for plugin +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_installations_view_caption + { + buf = qtn_cp_folder_installations; + } + + + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSInstallationsPlugin/inc/GSInstallationsPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSInstallationsPlugin/inc/GSInstallationsPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSInstallationsPlugin header. +* +*/ + + +#ifndef GSINSTALLATIONSPLUGIN_H +#define GSINSTALLATIONSPLUGIN_H + +// Includes +#include +#include +#include +#include + +// Classes referenced +class CAknViewAppUi; +class RConeResourceLoader; + +// Constants +_LIT( KGSInstallationsPluginResourceFileName, "z:GSInstallationsPluginRsc.rsc" ); +_LIT( KGSInstallationsPluginIconDirAndName, "z:GSInstallationsPlugin.mbm"); // Use KDC_BITMAP_DIR + +// CLASS DECLARATION + +/** +* CGSInstallationsPlugin view class. +* +* @since Series60_3.2 +*/ +class CGSInstallationsPlugin : public CGSParentPlugin + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return + */ + static CGSInstallationsPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSInstallationsPlugin(); + + public: // From CAknView + + /** + * See base class. + */ + TUid Id() const; + + /** + * See base class. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + /** + * See base class. + */ + void DoDeactivate(); + + public: // From CGSParentPlugin + + /** + * See base class. + */ + TUid UpperLevelViewUid(); + + /** + * See base class. + */ + void GetHelpContext( TCoeHelpContext& aContext ); + + public: // From CGSPluginInterface + + /** + * See base class. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * See base class. + */ + TInt PluginProviderCategory() const; + + protected: // New + /** + * C++ default constructor. + */ + CGSInstallationsPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + private: // Data + + // Resource loader. + RConeResourceLoader iResourceLoader; + }; + + +#endif // GSINSTALLATIONSPLUGIN_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSInstallationsPlugin/loc/GSInstallationsPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSInstallationsPlugin/loc/GSInstallationsPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSInstallationsPlugin. +* +*/ + + +// LOCALISATION STRINGS + +// **CAPTIONS + +//d:Plugin title. +//d:Long string. +//l:title_pane_t2/opt9 +//w: +//r:5.0 +// +#define qtn_cp_title_installations "Installations" + +//d:Plugin caption. +//d:Used by GS FW. +//l:list_single_large_graphic_pane_t1 +//w: +//r:5.0 +// +#define qtn_cp_folder_installations "Installations" + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSInstallationsPlugin/src/GSInstallationsPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSInstallationsPlugin/src/GSInstallationsPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,246 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSInstallationsPlugin source code. +* +*/ + + +// Includes +#include "GSInstallationsPlugin.h" +#include "GsLogger.h" +#include +#include // Icons +#include +#include +#include +#include +#include +#include +#include +#include // For TResourceReader + + +// Constants + + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CGSInstallationsPlugin::CGSInstallationsPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSInstallationsPlugin::CGSInstallationsPlugin() + : CGSParentPlugin(), iResourceLoader( *iCoeEnv ) + { + __GSLOGSTRING( "[CGSInstallationsPlugin] CGSInstallationsPlugin()" ); + + } + + +// --------------------------------------------------------------------------- +// CGSInstallationsPlugin::~CGSInstallationsPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSInstallationsPlugin::~CGSInstallationsPlugin() + { + __GSLOGSTRING( "[CGSInstallationsPlugin] ~CGSInstallationsPlugin()|->" ); + iResourceLoader.Close(); + __GSLOGSTRING( "[CGSInstallationsPlugin] ~CGSInstallationsPlugin()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSInstallationsPlugin::ConstructL() +// +// +// --------------------------------------------------------------------------- +// +void CGSInstallationsPlugin::ConstructL() + { + __GSLOGSTRING( "[CGSInstallationsPlugin] ConstructL()|->" ); + OpenLocalizedResourceFileL( KGSInstallationsPluginResourceFileName, + iResourceLoader ); + BaseConstructL( R_GS_INSTALLATIONS_VIEW, R_GS_INSTALLATIONS_VIEW_TITLE ); + __GSLOGSTRING( "[CGSInstallationsPlugin] ConstructL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSInstallationsPlugin::NewL() +// +// +// --------------------------------------------------------------------------- +// +CGSInstallationsPlugin* CGSInstallationsPlugin::NewL( TAny* /*aInitParams*/ ) + { + __GSLOGSTRING( "[CGSInstallationsPlugin] NewL()" ); + + CGSInstallationsPlugin* self = new(ELeave) CGSInstallationsPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::Id() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSInstallationsPlugin::Id() const + { + __GSLOGSTRING1( "[CGSInstallationsPlugin] Id():0x%X", KGSInstallationsPluginUid.iUid ); + return KGSInstallationsPluginUid; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoActivateL() +// +// +// --------------------------------------------------------------------------- +// +void CGSInstallationsPlugin::DoActivateL + ( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + __GSLOGSTRING( "[CGSInstallationsPlugin] DoActivateL()|->" ); + CGSParentPlugin::DoActivateL( aPrevViewId, + aCustomMessageId, + aCustomMessage ); + CGSMainView* parent = + static_cast ( AppUi()->View( KGSMainViewUid ) ); + + // Create tab group for this view (do only if casting parent succeeds): + __GSLOGSTRING( "[CGSInstallationsPlugin] DoActivateL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoDeactivate() +// +// +// --------------------------------------------------------------------------- +// +void CGSInstallationsPlugin::DoDeactivate() + { + __GSLOGSTRING( "[CGSInstallationsPlugin] DoDeactivate()|->" ); + CGSParentPlugin::DoDeactivate(); + __GSLOGSTRING( "[CGSInstallationsPlugin] DoDeactivate()-|" ); + } + + +// ========================= From CGSParentPlugin ===================== + + +// --------------------------------------------------------------------------- +// CGSInstallationsPlugin::UpperLevelViewUid() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSInstallationsPlugin::UpperLevelViewUid() + { + return KGSMainViewUid; + } + + +// ========================= From CGSPluginInterface ================== + + +// --------------------------------------------------------------------------- +// CGSInstallationsPlugin::GetCaptionL() +// +// +// --------------------------------------------------------------------------- +// +void CGSInstallationsPlugin::GetCaptionL( TDes& aCaption ) const + { + __GSLOGSTRING( "[CGSInstallationsPlugin] GetCaptionL()|->" ); + // The resource file is already opened by iResourceLoader. + HBufC* result = StringLoader::LoadL( R_GS_INSTALLATIONS_VIEW_CAPTION ); + aCaption.Copy( *result ); + delete result; + __GSLOGSTRING( "[CGSInstallationsPlugin] GetCaptionL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSInstallationsPlugin::PluginProviderCategory() +// +// +// --------------------------------------------------------------------------- +// +TInt CGSInstallationsPlugin::PluginProviderCategory() const + { + return KGSPluginProviderInternal; + } + + +// ----------------------------------------------------------------------------- +// CGSInstallationsPlugin::GetHelpContext() +// +// +// ----------------------------------------------------------------------------- +// +void CGSInstallationsPlugin::GetHelpContext( TCoeHelpContext& aContext ) + { + aContext.iMajor = KUidGS; + aContext.iContext = KCP_HLP_INSTALLATIONS; + } + + +// ----------------------------------------------------------------------------- +// CGSInstallationsPlugin::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CGSInstallationsPlugin::CreateIconL( const TUid aIconType ) + { + + //EMbm + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSInstallationsPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropCpInst, + fp->FullName(), + EMbmGsinstallationspluginQgn_prop_cp_inst, + EMbmGsinstallationspluginQgn_prop_cp_inst_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + CleanupStack::PopAndDestroy( fp ); + + return icon; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSInstallationsPlugin/src/GSInstallationsPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSInstallationsPlugin/src/GSInstallationsPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for GSInstallationsPlugin. +* +*/ + + +// System includes +#include +#include + +// User includes +#include "GSInstallationsPlugin.h" + +// Constants +const TImplementationProxy KGSInstallationsPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x10283321, CGSInstallationsPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSInstallationsPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSInstallationsPluginImplementationTable; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSListBox/GSListBox.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSListBox/GSListBox.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This is project specification for GS Listbox DLL +* +*/ + + +#include + +// Capability assignment. +CAPABILITY CAP_GENERAL_DLL + +TARGET gslistbox.dll +TARGETTYPE DLL +UID 0x1000008d 0x101FD68D + +SOURCEPATH Src +SOURCE GSListBox.cpp + +USERINCLUDE . +USERINCLUDE Inc +USERINCLUDE ../Data +USERINCLUDE ../GSFramework/inc + +//System include paths +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE + +// Libraries required by framework +LIBRARY bafl.lib +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY apparc.lib + +//Libraries for the DLL +LIBRARY eikcoctl.lib + +SOURCEPATH . diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSListBox/Src/GSListBox.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSListBox/Src/GSListBox.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,740 @@ +/* +* Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class declaration for CGSListboxEntry & CGSItemTextArray. +* +*/ + +// INCLUDES +#include "gslistbox.h" +#include "gscommon.hrh" + +#include +#include + + +// CONSTANTS +const TInt KGSListboxModelGranularity = 5; +_LIT(KGSEngineItemArrayPanic, "GSEngItemArray"); + +// Panic enum +enum TGSEngineItemArrayPanic + { + EGSEngineItemArrayPanicNoRadioSettingsPage = 0, + }; + +/*================================================ +* +* class declaration for CGSListboxEntry +* +*================================================*/ + + +//------------------------------------------------------------------------------ +// CGSListboxEntry::NewLC() +// Symbian OS two-phased constructor +//------------------------------------------------------------------------------ +EXPORT_C CGSListboxEntry* CGSListboxEntry::NewLC( TResourceReader& aReader ) + { + CGSListboxEntry* self = new (ELeave) CGSListboxEntry; + CleanupStack::PushL( self ); + self->ConstructL( aReader ); + return self; + } + +//------------------------------------------------------------------------------ +// CGSListboxEntry::NewLC() +// Symbian OS two-phased constructor +//------------------------------------------------------------------------------ +EXPORT_C CGSListboxEntry* CGSListboxEntry::NewLC( TInt aFeatureId ) + { + CGSListboxEntry* self = new (ELeave) CGSListboxEntry; + CleanupStack::PushL( self ); + self->iFeatureId = aFeatureId; + return self; + } + +//------------------------------------------------ +// CGSListboxEntry::NewLC() +// Symbian OS two-phased constructor +//------------------------------------------------ +EXPORT_C CGSListboxEntry* CGSListboxEntry::NewLC( + TUint32 aResId, CCoeEnv& aEnv, TInt aFeatureId ) + { + CGSListboxEntry* self = new (ELeave) CGSListboxEntry; + CleanupStack::PushL( self ); + self->ConstructL( aResId, aEnv, aFeatureId ); + return self; + } + +//------------------------------------------------ +// CGSListboxEntry::ConstructL() +// Symbian OS 2nd phase constructor +//------------------------------------------------ +void CGSListboxEntry::ConstructL( + TUint32 aResId, CCoeEnv& aEnv, TInt aFeatureId ) + { + // Create resource reader + TResourceReader reader; + aEnv.CreateResourceReaderLC( reader, aResId ); + + // Just read, not actually needed anywhere + reader.ReadInt16(); + + // Take base settings from resources + iCaption = reader.ReadHBufCL(); + iStaticTextLength = iCaption->Length(); + iFeatureId = aFeatureId + reader.ReadInt16(); + iType = reader.ReadInt8(); + + CleanupStack::PopAndDestroy(); //reader + } + +//------------------------------------------------------------------------------ +// CGSListboxEntry::ConstructL() +// Symbian OS 2nd phase constructor +//------------------------------------------------------------------------------ +void CGSListboxEntry::ConstructL( TResourceReader& aReader ) + { + iCaption = aReader.ReadHBufCL(); + iStaticTextLength = iCaption->Length(); + iFeatureId = aReader.ReadInt16(); + iType = aReader.ReadInt8(); + } + +//------------------------------------------------------------------------------ +// CGSListboxEntry() +// c++ default constructor +//------------------------------------------------------------------------------ +CGSListboxEntry::CGSListboxEntry() + { + } + +//------------------------------------------------------------------------------ +// ~CGSListboxEntry() +// destructor +//------------------------------------------------------------------------------ +EXPORT_C CGSListboxEntry::~CGSListboxEntry() + { + delete iCaption; + } + +//------------------------------------------------------------------------------ +// CGSListboxEntry::Feature() +// Provides feature for the selected entry +// @return feature +//------------------------------------------------------------------------------ +EXPORT_C TInt CGSListboxEntry::FeatureId() const + { + return iFeatureId; + } + +//------------------------------------------------------------------------------ +// CGSListboxEntry::Caption +// Provides caption for the selected entry +// @return caption +//------------------------------------------------------------------------------ +EXPORT_C const TDesC& CGSListboxEntry::Caption() const + { + return *iCaption; + } + +//------------------------------------------------------------------------------ +// CGSListboxEntry::Type +// Provides type for the selected entry +// @return type +//------------------------------------------------------------------------------ +EXPORT_C TInt CGSListboxEntry::Type() const + { + return iType; + } + +//------------------------------------------------------------------------------ +// CGSListboxEntry::SetDynamicTextL +// Appends dynamic text to the static text read +// from the resource. +//------------------------------------------------------------------------------ +EXPORT_C void CGSListboxEntry::SetDynamicTextL( const TDesC& aText ) + { + const TInt requiredLength = StaticTextLength() + aText.Length(); + // + TPtr pCaption( iCaption->Des() ); + const TInt maxLength = pCaption.MaxLength(); + // + if( requiredLength >= maxLength ) + { + // Make enough room for static text + new dynamic text + iCaption = iCaption->ReAllocL( requiredLength ); + } + + // Have to re-get a new modifiable descriptor for the HBufC* since the + // memory address may have changed after the realloc. + pCaption.Set( iCaption->Des() ); + + // Set the length back to only the static part + pCaption.SetLength( StaticTextLength() ); + pCaption.Append( aText ); + } + + +//------------------------------------------------------------------------------ +// CGSListboxEntry::SetDynamicTextDoublePaneL +// Appends dynamic text to the static text read +// from the resource. +//------------------------------------------------------------------------------ +EXPORT_C void CGSListboxEntry::SetDynamicTextDoublePaneL( const TDesC& aText ) + { + const TInt requiredLength = StaticTextLength() + aText.Length(); + // + TPtr pCaption( iCaption->Des() ); + const TInt maxLength = pCaption.MaxLength(); + const TInt textSize = aText.Length(); + TInt location; + + // Here if it is the NULL string then we track of the + // Default text size in iDynamicTextSize + if ( textSize > 0 ) + { + iDynamicTextSize = textSize; + // this location is also preserved for the same purpose + location = aText.Locate( aText[0] ); + } + else + { + location = KErrNotFound; + } + // + if ( location == KErrNotFound ) + { + // We take the value from the end of the string + location = pCaption.LocateReverse('\t'); + // We then delete the string; + // iDynamicTextSize is the size of the "Default" text i.e. 7 + // 1 is added bcos \tText\t\t for the last tab + pCaption.Delete( location - ( iDynamicTextSize + 1 ), iDynamicTextSize ); + } + else + { + if( requiredLength >= maxLength ) + { + // Make enough room for static text + new dynamic text + iCaption = iCaption->ReAllocL( requiredLength ); + } + + // Have to re-get a new modifiable descriptor for the HBufC* since the + // memory address may have changed after the realloc. + pCaption.Set( iCaption->Des() ); + location = pCaption.LocateReverse('\t'); + pCaption.Insert( ( location - 1 ), aText ); + } + } +//... HERE IT ENDS +/*================================================ +* +* class declaration for CGSItemTextArray +* +*================================================*/ + +//------------------------------------------------------------------------------ +// CGSItemTextArray::NewLC() +// Symbian OS two-phased constructor +//------------------------------------------------------------------------------ +EXPORT_C CGSItemTextArray* CGSItemTextArray::NewL( TUint32 aResId, + CCoeEnv& aEnv ) + { + CGSItemTextArray* self = + new (ELeave) CGSItemTextArray( ); + CleanupStack::PushL( self ); + self->ConstructL( aResId, aEnv ); + CleanupStack::Pop( self ); + + return self; + } + + +//------------------------------------------------------------------------------ +// CGSItemTextArray() +// constructor +//------------------------------------------------------------------------------ +CGSItemTextArray::CGSItemTextArray() +: iAllEntries( KGSListboxModelGranularity ), + iCurrentlyDisplayedEntries( KGSListboxModelGranularity ) + { + } + + +//------------------------------------------------------------------------------ +// ~CGSItemTextArray() +// destructor +//------------------------------------------------------------------------------ +CGSItemTextArray::~CGSItemTextArray() + { + iCurrentlyDisplayedEntries.Close(); + iAllEntries.ResetAndDestroy(); + iAllEntries.Close(); + } + + +//------------------------------------------------------------------------------ +// CGSItemTextArray::ConstructL() +// Symbian OS two-phased constructor +//------------------------------------------------------------------------------ +void CGSItemTextArray::ConstructL( TUint32 aResId, CCoeEnv& aEnv ) + { + TResourceReader reader; + aEnv.CreateResourceReaderLC( reader, aResId ); + // + const TInt count = reader.ReadInt16(); + for( TInt i = 0; i < count; i++ ) + { + CGSListboxEntry* entry = CGSListboxEntry::NewLC( reader ); + User::LeaveIfError( iAllEntries.Append( entry ) ); + + // Always visible items are added here and never removed + if ( entry->Type() == EGSListBoxItemTypeIsAlwaysVisible ) + { + User::LeaveIfError( iCurrentlyDisplayedEntries.Append( entry ) ); + } + // + CleanupStack::Pop( entry ); + } + + CleanupStack::PopAndDestroy(); //reader + } + +//------------------------------------------------ +// CGSItemTextArray::ConstructL() +// Symbian OS two-phased constructor +//------------------------------------------------ +void CGSItemTextArray::ConstructL( + TUint32 aResId, CCoeEnv& aEnv, TInt aCount ) + { + // Create entries and append them to entrylist. + for( TInt i = 0; i < aCount; i++ ) + { + CGSListboxEntry* entry = CGSListboxEntry::NewLC( aResId, aEnv, i ); + User::LeaveIfError( iAllEntries.Append( entry ) ); + CleanupStack::Pop( entry ); + } + } + +//------------------------------------------------------------------------------ +// CGSItemTextArray::MdcaCount() +// from MDesCArray +// @return count +//------------------------------------------------------------------------------ +EXPORT_C TInt CGSItemTextArray::MdcaCount() const + { + const TInt count = iCurrentlyDisplayedEntries.Count(); + return count; + } + +//------------------------------------------------------------------------------ +// CGSItemTextArray::MdcaPoint() +// from MDesCArray +// @return item text +//------------------------------------------------------------------------------ +EXPORT_C TPtrC CGSItemTextArray::MdcaPoint( TInt aIndex ) const + { + const TPtrC ret( iCurrentlyDisplayedEntries[aIndex]->Caption() ); + return ret; + } + + +//------------------------------------------------------------------------------ +// CGSItemTextArray::SetDynamicTextL() +// Appends dynamic text to a selected listbox item +// +//------------------------------------------------------------------------------ +EXPORT_C void CGSItemTextArray::SetDynamicTextL( TInt aFeatureId, + const TDesC& aAdditionalText ) + { + TIdentityRelation relation(CompareEntries); + // + CGSListboxEntry* entryToSearchFor = CGSListboxEntry::NewLC( aFeatureId ); + const TInt index = iAllEntries.Find( entryToSearchFor, relation ); + CleanupStack::PopAndDestroy( entryToSearchFor ); + User::LeaveIfError( index ); + // + CGSListboxEntry* entry = iAllEntries[index]; + entry->SetDynamicTextL( aAdditionalText ); + } + +//------------------------------------------------------------------------------ +// CGSItemTextArray::SetDynamicTextDoublePaneL() +// Appends dynamic text to a selected listbox item +// +//------------------------------------------------------------------------------ +EXPORT_C void CGSItemTextArray::SetDynamicTextDoublePaneL( TInt aFeatureId, + const TDesC& aAdditionalText ) + { + TIdentityRelation relation(CompareEntries); + // + CGSListboxEntry* entryToSearchFor = CGSListboxEntry::NewLC( aFeatureId ); + const TInt index = iAllEntries.Find( entryToSearchFor, relation ); + CleanupStack::PopAndDestroy( entryToSearchFor ); + User::LeaveIfError( index ); + // + CGSListboxEntry* entry = iAllEntries[index]; + entry->SetDynamicTextDoublePaneL( aAdditionalText ); + } +//*****ENDS HERE + +//------------------------------------------------------------------------------ +// CGSItemTextArray::SetItemVisibilityL() +// Indicates whether an item is to be shown/hidden +// +//------------------------------------------------------------------------------ +EXPORT_C void CGSItemTextArray::SetItemVisibilityL( TInt aFeatureId, + TVisibility aVisibility ) + { + TIdentityRelation relation( CompareEntries ); + CGSListboxEntry* entryToSearchFor = CGSListboxEntry::NewLC( aFeatureId ); + // + if ( aVisibility == EInvisible ) + { + const TInt index = iCurrentlyDisplayedEntries.Find( entryToSearchFor, + relation ); + if ( index != KErrNotFound ) + { + // Remove the item from the currently visible items array + iCurrentlyDisplayedEntries.Remove( index ); + } + } + else if ( aVisibility == EVisible ) + { + // Check its not already visible + const TInt alreadyVisibleIndex = iCurrentlyDisplayedEntries.Find( + entryToSearchFor, relation ); + if ( alreadyVisibleIndex == KErrNotFound ) + { + const TInt index = iAllEntries.Find( entryToSearchFor, relation ); + User::LeaveIfError( index ); + + // This is the entry we are going to make visible + CGSListboxEntry* entry = iAllEntries[index]; + + // Now insert it at the correct location. + TBool foundInsertionPoint = EFalse; + const TInt currentEntriesCount = iCurrentlyDisplayedEntries.Count(); + for( TInt allEntriesIndex=index-1; allEntriesIndex>=0 && + !foundInsertionPoint; allEntriesIndex-- ) + { + // We are going to try and insert the new entry after the entry + // specified as the previous item in the 'all entries' array, + // in the iCurrentlyDisplayedEntries array. + const TInt featureIdOfPreviousItem = + iAllEntries[allEntriesIndex]->FeatureId(); + + for( TInt currentEntriesIndex=0; !foundInsertionPoint && + currentEntriesIndexFeatureId() == featureIdOfPreviousItem ) + { + foundInsertionPoint = ETrue; + // Insert after this item + User::LeaveIfError( iCurrentlyDisplayedEntries.Insert( + entry, currentEntriesIndex+1 ) ); + } + } + + } + + if (!foundInsertionPoint) + { + // Just insert the item at the top of the list + User::LeaveIfError( + iCurrentlyDisplayedEntries.Insert( entry, 0 ) ); + } + } + } + CleanupStack::PopAndDestroy( entryToSearchFor ); + } + + +//------------------------------------------------------------------------------ +// CGSItemTextArray::CurrentFeature() +// Obtains feature id for a selected listbox item (feature) +// @return feature id +//------------------------------------------------------------------------------ +EXPORT_C TInt CGSItemTextArray::CurrentFeature() const + { + return KErrNotFound; + } + + +//------------------------------------------------------------------------------ +// CGSItemTextArray::IndexForFeatureId() +// +// @return index +//------------------------------------------------------------------------------ +EXPORT_C TInt CGSItemTextArray::IndexForFeatureIdL(TInt aFeatureId) const + { + TIdentityRelation relation( CompareEntries ); + CGSListboxEntry* entryToSearchFor = CGSListboxEntry::NewLC( aFeatureId ); + // + const TInt index = iCurrentlyDisplayedEntries.Find( entryToSearchFor, + relation ); + CleanupStack::PopAndDestroy( entryToSearchFor ); + // + return index; + } + + +//------------------------------------------------------------------------------ +// CGSItemTextArray::FeatureIdByIndexL() +// +// @return index +//------------------------------------------------------------------------------ +EXPORT_C TInt CGSItemTextArray::FeatureIdByIndex(TInt aIndex) const + { + TInt featureId = KErrNotFound; + // + const TInt currentEntriesCount = iCurrentlyDisplayedEntries.Count(); + if (aIndex >= 0 && aIndex < currentEntriesCount) + { + featureId = iCurrentlyDisplayedEntries[ aIndex ]->FeatureId(); + } + // + return featureId; + } + + +//------------------------------------------------------------------------------ +// CGSItemTextArray::FeatureById() +// +// @return feature +//------------------------------------------------------------------------------ +EXPORT_C const CGSListboxEntry* CGSItemTextArray::FeatureByIdL( + TInt aFeatureId ) const + { + const CGSListboxEntry* locatedEntry = NULL; + // + TIdentityRelation relation( CompareEntries ); + CGSListboxEntry* entryToSearchFor = CGSListboxEntry::NewLC( aFeatureId ); + // + const TInt index = iAllEntries.Find( entryToSearchFor, + relation ); + if ( index != KErrNotFound ) + { + locatedEntry = iAllEntries[ index ]; + } + CleanupStack::PopAndDestroy( entryToSearchFor ); + // + return locatedEntry; + } + + +//------------------------------------------------------------------------------ +// CGSItemTextArray::GetItemCaptionFromFeatureIdLC() +// +// @return feature's caption +//------------------------------------------------------------------------------ +EXPORT_C HBufC* CGSItemTextArray::GetItemCaptionFromFeatureIdLC( + TUint32 aResourceId, + TInt aFeatureId, + CCoeEnv& aCone ) + { + HBufC* caption = NULL; + // + CGSItemTextArray* items = CGSItemTextArray::NewL( aResourceId, aCone ); + CleanupStack::PushL( items ); + const CGSListboxEntry* entry = items->FeatureByIdL( aFeatureId ); + // + if ( entry ) + { + caption = entry->Caption().AllocL(); + } + else + { + caption = KNullDesC().AllocL(); + } + // + CleanupStack::PopAndDestroy( items ); + CleanupStack::PushL( caption ); + return caption; + } + + +//------------------------------------------------------------------------------ +// CGSItemTextArray::CompareEntries() +// Compares feature id's to check if they are the same +// @return boolean +//------------------------------------------------------------------------------ +TBool CGSItemTextArray::CompareEntries(const CGSListboxEntry& aLeft, + const CGSListboxEntry& aRight) + { + return aLeft.FeatureId() == aRight.FeatureId(); + } + + + + + + + +/*================================================ +* +* class declaration for CGSListBoxItemTextArray +* +*================================================*/ + +//------------------------------------------------------------------------------ +// CGSListBoxItemTextArray::NewLC() +// Symbian OS two-phased constructor +//------------------------------------------------------------------------------ +EXPORT_C CGSListBoxItemTextArray* CGSListBoxItemTextArray::NewL( TUint32 aResId, + CEikListBox& aListBox, + CCoeEnv& aEnv ) + { + CGSListBoxItemTextArray* self = + new (ELeave) CGSListBoxItemTextArray( aListBox ); + CleanupStack::PushL( self ); + self->ConstructL( aResId, aEnv ); + CleanupStack::Pop( self ); + + return self; + } + +//------------------------------------------------ +// CGSListBoxItemTextArray::NewL() +// Symbian OS two-phased constructor +//------------------------------------------------ +EXPORT_C CGSListBoxItemTextArray* CGSListBoxItemTextArray::NewL( + TUint32 aResId, CEikListBox& aListBox, CCoeEnv& aEnv, TInt aCount ) + { + CGSListBoxItemTextArray* self = + new (ELeave) CGSListBoxItemTextArray( aListBox ); + CleanupStack::PushL( self ); + self->ConstructL( aResId, aEnv, aCount ); + CleanupStack::Pop( self ); + + return self; + } + +//------------------------------------------------------------------------------ +// CGSListBoxItemTextArray() +// constructor +//------------------------------------------------------------------------------ +CGSListBoxItemTextArray::CGSListBoxItemTextArray( CEikListBox& aListBox ) +: iListBox( aListBox ) + { + } + + +//------------------------------------------------------------------------------ +// CGSListBoxItemTextArray::CurrentFeature() +// +// Obtains feature id for a selected listbox item (feature) +// @return feature id +//------------------------------------------------------------------------------ +EXPORT_C TInt CGSListBoxItemTextArray::CurrentFeature() const + { + TInt featureId = KErrNotFound; + const TInt listBoxCurrentItemIndex = iListBox.CurrentItemIndex(); + const TInt count = iCurrentlyDisplayedEntries.Count(); + if ( listBoxCurrentItemIndex >= 0 && listBoxCurrentItemIndex < count ) + { + const CGSListboxEntry* entry = + iCurrentlyDisplayedEntries[ listBoxCurrentItemIndex ]; + featureId = entry->FeatureId(); + } + return featureId; + } + + + + + + + + + +/*================================================ +* +* class declaration for CGSRadioButtonSettingPageItemTextArray +* +*================================================*/ + +//------------------------------------------------------------------------------ +// CGSRadioButtonSettingPageItemTextArray::NewL() +// +// Symbian OS two-phased constructor +//------------------------------------------------------------------------------ +EXPORT_C CGSRadioButtonSettingPageItemTextArray* + CGSRadioButtonSettingPageItemTextArray::NewL( TUint32 aResId, + CCoeEnv& aEnv, + CAknRadioButtonSettingPage* aSettingPage ) + { + CGSRadioButtonSettingPageItemTextArray* self = + new (ELeave) CGSRadioButtonSettingPageItemTextArray( aSettingPage ); + CleanupStack::PushL( self ); + self->ConstructL( aResId, aEnv ); + CleanupStack::Pop( self ); + + return self; + } + + +//------------------------------------------------------------------------------ +// CGSRadioButtonSettingPageItemTextArray() +// +// constructor +//------------------------------------------------------------------------------ +CGSRadioButtonSettingPageItemTextArray::CGSRadioButtonSettingPageItemTextArray ( + CAknRadioButtonSettingPage* aSettingPage ) +: iSettingPage( aSettingPage ) + { + } + + +//------------------------------------------------------------------------------ +// CGSRadioButtonSettingPageItemTextArray::SetRadioButtonSettingPage() +// +// +//------------------------------------------------------------------------------ +EXPORT_C void CGSRadioButtonSettingPageItemTextArray::SetRadioButtonSettingPage ( + CAknRadioButtonSettingPage& aSettingPage ) + { + iSettingPage = &aSettingPage; + } + + +//------------------------------------------------------------------------------ +// CGSRadioButtonSettingPageItemTextArray::CurrentFeature() +// Obtains feature id for a selected listbox item (feature) +// @return feature id +//------------------------------------------------------------------------------ +EXPORT_C TInt CGSRadioButtonSettingPageItemTextArray::CurrentFeature() const + { + __ASSERT_ALWAYS(iSettingPage, User::Panic( KGSEngineItemArrayPanic, + EGSEngineItemArrayPanicNoRadioSettingsPage ) ); + + TInt featureId = KErrNotFound; + + const TInt listBoxCurrentItemIndex = + iSettingPage->ListBoxControl()->CurrentItemIndex(); + const TInt count = iCurrentlyDisplayedEntries.Count(); + if ( listBoxCurrentItemIndex >= 0 && listBoxCurrentItemIndex < count ) + { + const CGSListboxEntry* entry = + iCurrentlyDisplayedEntries[ listBoxCurrentItemIndex ]; + featureId = entry->FeatureId(); + } + return featureId; + } + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSListBox/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSListBox/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building GSEngine. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSListBox.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gslistbox.iby ) + +PRJ_MMPFILES +GSListBox.mmp + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Data/102824A7.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Data/102824A7.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for Network Settings plugin. +* +*/ + +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x102824A7; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x102824A8; + version_no = 1; + display_name = "Network Settings Plugin"; + default_data = "0x10207250";// Parent UID + #ifdef RD_CONTROL_PANEL + opaque_data = "10"; // Order number + #else //RD_CONTROL_PANEL + opaque_data = "40"; // Order number + #endif //RD_CONTROL_PANEL + } + }; + } +#ifdef FF_POWER_SAVE + , + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = 0x2000B189; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x2000B594; + version_no = 1; + display_name = "PSM Network Plugin"; + default_data = ""; + opaque_data = ""; + } + }; + } +#endif + }; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Data/2000B593.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Data/2000B593.xml Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Data/GsNetworkPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Data/GsNetworkPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,588 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for GSNetworkPlugin +* +*/ + +// RESOURCE IDENTIFIER +NAME NETP // 4 letter ID + +// INCLUDES +#include + +#include +#include "GsNetworkPlugin.hrh" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define KGsNetworkPluginIcons "Z:"APP_RESOURCE_DIR"\\gsnetworkplugin.mbm" + +// RESOURCE DEFINITIONS + +RESOURCE RSS_SIGNATURE + { + } + + +// Common resources among GS +#include "GSCommonResources.rss" + +RESOURCE TBUF + { + buf="NET"; + } + +//---------------------------------------------------- +// +// EIK_APP_INFO +// It contains application information. +// +//---------------------------------------------------- +// +RESOURCE EIK_APP_INFO + { + } + +//---------------------------------------------------- +// +// r_gs_net_plugin_icon_array +// Default icons used by the CGSPluginInterface. +// +//---------------------------------------------------- +// +/* +RESOURCE AKN_ICON_ARRAY r_gs_net_plugin_icon_array + { + bmpfile = KGsNetPluginIcons; + + icons = + { + AKN_ICON + { + iconId = EMbmGstelpluginQgn_prop_set_network_sub; + maskId = EMbmGstelpluginQgn_prop_set_network_sub_mask; + }, + AKN_ICON + { + iconId = EMbmGstelpluginQgn_prop_set_network_tab4; + maskId = EMbmGstelpluginQgn_prop_set_network_tab4_mask; + } + }; + } + */ + +//---------------------------------------------------- +// r_gs_net_view_caption +// +// Network view caption for plugin +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_net_view_caption + { + buf = qtn_set_folder_network; + } + + +//---------------------------------------------------- +// r_gs_net_view_title +// +// Network view title +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_net_view_title + { + txt = qtn_set_title_settings_network; + } + + +//---------------------------------------------------- +// +// r_gs_net_view +// Network sub-menu view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_net_view + { + menubar=r_gs_menubar_change_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE; + } + + +//---------------------------------------------------- +// +// r_net_lbx_resource +// Network sub-menu's listbox +// +// +//---------------------------------------------------- +// +RESOURCE LISTBOX r_net_lbx_resource + { + array_id = r_net_lbx; + flags = EEikListBoxMultipleSelection; + } + +//---------------------------------------------------- +// +// r_net_lbx +// Items in cellular network-folder +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_net_lbx + { + items = + { + GS_FEATURE + { + txt = " \t"qtn_set_network_mode"\t\t"; + item = EGSNetworkModeItemId; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = " \t"qtn_netsl_netselect"\t\t"; + item = EGSNetworkModeSelectionItemId; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = " \t"qtn_mcn_control"\t\t"; + item = EGSMCNItemId; + } + }; + } + +//---------------------------------------------------- +// +// r_setting_page +// Setting page for Network selection mode/MCN items +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id= r_setting_listbox; + } + +//---------------------------------------------------- +// +// r_netsl_netselectmode +// Network selection mode setting page +// +//---------------------------------------------------- +// +RESOURCE TBUF r_netsl_netselectmode + { + buf = qtn_netsl_netselectmode; + } + + +//---------------------------------------------------- +// +// r_netsl_netselectmode_lbx +// Item in Network selection setting page +// +//---------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_netsl_netselectmode_lbx + { + items = + { + GS_FEATURE + { + txt = qtn_netsl_automatic; + item = EGSAutomaticSelectMode; + }, + GS_FEATURE + { + txt = qtn_netsl_manual; + item = EGSManualSelectMode; + } + }; + } + + +//---------------------------------------------------- +// +// r_confirm_note_nwmode_string +// +//---------------------------------------------------- +// +RESOURCE TBUF r_confirm_note_nwmode_string { buf = qtn_network_mode_note; } + + +//---------------------------------------------------- +// +// r_net_network_mode +// Network mode selection ui setting page +// +//---------------------------------------------------- +// +RESOURCE TBUF r_net_network_mode + { + buf = qtn_set_network_mode; + } + + +//---------------------------------------------------- +// +// r_net_network_mode_lbx +// Network mode selection ui setting page items +// +//---------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_net_network_mode_lbx + { + items = + { + GS_FEATURE + { + txt = qtn_network_mode_dual; + item = EGSNetworkModeDualmode; + }, + GS_FEATURE + { + txt = qtn_network_mode_umts; + item = EGSNetworkModeUMTS; + type = EGSListBoxItemTypeIsDynamic; + }, + GS_FEATURE + { + txt = qtn_network_mode_gsm; + item = EGSNetworkModeGSM; + type = EGSListBoxItemTypeIsDynamic; + } + }; + } + +//---------------------------------------------------- +// +// r_netsl_foundoperators +// Title for found network operators +// +//---------------------------------------------------- +// +RESOURCE TBUF r_netsl_foundoperators + { + buf = qtn_netsl_foundoperators; + } + +//---------------------------------------------------- +// +// r_no_network_found +// Texts for note wrappers. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_no_network_found + { + buf = text_no_networks_found; + } + +//---------------------------------------------------- +// +// r_ongoing_call +// Texts for note wrappers. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_ongoing_call + { + buf = text_call_in_progress; + } + +//---------------------------------------------------- +// +// r_active_gprs_conn_note +// Texts for note wrappers. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_active_gprs_conn_note + { + buf = qtn_mcn_info_not_received; + } + +//---------------------------------------------------- +// +// r_searching_note +// Note layout when searching for network operators +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_searching_note + { + flags = EAknWaitNoteFlags|EEikDialogFlagWait; + + buttons = r_softkeys_empty_quit; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = ESearchingNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + singular_label = text_searching; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_home_network_selected +// Text when home network selected. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_home_network_selected { buf = text_hplmn_selected; } + +//---------------------------------------------------- +// +// r_network_selected, +// r_netsl_networkselected +// Note layout when non-home network selected +// +//---------------------------------------------------- +// +RESOURCE TBUF r_netsl_networkselected { buf = qtn_netsl_networkselected; } + +//---------------------------------------------------- +// +// r_no_network_access, +// Text to be used, when access to network is denied. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_no_network_access { buf = text_no_access; } + +//---------------------------------------------------- +// +// r_offline_mode, +// Text to be used, when nw operation tried in offline mode. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_offline_mode { buf = qtn_offline_not_possible; } + +//---------------------------------------------------- +// +// r_registration_interrupted, +// Note layout when network registration is +// interrupted +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_registration_interrupted + { + flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar | + EEikDialogFlagCbaButtons | EEikDialogFlagWait; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = ENwRegistrationInterrupted; + control = AVKON_NOTE + { + layout = EGeneralLayout; + singular_label = qtn_netsl_registration_interrup; + animation = R_QGN_NOTE_ERROR_ANIM; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_mcn_cell_info_disp_mode +// MCN setting page +// +//---------------------------------------------------- +// +RESOURCE TBUF r_mcn_cell_info_disp_mode + { + buf = qtn_mcn_control; + } + + +//---------------------------------------------------- +// +// r_mcn_cell_info_disp_mode_lbx +// Items in setting page - MCN +// +//---------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_mcn_cell_info_disp_mode_lbx + { + items = + { + GS_FEATURE + { + txt = qtn_mcn_sett_on; + item = EGSMcnSetOn; + }, + GS_FEATURE + { + txt = qtn_mcn_sett_off; + item = EGSMcnSetOff; + } + }; + } + +//---------------------------------------------------- +// Icon array for Dual mode nw selection +//---------------------------------------------------- +// +RESOURCE AKN_ICON_ARRAY r_net_dualmode_icons + { + bmpfile = KGsNetworkPluginIcons; + + icons = + { + AKN_ICON + { + iconId = EMbmGsnetworkpluginQgn_prop_network_3g; + maskId = EMbmGsnetworkpluginQgn_prop_network_3g_mask; + }, + AKN_ICON + { + iconId = EMbmGsnetworkpluginQgn_prop_network_2g; + maskId = EMbmGsnetworkpluginQgn_prop_network_2g_mask; + }, + // forbidden operator icon + AKN_ICON + { + iconId = EMbmGsnetworkpluginQgn_prop_nfc_sess_closed; + maskId = EMbmGsnetworkpluginQgn_prop_nfc_sess_closed_mask; + } + }; + } + +//---------------------------------------------------- +// +// r_softkeys_empty_quit +// Softkeys for requesting notes: empty-quit +// +//---------------------------------------------------- +// +RESOURCE CBA r_softkeys_empty_quit + { + buttons = + { + CBA_BUTTON {txt = "";}, + CBA_BUTTON {id = EGSSoftkeyQuit; txt = text_softkey_quit;} + }; + } + +//---------------------------------------------------- +// +// r_requesting_note +// Note layout when requesting something from network +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_requesting_note + { + flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar | + EEikDialogFlagCbaButtons | EEikDialogFlagWait; + buttons = r_softkeys_empty_quit; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = ERequestingNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + singular_label = text_sending; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + }; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_call_msk_change +// Middle softkey label: change. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_call_msk_change + { + buf = qtn_msk_change; + } + +// ----------------------------------------------------------------------------- +// +// qtn_cp_detail_cellular_operational +// Network operational text in lbx item. +// +// ----------------------------------------------------------------------------- +// +/* +RESOURCE TBUF r_cellular_operational + { + buf = qtn_cp_detail_cellular_operational; + } +*/ +// ----------------------------------------------------------------------------- +// +// qtn_cp_detail_cellular_offline +// Network off-line text in lbx item. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cellular_offline + { + buf = qtn_cp_detail_cellular_offline; + } + +//---------------------------------------------------- +// +// r_gs_power_saving_protected_settings_infonote +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_power_saving_protected_settings_infonote + { + buf = qtn_power_saving_protected_settings_infonote; + } + +//End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/GSNetworkPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/GSNetworkPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification file. +* +*/ + + +#include // For RESOURCE_FILES_DIR + +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gsnetworkplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x102824A7 +VENDORID VID_DEFAULT + + +SOURCEPATH Src +SOURCE GSNetworkPluginImplementationTable.cpp +SOURCE GSNetworkPluginContainer.cpp +SOURCE GSNetworkPlugin.cpp +SOURCE GSNetworkPluginModel.cpp +SOURCE GSNetworkDebugHelper.cpp + +#ifdef FF_POWER_SAVE + SOURCE GSNetworkPluginAO.cpp + SOURCE PSMNetworkPlugin.cpp +#endif //#ifdef FF_POWER_SAVE + +//User include paths +USERINCLUDE Inc +USERINCLUDE Data // For *.rh +USERINCLUDE loc +USERINCLUDE ../Data +USERINCLUDE ../Logger +USERINCLUDE ../GSTelPlugin/Inc +USERINCLUDE ../Cenrep + +//System include paths +SYSTEMINCLUDE /epoc32/include/ecom +// Default system include paths for middleware layer modules. +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH Data + +START RESOURCE 102824A7.rss +TARGET gsnetworkplugin.rsc +END + +START RESOURCE GsNetworkPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY egul.lib +LIBRARY eikdlg.lib // eikon dialogs +LIBRARY ws32.lib + +LIBRARY commonengine.lib // For RConeResourceLoader +LIBRARY featmgr.lib // Feature manager +LIBRARY centralrepository.lib +LIBRARY aknskinsrv.lib // for enhanced skinning +LIBRARY aknskins.lib // for enhanced skinning + +LIBRARY aknnotify.lib // for CAknGlobalNote.h +LIBRARY hlplch.lib // for "Help" options menu +LIBRARY gsframework.lib // For base classes +LIBRARY gslistbox.lib // For CGSListBoxItemTextArray +LIBRARY flogger.lib // For GSLogger +LIBRARY gsecomplugin.lib +LIBRARY phonesettings.lib +LIBRARY apgrfx.lib +LIBRARY etelmm.lib +LIBRARY etel.lib +LIBRARY networkhandling.lib //For CNWSession, TNWInfo +#ifdef FF_POWER_SAVE + LIBRARY psmclient.lib +#endif // FF_POWER_SAVE +LIBRARY customapi.lib +// End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkDebugHelper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkDebugHelper.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Utility class for matching network related enumerations to +* descriptor. +* +*/ + + +#ifndef GSNETWORKDEBUGHELPER_H_ +#define GSNETWORKDEBUGHELPER_H_ + +#include "GsNetworkPlugin.hrh" +#include +#include +#include +#include +#include + +/** +* Static helper class for transfering network enumerations into descriptors. +* Pretty handy in printing debug traces from network events... +* +* Example (do not print in release mode!): +* #ifdef _DEBUG +* TBuf myBuf; +* GSNetworkDebugHelper::XXXToDes( myEnum, aModeCaps ); +* __GSLOGSTRING2( "%S", &aModeCaps, &myEnum ); +* #endif //_DEBUG +*/ +class GSNetworkDebugHelper + { +public: + + /** + * Prints enum name into descriptor. + * + * @param aMode Enumeration whose name should be used. + * @param buf Descriptor indicating the enumeration name. Use + * KGSNetworkModeDebugStrLen as length. + */ + static void NwToDes( TGSNetworkModeItems aMode, TDes& buf ); + + /** + * Prints enum name into descriptor. + * From: + * enum RMmCustomAPI::TNetworkModeCaps + * { + * KCapsNetworkModeGsm = 0x01, + * KCapsNetworkModeUmts = 0x02, + * KCapsNetworkModeDual = 0x04 + * }; + * AND KGSNetworkModeCapsNotUpdated + * + * Can be used for debugging purposes. + * + * @param aModeCaps Enumeration whose name should be used. + * @param buf Descriptor indicating the enumeration name. Use + * KGSNetworkModeDebugStrLen as length. + */ + static void NwCapsToDes( + TUint32 aModeCaps, + TDes& buf ); + + /** + * Prints enum name into descriptor. + * + * Example: + * TBuf myBuf; + * GSNetworkDebugHelper::NwCapsToDes( myEnum, aModeCaps ); + * __GSLOGSTRING2( "%S", &aModeCaps, &myEnum ); + * + * @param aNetworkStatus Enumeration whose name should be used. + * @param buf Descriptor indicating the enumeration name. Use + * KGSNetworkModeDebugStrLen as length. + * + */ + static void NetworkStatusToDes( + TNWRegistrationStatus aNetworkStatus, + TDes& aDes ); + + /** + * Prints enum name into descriptor. + * + * @param aNetworkMessage Enumeration whose name should be used. + * @param buf Descriptor indicating the enumeration name. Use + * KGSNetworkModeDebugStrLen as length. + */ + static void NetworkMessageToDes( + MNWMessageObserver::TNWMessages aNetworkMessage, + TDes& aDes ); + + /** + * Prints enum name into descriptor. + * + * @param aNetworkOperation Enumeration whose name should be used. + * @param buf Descriptor indicating the enumeration name. Use + * KGSNetworkModeDebugStrLen as length. + */ + static void NetworkOperationToDes( + MNWMessageObserver::TNWOperation aNetworkOperation, + TDes& aDes ); + + /** + * Prints enum name into descriptor. + * + * @param aRequest Enumeration whose name should be used. + * @param buf Descriptor indicating the enumeration name. Use + * KGSNetworkModeDebugStrLen as length. + */ + static void NetworkModeRequestToDes( + MPsetNetworkModeObserver::TServiceRequest aRequest, + TDes& aDes ); + + /** + * Prints enum name into descriptor. + * + * @param aRequest Enumeration whose name should be used. + * @param buf Descriptor indicating the enumeration name. Use + * KGSNetworkModeDebugStrLen as length. + */ + static void NetworkInfoRequestToDes( + MPsetNetworkInfoObserver::TServiceRequest aRequest, + TDes& aDes ); + + }; + +#endif /*GSNETWORKDEBUGHELPER_H_*/ + + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,519 @@ +/* +* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View for Network settings. +* +*/ + + +#ifndef GSNETWORKPLUGIN_H +#define GSNETWORKPLUGIN_H + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include //for base class +#include +#include +//For listening BT SAP events +#include +#include +#include + +#include "GSPhoneSettingConstants.h" +#include "GSNetworkPluginContainer.h" +#include "GsNetworkPlugin.hrh" +#include "MGsFWMSKLabelObserver.h" + +#include +#include + +#include + +// CONSTANTS +const TUid KGSNetworkPluginUid = { 0x102824A8 }; +// Resource file name +_LIT( KGSNetworkPluginResourceFileName, "z:GSNetworkPluginRsc.rsc" ); +// Icon file name +_LIT( KGSNetworkPluginIconDirAndName, "z:GSNetworkPlugin.mbm"); + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD CLASS DECLARATION +class CAknViewAppUi; +class CGSNetworkPluginContainer; +class CPsetNetwork; +class CAknWaitDialog; +class CPsetContainer; +class CAknRadioButtonSettingPage; +class CAknPopupList; +class MSSSettingsRefreshObserver; +class CPSetRefreshHandler; + +class CNWSession; +class TNWInfo; +class CGSParentPlugin; + +// CLASS DECLARATION +/** +* CGSNetworkPlugin view class +* +* Plugin implementation for Network settings +* @lib GSNetworkPlugin.lib +* @since Series 60_3.1 +*/ +#ifdef FF_POWER_SAVE + class CGSNetworkPluginAO; +#endif // FF_POWER_SAVE + +class CGSNetworkPlugin : public CGSBaseView, + public MPsetNetworkInfoObserver, + public MSSSettingsRefreshObserver, + public MGsFWMSKObserver, + public MGSSettingPSObserver, + public MNWMessageObserver + { + public: // Constructors and destructor + + /** C++ Constructor */ + CGSNetworkPlugin(); + + /** + * Symbian OS two-phased constructor + * @return GS connection view. + */ + static CGSNetworkPlugin* NewL( TAny* aInitParams ); + + static CGSNetworkPlugin* NewLC(); + + /** + * Destructor. + */ + ~CGSNetworkPlugin(); + + public: // from base classes + + /** + * Returns view id. + * @return TUid + */ + TUid Id() const; + + /** + * Handles commands. + * @param aCommand Command to be handled. + * + */ + void HandleCommandL( TInt aCommand ); + + /** + * From MEikCommandObserver, handles the commands. + * + * @param aCommand identifies the command given. + */ + void ProcessCommandL( TInt aCommand ); + + public: // From CGSPluginInterface + + /** + * @see CGSPluginInterface header file. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * @see CGSPluginInterface header file. + */ + void GetValue( const TGSPluginValueKeys aKey, + TDes& aValue ); + + /** + * @see CGSPluginInterface header file. + */ + TInt PluginProviderCategory() const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * @see CGSPluginInterface header file. + */ + TBool Visible() const; + + public: //new + + /** + * Get CGSNetworkPlugin's ccontainer. + */ + CGSNetworkPluginContainer* Container(); + + /** + * Checks if the MSK label needs to be adjusted. + */ + void CheckMiddleSoftkeyLabelL(); + + /** + * Remove command and label from MSK. + */ + void RemoveCommandFromMSK( const TBool flag); + + /** + * Adds given resource text as MSK to CBA. + * + * @param aResourceId middle softkey label. + * @param aCommandId command that should be performed when MSK + * is pressed. + * @since S60 v3.1 + */ + void SetMiddleSoftKeyLabelL( const TInt aResourceId,const TInt aCommandId ); + + /** + * Shows a requested note. + * @param aResourceId reource ID for note text + * @param aType type of note + */ + void ShowNoteL( TInt aResourceId, TInt aType ); + + public: // from base class MPsetNetworkInfoObserver + + /** + * @@see MPsetNetworkInfoObserver::HandleNetworkInfoReceivedL + */ + void HandleNetworkInfoReceivedL( + const CNetworkInfoArray* aInfoArray, const TInt aResult ); + + /** + * @@see MPsetNetworkInfoObserver::HandleCurrentNetworkInfoL - not used + */ + inline void HandleCurrentNetworkInfoL( + const MPsetNetworkSelect::TCurrentNetworkInfo& /* aCurrentInfo */, + const TInt /* aResult */ ) {} + + /** + * DEPRECATED in MPsetNetworkInfoObserver. + * + * @@see MPsetNetworkInfoObserver::HandleNetworkChangedL + */ + void HandleNetworkChangedL( + const MPsetNetworkSelect::TNetworkInfo& aCurrentInfo, + const MPsetNetworkSelect::TCurrentNetworkStatus aStatus, + const TInt aResult ); + + /** + * @@see MPsetNetworkInfoObserver::HandleNetworkChangedL + */ + void HandleNetworkChangedL( + const MPsetNetworkSelect::TNetworkInfo& aCurrentInfo, + const RMobilePhone::TMobilePhoneRegistrationStatus& aStatus, + const TInt aResult ); + + + /** + * @@see MPsetNetworkInfoObserver::HandleSearchingNetworksL + */ + void HandleSearchingNetworksL( TServiceRequest aRequest ); + + /** + * @@see MPsetNetworkInfoObserver::HandleRequestingSelectedNetworkL + */ + void HandleRequestingSelectedNetworkL( TBool aOngoing ); + + /** + * @@see MPsetNetworkInfoObserver::HandleCallActivatedL + */ + void HandleCallActivatedL(); + + /** + * @@see MPsetNetworkInfoObserver::HandleNetworkErrorL + */ + void HandleNetworkErrorL( const TServiceRequest aRequest, + const TInt aError ); + + public: //from base class MSSSettingsRefreshObserver + /** + * @@see MSSSettingsRefreshObserver::AllowRefresh + */ + TBool AllowRefresh( + const TSatRefreshType aType, + const TSatElementaryFiles aFiles ); + + /** + * @@see MSSSettingsRefreshObserver::Refresh + */ + void Refresh( + const TSatRefreshType aType, + const TSatElementaryFiles aFiles ); + + public: // From MNWMessageObserver + + /** + * Offers message interface to the client + * @param aMessage + * This methods execute time must be short,since code + * starting to run from RunL. + * + * Function updates data into iNWInfo. + */ + void HandleNetworkMessage( const TNWMessages aMessage ); + + /** + * Offers error message interface to the client + * @param aOperation operation which failed + * @param aErrorCode returned Symbian OS error code + * + */ + void HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode ); + + /** + * Updates network setting page in case it is visible. This is needed in + * case network mode is change while setting page is oppen. + */ + void UpdateNetworkSettingPageL(); + public: +#ifdef FF_POWER_SAVE + /* + * Update network plugin view when PSM mode has changed + */ + void UpdateOnPsmChanged(); +#endif + + protected: // From CAknView + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + void DoDeactivate(); + + protected: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + protected: + + /** + * C++ default constructor. + */ +/* CGSNetworkPlugin();*/ + + /** + * Symbian OS default constructor. + * + */ + void ConstructL(); + + void HandleClientRectChange(); + + private: // from CGSBaseView + + void NewContainerL(); + void HandleListBoxSelectionL(); + + private: // From MGSSettingPSObserver + /** + * Callback from MGSSettingPSObserver + */ + void HandleNotifyPSL( const TUid aUid, const TInt& aKey, + const TRequestStatus& aStatus ); + + private: //new methods + + /** + * Check if calls are active. Show note if Nw-menu is tried to open. + * @param aItemId list item ID in network view + */ + void CheckCallActiveL( TGSNetworkItemIds aItemId ); + + /** + * Provides the network operator list. + */ + void NetworkListL(); + + /** + * Displays setting page for highlighted setting. + * + * @param aPage identifies the page that will be displayed. + */ + void ShowSettingPageL( TGSNetworkItemIds aPage ); + + /** + * Sets title to a popup list. + * @param aList pointer to list + * @param aTitleID resource ID of the title + */ + void SetTitleToPopupL( CAknPopupList& aList, TInt aTitleID ); + + /** + * Adds item to a list. + * @param aList pointer to a list + * @param aItem resource ID of the item to be added + */ + void AppendItemL( CDesCArrayFlat& aList, TInt aItem ); + + /** + * Sets title to a settings page. + * @param aDlg setting page + * @param aTitleID resource ID of the title + */ + void SetTitleToSettingsL( CAknRadioButtonSettingPage& aDlg, + TInt aTitleID ); + + /** + * Shows a note if GPRS is active, when MCN is turned on. + * @param aCurrentItem value of setting currently + */ + void CheckGPRSConnectionL( TInt aCurrentItem ); + + /** + * Switches between shared data and setting page values (0 > 1, 1 > 0). + * @param aValue value to switch + */ + void SwitchOnOffValue( TInt& aValue ); + + /** + * Makes a Network/MCN Ss operation. + * @param aIndex currently active list item. + * @param aPage which setting page is open + */ + void CreateNetworkSsCallL( TInt aIndex, TGSNetworkItemIds aPage ); + + /** + * Creates a waiting note (member variable). + * @param aDelayOff is the note shown immediately or not + */ + void CheckAndCreateDlgL( TBool aDelayOff ); + + /** + * Empties fetched network provider's list. + */ + void PurgeNetworkList(); + + /** + * Updates listbox in container + */ + void UpdateListBoxL( const TInt& aListItem, const TInt aValue = -1 ); + + /** + * Activate the Phone Idle view. + */ + void PhoneIdle(); + + /** + * To verify if the phone is in the offline mode. (or mostly if mode is supported???) + */ + TBool IsPhoneOfflineL() const; + + /** + * Actually checks from telephone server cached data (iNWInfo) if phone + * is online. + * + * @return ETrue if phone is online. + */ + TBool PhoneOnline(); + + /** + * Updates iNetworkText from the iNWInfo values. + */ + void UpdateNetworkTextL(); + + /** + * Easy access to parent plugin. Casts view from AppUI. + */ + CGSParentPlugin* Parent(); + + /** + * Convert TInt to TGSNetworkModeItems. + * Will panic in case TInt is of wrong value. + */ + TGSNetworkModeItems CGSNetworkPlugin::IntToEnum( TInt aFeatureId ); + + /** + * Closes dialog (iSettingDlg) if it is open. + */ + void CloseDialog(); + +#ifdef FF_POWER_SAVE + /** + * Displays blocking note. Used if PSM is on. + */ + void DisplayBlockNoteL(); +#endif // FF_POWER_SAVE + + public: //enumerations + + enum TGSNetworkList + { + EAutomaticMode, + EManualMode + }; + + protected: + + // for load wait dialog + CAknWaitDialog* iWaitDialog; + + private: + + //Requesting note + CAknWaitDialog* iDlg; + //PhoneSettings container + CPsetContainer* iSettingsContainer; + //PhoneSettings engine object + CPsetNetwork* iPhoneSettingsEngine; + //Array of networks + CNetworkInfoArray* iNetworkArray; + //Network selection list + CAknPopupList* iNetworkPopupList; + //Setting page + CAknRadioButtonSettingPage* iSettingDlg; + //Value of MCN setting item + TInt iMCN; + //Has the user selected a valid network + TBool iApprovedNetwork; + //PhoneSettings refresh handler + CPSetRefreshHandler* iPSRefreshHandler; + //Previous network selection state + TBool iPreviousState; + // check if which command MSK is set during destruction + TBool iMskCommandFlag; + //PubSub object for BT SAP state + CGSPubSubsListener* iBtSapListener; + TBool iSearchForNetworksActive; + + // Session to network handling engine. Owned. + CNWSession* iNWSession; + + // Cached network info structure. Will be updated by iNWSession in a + // callback. + TNWInfo iNWInfo; + + // Cached network text read by GetValue(). When network handling engine + // updates data, this buffer is re-created accordingly. + HBufC* iNetworkText; +#ifdef FF_POWER_SAVE + // Active object for handling PSM realted CenRep events. + CGSNetworkPluginAO* iPsmActive; +#endif // FF_POWER_SAVE + + }; + +#endif // GSNETWORKPLUGIN_H + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginAO.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginAO.h Wed Sep 01 12:20:44 2010 +0100 @@ -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: Active object for handling PSM related CenRep changes. +* +*/ + + +#ifndef GSNETWORKPLUGINAO_H +#define GSNETWORKPLUGINAO_H + +// INCLUDES +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD CLASS DECLARATION + +// CLASS DECLARATION + +/** +* CGSNetworkPluginAO. Acts as a CenRep observer for PSM related state +* changes. +* +* @lib GSNetworkPlugin.lib +* @since Series 60_5.1 +*/ +class CRepository; +class CGSNetworkPlugin; + +class CGSNetworkPluginAO : public CActive + { + public: + + static CGSNetworkPluginAO* NewL(); + ~CGSNetworkPluginAO(); + + /** + * Set view which should be updated when PSM mode changes. + */ + void SetView( CGSNetworkPlugin* aNetworkPluginView ); + + /** + * @return PSM mode. See TPsmsrvMode. + */ + TInt Mode() const; + + protected: // From CActive + + void DoCancel(); + void RunL(); + TInt RunError( TInt aError ); + + private: + + CGSNetworkPluginAO(); + void ConstructL(); + + private: // Data + + CRepository* iPsmRepository; + TInt iPsmMode; + CGSNetworkPlugin* iNetworkPluginView; + }; + + +#endif // GSNETWORKPLUGINAO_H + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,229 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for the Network sub-folder +* +*/ + + +#ifndef GSNETWORKPLUGINCONTAINER_H +#define GSNETWORKPLUGINCONTAINER_H + +// INCLUDES +#include "GSNetworkPluginModel.h" +#include "GsNetworkPlugin.hrh" +#include "GSPhoneSettingConstants.h" //for GS & PS constants +#include +#include +#include +#include "MGsFWMSKLabelObserver.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CPsetNetwork; +class MEikListBoxObserver; +class CGSListBoxItemTextArray; +class CGSRadioButtonSettingPageItemTextArray; +class CPsetContainer; +class CGSNetworkPluginModel; +class CGSNetworkPlugin; + +// CLASS DECLARATION + +/** +* GSNetworkPluginContainer container class +* +* container class for Device settings view +* @lib GSNetworkPlugin.lib +* @since Series 60_3.1 +*/ +class CGSNetworkPluginContainer : public CGSBaseContainer + { + public: + enum { + ENetFirstBit = 1, + ENetSecondBit = 2 + }; + + public: // Constructors and destructor + + + /** C++ Constructor */ + CGSNetworkPluginContainer( CGSNetworkPlugin* aPlugin ); + + /** + * Symbian OS constructor. + * @param aRect Listbox's rect. + * + */ + void ConstructL( const TRect& aRect ); + + /** + * Destructor. + */ + ~CGSNetworkPluginContainer(); + + public: //new + + /** + * Updates listbox's item's value. + * @since Series 60_3.1 + * @param aItemId An item which is updated. + */ + void UpdateListBoxL( TInt aItemId, TInt aValue ); + + /** + * Retrieves the currently selected listbox feature id + * @since Series 60_3.1 + * @return feature id. + */ + + TInt CurrentFeatureId() const; + /** + * Gets currently active network selection mode. + * @return currently active network selection mode + */ + TInt GetSelectionMode(); + + /** + * Gets Mcn value from model. + * @param aMcnValue MCN value read from shared data. + */ + void GetMcnValue( TInt &aMcnValue ); + + /** + * Sets MCN value to model. + * @param aMcnValue MCN value written to shared data. + */ + void SetMcnValue( TInt &aMcnValue ); + + /** + * Trims non-supported variable options from the array + * This array items are displayed as radio button setting page items + * + * @param aItemArray array contents to trim from + */ + void CheckAndAlterContentsL( CGSRadioButtonSettingPageItemTextArray& + aItemArray ); + + /** + * return the model pointer + */ + CGSNetworkPluginModel* NetPluginModel(); + + /** + * Defines observer for the middle softkey label changes. + * Can only be set once. Further attempts are ignored. + * @since S60 v3.1 + */ + void SetMiddleSoftkeyObserver( MGsFWMSKObserver* aObserver ); + + /** + * OfferKeyEvent to this Call Container class for updating the label + * Up and Down rocker keys are handled + * @since S60 v3.1 + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * Callback from model. + */ + void HandleNetworkModeChangeL(); + + /** + * Returns the current selection of network mode. Note! network + * selection can be unknow in case network is slow and actual data + * has not yet been received... + * @return current network selection. + */ + TGSNetworkModeItems GetCurrentNetworkModeSelectionL(); + + /** + * Sets the current selection of network mode + * @param aNetworkMode current selection + */ + void SetCurrentNetworkModeSelectionL( + TGSNetworkModeItems aNetworkModeLbxItem ); + + protected: // from CGSBaseContainer + /** + * Creates list box. + * + * @param aResLbxId is resource number to create + */ + void ConstructListBoxL( TInt aResLbxId ); + + /** + * Required for help. + * + */ + void GetHelpContext(TCoeHelpContext& aContext) const; + + private: //new + + /** + * Creates list box items. + */ + void CreateListBoxItemsL(); + + /** + * Creates Network list box item. + * @param aValue value of setting item. + */ + void MakeNwItemL( TInt aValue = -1 ); + + /** + * Creates MCN list box item. + */ + void MakeMcnItemL(); + + /** + * Creates Network mode UI list box item. + */ + void MakeNwModeUiItemL(); + + private: // Member variables + + // Resource based features + CGSListBoxItemTextArray* iListboxItemArray; + + // CGSNetworkPluginModel is the model class of Network plugin. + CGSNetworkPluginModel* iModel; + + // Currently active network item in listbox. + TGSNetworkModeItems iSelectedNetworkModeLbxItem; + + /** + * Middle softkey label observer. + * Own. + */ + MGsFWMSKObserver* iMSKObserver; + + /** + * Reference to container's owner. Not owned. + */ + CGSNetworkPlugin* iPlugin; + + }; + +#endif //GSNETWORKPLUGINCONTAINER_H + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginModel.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,285 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Network Settings model. +* +*/ + + +#ifndef GSNETWORKPLUGINMODEL_H +#define GSNETWORKPLUGINMODEL_H + +#include +#include +#include +#include +#include +#include + +#include "GSNetworkPluginContainer.h" +#include "GsNetworkPlugin.hrh" + +// CONSTANTS + +const TUint32 KGSNetworkModeCapsNotUpdated = KMaxTUint32; + +// Used only for debugging. Init value for network mode debug strings. +const TInt KGSNetworkModeDebugStrLen = 50; + + +// Panic codes for used in this compilation unit +enum TGSTelPluginModelPanicCodes + { + EGSTelPluinModelPanicNullPtr = 1 + }; +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class MPsetNetworkModeObserver; +class CPsetContainer; +class CGSNetworkPluginContainer; +class CGSNetworkPlugin; + +// CLASS DEFINITION +/** +* CGSNetworkPluginModel is the model class of GS network plugin. +* It provides functions to get and set setting values. +* @lib GSNetworkPlugin.lib +* @since Series 60_3.1 + +*/ +class CGSNetworkPluginModel : public CBase, + private MPsetNetworkModeObserver + { + public: // Constructor and destructor + + /** + * Overloaded constructor meant to be used from container + */ + static CGSNetworkPluginModel* NewL( + CGSNetworkPluginContainer* aContainer, + CGSNetworkPlugin* aPlugin ); + + /** + * Destructor + */ + ~CGSNetworkPluginModel(); + + public: // new ones + /** + * Gets CSP status + * + * @return ETrue: CSP is set + * EFalse: CSP is not set + */ + TBool GetCSPStatus(); + + /** + * Sets CSP Active + * @param aValue TBool + * @return ETrue: CSP is set + * EFalse: CSP is not set + */ + void SetCSPActiveL( TBool aValue ); + + /** + * Get the network mode status from Shared data. This value is used + * to display/hide the "network mode UI" list item under network + * folder. Currently, this value is ONLY read and not written. + * @return ETrue if the value is 1 in SD. + */ + TBool IsNetworkModeVisible(); + + /** + * Returns if CSP setting is supported + * @param aSettingNumber TInt + * @return ETrue: CSP is supported + * EFalse: CSP is not supported + */ + TBool IsSettingSupported( TInt aSettingNumber ); + + /* + * Returns MCN value from shared data. + * @param aId value of shared data key + * @return ETrue: no errors + * EFalse: an error has occurred + */ + TBool GetMCNSettingValue( TInt& aId ); + + /* + * Sets MCN value to shared data. + * @param aId value of shared data key + * @return ETrue: no errors + * EFalse: an error has occurred + */ + TBool SetMCNSettingValue( TInt& aId ); + + /* + * Gets the supported network mode list from shared data. + * @return the bit-masked value from shared data + */ + TInt GetSupportedNetworksL(); + + /** + * Check if graphical network list is supported. + * This is handled using GS local variation + * @return ETrue if supported. + */ + TBool GraphicalNetworkListSupportedL(); + + /** + * Return local variation value for automatic network search + * support. Local key = EGSConfigNoAutoToAutoNetworkSearch + * See GeneralSettingsVariant.hrh for details + * @return local variation value + */ + TBool AutomaticNetworkSearchSupportedL(); + + + /** + * Creates phone settings engine. + * @param aContainer Container object as reference + */ + void CreatePhoneSettingsEngineL(); + + /** + * StartAsynGetCurrentNetworkModeSelectionL + */ + void StartAsynGetCurrentNetworkModeSelectionL(); + + /** + * StartSynGetCurrentNetworkModeSelectionL + */ + void StartSynGetCurrentNetworkModeSelectionL(); + + /** + * GetNetworkSelectionMode + */ + MPsetNetworkSelect::TSelectMode GetNetworkSelectionMode(); + + /** + * See iNetworkMode. + * @return TUint32 Current network mode value, RMmCustomAPI::KCapsNetworkModeUmts etc... + */ + TUint32 GetNetworkMode(); + + /** + * SetNetworkModeL + */ + void SetNetworkModeL( TUint32 aNetworkMode ); + + /** + * Prints model state to debug output in case of debug build. + */ + void PrintState(); + + /** + * Used only in debug mode: verifies network state with the UI selection. + * For debugging purposes only. + */ + void CheckState( TGSNetworkModeItems aMode ); + + + + + TBool IsCallActive(); + + private: // Private constructors + + /** + * Default C++ contructor + */ + CGSNetworkPluginModel( CGSNetworkPluginContainer* aContainer, + CGSNetworkPlugin* aPlugin ); + + /** + * Symbian OS default constructor + * @return void + */ + void ConstructL(); + + void ConstructBaseItemsL(); + + /** + * Initialize CenRep keys used in this class + */ + void InitializeCentralRepositoryL(); + + /** + * Un-initialize CenRep keys used in this class + */ + void UninitializeCentralRepository(); + + private: // from base class MPsetNetworkModeObserver + + /** + * @@see MPsetNetworkModeObserver::HandleNetworkSystemModeEventsL. + * @since 2.6 + */ + void HandleNetworkSystemModeEventsL( + const MPsetNetworkModeObserver::TServiceRequest aRequest, + const TUint32 aNetworkModeCaps ); + + + /** + * @@see MPsetNetworkModeObserver::HandleNetworkErrorL. + * @since 2.6 + */ + void HandleNetworkErrorL( + const MPsetNetworkModeObserver::TServiceRequest aRequest, + const TInt aError ); + + private: + // Central repository objects + CRepository* iNetworkRepository; + CRepository* iGSVariationRepository; + CPsetCustomerServiceProfile* iCSP; //check if CSP is active + TInt iLocalVariationValues; //local variated constants + + // PhoneSettings engine object for network mode + CPsetNetwork* iPhoneSettingsEngine; + CPsetContainer* iSettingsContainer; + + // Current network mode value from RMmCustomAPI::TNetworkModeCaps. + // enum RMmCustomAPI::TNetworkModeCaps + // { + // KkNetworkModeGsm = 0x01, + // KCapsNetworkModeUmts = 0x02, + // KCapsNetworkModeDual = 0x04 + // }; + // and in addition: KGSNetworkModeCapsNotUpdated + // + // Stores value aNetworkModeCaps from: + // MPsetNetworkModeObserver::HandleNetworkSystemModeEventsL(..., TUint32 aNetworkModeCaps ) + // + TUint32 iNetworkMode; + + // Temporarily value of the requested network mode. Stores requested + // mode which is updated to iNetworkMode in case request succeeds and + // HandleNetworkSystemModeEventsL is called. + TUint32 iRequestedNetworkMode; + + // Pointer for communicating with container. Not owned. + CGSNetworkPluginContainer* iContainer; + + // Reference to network plugin. Not owned. + CGSNetworkPlugin* iPlugin; + }; + +#endif //GSNETWORKPLUGINMODEL_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Inc/GsNetworkPlugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/GsNetworkPlugin.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains common definitions for menu id:s +* +*/ + + +#ifndef GSNETWORKPLUGIN_HRH +#define GSNETWORKPLUGIN_HRH + +// commands +// Network view's list items. +enum TGSNetworkItemIds + { + EGSNetworkModeItemId, + EGSNetworkModeSelectionItemId, + EGSMCNItemId + }; + +// Network mode selection setting page items +enum TGSNetworkModeItems + { + EGSNetworkModeDualmode, + EGSNetworkModeUMTS, + EGSNetworkModeGSM + }; + +// Network selection setting page items +enum TGSNetworkSelectionModeItems + { + EGSAutomaticSelectMode, + EGSManualSelectMode + }; + +// Cell Info Display setting page items +enum TGSMcnModeItems + { + EGSMcnSetOn, + EGSMcnSetOff + }; + +enum TGSTelNotes + { + ECWActivateNote = 1, + ECWCancelNote, + ECWNotActiveNote, + ERequestCancelledNote, + ERequestingNote, + EAlsDisabledNote, + EAlsEnabledNote, + ECBActiveNote, + EPasswordErrorNote, + EPasswordChangedNote, + ECBNotActiveNote, + ESearchingNote, + ENoNetworksFoundNote, + ECallInProgress, + EHomeNetworksSelectedNote, + ENetworkSelectedNote, + ENoNetworkAccessNote, + ENwRegistrationInterrupted, + ECugIndexErrorNote, + EImageLoadWaitNote + }; + +enum TGSSoftKeys + { + EGSSoftkeyQuit = 1, + EGSSoftkeyEmpty + }; + +enum TGSCustomerServiceGroups + { + EGSCSPCallForward = 1, + EGSCSPCallBarring, + EGSCSPCallWaiting, + EGSCSPAlternateLine, + EGSCSPManualNetworkSelection, + EGSCenRepSoftReject + }; + +#endif // GSNETWORKPLUGIN_HRH + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Inc/MGsFWMSKLabelObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/MGsFWMSKLabelObserver.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Indicates that MSK label might be in need of update. +* +*/ + + +#ifndef M_GSFWMSKLABELOBSERVER_H +#define M_GSFWMSKLABELOBSERVER_H + +/** + * Observer interface to enable observer to verify currently displayed + * middle softkey label. The inherited method should be called when + * the middle softkey label is in need of updating after a navigation + * event has been detected. + * @since S60 v3.1 + */ +class MGsFWMSKObserver + { + +public: + + /** + * Observer interface to verify currently displayed middle softkey label. + */ + IMPORT_C virtual void CheckMiddleSoftkeyLabelL() = 0; + + }; + + +#endif // M_GSFWMSKLABELOBSERVER_H diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Inc/PSMNetworkPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/PSMNetworkPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef PSMNETWORKPLUGIN_H +#define PSMNETWORKPLUGIN_H + +// INCLUDES +#include +#include +#include //CPsmPluginBase +#include + +class CGSNetworkPluginModel; +class CRepository; + +/** +* PSMNetwork plugin stub +* +* @lib ?library +* @since Series 60_5.1 +*/ +class CPSMNetworkPlugin : public CPsmPluginBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @return The created object. + */ + static CPSMNetworkPlugin* NewL( TPsmPluginCTorParams& initParams ); + + /** + * Destructor. + */ + virtual ~CPSMNetworkPlugin(); + + public: + + // From CPsmPluginBase + void NotifyModeChange( const TInt aMode ); + + private: + + CPSMNetworkPlugin( TPsmPluginCTorParams& aInitParams ); + void ConstructL(); + + /** + * Internal leaving function calleb from non-leaving NotifyModeChange. + */ + void DoModeChangeL( const TInt aMode ); + + /** + * To verify if the phone is in the offline mode. (or mostly if mode is supported???) + */ + TBool IsPhoneOfflineL() const; + + /** + * To verify if the network mode needs to be changed. + * not change when from EPsmsrvModeNormal to EPsmsrvPartialMode + * and from EPsmsrvModePowerSave to EPsmsrvPartialMode + */ + TBool IsChangeNetworkMode( TPsmsrvMode& aOldMode, TPsmsrvMode aNewMode ); + + private: // data + + CGSNetworkPluginModel *iModel; //data model + CRepository* iPsmRepository; + TPsmsrvMode iPsmMode; + + }; + +#endif // PSMNETWORKPLUGIN_H diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkDebugHelper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkDebugHelper.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,356 @@ +/* +* 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: Static utility class for transfering network enums to +* descriptor. +* +*/ + + +#include "GSNetworkDebugHelper.h" +#include "GSNetworkPluginModel.h" + + +// --------------------------------------------------------------------------- +// GSNetworkDebugHelper::NwToDes +// +// --------------------------------------------------------------------------- +void GSNetworkDebugHelper::NwToDes( TGSNetworkModeItems aMode, TDes& aDes ) + { + switch( aMode ) + { + case EGSNetworkModeDualmode: + _LIT( KGSDesModeDual, "EGSNetworkModeDualmode (%d)"); + aDes.Format( KGSDesModeDual, aMode ); + break; + case EGSNetworkModeUMTS: + _LIT( KGSDesModeUMTS, "EGSNetworkModeUMTS (%d)"); + aDes.Format( KGSDesModeUMTS, aMode ); + break; + case EGSNetworkModeGSM: + _LIT( KGSDesModeGSM, "EGSNetworkModeGSM (%d)"); + aDes.Format( KGSDesModeGSM, aMode ); + break; + default: + _LIT( KGSDesCapsUnknown, "Unknown mode (%d)!!!"); + aDes.Format( KGSDesCapsUnknown, aMode ); + break; + } + } + + +// --------------------------------------------------------------------------- +// GSNetworkDebugHelper::NwCapsToDes +// +// --------------------------------------------------------------------------- +void GSNetworkDebugHelper::NwCapsToDes( TUint32 aMode, TDes& aDes ) + { + switch( aMode ) + { + case RMmCustomAPI::KCapsNetworkModeGsm: + _LIT( KGSDesCapsModeDual, "RMmCustomAPI::KCapsNetworkModeGsm (%d)"); + aDes.Format( KGSDesCapsModeDual, aMode ); + break; + case RMmCustomAPI::KCapsNetworkModeUmts: + _LIT( KGSDesCapsModeUMTS, "RMmCustomAPI::KCapsNetworkModeUmts (%d)"); + aDes.Format( KGSDesCapsModeUMTS, aMode ); + break; + case RMmCustomAPI::KCapsNetworkModeDual: + _LIT( KGSDesCapsModeGSM, "RMmCustomAPI::KCapsNetworkModeDual (%d)"); + aDes.Format( KGSDesCapsModeGSM, aMode ); + break; + case KGSNetworkModeCapsNotUpdated: + _LIT( KGSDesCapsModeNotUpdated, "KGSNetworkModeCapsNotUpdated (%d)"); + aDes.Format( KGSDesCapsModeNotUpdated, aMode ); + break; + default: + _LIT( KGSDesCapsUnknown, "Unknown mode (%d)!!!"); + aDes.Format( KGSDesCapsUnknown, aMode ); + break; + } + } + + +// --------------------------------------------------------------------------- +// GSNetworkDebugHelper::NetworkStatusToDes +// +// --------------------------------------------------------------------------- +void GSNetworkDebugHelper::NetworkStatusToDes( + TNWRegistrationStatus aNetworkStatus, + TDes& aDes ) + { + switch( aNetworkStatus ) + { + case ENWRegistrationUnknown: + _LIT( KGSDes1, "ENWRegistrationUnknown (%d)"); + aDes.Format( KGSDes1, aNetworkStatus ); + break; + case ENWNotRegisteredNoService: + _LIT( KGSDes2, "ENWNotRegisteredNoService (%d)"); + aDes.Format( KGSDes2, aNetworkStatus ); + break; + case ENWNotRegisteredEmergencyOnly: + _LIT( KGSDes3, "ENWNotRegisteredEmergencyOnly (%d)"); + aDes.Format( KGSDes3, aNetworkStatus ); + break; + case ENWNotRegisteredSearching: + _LIT( KGSDes4, "ENWNotRegisteredSearching (%d)"); + aDes.Format( KGSDes4, aNetworkStatus ); + break; + case ENWRegisteredBusy: + _LIT( KGSDes5, "ENWRegisteredBusy (%d)"); + aDes.Format( KGSDes5, aNetworkStatus ); + break; + case ENWRegisteredOnHomeNetwork: + _LIT( KGSDes6, "ENWRegisteredOnHomeNetwork (%d)"); + aDes.Format( KGSDes6, aNetworkStatus ); + break; + case ENWRegistrationDenied: + _LIT( KGSDes7, "ENWRegistrationDenied (%d)"); + aDes.Format( KGSDes7, aNetworkStatus ); + break; + case ENWRegisteredRoaming: + _LIT( KGSDes8, "ENWRegisteredRoaming (%d)"); + aDes.Format( KGSDes8, aNetworkStatus ); + break; + + default: + _LIT( KGSDes, "Unknown status (%d)!!!"); + aDes.Format( KGSDes, aNetworkStatus ); + break; + } + } + + +// --------------------------------------------------------------------------- +// GSNetworkDebugHelper::NetworkMessageToDes +// +// --------------------------------------------------------------------------- +void GSNetworkDebugHelper::NetworkMessageToDes( + MNWMessageObserver::TNWMessages aNetworkMessage, + TDes& aDes ) + { + switch( aNetworkMessage ) + { + case MNWMessageObserver::ENWMessageNetworkInfoChange: + _LIT( KGSDes1, "ENWMessageNetworkInfoChange (%d)"); + aDes.Format( KGSDes1, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageNetworkModeChange: + _LIT( KGSDes2, "ENWMessageNetworkModeChange (%d)"); + aDes.Format( KGSDes2, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange: + _LIT( KGSDes3, "ENWMessageNetworkRegistrationStatusChange (%d)"); + aDes.Format( KGSDes3, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageProgrammableOperatorInfoChange: + _LIT( KGSDes4, "ENWMessageProgrammableOperatorInfoChange (%d)"); + aDes.Format( KGSDes4, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageNetworkProviderNameChange: + _LIT( KGSDes5, "ENWMessageNetworkProviderNameChange (%d)"); + aDes.Format( KGSDes5, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageServiceProviderNameChange: + _LIT( KGSDes6, "ENWMessageServiceProviderNameChange (%d)"); + aDes.Format( KGSDes6, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageProgrammableOperatorInfoUpdating: + _LIT( KGSDes7, "ENWMessageProgrammableOperatorInfoUpdating (%d)"); + aDes.Format( KGSDes7, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageNetworkProviderNameUpdating: + _LIT( KGSDes8, "ENWMessageNetworkProviderNameUpdating (%d)"); + aDes.Format( KGSDes8, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageServiceProviderNameUpdating: + _LIT( KGSDes9, "ENWMessageServiceProviderNameUpdating (%d)"); + aDes.Format( KGSDes9, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageAllowRefresh: + _LIT( KGSDes10, "ENWMessageAllowRefresh (%d)"); + aDes.Format( KGSDes10, aNetworkMessage ); + break; +#ifdef RD_PHONE_NG + case MNWMessageObserver::ENWMessageNetworkSelectionSettingChange: + _LIT( KGSDes11, "ENWMessageNetworkSelectionSettingChange (%d)"); + aDes.Format( KGSDes11, aNetworkMessage ); + break; +#endif // RD_PHONE_NG + case MNWMessageObserver::ENWMessageNetworkCellReselection: + _LIT( KGSDes12, "ENWMessageNetworkCellReselection (%d)"); + aDes.Format( KGSDes12, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageNetworkConnectionFailure: + _LIT( KGSDes13, "ENWMessageNetworkConnectionFailure (%d)"); + aDes.Format( KGSDes13, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageCurrentCellInfoMessage: + _LIT( KGSDes14, "ENWMessageCurrentCellInfoMessage (%d)"); + aDes.Format( KGSDes14, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageCurrentHomeZoneMessage: + _LIT( KGSDes15, "ENWMessageCurrentHomeZoneMessage (%d)"); + aDes.Format( KGSDes15, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageNetworkIndicatorChange: + _LIT( KGSDes16, "ENWMessageNetworkIndicatorChange (%d)"); + aDes.Format( KGSDes16, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageNetworkEmergencyMode: + _LIT( KGSDes17, "ENWMessageNetworkEmergencyMode (%d)"); + aDes.Format( KGSDes17, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageStartSystemSearchRequestCompleteOk: + _LIT( KGSDes18, "ENWMessageStartSystemSearchRequestCompleteOk (%d)"); + aDes.Format( KGSDes18, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageStartSystemSearchRequestCompleteFail: + _LIT( KGSDes19, "ENWMessageStartSystemSearchRequestCompleteFail (%d)"); + aDes.Format( KGSDes19, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageStopProtocolStackRequestCompleteOk: + _LIT( KGSDes20, "ENWMessageStopProtocolStackRequestCompleteOk (%d)"); + aDes.Format( KGSDes20, aNetworkMessage ); + break; + case MNWMessageObserver::ENWMessageStopProtocolStackRequestCompleteFail: + _LIT( KGSDes21, "ENWMessageStopProtocolStackRequestCompleteFail (%d)"); + aDes.Format( KGSDes21, aNetworkMessage ); + break; + default: + _LIT( KGSDes, "Unknown message (%d)!!!"); + aDes.Format( KGSDes, aNetworkMessage ); + break; + } + } + + +// --------------------------------------------------------------------------- +// GSNetworkDebugHelper::NetworkOperationToDes +// +// --------------------------------------------------------------------------- +void GSNetworkDebugHelper::NetworkOperationToDes( + MNWMessageObserver::TNWOperation aNetworkOperation, + TDes& aDes ) + { + switch( aNetworkOperation ) + { + case MNWMessageObserver::ENWNone: + _LIT( KGSDes1, "ENWNone (%d)"); + aDes.Format( KGSDes1, aNetworkOperation ); + break; + + case MNWMessageObserver::ENWGetServiceProviderName: + _LIT( KGSDes2, "ENWGetServiceProviderName (%d)"); + aDes.Format( KGSDes2, aNetworkOperation ); + break; + case MNWMessageObserver::ENWGetNetworkProviderName: + _LIT( KGSDes3, "ENWGetNetworkProviderName (%d)"); + aDes.Format( KGSDes3, aNetworkOperation ); + break; + case MNWMessageObserver::ENWGetProgrammableOperatorName: + _LIT( KGSDes4, "ENWGetProgrammableOperatorName (%d)"); + aDes.Format( KGSDes4, aNetworkOperation ); + break; + default: + _LIT( KGSDes, "Unknown operation (%d)!!!"); + aDes.Format( KGSDes, aNetworkOperation ); + break; + } + } + + +// --------------------------------------------------------------------------- +// GSNetworkDebugHelper::NetworkModeRequestToDes +// +// --------------------------------------------------------------------------- +void GSNetworkDebugHelper::NetworkModeRequestToDes( + MPsetNetworkModeObserver::TServiceRequest aRequest, + TDes& aDes ) + { + switch( aRequest ) + { + case MPsetNetworkModeObserver::EServiceRequestNone: + _LIT( KGSDes1, "EServiceRequestNone (%d)"); + aDes.Format( KGSDes1, aRequest ); + break; + + case MPsetNetworkModeObserver::EServiceRequestSetSelectedNetworkMode: + _LIT( KGSDes2, "EServiceRequestSetSelectedNetworkMode (%d)"); + aDes.Format( KGSDes2, aRequest ); + break; + case MPsetNetworkModeObserver::EServiceRequestGetCurrentNetworkMode: + _LIT( KGSDes3, "EServiceRequestGetCurrentNetworkMode (%d)"); + aDes.Format( KGSDes3, aRequest ); + break; + default: + _LIT( KGSDes, "Unknown request (%d)!!!"); + aDes.Format( KGSDes, aRequest ); + break; + } + } + + +// --------------------------------------------------------------------------- +// GSNetworkDebugHelper::NetworkInfoRequestToDes +// +// --------------------------------------------------------------------------- +void GSNetworkDebugHelper::NetworkInfoRequestToDes( + MPsetNetworkInfoObserver::TServiceRequest aRequest, + TDes& aDes ) + { + switch( aRequest ) + { + case MPsetNetworkInfoObserver::EServiceRequestNone: + _LIT( KGSDes1, "EServiceRequestNone (%d)"); + aDes.Format( KGSDes1, aRequest ); + break; + case MPsetNetworkInfoObserver::EServiceRequestEnumerateNetworks: + _LIT( KGSDes2, "EServiceRequestEnumerateNetworks (%d)"); + aDes.Format( KGSDes2, aRequest ); + break; + case MPsetNetworkInfoObserver::EServiceRequestGetNetworkInfo: + _LIT( KGSDes3, "EServiceRequestGetNetworkInfo (%d)"); + aDes.Format( KGSDes3, aRequest ); + break; + case MPsetNetworkInfoObserver::EServiceRequestGetCurrentNetworkInfo: + _LIT( KGSDes4, "EServiceRequestGetCurrentNetworkInfo (%d)"); + aDes.Format( KGSDes4, aRequest ); + break; + case MPsetNetworkInfoObserver::EServiceRequestGetNetworkSearchMode: + _LIT( KGSDes5, "EServiceRequestGetNetworkSearchMode (%d)"); + aDes.Format( KGSDes5, aRequest ); + break; + case MPsetNetworkInfoObserver::EServiceRequestSetNetwork: + _LIT( KGSDes6, "EServiceRequestSetNetwork (%d)"); + aDes.Format( KGSDes6, aRequest ); + break; + case MPsetNetworkInfoObserver::EServiceRequestSetNetworkMode: + _LIT( KGSDes7, "EServiceRequestSetNetworkMode (%d)"); + aDes.Format( KGSDes7, aRequest ); + break; + case MPsetNetworkInfoObserver::EServiceRequestSetNetworkAutomatic: + _LIT( KGSDes8, "EServiceRequestSetNetworkAutomatic (%d)"); + aDes.Format( KGSDes8, aRequest ); + break; + default: + _LIT( KGSDes, "Unknown request (%d)!!!"); + aDes.Format( KGSDes, aRequest ); + break; + } + } + + + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,1949 @@ +/* +* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Call submenu in General Settings. +* +*/ + + +// INCLUDE FILES +#include "GSNetworkPlugin.h" //for CGSCallPlugin +#include "GSNetworkPluginContainer.h" //for CGSCallPluginContainer +#include "GsLogger.h" +#include "GSNetworkPlugin.h" //for pluginUID + +#include +#include // For HlpLauncher + +//AVKON headers +#include //for Note Wrappers +#include //for Popup menus +#include //for Radio Button Setting Pages +#include //for viewappui +#include //for CAknWaitDialog +#include //for AknIconArray +#include //for StringLoader +#include + +#include + +//Phonesettings and TSY headers +#include //for CPsetContainer +#include //for CPsetNetwork +#include //for CPsetSAObserver +#include //for GSM-specific error messages +#include +#include +#include //for SAT refresh +#include //for radiobutton class + +#include +#include + +#include //for resource IDs +#include +#include //for CGSListBoxItemTextArray + +#include +#include +#include +#include +#include +#include // KCRUidCoreApplicationUIs, TCoreAppUIsNetworkConnectionAllowed +#include + +#include +#include +#include +#include "GSNetworkDebugHelper.h" + +#ifdef FF_POWER_SAVE + #include "GSNetworkPluginAO.h" +#endif // FF_POWER_SAVE + +// LOCAL CONSTANTS +_LIT( KGSNetWCDMAIcon, "0\t" ); +_LIT( KGSNetGSMIcon, "1\t" ); +_LIT( KEmptyStr, "" ); +/* Implementation of forbidden operator icon begins */ +_LIT( KGSNetNoIcon, "\t"); +_LIT( KGSNetForbiddenIcon, "2\t" ); +/* Implementation of forbidden operator icon ends */ +// Warning disabled as this constant is used inside __ASSERT_DEBUG +#pragma diag_suppress 177 +_LIT( KGSNetworkPluginAssertName, "CGSNetworkPlugin" ); + + +// Middle Softkey control ID. +const TInt KGSMSKControlID = 3; + +const TInt KGSNetIconAdditionalChars = 5; + + +// ========================= MEMBER FUNCTIONS ================================ +// --------------------------------------------------------------------------- +// +// Constructor. +// +// --------------------------------------------------------------------------- +CGSNetworkPlugin::CGSNetworkPlugin() + :iMskCommandFlag( ETrue ) , iPsmActive( NULL ) + { + } + +// --------------------------------------------------------------------------- +// +// Symbian OS two-phased constructor (second phase) +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::ConstructL() + { + __GSLOGSTRING("[CGSNetworkPlugin]--> CGSNetworkPlugin::ConstructL"); + FeatureManager::InitializeLibL(); + OpenLocalizedResourceFileL( KGSNetworkPluginResourceFileName, + iResourceLoader ); + + //PS listener initialization + iBtSapListener = CGSPubSubsListener::NewL( + KPSUidBluetoothSapConnectionState, + KBTSapConnectionState, this ); + + BaseConstructL( R_GS_NET_VIEW ); + + iSettingsContainer = CPsetContainer::NewL(); + iPSRefreshHandler = iSettingsContainer->CreateRefreshHandlerL(); + iPSRefreshHandler->NotifyFileChangeL( + *this, + KCspEf, + EFileChangeNotification ); + iPhoneSettingsEngine = iSettingsContainer->CreateNetworkObjectL( *this ); + iApprovedNetwork = EFalse; + CheckAndCreateDlgL( EFalse ); + iSearchForNetworksActive = EFalse; + + iNetworkText = HBufC::NewL( KNWShortNameLength ); + UpdateNetworkTextL(); + +#ifdef FF_POWER_SAVE + iPsmActive = CGSNetworkPluginAO::NewL(); + iPsmActive->SetView( this ); +#endif // FF_POWER_SAVE + + __GSLOGSTRING("[CGSNetworkPlugin] <--CGSNetworkPlugin::ConstructL"); + } + +// --------------------------------------------------------------------------- +// +// Symbian OS two-phased constructor (first phase) +// +// --------------------------------------------------------------------------- +CGSNetworkPlugin* CGSNetworkPlugin::NewLC() + { + CGSNetworkPlugin* self = new ( ELeave ) CGSNetworkPlugin; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// CGSNetworkPlugin::NewL() +// Static constructor +// +// --------------------------------------------------------------------------- +// +CGSNetworkPlugin* CGSNetworkPlugin::NewL( TAny* /*aInitParams*/ ) + { + CGSNetworkPlugin* self = new ( ELeave ) CGSNetworkPlugin(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// Destructor +// +// --------------------------------------------------------------------------- +CGSNetworkPlugin::~CGSNetworkPlugin() + { + __GSLOGSTRING("[CGSNetworkPlugin] ~CGSNetworkPlugin()|->"); + FeatureManager::UnInitializeLib(); + + if( iNWSession ) + { + delete iNWSession; + iNWSession = NULL; + } + if ( iBtSapListener ) + { + delete iBtSapListener; + iBtSapListener = NULL; + } + + if ( iPhoneSettingsEngine ) + { + if( iSearchForNetworksActive ) + { + //Reset back to previously used network + iPhoneSettingsEngine->ResetNetworkSearch(); + } + delete iPhoneSettingsEngine; + iPhoneSettingsEngine = NULL; + } + + if ( iNetworkArray ) + { + iNetworkArray->Reset(); + delete iNetworkArray; + iNetworkArray = NULL; + } + + if ( iDlg ) + { + delete iDlg; + iDlg = NULL; + } + if ( iNetworkPopupList ) + { + iNetworkPopupList->CancelPopup(); + } + + CloseDialog(); + + //Cancel any outstanding SAT notifications + if ( iPSRefreshHandler ) + { + iPSRefreshHandler->CancelNotify(); + delete iPSRefreshHandler; + iPSRefreshHandler = NULL; + } + + if( iSettingsContainer ) + { + delete iSettingsContainer; + iSettingsContainer = NULL; + } + + delete iNetworkText; + iNetworkText = NULL; + +#ifdef FF_POWER_SAVE + delete iPsmActive; + iPsmActive = NULL; +#endif // FF_POWER_SAVE + + __GSLOGSTRING("[CGSNetworkPlugin] ~CGSNetworkPlugin()-|"); + } + +// --------------------------------------------------------------------------- +// +// Returns Id of the Network submenu +// +// --------------------------------------------------------------------------- +TUid CGSNetworkPlugin::Id() const + { + return KGSNetworkPluginUid; + } + +// ---------------------------------------------------------------------------- +// CGSNetworkPlugin::Visible +// +// Provides the visibility status of self to framework. +// ---------------------------------------------------------------------------- +// +TBool CGSNetworkPlugin::Visible() const + { + TBool result( EFalse ); + TInt value = 0; + iBtSapListener->Get( value ); + if ( value == EBTSapNotConnected || value == EBTSapConnecting ) + { + result = ETrue; + } + else + { + result = EFalse; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// Handles network info +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::HandleNetworkInfoReceivedL( + const CNetworkInfoArray* aInfoArray, const TInt /* aResult */ ) + { + __GSLOGSTRING("[GS]--> CGSNetworkPlugin::HandleNetworkInfoReceivedL"); + const TInt itemsCount = aInfoArray->Count(); + + //first delete old ones + iNetworkArray->Delete( 0, iNetworkArray->Count() ); + + //then insert found networks + for ( TInt i = 0; i < itemsCount; i++ ) + { + MPsetNetworkSelect::TNetworkInfo info = aInfoArray->At( i ); + iNetworkArray->InsertL( i, info ); + } + NetworkListL(); //after search complete, show results + __GSLOGSTRING("[GS] <--CGSNetworkPlugin::HandleNetworkInfoReceivedL"); + } + +// --------------------------------------------------------------------------- +// +// Creates list of Network providers +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::NetworkListL() + { + __GSLOGSTRING("[GS]--> CGSNetworkPlugin::NetworkListL"); + + //check if the graphical list is needed... set in local variation + TBool showGraphicalList = + Container()->NetPluginModel()->GraphicalNetworkListSupportedL(); + __GSLOGSTRING1("[GS] NetworkListL: showGraphicalList: %d", showGraphicalList); + + //if no net items were found, do not show list + if ( iNetworkArray->Count() > 0 ) + { + /** Implementation of forbidden operator icon begins */ + // check if forbidden operator icon is supported + TBool forbiddenOperator = + FeatureManager::FeatureSupported( KFeatureIdFfTdScdmaForbiddenoperatoricondisplay ); + /** Implementation of forbidden operator icon ends */ + while ( !iApprovedNetwork ) + { + AknPopupListEmpty* list; + /** Implementation of forbidden operator icon begins */ + if (forbiddenOperator || showGraphicalList + && FeatureManager::FeatureSupported(KFeatureIdProtocolWcdma)) + { + list = new (ELeave) CAknSingleGraphicPopupMenuStyleListBox; + } + else + { + list = new (ELeave) CAknSinglePopupMenuStyleListBox; + } + /** Implementation of forbidden operator icon ends */ + + CleanupStack::PushL( list ); + if ( iNetworkPopupList ) + { + iNetworkPopupList->CancelPopup(); + iNetworkPopupList = NULL; + } + iNetworkPopupList = + CAknPopupList::NewL( list, R_AVKON_SOFTKEYS_OK_CANCEL ); + + list->ConstructL( iNetworkPopupList, + CEikListBox::ELeftDownInViewRect ); + list->CreateScrollBarFrameL( ETrue ); + list->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); + + //Fill in the list texts + CDesCArrayFlat* items = + new ( ELeave ) CDesCArrayFlat( KGSNetPopupMenuItems ); + CleanupStack::PushL( items ); + const TInt itemsCount = iNetworkArray->Count(); + __GSLOGSTRING1("[GS] NetworkListL: itemsCount: %d", itemsCount); + + for ( TInt loop = 0; loop < itemsCount; loop++ ) + { + HBufC* insertString = + HBufC::NewLC( + KGSNwLongNameLength + KGSNetIconAdditionalChars ); + MPsetNetworkSelect::TNetworkInfo info = + iNetworkArray->At( loop ); + + if ( info.iLongName.Length() <= 0 || + info.iLongName.Length() > KGSNwLongNameLength ) + { + //no names received, use IDs + if ( info.iShortName.Length() <= 0 || + info.iShortName.Length() > KGSNwShortNameLength ) + { + TNetworkID ids; + TNetworkID networkCode; + ids = info.iId.iCountryCode; + ids.Append( KGSEmptySpace ); + networkCode = info.iId.iNetworkCode; + ids.Append( networkCode ); + insertString->Des().Append( ids ); + __GSLOGSTRING1("[GS] NetworkListL: Network ID: %S", insertString); + } + //short name received + else + { + insertString->Des().Append( info.iShortName ); + __GSLOGSTRING1("[GS] NetworkListL: Network Shortname: %S", insertString); + } + } + //long name received + else + { + insertString->Des().Append( info.iLongName ); + __GSLOGSTRING1("[GS] NetworkListL: Network Longname: %S", insertString); + } + + /** Implementation of forbidden operator icon begins */ + //set icon for network + if ( forbiddenOperator ) + { + if ( info.iStatus == MPsetNetworkSelect::ENetStatForbidden ) + { + insertString->Des().Insert( 0, KGSNetForbiddenIcon ); + } + else + { + insertString->Des().Insert( 0, KGSNetNoIcon ); + } + } + else if ( showGraphicalList ) + { + if ( FeatureManager::FeatureSupported( + KFeatureIdProtocolWcdma ) ) + { + if ( info.iAccess != + MPsetNetworkSelect::ENetNetworkGSM ) + { + insertString->Des().Insert( 0, KGSNetWCDMAIcon ); + } + else + { + insertString->Des().Insert( 0, KGSNetGSMIcon ); + } + } + } + /** Implementation of forbidden operator icon ends */ + items->AppendL( *insertString ); + CleanupStack::PopAndDestroy(); + } + + // For Testing purpuses ONLY + for ( TInt k=0; kCount(); k++ ) + { + TPtrC itemText( (*items)[k] ); + __GSLOGSTRING2("[GS] NetworkListL: POS: %d, VALUE: %S", k, &itemText); + } + + CTextListBoxModel* model = list->Model(); + model->SetItemTextArray( items ); + model->SetOwnershipType( ELbmOwnsItemArray ); + CleanupStack::Pop( items ); //listbox model now owns this + + //Set title for list + SetTitleToPopupL( *iNetworkPopupList, R_NETSL_FOUNDOPERATORS ); + + // Setup graphic items list for dual mode nw selection listbox + // based on the local variation + /** Implementation of forbidden operator icon begins */ + if ( forbiddenOperator || showGraphicalList ) + { + CAknIconArray* iconList = new (ELeave) CAknIconArray( 10 ); + CleanupStack::PushL( iconList ); + iconList->ConstructFromResourceL( R_NET_DUALMODE_ICONS ); + list->ItemDrawer()->ColumnData()->SetIconArray( iconList ); + CleanupStack::Pop( iconList ); //listbox model now owns this + } + /** Implementation of forbidden operator icon ends */ + TInt res = 0; + if( items->Count() ) + { + res = iNetworkPopupList->ExecuteLD(); + } + iNetworkPopupList = NULL; + + iApprovedNetwork = ETrue; //not perhaps, but user might want to quit + TInt selection = list->CurrentItemIndex(); + __GSLOGSTRING1("[GS] NetworkListL: selection: %d", selection); + + CleanupStack::PopAndDestroy( list ); + + if ( res ) + { + MPsetNetworkSelect::TNetworkInfo info = + iNetworkArray->At( selection ); + info.iMode = MPsetNetworkSelect::ENetSelectModeManual; + iPhoneSettingsEngine->SelectNetworkL( info ); + } + else // user selected "Cancel" + { + //Reset back to previously used network + iPhoneSettingsEngine->ResetNetworkSearch(); + //After list has been used, clear it. + PurgeNetworkList(); + if ( iPhoneSettingsEngine->IsCallActive() != + CPsetSAObserver::EPSetCallActive ) + { + ShowSettingPageL( EGSNetworkModeSelectionItemId ); + } + } + } + } + iApprovedNetwork = EFalse; //initialize before new search + __GSLOGSTRING("[GS] <--CGSNetworkPlugin::NetworkListL"); + } + +// --------------------------------------------------------------------------- +// +// Handles requests to change network +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::HandleNetworkChangedL( + const MPsetNetworkSelect::TNetworkInfo& /*aCurrentInfo*/, + const MPsetNetworkSelect::TCurrentNetworkStatus /*aStatus*/, + const TInt /*aResult*/ ) + { + //DEPRECATED + } + +// --------------------------------------------------------------------------- +// +// Handles requests to change network +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::HandleNetworkChangedL( + const MPsetNetworkSelect::TNetworkInfo& aCurrentInfo, + const RMobilePhone::TMobilePhoneRegistrationStatus& aStatus, + const TInt /* aResult */ ) + { + __GSLOGSTRING("[GS]--> CGSNetworkPlugin::HandleNetworkChangedL"); + switch ( aStatus ) + { + case RMobilePhone::ERegisteredOnHomeNetwork: + ShowNoteL( R_HOME_NETWORK_SELECTED, KGSConfirmationNote ); + PurgeNetworkList(); + break; + case RMobilePhone::ERegisteredRoaming: + { + HBufC* stringholder; + if ( aCurrentInfo.iLongName.Length() > 0 && + aCurrentInfo.iLongName.Length() <= + MPsetNetworkSelect::ENetLongNameSize ) + { + stringholder = StringLoader::LoadLC( R_NETSL_NETWORKSELECTED, + aCurrentInfo.iLongName ); + } + else if (aCurrentInfo.iShortName.Length() > 0 && + aCurrentInfo.iShortName.Length() <= + MPsetNetworkSelect::ENetShortNameSize ) + { + stringholder = StringLoader::LoadLC( R_NETSL_NETWORKSELECTED, + aCurrentInfo.iShortName ); + } + else //network returned only ids + { + // construct whole "id-string" + // e.g. for Finland Nokia's test network "244 7" + TNetworkID ids; + TNetworkID networkCode; + ids = aCurrentInfo.iId.iCountryCode; + __GSLOGSTRING1("[GS] HandleNetworkChangedL: iCountryCode: %S", &aCurrentInfo.iId.iCountryCode); + + ids.Append( KGSEmptySpace ); + networkCode = aCurrentInfo.iId.iNetworkCode; + __GSLOGSTRING1("[GS] HandleNetworkChangedL: iNetworkCode: %S", &aCurrentInfo.iId.iNetworkCode); + + ids.Append( networkCode ); + stringholder = + StringLoader::LoadLC( R_NETSL_NETWORKSELECTED, ids ); + } + CAknConfirmationNote* note = new ( ELeave ) CAknConfirmationNote( ETrue ); + note->ExecuteLD( *stringholder ); + CleanupStack::PopAndDestroy( stringholder ); + //After list has been used, clear it. + PurgeNetworkList(); + break; + } + case RMobilePhone::ERegistrationUnknown: + case RMobilePhone::ENotRegisteredNoService: + case RMobilePhone::ENotRegisteredEmergencyOnly: + case RMobilePhone::ENotRegisteredSearching: + case RMobilePhone::ERegisteredBusy: + case RMobilePhone::ERegistrationDenied: + default: + break; + } + PhoneIdle(); + __GSLOGSTRING("[GS] <--CGSNetworkPlugin::HandleNetworkChangedL"); + } + + +// --------------------------------------------------------------------------- +// +// Handles user inputs in Options menu +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::HandleCommandL( TInt aCommand ) + { + __GSLOGSTRING1("[CGSNetworkPlugin] HandleCommandL(%d)|->", aCommand ); + switch ( aCommand ) + { + case EGSMSKCmdAppChange: + HandleListBoxSelectionL(); + break; + case EGSCmdAppChange: + { + const TInt currentFeatureId = Container()->CurrentFeatureId(); + + if ( currentFeatureId == EGSMCNItemId ) + { + ShowSettingPageL( EGSMCNItemId ); + } + else if ( currentFeatureId == EGSNetworkModeItemId ) + { + CheckCallActiveL( EGSNetworkModeItemId ); + } + else + { + HandleListBoxEventL( NULL, EEventEnterKeyPressed ); + } + } + break; + case EAknSoftkeyBack: + { + if (!iPhoneSettingsEngine->IsActive()) + { + iAppUi->ActivateLocalViewL( KGSConPluginUid /*KGSTelPluginUid*/ ); + } + break; + } + case EAknCmdHelp: + { + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), iAppUi->AppHelpContextL() ); + } + break; + } + default: + iAppUi->HandleCommandL( aCommand ); + break; + } + __GSLOGSTRING("[CGSNetworkPlugin] HandleCommandL()-|"); + } + + +// --------------------------------------------------------------------------- +// +// Handles user inputs in Options menu +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::ProcessCommandL( TInt aCommand ) + { + // Network base class + CAknView::ProcessCommandL( aCommand ); + } + +// --------------------------------------------------------------------------- +// +// While request to find networks is processed +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::HandleSearchingNetworksL( + MPsetNetworkInfoObserver::TServiceRequest aRequest ) + { + __GSLOGSTRING("[GS]--> CGSNetworkPlugin::HandleSearchingNetworksL"); + if ( !iNetworkArray ) + { + iNetworkArray = new ( ELeave ) + CNetworkInfoArray( KGSNetworkInfoArrayGranularity ); + } + + if ( aRequest != MPsetNetworkInfoObserver::EServiceRequestNone ) + { + CheckAndCreateDlgL( EFalse ); + if ( aRequest == + MPsetNetworkInfoObserver::EServiceRequestSetNetworkAutomatic ) + { + UpdateListBoxL( EGSNetworkModeSelectionItemId, + EGSAutomaticSelectMode ); + } + else + { + UpdateListBoxL( EGSNetworkModeSelectionItemId, + EGSManualSelectMode ); + } + + iSearchForNetworksActive = ETrue; + TInt res = iDlg->ExecuteLD( R_SEARCHING_NOTE ); + + if ( res == EGSSoftkeyQuit ) + { + iPhoneSettingsEngine->CancelProcess(); + + ShowSettingPageL( EGSNetworkModeSelectionItemId ); + } + else + { + if ( aRequest == + MPsetNetworkInfoObserver::EServiceRequestSetNetworkAutomatic ) + { + PhoneIdle(); + iAppUi->HandleCommandL( EEikCmdExit ); + } + } + } + else + { + delete iDlg; + iDlg = NULL; + } + + __GSLOGSTRING("[GS] <--CGSNetworkPlugin::HandleSearchingNetworksL"); + } + +// --------------------------------------------------------------------------- +// +// While request to change network is processed, a note is shown +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::HandleRequestingSelectedNetworkL( TBool aOngoing ) + { + __GSLOGSTRING("[GS]--> CGSNetworkPlugin::HandleRequestingSelectedNetworkL"); + if ( aOngoing ) + { + CheckAndCreateDlgL( ETrue ); + + if ( iDlg->ExecuteLD( R_REQUESTING_NOTE ) == EGSSoftkeyQuit ) + { + iPhoneSettingsEngine->CancelProcess(); + + CAknNoteDialog* dlg = new ( ELeave ) CAknNoteDialog( + CAknNoteDialog::EConfirmationTone, + CAknNoteDialog::EShortTimeout ); + dlg->ExecuteLD( R_REGISTRATION_INTERRUPTED ); + iApprovedNetwork = EFalse; + } + } + else + { + delete iDlg; + iDlg = NULL; + } + + __GSLOGSTRING("[GS] <--CGSNetworkPlugin::HandleRequestingSelectedNetworkL"); + } + + +// --------------------------------------------------------------------------- +// +// Activates the view +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::DoActivateL( const TVwsViewId& aPrevViewId , + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + __GSLOGSTRING( "[CGSNetworkPlugin] DoActivateL()|->" ); + CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + Container()->SetMiddleSoftkeyObserver( this ); + SetMiddleSoftKeyLabelL( R_CALL_MSK_CHANGE, EGSMSKCmdAppChange ); + // This way we set which command is set for MSK + iMskCommandFlag = ETrue; + iContainer->iListBox->SetTopItemIndex( iTopItemIndex ); + + if ( iCurrentItem >= 0 && + iCurrentItem < iContainer->iListBox->Model()->NumberOfItems() ) + { + iContainer->iListBox->SetCurrentItemIndexAndDraw( iCurrentItem ); + } + if ( aCustomMessageId == TUid::Uid( KGSCustomActivateNetView ) ) + { + UpdateListBoxL( EGSNetworkModeSelectionItemId, EGSManualSelectMode ); + iSearchForNetworksActive = ETrue; + iPhoneSettingsEngine->GetAvailableNetworksL(); + } + CheckMiddleSoftkeyLabelL(); + __GSLOGSTRING( "[CGSNetworkPlugin] DoActivateL()-|" ); + } + +// --------------------------------------------------------------------------- +// +// Deactivates the view +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::DoDeactivate() + { + __GSLOGSTRING("[CGSNetworkPlugin]--> DoDeactivate"); + if ( Container() ) + { + if ( Container()->iListBox && iContainer->iListBox->View() ) + { + iTopItemIndex = iContainer->iListBox->TopItemIndex(); + iCurrentItem = iContainer->iListBox->CurrentItemIndex(); + } + iAppUi->RemoveFromViewStack( *this, Container() ); + delete iContainer; + iContainer = NULL; + } + __GSLOGSTRING("[CGSNetworkPlugin] <--DoDeactivate"); + } + +// --------------------------------------------------------------------------- +// +// Shows setting page - for ON/OFF setting items +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::ShowSettingPageL( TGSNetworkItemIds aPage ) + { + __GSLOGSTRING( "[CGSNetworkPlugin::ShowSettingPageL]" ); + TInt resourceId = 0; + TInt currentItem = KGSSettingOff; + HBufC* settingPageTitle = NULL; + + switch( aPage ) + { + case EGSNetworkModeSelectionItemId: + resourceId = R_NETSL_NETSELECTMODE_LBX; + settingPageTitle = StringLoader::LoadLC( R_NETSL_NETSELECTMODE ); + currentItem = Container()->GetSelectionMode(); + break; + case EGSMCNItemId: + resourceId = R_MCN_CELL_INFO_DISP_MODE_LBX; + settingPageTitle = StringLoader::LoadLC( R_MCN_CELL_INFO_DISP_MODE ); + Container()->GetMcnValue( iMCN ); + //for MCN, values need to be switched since Off = 0 in shared data, 1 on screen + SwitchOnOffValue( iMCN ); + currentItem = iMCN; + break; + case EGSNetworkModeItemId: + resourceId = R_NET_NETWORK_MODE_LBX; + settingPageTitle = StringLoader::LoadLC( R_NET_NETWORK_MODE ); + currentItem = Container()->GetCurrentNetworkModeSelectionL(); + break; + default: + break; + } + + + + //Checking if the phone is in offline mode + const TBool iOfflineMode = IsPhoneOfflineL(); + + // If it is in offline mode, then we dont launch the NW mode setting page at all + if ( iOfflineMode /*&& aPage == EGSNetworkModeItemId*/ ) + { + HBufC* string = StringLoader::LoadLC( R_OFFLINE_MODE ); + CAknErrorNote* note = new ( ELeave ) CAknErrorNote ( ETrue ); + note->ExecuteLD( *string ); + CleanupStack::PopAndDestroy( string ); + } + else // if not offline mode we show the setting page + { + + CGSRadioButtonSettingPageItemTextArray* itemArray = + CGSRadioButtonSettingPageItemTextArray::NewL( resourceId, *iCoeEnv, NULL ); + + // network mode requires special handling as items in the settings page + // are variated. The method below checks which items to display & hide. + if ( aPage == EGSNetworkModeItemId ) + { + Container()->CheckAndAlterContentsL( *itemArray ); + } + + CleanupStack::PushL( itemArray ); + + TInt currentIndex = itemArray->IndexForFeatureIdL( currentItem ); + + // no editor resource given + iSettingDlg = new ( ELeave ) CAknRadioButtonSettingPage( + settingPageTitle, EAknSettingPageNoOrdinalDisplayed, 0, 0, + R_SETTING_PAGE, currentIndex, itemArray ); + itemArray->SetRadioButtonSettingPage( *iSettingDlg ); + + const TInt prevSelection = currentIndex; + if ( settingPageTitle ) + { + iSettingDlg->SetSettingTextL( *settingPageTitle ); + } + + //Start listening if call occurs + iPhoneSettingsEngine->SetNetSAObserver( *this ); + + __GSLOGSTRING( "[CGSNetworkPlugin::ShowSettingPageL] Executing dialog" ); + const TInt res = + iSettingDlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); + __GSLOGSTRING( "[CGSNetworkPlugin::ShowSettingPageL] Dialog closed" ); + iSettingDlg = NULL; + // Get the feature id corresponding to array index + const TGSNetworkModeItems currentFeature = IntToEnum( currentIndex ); + + if ( res ) + { + //not required for network mode UI item. + //other items require calling this method. + if (aPage != EGSNetworkModeItemId) + { + CreateNetworkSsCallL(currentFeature, aPage); + } + else if (prevSelection != currentIndex) + { + if ( iPsmActive->Mode() == EPsmsrvModePowerSave ) + { + // If PSM is on, block setting: + DisplayBlockNoteL(); + } + else + { + // Show the confirmation query. Uses TGSNetworkModeItems. + Container()->SetCurrentNetworkModeSelectionL(currentFeature); + } + } + } + CleanupStack::PopAndDestroy(itemArray); + } + //We'll update listbox for Network Mode when we're sure that phone is not + //in Offline mode + if ( aPage != EGSNetworkModeItemId ) + { + UpdateListBoxL( aPage ); + } + + CleanupStack::PopAndDestroy( settingPageTitle ); + + __GSLOGSTRING( "[CGSNetworkPlugin::ShowSettingPageL] End" ); + } + +// --------------------------------------------------------------------------- +// +// utility for converting TInt to TGSNetworkModes enum. +// +// --------------------------------------------------------------------------- +TGSNetworkModeItems CGSNetworkPlugin::IntToEnum( TInt aFeatureId ) + { + TGSNetworkModeItems mode = EGSNetworkModeDualmode; + TInt supportedNetworks = Container()->NetPluginModel()->GetSupportedNetworksL(); + TInt value = 0; + + switch( aFeatureId ) + { + case EGSNetworkModeDualmode: + mode = EGSNetworkModeDualmode; + break; + case EGSNetworkModeUMTS: + value = supportedNetworks & CGSNetworkPluginContainer::ENetFirstBit; + if ( value ) + { + mode = EGSNetworkModeUMTS; + } + else + //assume that only dual mode and gsm are possible. + { + mode = EGSNetworkModeGSM; + } + break; + case EGSNetworkModeGSM: + mode = EGSNetworkModeGSM; + break; + default: + // This should not happen as items should always have matching id. + __ASSERT_DEBUG( EFalse, User::Panic( KGSNetworkPluginAssertName, KErrArgument ) ); + } + return mode; + } + + +// --------------------------------------------------------------------------- +// +// If calls are started when in Network Setting Page, it is closed. +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::HandleCallActivatedL() + { + __GSLOGSTRING("[GS]--> CGSNetworkPlugin::HandleCallActivatedL"); + + CGSNetworkPluginContainer* container = Container(); + if ( container ) + { + const TInt currentFeatureId = container->CurrentFeatureId(); + + if ( currentFeatureId != EGSNetworkModeSelectionItemId ) + { + iPhoneSettingsEngine->CancelProcess(); + return; + } + iPhoneSettingsEngine->CancelProcess(); + //Close requesting notes + if ( iDlg ) + { + HandleSearchingNetworksL( MPsetNetworkInfoObserver::EServiceRequestNone ); + HandleRequestingSelectedNetworkL( EFalse ); + } + + //Close available network's list + if ( iNetworkPopupList ) + { + iNetworkPopupList->CancelPopup(); + iNetworkPopupList = NULL; + } + + CloseDialog(); + + } + __GSLOGSTRING("[GS] <--CGSNetworkPlugin::HandleCallActivatedL"); + } + +// --------------------------------------------------------------------------- +// +// Handles errors. +// From MPsetNetworkInfoObserver. +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::HandleNetworkErrorL( + const MPsetNetworkInfoObserver::TServiceRequest aRequest, + const TInt aError ) + { + +#ifdef _DEBUG + TBuf requestBuf; + GSNetworkDebugHelper::NetworkInfoRequestToDes( aRequest, requestBuf ); + __GSLOGSTRING2( "[CGSNetworkPlugin::HandleNetworkErrorL] %S error:%d", + &requestBuf, aError ); +#endif // _DEBUG + + TInt resourceTxt = KErrNone; + switch ( aRequest ) + { + case MPsetNetworkInfoObserver::EServiceRequestGetNetworkInfo: + iPhoneSettingsEngine->CancelProcess(); + iApprovedNetwork = EFalse; + break; + case MPsetNetworkInfoObserver::EServiceRequestSetNetworkAutomatic: + case MPsetNetworkInfoObserver::EServiceRequestSetNetwork: + default: + break; + } + + TBool ignore = EFalse; + + switch ( aError ) + { + case KErrGsmNetCauseCallActive: + ignore = ETrue; //do not show an error + break; + case KErrGsm0707NoNetworkService: + resourceTxt = R_NO_NETWORK_FOUND; + break; + case KErrGsmOfflineOpNotAllowed: + resourceTxt = R_OFFLINE_MODE; + break; + default: + resourceTxt = R_NO_NETWORK_ACCESS; + break; + } + if ( !ignore ) + { + ShowNoteL( resourceTxt, KGSErrorNote ); + iApprovedNetwork = EFalse; + } + __GSLOGSTRING("[GS] <--CGSNetworkPlugin::HandleNetworkErrorL"); + } + +// --------------------------------------------------------------------------- +// +// Check if calls are active and show note if Nw-menu is tried to be opened +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::CheckCallActiveL( TGSNetworkItemIds aItemId ) + { + __GSLOGSTRING("[GS]--> CGSNetworkPlugin::CheckCallActiveL"); + if ( iPhoneSettingsEngine->IsCallActive() == CPsetSAObserver::EPSetCallActive ) + { + ShowNoteL( R_ONGOING_CALL, KGSErrorNote ); + return; + } + + // Show network mode selection only if the mode value is already available! + if ( aItemId == EGSNetworkModeItemId && !iSettingDlg + && Container()->NetPluginModel()->GetNetworkMode() + != KGSNetworkModeCapsNotUpdated + ) + { +#ifdef FF_POWER_SAVE + if ( iPsmActive->Mode() == EPsmsrvModePowerSave ) + { + // If PSM is on, block setting: + DisplayBlockNoteL(); + } + else + { +#endif // FF_POWER_SAVE + ShowSettingPageL( EGSNetworkModeItemId ); +#ifdef FF_POWER_SAVE + } +#endif // FF_POWER_SAVE + } + else if( !iSettingDlg + //&& Container()->NetPluginModel()->GetNetworkMode() + /*!= KGSNetworkModeCapsNotUpdated*/ ) + { + ShowSettingPageL( EGSNetworkModeSelectionItemId ); + } + __GSLOGSTRING("[GS] <--CGSNetworkPlugin::CheckCallActiveL"); + } + +// --------------------------------------------------------------------------- +// +// Sets a title to a given popup list. +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::SetTitleToPopupL( CAknPopupList& aList, TInt aTitleID ) + { + HBufC* text = StringLoader::LoadLC( aTitleID ); + aList.SetTitleL( *text ); + CleanupStack::PopAndDestroy( text ); + text = NULL; + } + +// --------------------------------------------------------------------------- +// +// Sets a title to a settings page. +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::SetTitleToSettingsL( CAknRadioButtonSettingPage& aDlg, + TInt aTitleID ) + { + HBufC* title = StringLoader::LoadLC( aTitleID ); + aDlg.SetSettingTextL( *title ); + CleanupStack::PopAndDestroy( title ); + title = NULL; + } + +// --------------------------------------------------------------------------- +// +// Appends given item to given list +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::AppendItemL( CDesCArrayFlat& aList, TInt aItem ) + { + HBufC* string = StringLoader::LoadLC( aItem ); + aList.AppendL( *string ); + CleanupStack::PopAndDestroy( string ); + } + +// --------------------------------------------------------------------------- +// +// Shows a note if GPRS is active, when MCN is turned on. +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::CheckGPRSConnectionL( TInt aCurrentItem ) + { + if ( ( iPhoneSettingsEngine->IsGPRSConnected() == + CPsetSAObserver::EPSetGPRSConnectionActive ) + && ( aCurrentItem == KGSSettingOff ) ) //if trying to set On... + { + ShowNoteL( R_ACTIVE_GPRS_CONN_NOTE, KGSInformationNote ); + } + } + +// --------------------------------------------------------------------------- +// +// Set MCN value: off => on, on => off. +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::SwitchOnOffValue( TInt& aValue ) + { + if ( aValue == EGSMcnSetOn ) + { + aValue = EGSMcnSetOff; + } + else + { + aValue = EGSMcnSetOn; + } + } + +// --------------------------------------------------------------------------- +// +// Create new Net container. +// +// --------------------------------------------------------------------------- +// +void CGSNetworkPlugin::NewContainerL() + { + iContainer = new ( ELeave ) CGSNetworkPluginContainer( this ); + } + + +// --------------------------------------------------------------------------- +// CGSNetworkPlugin::HandleListBoxSelectionL +// +// Handle user selection in the listbox to perform an associated action +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::HandleListBoxSelectionL() + { + CEikMenuBar* menuBar = this->MenuBar(); + + const TInt currentFeatureId = Container()->CurrentFeatureId(); + + switch ( currentFeatureId ) + { + case EGSNetworkModeSelectionItemId: + CheckCallActiveL( EGSNetworkModeSelectionItemId ); + return; + case EGSMCNItemId: + if ( IsPhoneOfflineL() ) + { + HBufC* string = StringLoader::LoadLC( R_OFFLINE_MODE ); + CAknErrorNote* note = new ( ELeave ) CAknErrorNote ( ETrue ); + note->ExecuteLD( *string ); + CleanupStack::PopAndDestroy( string ); + } + else + { + Container()->GetMcnValue( iMCN ); + CheckGPRSConnectionL( iMCN ); + SwitchOnOffValue( iMCN ); + Container()->SetMcnValue( iMCN ); + } + break; + case EGSNetworkModeItemId: + CheckCallActiveL( EGSNetworkModeItemId ); + return; + default: + break; + } + + UpdateListBoxL( currentFeatureId ); + } + + +// --------------------------------------------------------------------------- +// +// Makes a Network/MCN Ss operation. +// +// --------------------------------------------------------------------------- +void CGSNetworkPlugin::CreateNetworkSsCallL( TInt aIndex, + TGSNetworkItemIds aPage ) + { + __GSLOGSTRING("[GS]--> CGSNetworkPlugin::CreateNetworkSsCallL"); + if ( aPage == EGSNetworkModeSelectionItemId ) + { + if ( aIndex == CGSNetworkPlugin::EAutomaticMode ) + { + MPsetNetworkSelect::TNetworkInfo info; + MPsetNetworkSelect::TSelectMode mode = + MPsetNetworkSelect::ENetSelectModeAutomatic; + iSearchForNetworksActive = ETrue; + iPhoneSettingsEngine->GetNetworkSelectMode( mode ); + if ( mode == MPsetNetworkSelect::ENetSelectModeAutomatic ) + { + iPreviousState = ETrue; + } + + //get the local variation status for auto-auto net search support + //the flag is negative... so 1 means "no search allowed". + TBool autoNetSearchOff = + Container()->NetPluginModel()->AutomaticNetworkSearchSupportedL(); + + //autoNetSearch is defaulted to 0 + if ( iPreviousState && autoNetSearchOff ) + { + PhoneIdle(); + } + else + { + info.iMode = MPsetNetworkSelect::ENetSelectModeAutomatic; + iSearchForNetworksActive = ETrue; + iPhoneSettingsEngine->SelectNetworkL( info ); + } + } + else //manual mode + { + iSearchForNetworksActive = ETrue; + iPhoneSettingsEngine->GetAvailableNetworksL(); + } + } + else // MCN Setting page + { + iMCN = aIndex; + CheckGPRSConnectionL( iMCN ); + SwitchOnOffValue( iMCN ); + Container()->SetMcnValue( iMCN ); + } + __GSLOGSTRING("[GS] <--CGSNetworkPlugin::CreateNetworkSsCallL"); + } + +// --------------------------------------------------------------------------- +// +// Shows note. +// +// --------------------------------------------------------------------------- +// +void CGSNetworkPlugin::ShowNoteL( TInt aResourceId, TInt aType ) + { + HBufC* string = StringLoader::LoadLC( aResourceId ); + switch ( aType ) + { + case KGSErrorNote: + { + CAknErrorNote* note = new ( ELeave ) CAknErrorNote ( ETrue ); + note->ExecuteLD( *string ); + break; + } + case KGSConfirmationNote: + { + CAknConfirmationNote* note = + new ( ELeave ) CAknConfirmationNote( ETrue ); + note->ExecuteLD( *string ); + break; + } + case KGSInformationNote: + { + CAknInformationNote* note = + new ( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *string ); + break; + } + default: + break; + } + CleanupStack::PopAndDestroy( string ); + } + +// --------------------------------------------------------------------------- +// +// Creates dialog, if it is does not exist yet. +// +// --------------------------------------------------------------------------- +// +void CGSNetworkPlugin::CheckAndCreateDlgL( TBool aDelayOff ) + { + if ( !iDlg ) + { + iDlg = new ( ELeave ) CAknWaitDialog( + reinterpret_cast ( &iDlg ), aDelayOff ); + } + } + +// --------------------------------------------------------------------------- +// +// Empties fetched network provider's list +// +// --------------------------------------------------------------------------- +// +void CGSNetworkPlugin::PurgeNetworkList() + { + __GSLOGSTRING("[GS]--> CGSNetworkPlugin::PurgeNetworkList"); + if ( iNetworkArray ) + { + iNetworkArray->Reset(); + delete iNetworkArray; + iNetworkArray = NULL; + } + __GSLOGSTRING("[GS] <--CGSNetworkPlugin::PurgeNetworkList"); + } + + +// --------------------------------------------------------------------------- +// CGSNetworkPlugin::Container +// +// Returns Network container item +// --------------------------------------------------------------------------- +// +CGSNetworkPluginContainer* CGSNetworkPlugin::Container() + { + return static_cast ( iContainer ); + } + +// --------------------------------------------------------------------------- +// @@see MSSSettingsRefreshObserver::AllowRefresh +// +// Notification to allow refresh from SAT +// --------------------------------------------------------------------------- +// +TBool CGSNetworkPlugin::AllowRefresh( + const TSatRefreshType aType, + const TSatElementaryFiles aFiles ) + { + __GSLOGSTRING("[GS]--> CGSNetworkPlugin::AllowRefresh"); + TBool allowRefresh = ETrue; + if ( iPhoneSettingsEngine->IsCallActive() == CPsetSAObserver::EPSetCallActive ) + { + allowRefresh = EFalse; + } + + //check that aFiles has a value before issuing a refresh command + //no need to check for a specific file... + if ( ( aType != EFileChangeNotification ) || + ( aType == EFileChangeNotification ) && + ( aFiles & KCsp1Ef || aFiles & KCsp2Ef ) ) + { + if ( iNetworkPopupList ) + { + allowRefresh = EFalse; + } + } + + __GSLOGSTRING1("[GS] AllowRefresh: allowRefresh: %d", allowRefresh); + __GSLOGSTRING("[GS] <--CGSNetworkPlugin::AllowRefresh"); + return allowRefresh; + } + + + +// --------------------------------------------------------------------------- +// @@see MSSSettingsRefreshObserver::Refresh +// +// Do the actual refresh of the UI for CSP file updation +// --------------------------------------------------------------------------- +// +void CGSNetworkPlugin::Refresh( + const TSatRefreshType aType, + const TSatElementaryFiles aFiles ) + { + __GSLOGSTRING("[GS]--> CGSNetworkPlugin::Refresh"); + // for a file change notification to be handled, aFiles must always + // contain a value + if ( ( aType != EFileChangeNotification ) || + ( aType == EFileChangeNotification ) && + ( aFiles & KCsp1Ef || aFiles & KCsp2Ef ) ) + { + //check if this check is required, as it is visible in the UI + if ( iNetworkPopupList ) + { + iNetworkPopupList->CancelPopup(); + iNetworkPopupList = NULL; + } + + //Change the network mode to Automatic. + MPsetNetworkSelect::TNetworkInfo info; + info.iMode = MPsetNetworkSelect::ENetSelectModeAutomatic; + iSearchForNetworksActive = ETrue; + TRAP_IGNORE( iPhoneSettingsEngine->SelectNetworkL( info ) ); + __GSLOGSTRING("[GS] Refresh: before Updating the listbox"); + TRAP_IGNORE( UpdateListBoxL( EGSNetworkModeSelectionItemId ) ); + __GSLOGSTRING("[GS] Refresh: after Updating the listbox"); + } + + __GSLOGSTRING("[GS] <--CGSNetworkPlugin::Refresh"); + } + + +// --------------------------------------------------------------------------- +// CGSNetworkPlugin::PhoneIdle +// +// Switch to Phone Idle view. GS is running at the background. +// --------------------------------------------------------------------------- +// +void CGSNetworkPlugin::PhoneIdle() + { + // Fetching the current Idle id + TInt idleApp; + RProperty::Get( KPSUidAiInformation, KActiveIdleUid, idleApp ); + TUid idleAppUid = { idleApp } ; + TApaTaskList taskList( iEikonEnv->WsSession() ); + TApaTask task = taskList.FindApp( idleAppUid ); + + // Expecting that idle application is open always + // if not we dont do anything + if( task.Exists() ) // App open + { + task.BringToForeground(); + } + + //No need to reset network search on exit + iSearchForNetworksActive = EFalse; + } + + +// ----------------------------------------------------------------------------- +// When this method is called, view checks based on highlight focus, if the MSK +// label is correct. +// ----------------------------------------------------------------------------- +// +void CGSNetworkPlugin::CheckMiddleSoftkeyLabelL() + { + } + + +// ----------------------------------------------------------------------------- +// Remove unnecessary commands from Middle softkey. +// @flag = ETrue means presently MSK value is "Change" so we remove that +// @flag = EFalse means presently MSK value is "Context Options" so we remove that +// ----------------------------------------------------------------------------- +// +void CGSNetworkPlugin::RemoveCommandFromMSK(const TBool flag ) + { + CEikButtonGroupContainer* cbaGroup = Cba(); + if ( cbaGroup ) + { + if ( flag ) + { + cbaGroup->RemoveCommandFromStack( + KGSMSKControlID, EGSMSKCmdAppChange ); + } + else + { + cbaGroup->RemoveCommandFromStack( + KGSMSKControlID, EAknSoftkeyContextOptions ); + } + } + } + +// --------------------------------------------------------------------------- +// Sets middle softkey label. +// --------------------------------------------------------------------------- +// +void CGSNetworkPlugin::SetMiddleSoftKeyLabelL( + const TInt aResourceId, const TInt aCommandId ) + { + CEikButtonGroupContainer* cbaGroup = Cba(); + if ( cbaGroup ) + { + HBufC* middleSKText = StringLoader::LoadLC( aResourceId ); + TPtr mskPtr = middleSKText->Des(); + cbaGroup->AddCommandToStackL( + KGSMSKControlID, + aCommandId, + mskPtr ); + CleanupStack::PopAndDestroy( middleSKText ); + } + } + +// ----------------------------------------------------------------------------- +// CGSNetworkPlugin::HandleClientRectChange +// +// +// ----------------------------------------------------------------------------- +// +void CGSNetworkPlugin::HandleClientRectChange() + { + if ( iContainer ) + { + iContainer->SetRect( ClientRect() ); + } + } + +// ========================= From CGSPluginInterface ================== + +// ----------------------------------------------------------------------------- +// CGSNetworkPlugin::GetCaptionL +// +// +// ----------------------------------------------------------------------------- +// +void CGSNetworkPlugin::GetCaptionL( TDes& aCaption ) const + { + HBufC* result = StringLoader::LoadL( R_GS_NET_VIEW_CAPTION ); + aCaption.Copy( *result ); + delete result; + } + + +// ----------------------------------------------------------------------------- +// CGSNetworkPlugin::PluginProviderCategory +// +// +// ----------------------------------------------------------------------------- +// +TInt CGSNetworkPlugin::PluginProviderCategory() const + { + //This plugin is created by 3rd party. + return KGSPluginProviderInternal; + } + +// --------------------------------------------------------------------------- +// +// Updates specific value to container. +// +// --------------------------------------------------------------------------- +// +void CGSNetworkPlugin::UpdateListBoxL( const TInt& aListItem, + const TInt aNewValue ) + { + if ( iContainer && iContainer->iListBox ) + { + Container()->UpdateListBoxL( aListItem, aNewValue ); + } + CheckMiddleSoftkeyLabelL(); + } + +// ----------------------------------------------------------------------------- +// CGSNetworkPlugin::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CGSNetworkPlugin::CreateIconL( const TUid aIconType ) + { + //EMbm + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSNetworkPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem && PhoneOnline() ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropSetNetworkSub, + fp->FullName(), + EMbmGsnetworkpluginQgn_prop_set_network_sub, + EMbmGsnetworkpluginQgn_prop_set_network_sub_mask ); + } + else if( aIconType == KGSIconTypeLbxItem /*->phone offline*/ ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropSetNetworkSub, + fp->FullName(), + EMbmGsnetworkpluginQgn_prop_set_network_sub_offline, + EMbmGsnetworkpluginQgn_prop_set_network_sub_offline_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + CleanupStack::PopAndDestroy( fp ); + return icon; + } + +// --------------------------------------------------------------------------- +// CGSNetworkPlugin::HandleNotifyPSL +// +// Handling PS keys change +// --------------------------------------------------------------------------- +// +void CGSNetworkPlugin::HandleNotifyPSL( const TUid aUid, const TInt& aKey, + const TRequestStatus& /* aStatus */ ) + { + if ( aUid == KPSUidBluetoothSapConnectionState && + aKey == KBTSapConnectionState ) + { + Visible(); + } + } + +// --------------------------------------------------------- +// CGSNetworkPlugin::IsPhoneOfflineL +// +// Checks if phone is in offline mode or not. +// Return ETrue if phone is in offline mode. +// Return EFalse if phone is not in offline mode. +// --------------------------------------------------------- +// +TBool CGSNetworkPlugin::IsPhoneOfflineL() const + { + if ( FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) ) + { + CRepository* repository = CRepository::NewLC( KCRUidCoreApplicationUIs ); + TInt connAllowed = 1; + repository->Get( KCoreAppUIsNetworkConnectionAllowed, connAllowed ); + CleanupStack::PopAndDestroy(); // repository + if ( !connAllowed ) + { + return ETrue; + } + } + return EFalse; + } + + +// ---------------------------------------------------------------------------- +// CGSNetworkPlugin::DynInitMenuPaneL() +// +// Display the dynamic menu +// ---------------------------------------------------------------------------- +void CGSNetworkPlugin::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + // show or hide the 'help' menu item when supported + if( aResourceId == R_GS_MENU_ITEM_HELP ) + { + User::LeaveIfNull( aMenuPane ); + + if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + } + + +//Disabling warning caused by err variable used inside macros +#pragma diag_suppress 550 +// ----------------------------------------------------------------------------- +// CGSNetworkPlugin::GetValue() +// +// ----------------------------------------------------------------------------- +// +void CGSNetworkPlugin::GetValue( const TGSPluginValueKeys aKey, + TDes& aValue ) + { + switch( aKey ) + { + case EGSPluginKeySettingsItemValueString: + // Operator name is async function but GetValue is synchronous. + // As a result the first GetValue call might not contain updated + // operator name. A callback will however ask to update parent plugin + // which will then call GetValue a second time and the operator name + // will then be updated. + if( !iNWSession ) + { + __GSLOGSTRING(" [CGSNetworkPlugin::GetValue] Opening iNWSession..." ); + + // Create network handling engine session. + // Question: is this callback one-shot or constant observer? + TRAPD( err, iNWSession = CreateL( *this, iNWInfo ) ); + __GSLOGSTRING1(" [CGSNetworkPlugin::GetValue] Done. Err:%d", err ); + } + aValue.Copy( iNetworkText->Des() ); + break; + default: + aValue.Append( KEmptyStr ); + break; + } + } + +//Enabling warnings +#pragma diag_default 550 +// ----------------------------------------------------------------------------- +// CGSNetworkPlugin::GetNetworkValues() +// Get network status +// qtn.cp.detail.cellular.operational / qtn.cp.detail.cellular.offline +// qtn_cp_detail_cellular_operational / qtn_cp_detail_cellular_offline +// and operator name. +// ----------------------------------------------------------------------------- +// +void CGSNetworkPlugin::UpdateNetworkTextL() + { + // On default text is 'off-line', if online status is received use, + // 'operational'. + TInt networkStatusRscId = R_CELLULAR_OFFLINE; + + if( iNetworkText ) + { + delete iNetworkText; + iNetworkText = NULL; + } + + if( PhoneOnline() ) + { + __GSLOGSTRING(" [CGSNetworkPlugin::UpdateNetworkTextL] Loading operational-text" ); + // The service provider name may missed in SIM card, so display the operator name + // which returned by NTSY here. + iNetworkText = iNWInfo.iOperatorNameInfo.iName.AllocL(); + } + else + { + __GSLOGSTRING(" [CGSNetworkPlugin::UpdateNetworkTextL] Loading offline-text" ); + networkStatusRscId = R_CELLULAR_OFFLINE; + iNetworkText = StringLoader::LoadL( networkStatusRscId ); + } + __GSLOGSTRING1( "[CGSNetworkPlugin::UpdateNetworkTextL] iNetworkText:%S ", iNetworkText ); + } + + +//Disabling warning caused by err variable used inside macros +#pragma diag_suppress 550 +// ----------------------------------------------------------------------------- +// CGSNetworkPlugin::HandleNetworkMessage +// From MNWMessageObserver. +// +// ----------------------------------------------------------------------------- +// +void CGSNetworkPlugin::HandleNetworkMessage( const TNWMessages aMessage ) + { +#ifdef _DEBUG + TBuf messageBuf; + GSNetworkDebugHelper::NetworkMessageToDes( aMessage, messageBuf ); + __GSLOGSTRING1( "[CGSNetworkPlugin::HandleNetworkMessage] %S", + &messageBuf ); +#endif // _DEBUG + + switch( aMessage ) + { + case ENWMessageNetworkInfoChange: + TRAPD + ( + err, + UpdateNetworkTextL(); + ) + __GSLOGSTRING1( + "[CGSNetworkPlugin::HandleNetworkMessage] Update network text error:%d.", + err ); + TRAPD + ( + err2, + UpdateNetworkSettingPageL(); + ) + __GSLOGSTRING1( + "[CGSNetworkPlugin::HandleNetworkMessage] Update network setting page error:%d.", + err2 ); + Parent()->UpdateView(); + break; + default: + break; + } + } + + +// ----------------------------------------------------------------------------- +// CGSNetworkPlugin::UpdateNetworkSettingPageL +// +// +// ----------------------------------------------------------------------------- +// +void CGSNetworkPlugin::UpdateNetworkSettingPageL() + { + // If network mode setting page is open, close it and open + // again so it will update the selected value correctly. + // Whoopee! Who said setting dialogs are dumb? + if( iSettingDlg && Container()->CurrentFeatureId() == EGSNetworkModeItemId ) + { + __GSLOGSTRING( "[CGSNetworkPlugin::UpdateNetworkSettingPageL] Closing and reopening dialog..." ); + CloseDialog(); + ShowSettingPageL( EGSNetworkModeItemId ); + } + } + +//Enabling warnings +#pragma diag_default 550 + +// ----------------------------------------------------------------------------- +// CGSNetworkPlugin::HandleNetworkError +// From MNWMessageObserver. +// +// ----------------------------------------------------------------------------- +// +void CGSNetworkPlugin::HandleNetworkError( const TNWOperation aOperation, + TInt aErrorCode ) + { + // Probably no need to do anything as default assumption is off-line unless + // iNWInfo.iRegistrationStatus defines otherwise. Question is, does + // iNWSession update iNWInfo values to anything sensible in case of error. +#ifdef _DEBUG + TBuf operationBuf; + GSNetworkDebugHelper::NetworkOperationToDes( aOperation, operationBuf ); + __GSLOGSTRING2( "[CGSNetworkPlugin::HandleNetworkError] %S error:%d", + &operationBuf, aErrorCode ); +#endif // _DEBUG + + // Later network operator name seems to be updated after HandleNetworkError + // so we probably want to update the name also in UI as soon as possible. + TRAP_IGNORE( UpdateNetworkTextL(); ); + + // CGSParentPlugin::DoDeactivate() will delete it's container so calling + // CGSParentPlugin::UpdateView() should not cause unnecessary container + // updates. + Parent()->UpdateView(); + } + + +// ----------------------------------------------------------------------------- +// CGSNetworkPlugin::Parent +// +// +// ----------------------------------------------------------------------------- +// +CGSParentPlugin* CGSNetworkPlugin::Parent() + { + CGSParentPlugin* parent = static_cast( + AppUi()->View( KGSConPluginUid ) ); + return parent; + } + + +// ----------------------------------------------------------------------------- +// CGSNetworkPlugin::PhoneOnline +// +// +// ----------------------------------------------------------------------------- +// +TBool CGSNetworkPlugin::PhoneOnline() + { +#ifdef _DEBUG + TBuf statusBuf; + GSNetworkDebugHelper::NetworkStatusToDes( iNWInfo.iRegistrationStatus, statusBuf ); + __GSLOGSTRING1( "[CGSNetworkPlugin::PhoneOnline] %S", &statusBuf ); +#endif // _DEBUG + + TBool online = EFalse; + switch( iNWInfo.iRegistrationStatus ) + { + case ENWRegisteredOnHomeNetwork: // Same functionality as below + case ENWRegisteredRoaming: + { + online = ETrue; + break; + } + default: + { + online = EFalse; + break; + } + } + return online; + } + + +// ----------------------------------------------------------------------------- +// CGSNetworkPlugin::CloseDialog +// +// +// ----------------------------------------------------------------------------- +// +void CGSNetworkPlugin::CloseDialog() + { + //Send ESC key sequence to setting dialog, so that it closes itself. + if ( iSettingDlg ) + { + TKeyEvent event; + event.iCode = EKeyEscape; + event.iScanCode = EStdKeyEscape; + event.iRepeats = 0; + TRAP_IGNORE( iCoeEnv->SimulateKeyEventL( event, EEventKeyDown ); + iCoeEnv->SimulateKeyEventL( event, EEventKey ); + iCoeEnv->SimulateKeyEventL( event, EEventKeyUp ); ); + } + } + +#ifdef FF_POWER_SAVE +// ---------------------------------------------------------------------------------- +// CGSDisplayPlugin::DisplayBlockNoteL() +// ---------------------------------------------------------------------------------- +void CGSNetworkPlugin::DisplayBlockNoteL() + { + HBufC* prompt = iCoeEnv->AllocReadResourceLC( + R_GS_POWER_SAVING_PROTECTED_SETTINGS_INFONOTE ); + CAknInformationNote* note = new ( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *prompt ); + CleanupStack::PopAndDestroy( prompt ); + } + +// ---------------------------------------------------------------------------------- +// CGSDisplayPlugin::UpdateOnPsmChanged() +// ---------------------------------------------------------------------------------- +void CGSNetworkPlugin::UpdateOnPsmChanged() + { + __GSLOGSTRING( "[CGSNetworkPlugin::UpdateOnPsmChanged]" ); + + if ( Container() && Container()->NetPluginModel() ) + { + Container()->NetPluginModel()->StartAsynGetCurrentNetworkModeSelectionL(); + } + } + +#endif // FF_POWER_SAVE + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginAO.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginAO.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,140 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// INCLUDE FILES +#include "GSNetworkPlugin.h" +#include "GSNetworkPluginAO.h" +#include "GsLogger.h" +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// ---------------------------------------------------------------------------------- +// CGSNetworkPluginAO::CGSNetworkPluginAO +// ---------------------------------------------------------------------------------- +CGSNetworkPluginAO::CGSNetworkPluginAO() : + CActive( EPriorityStandard ), + iPsmRepository( NULL ), + iPsmMode( -1 ), + iNetworkPluginView( NULL ) + + { + + } + + +// ---------------------------------------------------------------------------------- +// CGSNetworkPluginAO::~CGSNetworkPluginAO +// ---------------------------------------------------------------------------------- +CGSNetworkPluginAO::~CGSNetworkPluginAO() + { + Cancel(); + delete iPsmRepository; + iPsmRepository = NULL; + } + + +// ---------------------------------------------------------------------------------- +// CGSNetworkPluginAO::DoCancel +// ---------------------------------------------------------------------------------- +void CGSNetworkPluginAO::DoCancel() + { + iPsmRepository->NotifyCancel( KPsmCurrentMode ); + } + +// ---------------------------------------------------------------------------------- +// CGSNetworkPluginAO::RunL +// ---------------------------------------------------------------------------------- +void CGSNetworkPluginAO::RunL() + { + // Request complete, notify request again and get new value + iPsmRepository->Get( KPsmCurrentMode, iPsmMode ); + iPsmRepository->NotifyRequest( KPsmCurrentMode, iStatus ); + + SetActive(); + + __GSLOGSTRING1( "[CGSNetworkPluginAO::RunL] iPsmMode:%d", iPsmMode ); + + // Update network plugin view when PSM mode has changed + if ( iNetworkPluginView ) + { + iNetworkPluginView->UpdateOnPsmChanged(); + } + } + +// ---------------------------------------------------------------------------------- +// CGSNetworkPluginAO::RunError +// ---------------------------------------------------------------------------------- +TInt CGSNetworkPluginAO::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + + +// ---------------------------------------------------------------------------------- +// CGSNetworkPluginAO::NewL +// ---------------------------------------------------------------------------------- +CGSNetworkPluginAO* CGSNetworkPluginAO::NewL() + { + CGSNetworkPluginAO* self = new( ELeave ) CGSNetworkPluginAO(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------------- +// CGSNetworkPluginAO::ConstructL +// ---------------------------------------------------------------------------------- +void CGSNetworkPluginAO::ConstructL() + { + CActiveScheduler::Add ( this ); + iPsmRepository = CRepository::NewL( KCRUidPowerSaveMode ); + // Read from CenRep so iPsmMode gets correct init value + iPsmRepository->Get( KPsmCurrentMode, iPsmMode ); + iPsmRepository->NotifyRequest( KPsmCurrentMode, iStatus ); + + SetActive(); + } + + +// ---------------------------------------------------------------------------------- +// CGSNetworkPluginAO::SetView +// ---------------------------------------------------------------------------------- +void CGSNetworkPluginAO::SetView( CGSNetworkPlugin* aNetworkPluginView ) + { + iNetworkPluginView = aNetworkPluginView; + } + + +// ---------------------------------------------------------------------------------- +// CGSNetworkPluginAO::Mode +// ---------------------------------------------------------------------------------- +TInt CGSNetworkPluginAO::Mode() const + { + return iPsmMode; + } + +// End of File + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,604 @@ +/* +* Copyright (c) 2003 - 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for Network folder in GSTelPlugin. +* +*/ + + +// INCLUDE FILES +#include "GSNetworkPluginModel.h" //for CGSModel +#include "gssettingid.h" //for view IDs +#include "GSNetworkPluginContainer.h" //for CGSNetworkPluginContainer +#include "GsLogger.h" + + +#include //for CAknSettingStyleListBox +#include //for AknErrorNote +#include //for iAvkonAppUi +#include //for StringLoader +#include //for resource IDs +#include //for CPsetContainer +#include //for CPsetNetwork +#include //for listbox classes +#include +#include // for KUidGS +#include //for network mode values +#include //for GSM-specific error messages +#include //Feature Manager +#include +#include "GSNetworkDebugHelper.h" + +#ifndef RD_STARTUP_CHANGE + #include //Startup reasons +#else + #include // Startup reasons +#endif // RD_STARTUP_CHANGE + + +// LOCAL CONSTANTS +_LIT( KNameOfClass, "CGSNetworkPluginContainer" ); + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// C++ Constructor. Needed for initializing iPlugin. +// --------------------------------------------------------------------------- +CGSNetworkPluginContainer::CGSNetworkPluginContainer( CGSNetworkPlugin* aPlugin ) + :iPlugin( aPlugin ) + { + } + +// --------------------------------------------------------------------------- +// +// Symbian OS two phased constructor with pointer to Network object +// +// --------------------------------------------------------------------------- +void CGSNetworkPluginContainer::ConstructL( const TRect& aRect ) + { + iListBox = new ( ELeave ) CAknSettingStyleListBox; + + //model construction + iModel = CGSNetworkPluginModel::NewL( this, iPlugin ); + + BaseConstructL( aRect, + R_GS_NET_VIEW_TITLE, + R_NET_LBX ); + } + +// --------------------------------------------------------------------------- +// +// Destructor +// +// --------------------------------------------------------------------------- +CGSNetworkPluginContainer::~CGSNetworkPluginContainer() + { + if ( iListboxItemArray ) + { + delete iListboxItemArray; + iListboxItemArray = NULL; + } + + if( iModel ) + { + delete iModel; + iModel = NULL; + } + } + +// --------------------------------------------------------------------------- +// +// Creates list box +// +// --------------------------------------------------------------------------- +void CGSNetworkPluginContainer::ConstructListBoxL( TInt aResLbxId ) + { + __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::ConstructListBoxL"); + iListBox->ConstructL( this, EAknListBoxSelectionList ); + iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, + *iListBox, *iCoeEnv ); + iListBox->Model()->SetItemTextArray( iListboxItemArray ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + CreateListBoxItemsL(); + __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::ConstructListBoxL"); + } + +// --------------------------------------------------------------------------- +// +// Creates list box items +// +// --------------------------------------------------------------------------- +void CGSNetworkPluginContainer::CreateListBoxItemsL() + { + __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::CreateListBoxItemsL"); +// do not get check CSP if not using WINS +#ifndef __WINS__ + //Set CSP on, if it is not already + if ( !iModel->GetCSPStatus() ) + { + iModel->SetCSPActiveL( ETrue ); + } +#endif + + if ( FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) ) + { + if ( iModel->IsNetworkModeVisible() ) + { + MakeNwModeUiItemL(); + } + } + + MakeNwItemL(); + MakeMcnItemL(); + __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::CreateListBoxItemsL"); + } + +// --------------------------------------------------------------------------- +// +// Updates changed list box item +// +// --------------------------------------------------------------------------- +void CGSNetworkPluginContainer::UpdateListBoxL( TInt aFeatureId, TInt aValue ) + { + __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::UpdateListBoxL"); + switch ( aFeatureId ) + { + case EGSNetworkModeItemId: + if ( FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) ) + { + if ( iModel->IsNetworkModeVisible() ) + { + MakeNwModeUiItemL(); + } + } + break; + case EGSNetworkModeSelectionItemId: + MakeNwItemL( aValue ); + break; + case EGSMCNItemId: + MakeMcnItemL(); + break; + default: + Panic( KNameOfClass, EInvalidIndex ); + break; + } + iListBox->HandleItemAdditionL(); + __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::UpdateListBoxL"); + } + +// --------------------------------------------------------------------------- +// +// Creates new Network list box item +// +// --------------------------------------------------------------------------- +void CGSNetworkPluginContainer::MakeNwItemL( TInt aValue ) + { + __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::MakeNwItemL"); + HBufC* dynamicText = NULL; + TInt currentValue = KErrNone; + + if ( aValue != KErrNotFound ) + { + currentValue = aValue; + } + else + { + //use bogus values for WINS to avoid jamming the emulator +#ifdef __WINS__ + currentValue = EGSManualSelectMode; +#else + currentValue = GetSelectionMode(); +#endif // __WINS__ + } + + TUint32 resourceId = R_NETSL_NETSELECTMODE_LBX; + TInt featureId = EGSAutomaticSelectMode; + + if ( currentValue == EGSManualSelectMode ) + { + featureId = EGSManualSelectMode; + } + + dynamicText = CGSItemTextArray::GetItemCaptionFromFeatureIdLC( + resourceId, + featureId, + *iCoeEnv ); + +#ifndef __WINS__ + //Create network mode setting item + if ( iModel->IsSettingSupported( EGSCSPManualNetworkSelection ) ) + { +#endif + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSNetworkModeSelectionItemId, + *dynamicText ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSNetworkModeSelectionItemId, + CGSListBoxItemTextArray::EVisible ); + +#ifndef __WINS__ + } +#endif + + CleanupStack::PopAndDestroy( dynamicText ); + __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::MakeNwItemL"); + } + +// --------------------------------------------------------------------------- +// +// Gets the currently active selection mode. +// +// --------------------------------------------------------------------------- +TInt CGSNetworkPluginContainer::GetSelectionMode() + { + __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::GetSelectionMode"); + MPsetNetworkSelect::TSelectMode mode = + iModel->GetNetworkSelectionMode(); + + if ( mode == MPsetNetworkSelect::ENetSelectModeManual ) + { + __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::GetSelectionMode"); + return EGSManualSelectMode; + } + else + { + __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::GetSelectionMode"); + return EGSAutomaticSelectMode; + } + } + +// --------------------------------------------------------------------------- +// +// Creates new MCN list box item +// +// --------------------------------------------------------------------------- +void CGSNetworkPluginContainer::MakeMcnItemL() + { + __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::MakeMcnItemL"); + HBufC* dynamicText = NULL; + TInt readValue = 0; + + GetMcnValue( readValue ); + TUint32 resourceId = R_MCN_CELL_INFO_DISP_MODE_LBX; + TInt featureId = EGSMcnSetOn; + + switch ( readValue ) //resource manipulation + { + case 0: // Off should be displayed in UI + featureId = EGSMcnSetOff; + break; + case 1: // On should be displayed in UI + featureId = EGSMcnSetOn; + break; + default: + break; + } + + dynamicText = CGSItemTextArray::GetItemCaptionFromFeatureIdLC( + resourceId, + featureId, + *iCoeEnv ); + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSMCNItemId, *dynamicText ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSMCNItemId, + CGSListBoxItemTextArray::EVisible ); + + CleanupStack::PopAndDestroy( dynamicText ); + __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::MakeMcnItemL"); + } + +// --------------------------------------------------------------------------- +// +// Gets MCN value from model. +// +// --------------------------------------------------------------------------- +// +void CGSNetworkPluginContainer::GetMcnValue( TInt &aMcnValue ) + { + iModel->GetMCNSettingValue( aMcnValue ); + } + +// --------------------------------------------------------------------------- +// +// Sets MCN value from model. +// +// --------------------------------------------------------------------------- +// +void CGSNetworkPluginContainer::SetMcnValue( TInt &aMcnValue ) + { + iModel->SetMCNSettingValue( aMcnValue ); + } + + +// --------------------------------------------------------------------------- +// +// Creates network mode ui list box item +// +// --------------------------------------------------------------------------- +void CGSNetworkPluginContainer::MakeNwModeUiItemL() + { + __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::MakeNwModeUiItemL"); + HBufC* dynamicText = NULL; + + // In here KGSNetworkModeCapsNotUpdated means mode is not updated yet + if( iModel->GetNetworkMode() != KGSNetworkModeCapsNotUpdated ) + { + // Allocate value to dynamicText from the resource item + TUint32 resourceId= R_NET_NETWORK_MODE_LBX; + dynamicText = CGSItemTextArray::GetItemCaptionFromFeatureIdLC( + resourceId, GetCurrentNetworkModeSelectionL(), *iCoeEnv ); + } + else + { + _LIT( KEmpty, " "); + dynamicText = KEmpty().AllocLC ( ); + } + + // Finally, set the dynamic text + iListboxItemArray->SetDynamicTextL( EGSNetworkModeItemId, *dynamicText ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( EGSNetworkModeItemId, + CGSListBoxItemTextArray::EVisible ); + + // this variable needs to be removed from cleanup stack + CleanupStack::PopAndDestroy( dynamicText ); + __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::MakeNwModeUiItemL"); + } + + +// --------------------------------------------------------------------------- +// CGSNetworkPluginContainer::CheckAndAlterContentsL +// +// Trims non-supported variable options from the array. +// This array items are displayed as radio button setting page items +// --------------------------------------------------------------------------- +// +void CGSNetworkPluginContainer::CheckAndAlterContentsL( + CGSRadioButtonSettingPageItemTextArray& aItemArray ) + { + __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::CheckAndAlterContentsL"); + TInt value = 0; + TInt supportedNetworks = iModel->GetSupportedNetworksL(); + __GSLOGSTRING1("[GS] CheckAndAlterContentsL: supportedNetworks: %d", supportedNetworks); + + // The 0th item corresponds to DualMode. This is always available in the + // setting page, so no actions required, just make it visible. + aItemArray.SetItemVisibilityL( EGSNetworkModeDualmode, + CGSListBoxItemTextArray::EVisible ); + + // the first bit corresponds to UMTS + value = supportedNetworks & ENetFirstBit; + __GSLOGSTRING1("[GS] CheckAndAlterContentsL: (UMTS)value: %d", value); + + if ( value == EGSNetworkModeUMTS ) + { + aItemArray.SetItemVisibilityL( EGSNetworkModeUMTS, + CGSListBoxItemTextArray::EVisible ); + } + else + { + aItemArray.SetItemVisibilityL( EGSNetworkModeUMTS, + CGSListBoxItemTextArray::EInvisible ); + } + + // Get the zeroeth value (GSM) from the list + value = supportedNetworks & ENetSecondBit; + __GSLOGSTRING1("[GS] CheckAndAlterContentsL: (GSM)value: %d", value); + + if ( value == EGSNetworkModeGSM ) + { + aItemArray.SetItemVisibilityL( EGSNetworkModeGSM, + CGSListBoxItemTextArray::EVisible ); + } + else + { + aItemArray.SetItemVisibilityL( EGSNetworkModeGSM, + CGSListBoxItemTextArray::EInvisible ); + } + + __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::CheckAndAlterContentsL"); + } + +// --------------------------------------------------------------------------- +// CGSNetworkPluginContainer::GetHelpContext(TCoeHelpContext& aContext) const +// Gets Help +// +// --------------------------------------------------------------------------- +// +void CGSNetworkPluginContainer::GetHelpContext(TCoeHelpContext& aContext) const + { + aContext.iMajor = KUidGS; + aContext.iContext = KCP_HLP_NETWORK; + } + +// --------------------------------------------------------------------------- +// CGSSettListCallContainer::CurrentFeatureId() +// +// --------------------------------------------------------------------------- +// +TInt CGSNetworkPluginContainer::CurrentFeatureId( ) const + { + return iListboxItemArray->CurrentFeature( ); + } + + +void CGSNetworkPluginContainer::HandleNetworkModeChangeL() + { + UpdateListBoxL( EGSNetworkModeItemId, GetCurrentNetworkModeSelectionL() ); + + //updating value + CGSRadioButtonSettingPageItemTextArray* nwModeArray = + CGSRadioButtonSettingPageItemTextArray::NewL( + R_NET_NETWORK_MODE_LBX, + *iCoeEnv, + NULL ); + // For showing updated network mode value??? + CleanupStack::PushL( nwModeArray ); + CheckAndAlterContentsL( *nwModeArray ); + TInt currentIndex = nwModeArray->IndexForFeatureIdL( + GetCurrentNetworkModeSelectionL() ); + HBufC* buf = StringLoader::LoadL( + R_CONFIRM_NOTE_NWMODE_STRING, + nwModeArray->MdcaPoint( currentIndex ), + iEikonEnv ); + CleanupStack::PushL( buf ); + CAknConfirmationNote* note = new( ELeave ) CAknConfirmationNote( ETrue ); + note->ExecuteLD( *buf ); + CleanupStack::PopAndDestroy( buf ); + CleanupStack::PopAndDestroy( nwModeArray ); + } + + +// --------------------------------------------------------------------------- +// CGSNetworkPluginContainer::TelPluginModel +// +// Return the model pointer for use in view class +// --------------------------------------------------------------------------- +// +CGSNetworkPluginModel* CGSNetworkPluginContainer::NetPluginModel() + { + return iModel; + } + +// --------------------------------------------------------------------------- +// Sets observer for MSK label updations. +// --------------------------------------------------------------------------- +// +void CGSNetworkPluginContainer::SetMiddleSoftkeyObserver( + MGsFWMSKObserver* aObserver ) + { + if ( !iMSKObserver && aObserver ) + { + iMSKObserver = aObserver; + } + } + +// --------------------------------------------------------------------------- +// CGSNetworkPluginContainer::OfferKeyEventL +// Called when a key is pressed. +// --------------------------------------------------------------------------- +TKeyResponse CGSNetworkPluginContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + switch ( aKeyEvent.iCode ) + { + case EKeyUpArrow: + case EKeyDownArrow: + { + TKeyResponse listboxResp = + iListBox->OfferKeyEventL( aKeyEvent, aType ); + if ( iMSKObserver ) + { + iMSKObserver->CheckMiddleSoftkeyLabelL(); + } + return listboxResp; + } + case EKeyLeftArrow: + case EKeyRightArrow: + // Listbox takes all events even if it doesn't use them + return EKeyWasNotConsumed; + default: + break; + } + + return iListBox->OfferKeyEventL( aKeyEvent, aType ); + } + + +// --------------------------------------------------------------------------- +// CGSNetworkPluginContainer::GetCurrentNetworkModeSelectionL +// +// Returns the current listbox selection of network mode. +// --------------------------------------------------------------------------- +// +TGSNetworkModeItems CGSNetworkPluginContainer::GetCurrentNetworkModeSelectionL() + { + TGSNetworkModeItems featureId = EGSNetworkModeDualmode; + + switch( iModel->GetNetworkMode() ) + { + case RMmCustomAPI::KCapsNetworkModeGsm: + featureId = EGSNetworkModeGSM; + break; + + case RMmCustomAPI::KCapsNetworkModeUmts: + featureId = EGSNetworkModeUMTS; + break; + + case RMmCustomAPI::KCapsNetworkModeDual: + featureId = EGSNetworkModeDualmode; + break; + default: + // Mode might not be updated yet, in which case default is dual. + // Not a perfect solution but have to have an item selected in + // options box + featureId = EGSNetworkModeDualmode; + break; + } + +#ifdef _DEBUG + TBuf selectedModeBuf; + GSNetworkDebugHelper::NwToDes( featureId, selectedModeBuf ); + __GSLOGSTRING1( "[CGSNetworkPluginContainer::GetCurrentNetworkModeSelectionL] %S ", + &selectedModeBuf ); +#endif // _DEBUG + + iModel->CheckState( featureId ); + return featureId; + } + + +// --------------------------------------------------------------------------- +// CGSNetworkPluginContainer::SetCurrentNetworkModeSelectionL +// +// +// --------------------------------------------------------------------------- +// +void CGSNetworkPluginContainer::SetCurrentNetworkModeSelectionL( + TGSNetworkModeItems aNetworkModeLbxItem ) + { + __GSLOGSTRING1( "[CGSNetworkPluginContainer::SetCurrentNetworkModeSelectionL] Mode:%d", aNetworkModeLbxItem ); + TUint32 networkMode; + switch ( aNetworkModeLbxItem ) + { + case EGSNetworkModeGSM: //just using the index + networkMode = RMmCustomAPI::KCapsNetworkModeGsm; + break; + case EGSNetworkModeUMTS: + networkMode = RMmCustomAPI::KCapsNetworkModeUmts; + break; + case EGSNetworkModeDualmode: + default: + networkMode = RMmCustomAPI::KCapsNetworkModeDual; + break; + } + // Don't change the network mode if there is ongoing phone call + // since this will disconnect it + if ( !iModel->IsCallActive() ) + { + iModel->SetNetworkModeL( networkMode ); + iSelectedNetworkModeLbxItem = aNetworkModeLbxItem; + } + __GSLOGSTRING( "[CGSNetworkPluginContainer::SetCurrentNetworkModeSelectionL] End]" ); + } + + + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* ECOM proxy table for this plugin +* +*/ + + +// System includes +#include +#include + +// User includes +#include "GSNetworkPlugin.h" + +#ifdef FF_POWER_SAVE + #include "PSMNetworkPlugin.h" +#endif // FF_POWER_SAVE + +// Constants +const TImplementationProxy KGSNetworkPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x102824A8, CGSNetworkPlugin::NewL ) +#ifdef FF_POWER_SAVE + , + IMPLEMENTATION_PROXY_ENTRY( 0x2000B594, CPSMNetworkPlugin::NewL ) +#endif // FF_POWER_SAVE + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// +// Gate/factory function +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSNetworkPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSNetworkPluginImplementationTable; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginModel.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,747 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Model/Engine for Network Settings Plugin +* +*/ + + +// INCLUDE FILES +#include "GSNetworkPluginModel.h" +#include "GSNetworkPlugin.h" +#include "GsNetworkPlugin.hrh" +#include "GsLogger.h" //for logging traces +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include //PubSub +#include +#include "SettingsPrivateCRKeys.h" +#include +#include +#include //ongoing call check +#include "GSNetworkDebugHelper.h" +#include //for resource IDs +#include +//CONSTANTS +// default value for autolock period +// default value for Sat operations + + +_LIT( KGSNameOfClass, "CGSNetworkPluginModel" ); + +// Warning disabled as this constant is used inside __ASSERT_DEBUG +#pragma diag_suppress 177 +_LIT( KGSNetworkPluginModelAssertName, "CGSNetworkPluginModel::CheckState" ); + + +// ================= MEMBER FUNCTIONS ======================= + +// ---------------------------------------------------------------------------- +// CGSNetworkPluginModel::NewL +// +// Symbian OS two-phased constructor, overloaded version +// ---------------------------------------------------------------------------- +// +CGSNetworkPluginModel* CGSNetworkPluginModel::NewL( + CGSNetworkPluginContainer* aContainer, + CGSNetworkPlugin* aPlugin ) + { + CGSNetworkPluginModel* self = new( ELeave ) CGSNetworkPluginModel( + aContainer, + aPlugin ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CGSNetworkPluginModel::CGSNetworkPluginModel +// +// C++ default constructor can NOT contain any code, that +// might leave. +// ---------------------------------------------------------------------------- +// +CGSNetworkPluginModel::CGSNetworkPluginModel( + CGSNetworkPluginContainer* aContainer, + CGSNetworkPlugin* aPlugin ) + : iNetworkMode( KGSNetworkModeCapsNotUpdated ), + iContainer( aContainer ), + iPlugin( aPlugin ) + { + } + + +// ---------------------------------------------------------------------------- +// CGSNetworkPluginModel::ConstructL +// +// EPOC default constructor can leave. +// ---------------------------------------------------------------------------- +// +void CGSNetworkPluginModel::ConstructL() + { + ConstructBaseItemsL(); + } + +// ---------------------------------------------------------------------------- +// CGSNetworkPluginModel::ConstructBaseItemsL +// +// Constructing base items +// ---------------------------------------------------------------------------- +// +void CGSNetworkPluginModel::ConstructBaseItemsL() + { + FeatureManager::InitializeLibL(); + InitializeCentralRepositoryL(); + SetCSPActiveL( ETrue ); + iSettingsContainer = CPsetContainer::NewL(); + User::LeaveIfError( iGSVariationRepository->Get( + KSettingsVariationFlags, iLocalVariationValues ) ); +#ifndef __WINS__ + //This is currently not supported by emulator + CreatePhoneSettingsEngineL(); +#endif //__WINS__ + } + + +// ---------------------------------------------------------------------------- +// CGSNetworkPluginModel::~CGSNetworkPluginModel +// +// Destructor +// ---------------------------------------------------------------------------- +// +CGSNetworkPluginModel::~CGSNetworkPluginModel() + { + UninitializeCentralRepository(); + + if ( GetCSPStatus() ) + { + TRAP_IGNORE( SetCSPActiveL( EFalse ) ); + } + + if ( iPhoneSettingsEngine ) + { + delete iPhoneSettingsEngine; + } + + if( iSettingsContainer ) + { + delete iSettingsContainer; + } + + FeatureManager::UnInitializeLib(); + + if ( iContainer ) + { + iContainer = NULL; + } + } + +// ---------------------------------------------------------------------------- +// CGSNetworkPluginModel::InitializeCentralRepositoryL +// +// Creating and setting keys for the Central Repository +// ---------------------------------------------------------------------------- +// +void CGSNetworkPluginModel::InitializeCentralRepositoryL() + { + iNetworkRepository = CRepository::NewL( KCRUidNetworkSettings ); + iGSVariationRepository = CRepository::NewL( KCRUidSettingsVariation ); + } + +// ---------------------------------------------------------------------------- +// CGSNetworkPluginModel::UninitializeCentralRepositoryL +// +// Removes Central Repository objects +// ---------------------------------------------------------------------------- +// +void CGSNetworkPluginModel::UninitializeCentralRepository() + { + if ( iNetworkRepository ) + { + delete iNetworkRepository; + iNetworkRepository = NULL; + } + if ( iGSVariationRepository ) + { + delete iGSVariationRepository; + iGSVariationRepository = NULL; + } + } + +// ---------------------------------------------------------------------------- +// CGSNetworkPluginModel::GetCSPStatus +// +// Get Customer Service Profile status +// ---------------------------------------------------------------------------- +// +TBool CGSNetworkPluginModel::GetCSPStatus() + { + if ( iCSP ) + { + return ETrue; + } + else + { + return EFalse; + } + } + +// ---------------------------------------------------------------------------- +// CGSNetworkPluginModel::SetCSPActiveL +// +// Set Customer Service Profile active +// ---------------------------------------------------------------------------- +// +void CGSNetworkPluginModel::SetCSPActiveL( TBool aValue ) + { + if ( aValue ) + { + iCSP = CPsetCustomerServiceProfile::NewL(); + User::LeaveIfError( iCSP->OpenCSProfileL() ); + } + else + { + delete iCSP; + iCSP = NULL; + } + } + +// ---------------------------------------------------------------------------- +// CGSNetworkPluginModel::IsNetworkModeVisible +// +// Get network mode status value from shared data. +// ---------------------------------------------------------------------------- +// +TBool CGSNetworkPluginModel::IsNetworkModeVisible() + { + TBool nwModeAvailable = EFalse; + TInt value; + + iNetworkRepository->Get( KSettingsNetworkMode, value ); + + switch ( value ) + { + case 1: + nwModeAvailable = ETrue; + break; + case 0: + nwModeAvailable = EFalse; + break; + default: + break; + } + + return nwModeAvailable; + + } + +// ---------------------------------------------------------------------------- +// CGSNetworkPluginModel::IsSettingSupported +// +// Check if a given setting is supported +// ---------------------------------------------------------------------------- +// +TBool CGSNetworkPluginModel::IsSettingSupported( TInt aSettingNumber ) + { + __ASSERT_ALWAYS( iCSP != NULL, User::Panic( KGSNameOfClass, + EGSTelPluinModelPanicNullPtr ) ); + TBool settingSupported = EFalse; + TInt retVal = KErrNone; + switch ( aSettingNumber ) + { + case EGSCSPCallForward: + retVal = iCSP->IsCFSupported( settingSupported ); + break; + case EGSCSPCallBarring: + retVal = iCSP->IsCBSupported( settingSupported ); + break; + case EGSCSPCallWaiting: + retVal = iCSP->IsCWSupported( settingSupported ); + break; + case EGSCSPAlternateLine: + retVal = iCSP->IsALSSupported( settingSupported ); + break; + case EGSCSPManualNetworkSelection: + retVal = iCSP->IsNetworkSelectionSupported( settingSupported ); + break; + default: + break; + } + + if ( retVal != KErrNone ) + { + //if a CSP error occurs, by default service is available + settingSupported = ETrue; + } + + return settingSupported; + } + +// ---------------------------------------------------------------------------- +// CGSNetworkPluginModel::GetMCNSettingValue +// Gets MCN setting value +// +// ---------------------------------------------------------------------------- +// +TBool CGSNetworkPluginModel::GetMCNSettingValue( TInt& aId ) + { + TInt ret = KErrNone; + ret = iNetworkRepository->Get( KSettingsMcnDisplay, aId ); + return ret; + } + +// ---------------------------------------------------------------------------- +// CGSNetworkPluginModel::SetMCNSettingValue +// Sets MCN setting value +// +// ---------------------------------------------------------------------------- +// +TBool CGSNetworkPluginModel::SetMCNSettingValue( TInt& aId ) + { + TInt ret = KErrNone; + ret = iNetworkRepository->Set( KSettingsMcnDisplay, aId ); + return ret; + } + +// ---------------------------------------------------------------------------- +// CGSNetworkPluginModel::GetSupportedNetworksL +// +// Get supported network mode list +// ---------------------------------------------------------------------------- +// +TInt CGSNetworkPluginModel::GetSupportedNetworksL() + { + TInt supportedNetworks = KGSSettingOff; + User::LeaveIfError( iNetworkRepository-> + Get( KSettingsNetworkModeList, supportedNetworks ) ); + + return supportedNetworks; + } + +// --------------------------------------------------------- +// CGSNetworkPluginModel::GraphicalNetworkListSupportedL +// +// Check if graphical network list is supported. +// --------------------------------------------------------- +// +TBool CGSNetworkPluginModel::GraphicalNetworkListSupportedL() + { + TBool supported = EFalse; + + if ( iLocalVariationValues & EGSConfig2G3GNetworkIcon ) + { + supported = ETrue; + } + + return supported; + } + +// --------------------------------------------------------- +// CGSTelPluginModel::AutomaticNetworkSearchSupportedL +// +// Check if automatic to automatic network search is supported. +// --------------------------------------------------------- +// +TBool CGSNetworkPluginModel::AutomaticNetworkSearchSupportedL() + { + TBool supported = EFalse; + + if ( iLocalVariationValues & EGSConfigNoAutoToAutoNetworkSearch ) + { + supported = ETrue; + } + return supported; + } + + +// --------------------------------------------------------------------------- +// +// Sets network mode to member variable. +// +// --------------------------------------------------------------------------- +// +void CGSNetworkPluginModel::CreatePhoneSettingsEngineL() + { + __GSLOGSTRING("[GS]--> CGSNetworkPluginModel::CreatePhoneSettingsEngineL"); + //initialize the phone settings object for network mode + if ( !iPhoneSettingsEngine ) + { + iPhoneSettingsEngine = iSettingsContainer->CreateNetworkModeObjectL( *this ); + } + iPhoneSettingsEngine->SetNetworkModeObserver( *this ); + //CPSMNetworkPlugin will init iPlugin NULL. + if ( iPlugin == NULL ) + { + // get the current net mode synchronously + StartSynGetCurrentNetworkModeSelectionL(); + } + else + { + // get the current net mode asynchronously + StartAsynGetCurrentNetworkModeSelectionL(); + } + + __GSLOGSTRING("[GS] <--CGSNetworkPluginModel::CreatePhoneSettingsEngineL"); + } + + +// --------------------------------------------------------------------------- +// CGSNetworkPluginModel::HandleNetworkSystemModeEventsL +// +// Handles Network system mode list fetching from CustomAPI. +// Handles Network system mode setting to CustomAPI. +// Handles current network system mode fetching from CustomAPI. +// +// --------------------------------------------------------------------------- +// +void CGSNetworkPluginModel::HandleNetworkSystemModeEventsL( + const MPsetNetworkModeObserver::TServiceRequest aRequest, + const TUint32 aNetworkModeCaps ) + { +#ifdef _DEBUG + TBuf requestBuf; + GSNetworkDebugHelper::NetworkModeRequestToDes( aRequest, requestBuf ); + __GSLOGSTRING1( "[CGSNetworkPluginModel::HandleNetworkSystemModeEventsL] %S ", + &requestBuf ); +#endif // _DEBUG + + PrintState(); + + switch ( aRequest ) + { + case MPsetNetworkModeObserver::EServiceRequestGetCurrentNetworkMode: + { + TBool networkModeChanged = EFalse; + if( iNetworkMode != aNetworkModeCaps ) + { + networkModeChanged = ETrue; + iNetworkMode = aNetworkModeCaps; + } + if( networkModeChanged ) + { + if ( iContainer ) + { + iContainer->UpdateListBoxL( EGSNetworkModeItemId, 0 ); + } + // Will update nw setting page in case it is open. + if ( iPlugin ) + { + iPlugin->UpdateNetworkSettingPageL(); + } + } + } + break; + case MPsetNetworkModeObserver::EServiceRequestSetSelectedNetworkMode: + { + + /** + * Setting network mode succeeded: update actual mode: + */ + iNetworkMode = iRequestedNetworkMode; + + /** + * iNetworkMode should not be updated in case of error. + * ->update only in this success case. + * + * Problem: Currently unclear if aNetworkModeCaps contains + * valid cata in this EServiceRequestSetSelectedNetworkMode case. + * So, cannot update iNetworkMode from aNetworkModeCaps here. + * Instead use iRequestedNetworkMode manually. + */ + + if( iContainer ) + { + iContainer->HandleNetworkModeChangeL(); + } + break; + } + default: + break; + } + PrintState(); + } + + +// --------------------------------------------------------------------------- +// CGSNetworkPluginModel::HandleNetworkErrorL +// +// From MPsetNetworkModeObserver. This is called if +// EServiceRequestSetSelectedNetworkMode fails. No need to handle other cases. +// --------------------------------------------------------------------------- +// +void CGSNetworkPluginModel::HandleNetworkErrorL( + const MPsetNetworkModeObserver::TServiceRequest aRequest, + const TInt aError ) + { +#ifdef _DEBUG + TBuf requestBuf; + GSNetworkDebugHelper::NetworkModeRequestToDes( aRequest, requestBuf ); + __GSLOGSTRING2( "[CGSNetworkPluginModel::HandleNetworkErrorL] %S error:%d", + &requestBuf, aError ); +#endif // _DEBUG + + /** + * Handles failing when setting network mode. + * Requested mode is stored into a member and actual network mode is updated only + * when success is reported in HandleNetworkSystemModeEventsL/ + * EServiceRequestSetSelectedNetworkMode. + */ + switch( aRequest ) + { + case MPsetNetworkModeObserver::EServiceRequestGetCurrentNetworkMode: + break; + case MPsetNetworkModeObserver::EServiceRequestSetSelectedNetworkMode: + // Hould display error note, iNetworkMode value is still correct as + // it is not updated in case request failed. + if ( iPlugin ) + { + iPlugin->ShowNoteL( R_NO_NETWORK_ACCESS, KGSErrorNote ); + } + break; + default: + break; + } + } + +// --------------------------------------------------------------------------- +// CGSNetworkPluginModel::GetNetworkSelectionMode +// +// Gets network selection mode (automatic/manual) +// --------------------------------------------------------------------------- +// +MPsetNetworkSelect::TSelectMode CGSNetworkPluginModel::GetNetworkSelectionMode() + { + MPsetNetworkSelect::TSelectMode mode = + MPsetNetworkSelect::ENetSelectModeAutomatic; +#ifndef __WINS__ + iPhoneSettingsEngine->GetNetworkSelectMode( mode ); +#endif //__WINS__ + + return mode; + } + +// --------------------------------------------------------------------------- +// CGSNetworkPluginModel::StartAsynGetCurrentNetworkModeSelectionL +// +// --------------------------------------------------------------------------- +// +void CGSNetworkPluginModel::StartAsynGetCurrentNetworkModeSelectionL() + { + if ( iPhoneSettingsEngine ) + { + iPhoneSettingsEngine->GetCurrentNetworkModeSelectionL(); + } + } + +// --------------------------------------------------------------------------- +// CGSNetworkPluginModel::StartSynGetCurrentNetworkModeSelectionL +// +// --------------------------------------------------------------------------- +// +void CGSNetworkPluginModel::StartSynGetCurrentNetworkModeSelectionL() + { + // Connects to Etel and loads Tsy module + RMobilePhone phone; + RTelServer server; + // Custom phone. + RMmCustomAPI customPhone; + + TInt err = KErrNone; + for ( TInt a = 0; a < KPSetRetryCount; a++ ) + { + err = server.Connect(); + + if ( err == KErrNone ) + { + break; + } + + User::After( KPSetRetryTimeout ); + } + + if ( err != KErrNone ) + { + User::Leave( err ); + } + else + { + server.LoadPhoneModule( KMmTsyModuleName ); + } + User::LeaveIfError( server.SetExtendedErrorGranularity( RTelServer::EErrorExtended ) ); + + TInt numPhones; + + User::LeaveIfError( server.EnumeratePhones( numPhones ) ); + if ( !numPhones ) + { + User::Leave( KErrGeneral ); + } + + //match phone name to correct one + RTelServer::TPhoneInfo phoneInfo; + TName matchTsyName; + TInt i = 0; + for (; i < numPhones; i++) + { + User::LeaveIfError(server.GetTsyName(i, matchTsyName)); + if (matchTsyName.CompareF(KMmTsyModuleName) == 0) + { + User::LeaveIfError(server.GetPhoneInfo(i, phoneInfo)); + break; + } + } + if (i == numPhones) + { + User::Leave(KErrGeneral); + } + + //open phone subsession + User::LeaveIfError( phone.Open( server, phoneInfo.iName ) ); + User::LeaveIfError( customPhone.Open( phone ) ); + TUint32 currentNetworkModes; + customPhone.GetCurrentSystemNetworkModes( currentNetworkModes ); + iNetworkMode = (TInt)currentNetworkModes; + customPhone.Close(); + phone.Close(); + server.Close(); + } + +// --------------------------------------------------------------------------- +// CGSNetworkPluginModel::GetNetworkMode +// +// --------------------------------------------------------------------------- +// +TUint32 CGSNetworkPluginModel::GetNetworkMode() + { + /* + * This does not actually ask for the mode from phone engine as + * iPhoneSettingsEngine->GetCurrentNetworkModeSelectionL(); + * Has allready been called in constructor and afterwards we will receive + * notifications if mode changes. + */ + return iNetworkMode; + } + + +void CGSNetworkPluginModel::SetNetworkModeL( TUint32 aNetworkMode ) + { + __GSLOGSTRING1( "[GS]--> [CGSNetworkPluginModel::SetNetworkModeL]:%d", aNetworkMode ); + + // Store requested mode but iNetworkMode should not updated unless request + // succeeds. + iRequestedNetworkMode = aNetworkMode; + if( iPhoneSettingsEngine ) + { + // Cancel the ongoing operation, otherwise, the set network mode operation will + // leave with error code: KErrInUse. + if ( iPhoneSettingsEngine->IsActive() ) + { + iPhoneSettingsEngine->Cancel(); + } + iPhoneSettingsEngine->SetNetworkModeSelectionL( aNetworkMode ); + } + + __GSLOGSTRING1( "[GS]<-- [CGSNetworkPluginModel::SetNetworkModeL]:%d", aNetworkMode ); + } + + +// --------------------------------------------------------------------------- +// CGSNetworkPluginModel::PrintState +// +// --------------------------------------------------------------------------- +void CGSNetworkPluginModel::PrintState() + { +#ifdef _DEBUG + TBuf networkModeCaps; + GSNetworkDebugHelper::NwCapsToDes( iNetworkMode, networkModeCaps ); + __GSLOGSTRING1( "[CGSNetworkPluginModel::PrintState] iNetworkMode: %S ", + &networkModeCaps ); +#endif // _DEBUG + } + +// --------------------------------------------------------------------------- +// CGSNetworkPluginModel::CheckState +// For debugging +// --------------------------------------------------------------------------- +void CGSNetworkPluginModel::CheckState( TGSNetworkModeItems aMode ) + { +#ifdef _DEBUG + TBuf networkModeCaps; + GSNetworkDebugHelper::NwCapsToDes( iNetworkMode, networkModeCaps ); + TBuf networkMode; + GSNetworkDebugHelper::NwToDes( aMode, networkMode ); + + __GSLOGSTRING2( "[CGSNetworkPluginModel::CheckState] %S <-> %S", + &networkModeCaps, &networkMode ); + + switch ( iNetworkMode ) + { + case RMmCustomAPI::KCapsNetworkModeDual: + __ASSERT_DEBUG( + aMode == EGSNetworkModeDualmode, + User::Panic( KGSNetworkPluginModelAssertName, KErrArgument ) ); + break; + case RMmCustomAPI::KCapsNetworkModeUmts: + __ASSERT_DEBUG( + aMode == EGSNetworkModeUMTS, + User::Panic( KGSNetworkPluginModelAssertName, KErrArgument ) ); + break; + case RMmCustomAPI::KCapsNetworkModeGsm: + __ASSERT_DEBUG( + aMode == EGSNetworkModeGSM, + User::Panic( KGSNetworkPluginModelAssertName, KErrArgument ) ); + break; + case KGSNetworkModeCapsNotUpdated: + // Not updated yet so cannot check state. + break; + default: + __ASSERT_DEBUG( + EFalse, + User::Panic( KGSNetworkPluginModelAssertName, KErrArgument ) ); + break; + } + +#endif // _DEBUG + } + + + +TBool CGSNetworkPluginModel::IsCallActive() + { + TBool callActive = EFalse; + +#ifndef __WINS__ +//This is currently not supported by emulator + + if ( iPhoneSettingsEngine->IsCallActive() != CPsetSAObserver::EPSetNoCallsActive ) + { + callActive = ETrue; + } + +#endif //__WINS__ + + return callActive; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/Src/PSMNetworkPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/Src/PSMNetworkPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,194 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Stub imlementation +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include // KCRUidCoreApplicationUIs, TCoreAppUIsNetworkConnectionAllowed +#include "PSMNetworkPlugin.h" +#include "GSNetworkPluginModel.h" +#include "GsLogger.h" + +// CONSTANT DEFINITIONS +const TUint32 KPSMNetworkPluginStorageId = 0x2000B593; + +enum TPSMNetworkPluginKeys + { + ENetworkMode = 1, + }; + +// +// ---------------------------------------------------------------------------------- +// CPSMNetworkPlugin::CPSMNetworkPlugin() +// ---------------------------------------------------------------------------------- +// +CPSMNetworkPlugin::CPSMNetworkPlugin( TPsmPluginCTorParams& aInitParams ) : + CPsmPluginBase( aInitParams ) + { + } + +// ----------------------------------------------------------------------------- +// CPSMNetworkPlugin::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CPSMNetworkPlugin::ConstructL() + { + __GSLOGSTRING( "[GS]-->[CPSMNetworkPlugin::ConstructL]" ); + + iModel = CGSNetworkPluginModel::NewL( NULL,NULL ); + iPsmRepository = CRepository::NewL( KCRUidPowerSaveMode ); + // Read from CenRep so iPsmMode gets correct init value + TInt psmMode; + iPsmRepository->Get( KPsmCurrentMode, psmMode ); + iPsmMode = ( TPsmsrvMode )psmMode; + + __GSLOGSTRING( "[GS]<--[CPSMNetworkPlugin::ConstructL]" ); + } + +// +// ---------------------------------------------------------------------------------- +// CPSMNetworkPlugin::NewL() +// ---------------------------------------------------------------------------------- +// +// Two-phased constructor. +CPSMNetworkPlugin* CPSMNetworkPlugin::NewL( TPsmPluginCTorParams& aInitParams ) + { + CPSMNetworkPlugin* self = new ( ELeave ) CPSMNetworkPlugin( aInitParams ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ---------------------------------------------------------------------------------- +// CPSMNetworkPlugin::~CPSMNetworkPlugin() +// ---------------------------------------------------------------------------------- +// +// Destructor. +CPSMNetworkPlugin::~CPSMNetworkPlugin() + { + __GSLOGSTRING( "[CPSMNetworkPlugin::~CPSMNetworkPlugin]" ); + delete iModel; + iModel = NULL; + delete iPsmRepository; + iPsmRepository = NULL; + } + +// --------------------------------------------------------- +// CPSMNetworkPlugin::IsPhoneOfflineL +// +// Checks if phone is in offline mode or not. +// Return ETrue if phone is in offline mode. +// Return EFalse if phone is not in offline mode. +// --------------------------------------------------------- +// +TBool CPSMNetworkPlugin::IsPhoneOfflineL() const + { + if ( FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) ) + { + CRepository* repository = CRepository::NewLC( KCRUidCoreApplicationUIs ); + TInt connAllowed = 1; + repository->Get( KCoreAppUIsNetworkConnectionAllowed, connAllowed ); + CleanupStack::PopAndDestroy(); // repository + if ( !connAllowed ) + { + return ETrue; + } + } + return EFalse; + } + +// ---------------------------------------------------------------------------------- +// CPSMNetworkPlugin::NotifyModeChange() +// ---------------------------------------------------------------------------------- +// +void CPSMNetworkPlugin::NotifyModeChange( const TInt aMode ) + { + TInt err = KErrNone; + TRAP( err, DoModeChangeL( aMode ) ); + if ( KErrNone != err) + {} + __GSLOGSTRING2( "[CPSMNetworkPlugin::NotifyModeChange]: Mode:%d Err:%d", aMode, err ); + } + + +// ---------------------------------------------------------------------------------- +// CPSMNetworkPlugin::NotifyModeChange() +// ---------------------------------------------------------------------------------- +// +void CPSMNetworkPlugin::DoModeChangeL( const TInt aMode ) + { + TPsmsrvMode newMode = ( TPsmsrvMode )aMode; + if ( !IsPhoneOfflineL() && + FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) && + iModel->IsNetworkModeVisible() && IsChangeNetworkMode ( iPsmMode, newMode ) ) + { + RConfigInfoArray infoArray; + + TPsmsrvConfigInfo info1; + info1.iConfigId = ENetworkMode; + info1.iConfigType = EConfigTypeInt; + info1.iIntValue = iModel->GetNetworkMode(); + infoArray.Append( info1 ); + + __GSLOGSTRING1( "[CPSMNetworkPlugin::NotifyModeChangeL] Switching to mode:%d", aMode ); + + __GSLOGSTRING1( "[CPSMNetworkPlugin::NotifyModeChangeL]: oldValue info1: %d", infoArray[0].iIntValue ); + + iSettingsProvider.BackupAndGetSettingsL( infoArray, KPSMNetworkPluginStorageId ); + + __GSLOGSTRING1( "[CPSMNetworkPlugin::NotifyModeChangeL]: newValue info1: %d", infoArray[0].iIntValue ); + + // Don't change the network mode if there is ongoing phone call + // since this will disconnect it + if ( !iModel->IsCallActive() ) + { + iModel->SetNetworkModeL ( infoArray[0].iIntValue ); + } + + infoArray.Reset(); + } + } + +// ---------------------------------------------------------------------------------- +// CPSMNetworkPlugin::IsChangeNetworkMode +// ---------------------------------------------------------------------------------- +// +TBool CPSMNetworkPlugin::IsChangeNetworkMode( TPsmsrvMode& aOldMode, TPsmsrvMode aNewMode ) + { + TPsmsrvMode oldMode = aOldMode; + aOldMode = aNewMode; + if ( ( oldMode == EPsmsrvModeNormal && aNewMode == EPsmsrvPartialMode ) + || ( oldMode == EPsmsrvModePowerSave && aNewMode + == EPsmsrvPartialMode ) ) + { + return EFalse; + } + else + { + return ETrue; + } + } + +//End of File + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSNetworkPlugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSNetworkPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsnetworkplugin.iby ) +../rom/GSNetworkPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsnetworkpluginresources.iby ) +loc/GsNetworkPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsnetworkplugin.loc ) + +#ifdef FF_POWER_SAVE + // PSM Config files for emulator use + Data/2000B593.xml /epoc32/release/winscw/urel/z/private/2000b187/2000b593.xml + Data/2000B593.xml /epoc32/release/winscw/udeb/z/private/2000b187/2000b593.xml + + // PSM Config files for HW use + Data/2000B593.xml /epoc32/data/z/private/2000b187/2000b593.xml +#endif // FF_POWER_SAVE + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gsnetworkplugin.mif + OPTION HEADERFILE gsnetworkplugin.mbg + OPTION SOURCES \ + -c8,8 qgn_prop_set_network_sub -c8,8 qgn_prop_set_network_sub_offline -c8,8 qgn_prop_set_network_tab4 \ + -c8,1 qgn_prop_network_3g -c8,1 qgn_prop_network_2g \ + -c8,8 qgn_prop_nfc_sess_closed +END + + +PRJ_MMPFILES +GSNetworkPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSNetworkPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSNetworkPlugin/loc/GsNetworkPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSNetworkPlugin/loc/GsNetworkPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,168 @@ +/* +* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSNetworkPlugin. +* +*/ + + +// LOCALISATION STRINGS + +//d: title for call settings folder +//l: list_single_large_graphic_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_folder_network "Network" + +//CELLULAR NETWORK FOLDER +//d: title to network settings folder in gs folder +//l: title_pane_t2/opt9 +// +#define qtn_set_title_settings_network "GSM network settings" + +//d: first item in network settings folder +//l: list_setting_pane_t1 +// +#define qtn_netsl_netselect "Network selection" + +//d: network selection setting page option "manual" +//l: list_set_graphic_pane_t1 +// +#define qtn_netsl_manual "Manual" + +//d: network selection setting page option "automatic" +//l: list_set_graphic_pane_t1 +// +#define qtn_netsl_automatic "Automatic" + +//d: network selection setting page heading +//l: list_setting_pane_t1 +// +#define qtn_netsl_netselectmode "Network selection mode:" + +//d: heading when networks are retrieved +//l: heading_pane_t1 +// +#define qtn_netsl_foundoperators "Found operators:" + +//d: mcn display settings item turned on +//l: list_set_graphic_pane_t1 +// +#define qtn_mcn_sett_off "Off" + +//d: mcn display settings item turned on +//l: list_set_graphic_pane_t1 +// +#define qtn_mcn_sett_on "On" + +//d: wait note text when searching for networks +//l: popup_note_wait_window +// +#define text_searching "Searching..." + +//d: error note text when networks were searched, but nothing was found +//l: popup_note_window +// +#define text_no_networks_found "No network found" + +//d: error note text when user is about to change network mode but there +//d: is an ongoing call +//l: popup_note_window +// +#define text_call_in_progress "Call in progress" + +//d: error note text when user has changed MCN on and there's a GPRS +//d: connection active +//l: popup_note_window +// +#define qtn_mcn_info_not_received "Cell info may not always be shown while packet data connection is active" + +//d: mcn display settings item heading +//l: list_setting_pane_t1 +// +#define qtn_mcn_control "Cell info display " + +//d: first item in network settings folder +//l: list_setting_pane_t1 +// +#define qtn_set_network_mode "Network Mode" + +//d: network mode ui setting page option "GSM" +//l: list_set_graphic_pane_t1 +// +#define qtn_network_mode_gsm "GSM" + +//d: network mode ui setting page option "UMTS" +//l: list_set_graphic_pane_t1 +// +#define qtn_network_mode_umts "UMTS" + +//d: network mode ui setting page option "Dual mode" +//l: list_set_graphic_pane_t1 +// +#define qtn_network_mode_dual "Dual mode" + +//d:Text of a list item in Network setting list view's list +// d: Confirmation for Network mode selection operation. +// l: popup_note_window +//w: +//r: 3.1 +#define qtn_network_mode_note "Network mode %U selected." + +//SERVICE REQUEST STUFF + +//d: text to confirmation note when roaming network selected +//d: %U is the name of the network +//l: popup_note_window +// +#define qtn_netsl_networkselected "Selected network: %U" + +//d: text to error note when error encountered +//d: when trying to register into network +//l: popup_note_window +// +#define text_no_access "No access" + +//d: text to confirmation note when home network selected +//l: popup_note_window +// +#define text_hplmn_selected "Home network selected" + +//d: text to confirmation note registration to network cancelled +//l: popup_note_window +// +#define qtn_netsl_registration_interrup "Registration interrupted" + +//d: Network operational and operator name text in lbx item 2nd row. +//d: U% is the name of the operator. +//l: list_double_large_graphic_pane_t2 +// +//#define qtn_cp_detail_cellular_operational "Operational, %U" + +//d: Network off-line text in lbx item 2nd row. +//l: list_double_large_graphic_pane_t2 +// +#define qtn_cp_detail_cellular_offline "Off-line" + +//CONTROL PANEL + +//d:Text when settings item is blocked. +//l:popup_note_window +//w: +//r:5.1 +// +#define qtn_power_saving_protected_settings_infonote "Power saving is active. Unable to edit." + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSOpticalJoystickPlugin/Data/1028331A.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/Data/1028331A.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for Optical Joystick Settings Plugin. +* +*/ + +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x1028331A; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x1028331B; + version_no = 1; + display_name = "Optical Joystick Settings Plugin"; + default_data = "0x10283317";// Parent UID + opaque_data = "15";//Order number + } + }; + } + }; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSOpticalJoystickPlugin/Data/GSOpticalJoystickPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/Data/GSOpticalJoystickPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,173 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for Optical Joystick +* +*/ + + +// RESOURCE IDENTIFIER +NAME OptJ // 4 letter ID + +// INCLUDES +#include "GSOpticalJoystickPlugin.hrh" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// CONSTANTS + +// RESOURCE DEFINITIONS + +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + + +RESOURCE TBUF + { + buf="OptJ"; + } + +//---------------------------------------------------- +// +// EIK_APP_INFO +// It contains application information. +// +//---------------------------------------------------- +// +RESOURCE EIK_APP_INFO + { + } + + +//---------------------------------------------------- +// r_gs_opticaljoystick_view_caption +// +// Data call view caption for plugin +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_opticaljoystick_view_caption + { + buf = qtn_set_optical_joystick; + } + +//---------------------------------------------------- +// +// r_gs_csd_view_title +// Data call view's title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_opticaljoystick_view_title + { + txt = qtn_set_optical_joystick; + } + +//---------------------------------------------------- +// +// r_gs_dcall_view +// Data call view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_opticaljoystick_view + { + menubar = r_gs_menubar_change_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE; + } + + +//---------------------------------------------------- +// +// r_dcall_lbx +// Data call view's listbox. +// +//---------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_opticaljoystick_lbx + { + items = + { + GS_FEATURE + { + txt = " \t"qtn_set_optical_joystick"\t\t"; + item = KGSSettIdOptJoyst; + } + }; + } + +//---------------------------------------------------- +// +// r_opticaljoystick_setting_page +// Optical joystick setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_opticaljoystick_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_set_optical_joystick; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +//---------------------------------------------------- +// +// r_opticaljoystick_setting_page_lbx +// Optical joystick setting page's listbox. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_opticaljoystick_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_set_optical_joystick_off; + }, + LBUF + { + txt = qtn_set_optical_joystick_on; + } + }; + } + +RESOURCE TBUF r_optical_joystick_on + { + buf = qtn_set_optical_joystick_on; + } + +RESOURCE TBUF r_optical_joystick_off + { + buf = qtn_set_optical_joystick_off; + } + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSOpticalJoystickPlugin/GSOpticalJoystickPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/GSOpticalJoystickPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification file. +* +*/ + + +#include // For RESOURCE_FILES_DIR +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gsopticaljoystickplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x1028331A +VENDORID VID_DEFAULT + + +SOURCEPATH Src +SOURCE GSOpticalJoystickPluginImplementationTable.cpp +SOURCE GSOpticalJoystickPluginContainer.cpp +SOURCE GSOpticalJoystickPlugin.cpp + + +//User include paths +USERINCLUDE Inc +USERINCLUDE Data // For *.rh +USERINCLUDE loc +USERINCLUDE ../Logger +USERINCLUDE ../Data // For GSCommonResources.rss + +//System include paths +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/cshelp +// Default system include paths for middleware layer modules. +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH Data + +START RESOURCE 1028331A.rss +TARGET gsopticaljoystickplugin.rsc +END + +START RESOURCE GSOpticalJoystickPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY egul.lib +LIBRARY eikdlg.lib // eikon dialogs +LIBRARY commdb.lib +LIBRARY centralrepository.lib + +LIBRARY commonengine.lib // For RConeResourceLoader +LIBRARY featmgr.lib // Feature manager +LIBRARY aknskinsrv.lib // for enhanced skinning +LIBRARY aknskins.lib // for enhanced skinning +LIBRARY hlplch.lib // for "Help" options menu +LIBRARY gsframework.lib // For base classes +LIBRARY gslistbox.lib // For CGSListBoxItemTextArray +LIBRARY flogger.lib // For GSLogger +LIBRARY gsecomplugin.lib + +// End of File \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,175 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View for GSOpticalJoystickPlugin +* +*/ + +#ifndef GSOPTICALJOYSTICKPLUGIN_H +#define GSOPTICALJOYSTICKPLUGIN_H + +// INCLUDES +#include +#include +#include +#include + + +//CONSTANTS +const TUid KGSOpticalJoystickPluginUid = { 0x1028331B }; +_LIT( KGSOpticalJoystickPluginIconDirAndName, "z:GSOpticalJoystickPlugin.mbm"); // Use KDC_BITMAP_DIR + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CAknViewAppUi; +class CGSOpticalJoystickPluginContainer; +class CGSOpticalJoystickPluginModel; + +// CLASS DEFINITION +/** +* CGSOpticalJoystickPlugin view class for data call settings +* @since Series 60_3.1 +* +*/ +class CGSOpticalJoystickPlugin : public CGSBaseView, + public MAknSettingPageObserver + { + public: + enum TGSSettingIds + { + KGSOpticalJoystickSettingId + }; + + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return GS connection view. + */ + static CGSOpticalJoystickPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor + */ + ~CGSOpticalJoystickPlugin(); + + public: // From CGSPluginInterface + + /** + * @see CGSPluginInterface header file. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * @see CGSPluginInterface header file. + */ + TInt PluginProviderCategory() const; + + /** + * @see CGSPluginInterface header file. + */ + TBool Visible() const; + + public: // from MAknSettingPageObserver + + /** + * Handle setting page events + */ + virtual void HandleSettingPageEventL( CAknSettingPage* aSettingPage, + TAknSettingPageEvent aEventType ); + + public: // from base classes + + /** + * Returns view id. + * @return TUid + */ + TUid Id() const; + + /** + * Handles commands. + * @param aCommand Command to be handled. + * + */ + void HandleCommandL( TInt aCommand ); + + public: // new + + /** + * Updates listbox's item's value. + * @param aItemId An item which is updated. + * + */ + void UpdateListBoxL( TInt aItemId ); + + /** + * Get CGSOpticalJoystickPlugin's ccontainer. + */ + CGSOpticalJoystickPluginContainer* Container(); + + protected: // From CAknView + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + void DoDeactivate(); + + protected: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + protected: + + /** + * C++ default constructor. + */ + CGSOpticalJoystickPlugin(); + + /** + * Symbian OS default constructor. + * + */ + void ConstructL(); + + void HandleClientRectChange(); + + private: // from CGSBaseView + + void NewContainerL(); + void HandleListBoxSelectionL(); + + private: // new methods + + /** + * Display dialup auto disconnect setting page. + */ + void ShowSettingPageL(); + + private: + // resource loader + RConeResourceLoader iResourceLoader; + + }; + +#endif //GSOPTICALJOYSTICKPLUGIN_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPlugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPlugin.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains common definitions for menu id:s +* +*/ + + +#ifndef GSOPTICALJOYSTICKPLUGIN_HRH +#define GSOPTICALJOYSTICKPLUGIN_HRH + +// commands +enum TGSOpticalJoystickMenuCommands + { + EAppCmdChange = 1 + }; + + +enum TSettingId + { + KGSSettIdOptJoyst + }; + +#endif // GSOPTICALJOYSTICKPLUGIN_HRH + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPluginContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPluginContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,107 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for Optical Joystick +* +*/ + + +#ifndef GSOPTICALJOYSTICKPLUGINCONTAINER_H +#define GSOPTICALJOYSTICKPLUGINCONTAINER_H + +// INCLUDES +#include +#include + +#include "gssettingid.h" + +// FORWARD DECLARATION +class CGSListBoxItemTextArray; +class CRepository; + +// CLASS DECLARATION + +/** +* CGSOpticalJoystickPluginContainer container class +* @since Series 60_3.1 +* +*/ +class CGSOpticalJoystickPluginContainer : public CGSBaseContainer + { + public: // Constructors and destructor + + /** + * Symbian OS constructor. + * @param aRect Listbox's rect. + * + */ + void ConstructL( const TRect& aRect ); + + /** + * Destructor. + */ + ~CGSOpticalJoystickPluginContainer(); + + public: //new + + /** + * Updates listbox's item's value. + * @param aFeatureId An item which is updated. + * + */ + void UpdateListBoxL( TInt aFeatureId ); + + /** + * Retrieves the currently selected listbox feature id + * @return feature id. + */ + TInt CurrentFeatureId() const; + + /** + * Set the status of optical joystick + * @param aStatus Status of the optical joystick. + */ + void GetOpticalJoystickStatus(TInt& aStatus); + + /** + * Set the status of optical joystick + * @param aStatus Status of the optical joystick to be set to. + */ + void SetOpticalJoystickStatusL(TInt aStatus); + + protected: // from CGSBaseContainer + void ConstructListBoxL( TInt aResLbxId ); + + private: // new + void CreateListBoxItemsL(); + void MakeFocusedItemContentL(); + + private: + /** + * Required for help. + * + */ + void GetHelpContext( TCoeHelpContext& aContext ) const; + + private: // data + //Auto disconnect list item + CDesCArrayFlat* iAutodisconValue; + //Listbox item array model + CGSListBoxItemTextArray* iListboxItemArray; + //Repository to access optical joystick status + CRepository* iPersonalizationRepository; + }; + +#endif //GSOPTICALJOYSTICKPLUGINCONTAINER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -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: View for Optical joystick +* +*/ + + +// INCLUDE FILES +#include "GSOpticalJoystickPlugin.h" +#include "GSOpticalJoystickPluginContainer.h" +#include "GSOpticalJoystickPlugin.hrh" +#include "GsLogger.h" +#include // Icons +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // For HlpLauncher + +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +_LIT( KGSOpticalJoystickPluginResourceFileName, "z:GSOpticalJoystickPluginRsc.rsc" ); + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS ============================== + +// ========================= MEMBER FUNCTIONS ================================ + +// ---------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::CGSOpticalJoystickPlugin() +// +// Constructor +// ---------------------------------------------------------------------------- +// +CGSOpticalJoystickPlugin::CGSOpticalJoystickPlugin() + : iResourceLoader( *iCoeEnv ) + { + } + + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::NewL() +// +// Symbian OS default constructor +// --------------------------------------------------------------------------- +CGSOpticalJoystickPlugin* CGSOpticalJoystickPlugin::NewL( TAny* /*aInitParams*/ ) + { + CGSOpticalJoystickPlugin* self = new( ELeave ) CGSOpticalJoystickPlugin (); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::ConstructL() +// +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +void CGSOpticalJoystickPlugin::ConstructL() + { + FeatureManager::InitializeLibL(); + // Find the resource file + TParse parse; + parse.Set( KGSOpticalJoystickPluginResourceFileName, + &KDC_RESOURCE_FILES_DIR, NULL ); + TFileName fileName( parse.FullName() ); + + // Get language of resource file + BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName ); + + // Open resource file + iResourceLoader.OpenL( fileName ); + + BaseConstructL( R_GS_OPTICALJOYSTICK_VIEW ); + } + + +// ---------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::~CGSOpticalJoystickPlugin +// +// Destructor +// ---------------------------------------------------------------------------- +CGSOpticalJoystickPlugin::~CGSOpticalJoystickPlugin() + { + FeatureManager::UnInitializeLib(); + iResourceLoader.Close(); + } + + +// --------------------------------------------------------------------------- +// TUid CGSOpticalJoystickPlugin::Id() +// +// Returns view's ID. +// --------------------------------------------------------------------------- +TUid CGSOpticalJoystickPlugin::Id() const + { + return KGSOpticalJoystickPluginUid; + } + + +// ========================= From CGSPluginInterface ================== + +// ---------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::GetCaption +// +// Return application/view caption. +// ---------------------------------------------------------------------------- +// +void CGSOpticalJoystickPlugin::GetCaptionL( TDes& aCaption ) const + { + // the resource file is already opened. + HBufC* result = StringLoader::LoadL( R_GS_OPTICALJOYSTICK_VIEW_CAPTION ); + + aCaption.Copy( *result ); + delete result; + } + + +// ---------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::PluginProviderCategory +// +// A means to identify the location of this plug-in in the framework. +// ---------------------------------------------------------------------------- +// +TInt CGSOpticalJoystickPlugin::PluginProviderCategory() const + { + //To identify internal plug-ins. + return KGSPluginProviderInternal; + } + + +// ---------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::Visible +// +// Provides the visibility status of self to framework. +// ---------------------------------------------------------------------------- +// +TBool CGSOpticalJoystickPlugin::Visible() const + { + if( FeatureManager::FeatureSupported( 193 /* KFeatureIdFfOfnFeature */) ) + { + return ETrue; + } + else + { + return EFalse; + } + } + + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::HandleCommandL(TInt aCommand) +// +// Handles commands directed to this class. +// --------------------------------------------------------------------------- +void CGSOpticalJoystickPlugin::HandleCommandL( TInt aCommand ) + { + switch ( aCommand ) + { + case EGSMSKCmdAppChange: + case EGSCmdAppChange: + HandleListBoxSelectionL(); + break; + case EAknSoftkeyBack: + iAppUi->ActivateLocalViewL( KGSDeviceManagementPluginUid ); + break; + case EAknCmdHelp: + { + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), iAppUi->AppHelpContextL() ); + } + break; + } + default: + iAppUi->HandleCommandL( aCommand ); + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::UpdateListBoxL +// +// Updates listbox items. +// --------------------------------------------------------------------------- +// +void CGSOpticalJoystickPlugin::UpdateListBoxL( TInt aItemId ) + { + if( Container() ) + { + Container()->UpdateListBoxL( aItemId ); + } + } + + +// ---------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::Container +// +// Return handle to container class. +// ---------------------------------------------------------------------------- +// +CGSOpticalJoystickPluginContainer* CGSOpticalJoystickPlugin::Container() + { + return static_cast( iContainer ); + } + + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::NewContainerL() +// +// Creates new iContainer. +// --------------------------------------------------------------------------- +// +void CGSOpticalJoystickPlugin::NewContainerL() + { + iContainer = new( ELeave ) CGSOpticalJoystickPluginContainer; + } + + +// ---------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::DoActivateL +// +// First method called by the Avkon framwork to invoke a view. +// ---------------------------------------------------------------------------- +// +void CGSOpticalJoystickPlugin::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + } + + +// ---------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::DoDeactivate +// +// Called by the Avkon view framework when closing. +// ---------------------------------------------------------------------------- +// +void CGSOpticalJoystickPlugin::DoDeactivate() + { + CGSBaseView::DoDeactivate(); + } + + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::HandleListBoxSelectionL() +// +// Handles events raised through a rocker key. +// --------------------------------------------------------------------------- +void CGSOpticalJoystickPlugin::HandleListBoxSelectionL() + { + const TInt currentFeatureId = Container()->CurrentFeatureId(); + + switch ( currentFeatureId ) + { + case KGSSettIdOptJoyst: + ShowSettingPageL(); + break; + default: + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::HandleSettingPageEventL +// +// Handle any setting page related events +// --------------------------------------------------------------------------- +// +void CGSOpticalJoystickPlugin::HandleSettingPageEventL( CAknSettingPage* /*aSettingPage*/, + TAknSettingPageEvent /*aEventType*/ ) + { + } + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::ShowDialupAutodisconSettingPageL +// +// Display dialup auto disconnect setting page. +// --------------------------------------------------------------------------- +// +void CGSOpticalJoystickPlugin::ShowSettingPageL() + { + TInt currentValue; // This value should be got from Hardware + TInt err = 0; + + Container()->GetOpticalJoystickStatus( currentValue ); + + __GSLOGSTRING1("[CGSOpticalJoystickPlugin]--> ShowSettingPageL(), value: %d", currentValue ); + + CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( + R_OPTICALJOYSTICK_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + + CAknRadioButtonSettingPage* dlg = new( ELeave ) CAknRadioButtonSettingPage( + R_OPTICALJOYSTICK_SETTING_PAGE, + currentValue, items ); + + dlg->SetSettingId( KGSOpticalJoystickSettingId ); + dlg->SetSettingPageObserver( this ); + + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { + Container()->SetOpticalJoystickStatusL( currentValue ); + + __GSLOGSTRING1("[CGSOpticalJoystickPlugin]--> ShowSettingPageL(), value: %d", currentValue); + + UpdateListBoxL( KGSSettIdOptJoyst ); + } + + CleanupStack::PopAndDestroy( items ); + } + +// ----------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CGSOpticalJoystickPlugin::CreateIconL( const TUid aIconType ) + { + //EMbm + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSOpticalJoystickPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropCpOptiJoystick, + fp->FullName(), + EMbmGsopticaljoystickpluginQgn_prop_cp_opti_joystick, + EMbmGsopticaljoystickpluginQgn_prop_cp_opti_joystick_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + CleanupStack::PopAndDestroy( fp ); + + return icon; + } + + +// ----------------------------------------------------------------------------- +// CGSOpticalJoystickPlugin::DynInitMenuPaneL() +// +// dynamically handle help item if not supported +// ----------------------------------------------------------------------------- +// +void CGSOpticalJoystickPlugin::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + if( aResourceId == R_GS_MENU_ITEM_HELP ) + { + User::LeaveIfNull( aMenuPane ); + + if ( FeatureManager::FeatureSupported( KFeatureIdHelp )) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPluginContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPluginContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,226 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for GSOpticalJoystickPlugin +* +*/ + + +// INCLUDE FILES +#include "GSOpticalJoystickPluginContainer.h" +#include "GSOpticalJoystickPlugin.hrh" +#include "GsLogger.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// These enumations could be found in ofn_hal_groups.h +/** + * The OFN HAL group +*/ +enum + { + EHalGroupOFN = 28 + }; + +/** + * Supported HAL functions + * +*/ +enum TOFNHalFunction + { + EOFNSetPowerON, // OFN Powering (ON/OFF) + EOFNGetPowerState // For reading power state + }; + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPluginContainer::ConstructL() +// +// Symbian OS two phased constructor +// --------------------------------------------------------------------------- +// +void CGSOpticalJoystickPluginContainer::ConstructL( const TRect& aRect ) + { + iPersonalizationRepository = CRepository::NewL( KCRUidPersonalizationSettings ); + + iListBox = new( ELeave ) CAknSettingStyleListBox; + + BaseConstructL( aRect, R_GS_OPTICALJOYSTICK_VIEW_TITLE, R_OPTICALJOYSTICK_LBX ); + } + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPluginContainer::~CGSOpticalJoystickPluginContainer() +// +// Destructor +// --------------------------------------------------------------------------- +// +CGSOpticalJoystickPluginContainer::~CGSOpticalJoystickPluginContainer() + { + delete iAutodisconValue; + delete iListboxItemArray; + if ( iPersonalizationRepository ) + { + delete iPersonalizationRepository; + iPersonalizationRepository = NULL; + } + } + + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPluginContainer::ConstructListBoxL() +// +// Construct the listbox from resource array. +// --------------------------------------------------------------------------- +// +void CGSOpticalJoystickPluginContainer::ConstructListBoxL( TInt aResLbxId ) + { + iListBox->ConstructL( this, EAknListBoxSelectionList ); + + iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, + *iListBox, *iCoeEnv ); + iListBox->Model()->SetItemTextArray( iListboxItemArray ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + CreateListBoxItemsL(); + } + + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPluginContainer::CreateListBoxItemsL() +// +// Create listbox items. +// --------------------------------------------------------------------------- +// +void CGSOpticalJoystickPluginContainer::CreateListBoxItemsL() + { + MakeFocusedItemContentL(); + } + + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPluginContainer::UpdateListBoxL() +// +// Update listbox item. +// --------------------------------------------------------------------------- +// +void CGSOpticalJoystickPluginContainer::UpdateListBoxL( TInt aFeatureId ) + { + switch( aFeatureId ) + { + case KGSSettIdOptJoyst: + MakeFocusedItemContentL(); + break; + default: + break; + } + + iListBox->HandleItemAdditionL(); + } + + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPluginContainer::MakeAutodisconItemL() +// +// Create auto disconnect list item +// --------------------------------------------------------------------------- +// +void CGSOpticalJoystickPluginContainer::MakeFocusedItemContentL() + { + TInt currentStatus = 0; + GetOpticalJoystickStatus( currentStatus); + __GSLOGSTRING1("[CGSOpticalJoystickPluginContainer]--> MakeFocusedItemContentL(), value: %d", currentStatus); + + HBufC* buf = NULL; + switch( currentStatus ) + { + case 1: + buf = iEikonEnv->AllocReadResourceL( R_OPTICAL_JOYSTICK_ON ); + break; + case 0: + buf = iEikonEnv->AllocReadResourceL( R_OPTICAL_JOYSTICK_OFF ); + break; + default: + buf = iEikonEnv->AllocReadResourceL( R_OPTICAL_JOYSTICK_OFF ); + break; + } + + TPtr bufPtr( buf->Des() ); + iListboxItemArray->SetDynamicTextL( KGSSettIdOptJoyst, bufPtr ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( KGSSettIdOptJoyst, CGSListBoxItemTextArray::EVisible ); + + delete buf; + } + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPluginContainer::GetHelpContext() const +// +// Gets Help +// --------------------------------------------------------------------------- +// +void CGSOpticalJoystickPluginContainer::GetHelpContext( TCoeHelpContext& aContext ) const + { + aContext.iMajor = KUidGS; + aContext.iContext = KCP_HLP_DEVICE_MANAGEMENT; + } + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPluginContainer::CurrentFeatureId() +// +// Return the feature id of selected listitem +// --------------------------------------------------------------------------- +// +TInt CGSOpticalJoystickPluginContainer::CurrentFeatureId( ) const + { + return iListboxItemArray->CurrentFeature( ); + } + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPluginContainer::GetOpticalJoystickStatus() +// +// Get the status of optical joystick +// --------------------------------------------------------------------------- +// +void CGSOpticalJoystickPluginContainer::GetOpticalJoystickStatus(TInt& aStatus) + { + TInt err = UserSvr::HalFunction( EHalGroupOFN, EOFNGetPowerState, + &aStatus, reinterpret_cast( ETrue ) ); + __GSLOGSTRING2( "[CGSOpticalJoystickPluginContainer::GetOpticalJoystickStatusL] err: %d, status: %d", err, aStatus ); + } + +// --------------------------------------------------------------------------- +// CGSOpticalJoystickPluginContainer::SetOpticalJoystickStatus() +// +// Set the status of optical joystick +// --------------------------------------------------------------------------- +// +void CGSOpticalJoystickPluginContainer::SetOpticalJoystickStatusL(TInt aStatus) + { + TInt err = UserSvr::HalFunction( EHalGroupOFN, EOFNSetPowerON, + reinterpret_cast( aStatus ), + reinterpret_cast( aStatus ) ); + __GSLOGSTRING2( "[CGSOpticalJoystickPluginContainer::SetOpticalJoystickStatusL] err: %d, status: %d", err, aStatus ); + User::LeaveIfError( iPersonalizationRepository->Set( KSettingsOpticalJoystickStatus, aStatus ) ); + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for GSOpticalJoystickPlugin +* +*/ + + +// INCLUDES +#include "GSOpticalJoystickPlugin.h" + +#include +#include + + +// CONSTANTS +const TImplementationProxy KGSOpticalJoystickPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x1028331B, CGSOpticalJoystickPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// +// Gate/factory function +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSOpticalJoystickPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSOpticalJoystickPluginImplementationTable; + } + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSOpticalJoystickPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -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: This file provides the information required for building +* GSOpticalJoystickPlugin. +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSOpticalJoystickPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsopticaljoystickplugin.iby ) +../rom/GSOpticalJoystickPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsopticaljoystickpluginresources.iby ) +loc/GSOpticalJoystickPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsopticaljoystickplugin.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gsopticaljoystickplugin.mif + OPTION HEADERFILE gsopticaljoystickplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_cp_opti_joystick +END + +PRJ_MMPFILES +GSOpticalJoystickPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSOpticalJoystickPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSOpticalJoystickPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSOpticalJoystickPlugin/loc/GSOpticalJoystickPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSOpticalJoystickPlugin/loc/GSOpticalJoystickPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSOpticalJoystickPlugin. +* +*/ + + +// LOCALISATION STRINGS + +// NEW + +// **Optical Joystick VIEW + +//d:Text in title pane +//d:Optical joystick setting list view +//l:title_pane_t2/opt9 +//w: +//r: 3.1 +// +#define qtn_set_optical_joystick "Optical joystick" + +//d:Text of a list item in Optical joystick setting list view's list +//d:Item opens Autodisconnect time setting page +//l:list_setting_pane_t1 +//w: +//r: 3.1 +// +#define qtn_set_optical_joystick_on "On" + + +// AUTODISCONNECT TIME + +//d:Item in Autodisconnect time setting page's list +//d:Setting value User defined +//l:list_set_graphic_pane_t1 +//w: +//r: 3.1 +// +#define qtn_set_optical_joystick_off "Off" + +// End of File + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataAccessPointPlugin/GSPDataAccessPointPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/GSPDataAccessPointPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification file for GSPDataAccessPointPlugin. +* +*/ + +#include //this is needed for RESOURCE_FILES_DIR +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gspdataaccesspointplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10282DC5 +VENDORID VID_DEFAULT + +SOURCEPATH src +SOURCE GSPDataAccessPointModel.cpp +SOURCE GSPDataAccessPointPlugin.cpp +SOURCE GSPDataAccessPointPluginImplementationTable.cpp + +USERINCLUDE ../Logger +USERINCLUDE data +USERINCLUDE ../Data +USERINCLUDE inc +USERINCLUDE loc + +// System Includes + +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/cshelp +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH data + +//ECOM resource definition +START RESOURCE 10282DC5.rss +TARGET gspdataaccesspointplugin.rsc +TARGETPATH ECOM_RESOURCE_DIR +END // ECOM resource definition + +//PDataAccessPoint resources +START RESOURCE GSPDataAccessPointPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // PDataAccessPoint resources + +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY centralrepository.lib +LIBRARY commdb.lib +LIBRARY commonengine.lib // RConeResourceLoader +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY etel.lib // RPhone +LIBRARY etelpckt.lib // RPacketService +LIBRARY euser.lib +LIBRARY featmgr.lib // FeatureManager +LIBRARY flogger.lib // RFileLogger +LIBRARY gsecomplugin.lib +LIBRARY gsframework.lib // Base classes +LIBRARY gslistbox.lib // CGSListBoxItemTextArray +LIBRARY hlplch.lib // HlpLauncher +LIBRARY apgrfx.lib +LIBRARY centralrepository.lib + + +//Documents. Defining these is optional. Used only by IDE's file browser. +SOURCEPATH data +DOCUMENT 10282DC5.rss +DOCUMENT GSPDataAccessPointPluginRsc.rss + +SOURCEPATH inc + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataAccessPointPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Information required for building GSPDataAccessPointPlugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSPDataAccessPointPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gspdataaccesspointplugin.iby ) +../rom/GSPDataAccessPointPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gspdataaccesspointpluginresources.iby ) +loc/GSPDataAccessPointPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gspdataaccesspointplugin.loc ) + +PRJ_MMPFILES +GSPDataAccessPointPlugin.mmp + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataAccessPointPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSPDataAccessPointPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataAccessPointPlugin/data/10282DC5.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/data/10282DC5.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for GSPDataAccessPointPlugin. +* +*/ + +#include + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x10282DC5; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10282DC6; + version_no = 1; + display_name = "Packet Data Access Point"; + default_data = "0x1020724E"; // Parent UID + opaque_data = "20"; // Order number + } + }; + } + }; + } + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataAccessPointPlugin/data/GSPDataAccessPointPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/data/GSPDataAccessPointPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for GSPDataAccessPointPlugin. +* +*/ + + +// RESOURCE IDENTIFIER +NAME PDAP // 4 letter ID + +// INCLUDES +#include // PDataAccessPoint localized strings + +#include +#include +#include // Avkon localized strings +#include +#include +#include +#include +#include + +// CONSTANTS + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// +// +// Needed or loading the resource fails! +// +//---------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + + +//---------------------------------------------------- +// +// r_gs_PDataAccessPoint_view +// Active idle view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_pdataaccesspoint_view + { + menubar = r_gs_menubar_change_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE; + } + + + +// DIAL-UP ACCESS POINT NAME + +//---------------------------------------------------- +// +// r_dialup_ap_name_none +// Text resource for Dial-up access point name setting. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_dialup_ap_name_none + { + buf = qtn_selec_sett_val_field_none; + } + +//---------------------------------------------------- +// +// r_dialup_ap_name_setting_page +// +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_dialup_ap_name_setting_page + { + label= qtn_set_dial_up_ap_gprs; + type = EEikCtEdwin; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + editor_resource_id = r_dialup_ap_name_edwin; + } + +//---------------------------------------------------- +// +// r_dialup_ap_name_edwin +// Dialup acces point name editor. +// +//---------------------------------------------------- +// +RESOURCE EDWIN r_dialup_ap_name_edwin + { + width = 9; + lines = 5; + maxlength = 100; + numeric_keymap = EAknEditorStandardNumberModeKeymap; + allowed_input_modes = EAknEditorTextInputMode |EAknEditorNumericInputMode; + default_case = EAknEditorLowerCase; + avkon_flags = EAknEditorFlagNoT9 | EAknEditorFlagLatinInputModesOnly; + flags = EEikEdwinNoLineOrParaBreaks; + } + + //---------------------------------------------------- +// +// r_gs_pdataaccesspoint_plugin_caption +// Packet Data Accesspoint Plugin caption. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_pdataaccesspoint_plugin_caption + { + buf = qtn_set_dial_up_ap_gprs; + } + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataAccessPointPlugin/inc/GSPDataAccessPointModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/inc/GSPDataAccessPointModel.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,108 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataAccessPointPlugin model. +* +*/ + +#ifndef GSPDATAACCESSPOINTMODEL_H +#define GSPDATAACCESSPOINTMODEL_H + +// INCLUDES +// INCLUDES +#include +#include +#include +#include +#include +#include + +// CONSTANTS + +const TInt KAttachSettingWhenNeeded = 0; +const TInt KAttachSettingWhenAvailable = 1; +const TInt KGSMaxDAPName = KCommsDbSvrMaxFieldLength; + +// CLASS DEFINITIONS + +class CRfsHandler; +class CCommsDatabase; +class CCommsDbTableView; + +/** +* CGSPDataAccessPointModel is the model class of GS app. +* It provides functions to get and set setting values. +*/ +class CGSPDataAccessPointModel : public CBase + { + public: // Constructor and destructor + /** + * Two-phased constructor + */ + static CGSPDataAccessPointModel* NewL(); + + /** + * Destructor + */ + ~CGSPDataAccessPointModel(); + + public: //new + /** + * Gets dialup access point name from commdb. + * @param aName Descriptor which will contain the dialup access point name. + * Max length is KGSMaxDAPName. + * @return Error code. + */ + TInt GetDialupAPNameL( TDes& aName ); + + /** + * Stores dialup access point name to commdb. + * @param aName Descriptor which contains the dialup access point name. + * Max length is KGSMaxDAPName. + */ + void SetDialupAPNameL( const TDesC& aName ); + + private: // Private constructors + /** + * Default C++ contructor + */ + CGSPDataAccessPointModel(); + + /** + * Symbian OS default constructor + * @return void + */ + void ConstructL(); + + private: // Data + + // Handle to Comms database. + CCommsDatabase* iCommsDb; + + // Handle to packet service. + RPacketService iPktService; + + // Handle to phone. + RPhone iPhone; + + // Handle to tel server. + RTelServer iTelServer; + + // Networking repository + CRepository* iNetworkRepository; + + }; + + +#endif // GSPDATAACCESSPOINTMODEL_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataAccessPointPlugin/inc/GSPDataAccessPointPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/inc/GSPDataAccessPointPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,160 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataAccessPointPlugin implementation. +* +*/ + +#ifndef GSPDATAACCESSPOINTPLUGIN_H +#define GSPDATAACCESSPOINTPLUGIN_H + +// User includes + +// System includes +#include +#include +#include +#include + +// Classes referenced +class CAknViewAppUi; +class CGSPDataAccessPointModel; + + +// Constants +const TUid KGSPDataAccessPointPluginUID = { 0x10282DC6 }; +_LIT( KPDataAccessPointResourceFileName, "z:GSPDataAccessPointPluginRsc.rsc" ); + +// CLASS DECLARATION + +/** +* CGSPDataAccessPointPlugin view class. +* +* This class handles state and application logic of PDataAccessPoint settings. +* The plugin is a type of EGSItemTypeSettingDialog and therefore the GS FW will +* call HandleSelection() instead of DoActivate(). +* +*/ +class CGSPDataAccessPointPlugin : public CGSPluginInterface + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return + */ + static CGSPDataAccessPointPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSPDataAccessPointPlugin(); + + public: // From CAknView + + /** + * See base class. + */ + TUid Id() const; + + public: // From CGSPluginInterface + + /** + * See base class. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + TInt PluginProviderCategory() const; + + /** + * See base class. + */ + TGSListboxItemTypes ItemType(); + + /** + * See base class. + */ + void GetValue( const TGSPluginValueKeys aKey, + TDes& aValue ); + + /** + * See base class. + */ + void HandleSelection( const TGSSelectionTypes aSelectionType ); + + /** + * See base class. + */ + TGSMenuActivationItems MenuActivationItem(); + + protected: // New + + /** + * C++ default constructor. + */ + CGSPDataAccessPointPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + protected: // From CAknView + + /** + * See base class. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * See base class. + */ + void DoDeactivate(); + + private: // New + + /** + * Show Access point setting page. + * + */ + void ShowAccessPointSettingPageL(); + + /** + * Opens localized resource file. + */ + void OpenLocalizedResourceFileL( + const TDesC& aResourceFileName, + RConeResourceLoader& aResourceLoader ); + + /** + * Leaving version of GetValue() + */ + void GetValueL( TDes& aValue ); + + protected: // Data + + // PDataAccessPoint model. + CGSPDataAccessPointModel* iModel; + + // Resource loader. + RConeResourceLoader iResources; + }; + +#endif // GSPDATAACCESSPOINTPLUGIN_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataAccessPointPlugin/loc/GSPDataAccessPointPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/loc/GSPDataAccessPointPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSPDataAccessPointPlugin. +* +*/ + +// LOCALISATION STRINGS + +//d:Text of a list item in Packet data setting list view's list +//d:Item opens Dial-up access point name setting page +//l:list_setting_pane_t1 +//w: +//r:4.0 +// +#define qtn_set_dial_up_ap_gprs "Access point" + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointModel.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Model for GSPDataAccessPointPlugin. +* +*/ + + +// INCLUDE FILES +#include "GSPDataAccessPointModel.h" +#include "GsLogger.h" + +#include +#include +#include +#include + + +// CONSTANTS + +// ================= MEMBER FUNCTIONS ======================= + + +// ---------------------------------------------------------------------------- +// CGSPDataAccessPointModel::NewL +// +// EPOC two-phased constructor +// ---------------------------------------------------------------------------- +// +CGSPDataAccessPointModel* CGSPDataAccessPointModel::NewL() + { + CGSPDataAccessPointModel* self = new( ELeave ) CGSPDataAccessPointModel; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CGSPDataAccessPointModel::CGSPDataAccessPointModel +// +// C++ default constructor can NOT contain any code, that +// might leave. +// ---------------------------------------------------------------------------- +// +CGSPDataAccessPointModel::CGSPDataAccessPointModel() + { + __GSLOGSTRING( "[CGSPDataAccessPointModel] CGSPDataAccessPointModel()" ); + } + + +// ---------------------------------------------------------------------------- +// CGSPDataAccessPointModel::ConstructL +// +// EPOC default constructor can leave. +// ---------------------------------------------------------------------------- +// +void CGSPDataAccessPointModel::ConstructL() + { + iCommsDb = CCommsDatabase::NewL( EDatabaseTypeIAP ); + iNetworkRepository = + CRepository::NewL( KCRUidNetworkSettings ); + if( FeatureManager::FeatureSupported( KFeatureIdLoggerGprs ) ) + { + User::LeaveIfError( iTelServer.Connect() ); + User::LeaveIfError( iPhone.Open( iTelServer, KMmTsyPhoneName ) ); + User::LeaveIfError( iPktService.Open( iPhone ) ); + } + } + + +// ---------------------------------------------------------------------------- +// CGSPDataAccessPointModel::~CGSPDataAccessPointModel +// +// Destructor +// ---------------------------------------------------------------------------- +// +CGSPDataAccessPointModel::~CGSPDataAccessPointModel() + { + if ( iNetworkRepository ) + { + delete iNetworkRepository; + } + delete iCommsDb; + if( FeatureManager::FeatureSupported( KFeatureIdLoggerGprs ) ) + { + iPktService.Close(); + iPhone.Close(); + iTelServer.Close(); + } + __GSLOGSTRING( "[CGSPDataConnectionModel] Handles closed." ); + } + + +// ---------------------------------------------------------------------------- +// CGSPDataModel::GetDialupAPNameL +// +// Gets dial-up acces point name. +// ---------------------------------------------------------------------------- +// +TInt CGSPDataAccessPointModel::GetDialupAPNameL( TDes& aName ) + { + CCommsDbTableView* table = iCommsDb->OpenTableLC( TPtrC( DEFAULT_GPRS ) ); + table->GotoFirstRecord(); + + //If dialup AP name is not initialized, ReadTextL will leave + TRAPD( error, table->ReadTextL( TPtrC( GPRS_APN), aName ) ); + CleanupStack::PopAndDestroy( table ); + return error; + } + + +// ---------------------------------------------------------------------------- +// CGSPDataModel::SetDialupAPNameL +// +// Sets dial-up acces point name. +// ---------------------------------------------------------------------------- +// +void CGSPDataAccessPointModel::SetDialupAPNameL( const TDesC& aName ) + { + CCommsDbTableView* table = iCommsDb->OpenTableLC( TPtrC( DEFAULT_GPRS ) ); + table->GotoFirstRecord(); + User::LeaveIfError( table->UpdateRecord() ); + table->WriteTextL( TPtrC( GPRS_APN ),aName ); + User::LeaveIfError( table->PutRecordChanges() ); + CleanupStack::PopAndDestroy( table ); + + if( FeatureManager::FeatureSupported( KFeatureIdLoggerGprs ) ) + { + TRequestStatus status; + RPacketContext::TContextConfigGPRS params; + TPckg< RPacketContext::TContextConfigGPRS > paramsBuf( params ); + + if ( aName.Length() <= params.iAccessPointName.MaxLength() ) + { + params.iAccessPointName.Copy( aName ); + iPktService.SetDefaultContextParams( status, paramsBuf ); + User::WaitForRequest( status ); + } + } + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,308 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataAccessPointPlugin implementation. +* +*/ + + +// User includes +#include "GSPDataAccessPointPlugin.h" +#include "GSPDataAccessPointModel.h" +#include +#include +#include // GUI Resource +#include +#include + +// System includes +#include +#include +#include +#include +#include +#include +#include // HlpLauncher +#include +#include +#include + +// Constants +const TInt KGSBufSize128 = 128; +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSPDataAccessPointPlugin::CGSPDataAccessPointPlugin() +// Constructor +// +// --------------------------------------------------------------------------- +// +CGSPDataAccessPointPlugin::CGSPDataAccessPointPlugin() + : iResources( *iCoeEnv ) + { + } + + +// --------------------------------------------------------------------------- +// CGSPDataAccessPointPlugin::~CGSPDataAccessPointPlugin() +// Destructor +// +// --------------------------------------------------------------------------- +// +CGSPDataAccessPointPlugin::~CGSPDataAccessPointPlugin() + { + iResources.Close(); + + if( iModel ) + { + delete iModel; + } + } + + +// --------------------------------------------------------------------------- +// CGSPDataAccessPointPlugin::ConstructL(const TRect& aRect) +// Symbian OS two-phased constructor +// +// --------------------------------------------------------------------------- +// +void CGSPDataAccessPointPlugin::ConstructL() + { + iModel = CGSPDataAccessPointModel::NewL(); + OpenLocalizedResourceFileL( KPDataAccessPointResourceFileName, iResources ); + BaseConstructL( R_GS_PDATAACCESSPOINT_VIEW ); + } + + +// --------------------------------------------------------------------------- +// CGSPDataAccessPointPlugin::NewL() +// Static constructor +// +// --------------------------------------------------------------------------- +// +CGSPDataAccessPointPlugin* CGSPDataAccessPointPlugin::NewL( TAny* /*aInitParams*/ ) + { + CGSPDataAccessPointPlugin* self = new( ELeave ) CGSPDataAccessPointPlugin(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CGSPDataAccessPointPlugin::Id +// +// +// ----------------------------------------------------------------------------- +// +TUid CGSPDataAccessPointPlugin::Id() const + { + return KGSPDataAccessPointPluginUID; + } + +// ----------------------------------------------------------------------------- +// CGSPDataAccessPointPlugin::DoActivateL +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataAccessPointPlugin::DoActivateL( const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// CGSPDataAccessPointPlugin::DoDeactivate +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataAccessPointPlugin::DoDeactivate() + { + } + + +// ========================= From CGSPluginInterface ================== + + +// ----------------------------------------------------------------------------- +// CGSPDataAccessPointPlugin::GetCaptionL +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataAccessPointPlugin::GetCaptionL( TDes& aCaption ) const + { + HBufC* result = StringLoader::LoadL( R_GS_PDATAACCESSPOINT_PLUGIN_CAPTION ); + aCaption.Copy( *result ); + delete result; + } + + +// ----------------------------------------------------------------------------- +// CGSPDataAccessPointPlugin::PluginProviderCategory +// +// +// ----------------------------------------------------------------------------- +// +TInt CGSPDataAccessPointPlugin::PluginProviderCategory() const + { + return KGSPluginProviderInternal; + } + + +// ----------------------------------------------------------------------------- +// CGSPDataAccessPointPlugin::ItemType() +// +// +// ----------------------------------------------------------------------------- +// +TGSListboxItemTypes CGSPDataAccessPointPlugin::ItemType() + { + return EGSItemTypeSettingDialog; + } + + +// ----------------------------------------------------------------------------- +// CGSPDataAccessPointPlugin::GetValue() +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataAccessPointPlugin::GetValue( const TGSPluginValueKeys aKey, + TDes& aValue ) + { + TRAPD( err, GetValueL( aValue ) ); + if ( err != KErrNone ) + { + CGSPluginInterface::GetValue( aKey, aValue ); + } + } + + +// ----------------------------------------------------------------------------- +// CGSPDataAccessPointPlugin::GetValueL() +// +// Leaving version of GetValue() +// ----------------------------------------------------------------------------- +// +void CGSPDataAccessPointPlugin::GetValueL( TDes& aValue ) + { + HBufC* name = HBufC::NewLC( KGSBufSize128 ); + TPtr ptrBuffer ( name->Des() ); + HBufC* dynamicText = name; + if ( iModel->GetDialupAPNameL( ptrBuffer ) != KErrNone + || ptrBuffer.Length() == 0 ) + { + dynamicText = iEikonEnv->AllocReadResourceL( R_DIALUP_AP_NAME_NONE ); + } + TPtr bufPtr( dynamicText->Des() ); + aValue.Copy( *dynamicText ); + CleanupStack::PopAndDestroy( name ); + } + + +// ----------------------------------------------------------------------------- +// CGSPDataAccessPointPlugin::HandleSelection() +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataAccessPointPlugin::HandleSelection( + const TGSSelectionTypes aSelectionType ) + { + switch( aSelectionType ) + { + case EGSSelectionBySelectionKey: + case EGSSelectionByMenu: + TRAP_IGNORE( ShowAccessPointSettingPageL() ); + break; + } + + } + + +// ----------------------------------------------------------------------------- +// CGSPDataAccessPointPlugin::ShowAccessPointSettingPageL() +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataAccessPointPlugin::ShowAccessPointSettingPageL() + { + TBuf name; + //returns error code, no need to check the value + //(it doesn't matter if 'name' is empty) + iModel->GetDialupAPNameL( name ); + + CAknTextSettingPage* dlg = new( ELeave ) CAknTextSettingPage( + R_DIALUP_AP_NAME_SETTING_PAGE, + name, + CAknTextSettingPage::EZeroLengthAllowed ); + + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { + iModel->SetDialupAPNameL( name ); + // Update AI item's value to lbx: + CGSParentPlugin* parent = static_cast( + AppUi()->View( KGSPDataPluginUid ) );// This is the parent plugin + parent->UpdateView(); + } + } + + +// ----------------------------------------------------------------------------- +// CGSPDataAccessPointPlugin::OpenLocalizedResourceFileL() +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataAccessPointPlugin::OpenLocalizedResourceFileL( + const TDesC& aResourceFileName, + RConeResourceLoader& aResourceLoader ) + { + RFs fsSession; + User::LeaveIfError( fsSession.Connect() ); + + // Find the resource file: + TParse parse; + parse.Set( aResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL ); + TFileName fileName( parse.FullName() ); + + // Get language of resource file: + BaflUtils::NearestLanguageFile( fsSession, fileName ); + + // Open resource file: + aResourceLoader.OpenL( fileName ); + + // If leave occurs before this, close is called automatically when the + // thread exits. + fsSession.Close(); + } + + +// ----------------------------------------------------------------------------- +// CGSPDataAccessPointPlugin::TGSMenuActivationItems() +// +// +// ----------------------------------------------------------------------------- +// +TGSMenuActivationItems CGSPDataAccessPointPlugin::MenuActivationItem() + { + return EGSMenuActivationItemChange; + } + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for GSPDataAccessPointPlugin. +* +*/ + + +// User includes +#include "GSPDataAccessPointPlugin.h" + +// System includes +#include +#include + + +// Constants +const TImplementationProxy KGSPDataAccessPointSettingsPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x10282DC6, CGSPDataAccessPointPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSPDataAccessPointSettingsPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSPDataAccessPointSettingsPluginImplementationTable; + } + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataConnectionPlugin/GSPDataConnectionPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/GSPDataConnectionPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification file for GSPDataConnectionPlugin. +* +*/ + +#include //this is needed for RESOURCE_FILES_DIR +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gspdataconnectionplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10282DC3 +VENDORID VID_DEFAULT + +SOURCEPATH src +SOURCE GSPDataConnectionModel.cpp +SOURCE GSPDataConnectionPlugin.cpp +SOURCE GSPDataConnectionPluginImplementationTable.cpp + +USERINCLUDE ../Logger +USERINCLUDE data +USERINCLUDE ../Data +USERINCLUDE inc +USERINCLUDE loc + +// System Includes + +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/cshelp +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH data + +//ECOM resource definition +START RESOURCE 10282DC3.rss +TARGET gspdataconnectionplugin.rsc +TARGETPATH ECOM_RESOURCE_DIR +END // ECOM resource definition + +//PDataConnection resources +START RESOURCE GSPDataConnectionPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // PDataConnection resources + +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY centralrepository.lib +LIBRARY commdb.lib +LIBRARY commonengine.lib // RConeResourceLoader +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY etel.lib // RPhone +LIBRARY etelpckt.lib // RPacketService +LIBRARY euser.lib +LIBRARY featmgr.lib // FeatureManager +LIBRARY flogger.lib // RFileLogger +LIBRARY gsecomplugin.lib +LIBRARY gsframework.lib // Base classes +LIBRARY gslistbox.lib // CGSListBoxItemTextArray +LIBRARY hlplch.lib // HlpLauncher +LIBRARY apgrfx.lib + +//Documents. Defining these is optional. Used only by IDE's file browser. +SOURCEPATH data +DOCUMENT 10282DC3.rss +DOCUMENT GSPDataConnectionPluginRsc.rss + +SOURCEPATH inc + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataConnectionPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Information required for building GSPDataConnectionPlugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSPDataConnectionPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gspdataconnectionplugin.iby ) +../rom/GSPDataConnectionPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gspdataconnectionpluginresources.iby ) +loc/GSPDataConnectionPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gspdataconnectionplugin.loc ) + +PRJ_MMPFILES +GSPDataConnectionPlugin.mmp + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataConnectionPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSPDataConnectionPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataConnectionPlugin/data/10282DC3.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/data/10282DC3.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for GSPDataConnectionPlugin. +* +*/ + +#include + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x10282DC3; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10282DC4; + version_no = 1; + display_name = "Packet Data Connection"; + default_data = "0x1020724E"; // Parent UID + opaque_data = "10"; // Order number + } + }; + } + }; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataConnectionPlugin/data/GSPDataConnectionPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/data/GSPDataConnectionPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,142 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for GSPDataConnectionPlugin. +* +*/ + + +// RESOURCE IDENTIFIER +NAME PDCP // 4 letter ID + +// INCLUDES +#include // PDataConnection localized strings + +#include +#include +#include // Avkon localized strings +#include +#include +#include +#include +#include + +// CONSTANTS + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// +// +// Needed or loading the resource fails! +// +//---------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +//---------------------------------------------------- +// +// r_gs_pdataconnection_plugin_caption +// Packet Data Connection Plugin caption. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_pdataconnection_plugin_caption + { + buf = qtn_set_attach; + } + +//---------------------------------------------------- +// +// r_gs_PDataConnection_view +// Packet Data Connection view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_pdataconnection_view + { + menubar = r_gs_menubar_change_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE; + } + + +//---------------------------------------------------- +// +// r_gs_pdataconnection_setting_page +// +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_gs_pdataconnection_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_set_attach; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + + +//---------------------------------------------------- +// +// r_gs_pdataconnection_setting_page_lbx +// +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_gs_pdataconnection_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_set_attach_avail; + }, + LBUF + { + txt = qtn_set_attach_needed; + } + }; + } + + +//---------------------------------------------------- +// +// r_gs_pdataconnection_on_text +// Packet Data Connection text for "when available". +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_pdataconn_when_enable_text + { + buf = qtn_set_attach_avail; + } + +//---------------------------------------------------- +// +// r_gs_pdataconnection_off_text +// Packet Data Connection text for "when needed". +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_pdataconn_when_needed_text + { + buf = qtn_set_attach_needed; + } + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataConnectionPlugin/inc/GSPDataConnectionModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/inc/GSPDataConnectionModel.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataConnectionPlugin model. +* +*/ + +#ifndef GSPDATACONNECTIONMODEL_H +#define GSPDATACONNECTIONMODEL_H + +// INCLUDES +// INCLUDES +#include +#include +#include +#include +#include + +// CONSTANTS + +const TInt KAttachSettingWhenNeeded = 1; +const TInt KAttachSettingWhenAvailable = 0; + + +// CLASS DEFINITIONS + +class CRfsHandler; +class CCommsDatabase; +class CCommsDbTableView; + + +/** +* CGSPDataConnectionModel is the model class of GS app. +* It provides functions to get and set setting values. +*/ +class CGSPDataConnectionModel : public CBase + { + public: // Constructor and destructor + /** + * Two-phased constructor + */ + static CGSPDataConnectionModel* NewL(); + + /** + * Destructor + */ + ~CGSPDataConnectionModel(); + + public: //new + + /** + * Gets AI state. + */ + TInt PDataAttachL(); + + /** + * Sets AI state. + */ + void SetPDataAttachL( const TInt aAttach ); + + + private: // Private constructors + /** + * Default C++ contructor + */ + CGSPDataConnectionModel(); + + /** + * Symbian OS default constructor + * @return void + */ + void ConstructL(); + + private: // Data + + // Flag to indicate whether the feature KFeatureIdLoggerGprs is supported + TBool iIsFeatureIdLoggerGprs; + + // Handle to Comms database. + CCommsDatabase* iCommsDb; + + // Handle to packet service. + RPacketService iPktService; + + // Handle to phone. + RPhone iPhone; + + // Handle to tel server. + RTelServer iTelServer; + + }; +#endif // GSPDATACONNECTIONMODEL_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataConnectionPlugin/inc/GSPDataConnectionPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/inc/GSPDataConnectionPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,173 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataConnectionPlugin implementation. +* +*/ + +#ifndef GSPDATACONNECTIONPLUGIN_H +#define GSPDATACONNECTIONPLUGIN_H + +// User includes + +// System includes +#include +#include +#include +#include + +// Classes referenced +class CAknViewAppUi; +class CGSPDataConnectionModel; + + +// Constants +const TUid KGSPDataConnectionPluginUID = { 0x10282DC4}; +_LIT( KPDataConnectionResourceFileName, "z:GSPDataConnectionPluginRsc.rsc" ); + +// CLASS DECLARATION + +/** +* CGSPDataConnectionPlugin view class. +* +* This class handles state and application logic of PDataConnection settings. +* The plugin is a type of EGSItemTypeSettingDialog and therefore the GS FW will +* call HandleSelection() instead of DoActivate(). +* +*/ +class CGSPDataConnectionPlugin : public CGSPluginInterface + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return + */ + static CGSPDataConnectionPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSPDataConnectionPlugin(); + + public: // From CAknView + + /** + * See base class. + */ + TUid Id() const; + + public: // From CGSPluginInterface + + /** + * See base class. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + TInt PluginProviderCategory() const; + + /** + * See base class. + */ + TGSListboxItemTypes ItemType(); + + /** + * See base class. + */ + void GetValue( const TGSPluginValueKeys aKey, + TDes& aValue ); + + /** + * See base class. + */ + void HandleSelection( const TGSSelectionTypes aSelectionType ); + + /** + * See base class. + */ + TGSMenuActivationItems MenuActivationItem(); + + /** + * @see CGSPluginInterface header file. + */ + TBool Visible() const; + + protected: // New + + /** + * C++ default constructor. + */ + CGSPDataConnectionPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + protected: // From CAknView + + /** + * See base class. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * See base class. + */ + void DoDeactivate(); + + private: // New + + /** + * Sets Attach state. + * Launches Setting Page for setting the item + */ + void SetAttachStateL(); + + /** + * Launches Attach on/off dialog. + * @param aPDataConnectionState Current value of Attach state. This WILL BE + * UPDATED to contain new user selected value. + * @return ETrue if value updated. + * EFalse if value not updated. + */ + TBool ShowAttachSettingPageL( TInt& aPDataConnectionState ); + + /** + * Opens localized resource file. + */ + void OpenLocalizedResourceFileL( + const TDesC& aResourceFileName, + RConeResourceLoader& aResourceLoader ); + + /** + * Leaving version of GetValue() + */ + void GetValueL( TDes& aValue ); + + protected: // Data + + // PDataConnection model. + CGSPDataConnectionModel* iModel; + + // Resource loader. + RConeResourceLoader iResources; + }; + +#endif // GSPDATACONNECTIONPLUGIN_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataConnectionPlugin/loc/GSPDataConnectionPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/loc/GSPDataConnectionPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSPDataConnectionPlugin. +* +*/ + +// LOCALISATION STRINGS + +// **PACKET DATA (CONNECTION) VIEW + +//d:Text of a list item in Packet data setting list view's list +//d:Item opens Attach setting page +//l:list_setting_pane_t1 +//w: +//r:4.0 +// +#define qtn_set_attach "Attach" + +// ATTACH + +//d:Text in setting list item's current value field +//d:Item in Attach setting page's list +//d:Setting value When available +//l:list_set_graphic_pane_t1 +//w: +//r:4.0 +// +#define qtn_set_attach_avail "When available" + +//d:Text in setting list item's current value field +//d:Item in Attach setting page's list +//d:Setting value When needed +//l:list_set_graphic_pane_t1 +//w: +//r:4.0 +// +#define qtn_set_attach_needed "When needed" + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionModel.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,146 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Model for GSPDataConnectionPlugin. +* +*/ + + +// INCLUDE FILES +#include "GSPDataConnectionModel.h" +#include "GsLogger.h" + +#include +#include +#include +#include + + +// CONSTANTS +// Default values for some of the settings +const TUint32 KGSDefaultAttachMode = 0; // when available + +// ================= MEMBER FUNCTIONS ======================= + + +// ---------------------------------------------------------------------------- +// CGSPDataConnectionModel::NewL +// +// EPOC two-phased constructor +// ---------------------------------------------------------------------------- +// +CGSPDataConnectionModel* CGSPDataConnectionModel::NewL() + { + CGSPDataConnectionModel* self = new( ELeave ) CGSPDataConnectionModel; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CGSPDataConnectionModel::CGSPDataConnectionModel +// +// C++ default constructor can NOT contain any code, that +// might leave. +// ---------------------------------------------------------------------------- +// +CGSPDataConnectionModel::CGSPDataConnectionModel() + { + iIsFeatureIdLoggerGprs = EFalse; + __GSLOGSTRING( "[CGSPDataConnectionModel] CGSPDataConnectionModel()" ); + } + + +// ---------------------------------------------------------------------------- +// CGSPDataConnectionModel::ConstructL +// +// EPOC default constructor can leave. +// ---------------------------------------------------------------------------- +// +void CGSPDataConnectionModel::ConstructL() + { + iCommsDb = CCommsDatabase::NewL( EDatabaseTypeIAP ); + if( FeatureManager::FeatureSupported( KFeatureIdLoggerGprs ) ) + { + iIsFeatureIdLoggerGprs = ETrue; + User::LeaveIfError( iTelServer.Connect() ); + User::LeaveIfError( iPhone.Open( iTelServer, KMmTsyPhoneName ) ); + User::LeaveIfError( iPktService.Open( iPhone ) ); + } + } + + +// ---------------------------------------------------------------------------- +// CGSPDataConnectionModel::~CGSPDataConnectionModel +// +// Destructor +// ---------------------------------------------------------------------------- +// +CGSPDataConnectionModel::~CGSPDataConnectionModel() + { + delete iCommsDb; + if( iIsFeatureIdLoggerGprs ) + { + iPktService.Close(); + iPhone.Close(); + iTelServer.Close(); + } + __GSLOGSTRING( "[CGSPDataConnectionModel] Handles closed." ); + } + + +// ---------------------------------------------------------------------------- +// CGSPDataConnectionModel::PDataAttachL +// +// Returns packet data attach mode. +// ---------------------------------------------------------------------------- +// +TInt CGSPDataConnectionModel::PDataAttachL() + { + TUint32 attachMode = KGSDefaultAttachMode; + TRAPD( error, iCommsDb->GetGlobalSettingL( TPtrC( GPRS_ATTACH_MODE ), + attachMode ) ); + if ( error == KErrNotFound ) + { + iCommsDb->SetGlobalSettingL( TPtrC( GPRS_ATTACH_MODE ), attachMode ); + } + else if ( error != KErrNone ) + { + User::Leave( error ); + } + return static_cast ( attachMode ); + } + +// ---------------------------------------------------------------------------- +// CGSPDataConnectionModel::SetPDataAttachL +// +// Sets packet data attach mode. +// ---------------------------------------------------------------------------- +// +void CGSPDataConnectionModel::SetPDataAttachL( const TInt aAttach ) + { + iCommsDb->SetGlobalSettingL( TPtrC( GPRS_ATTACH_MODE ), aAttach ); + + if( FeatureManager::FeatureSupported( KFeatureIdLoggerGprs ) ) + { + TRequestStatus status; + RPacketService::TAttachMode mode( + static_cast ( aAttach ) ); + iPktService.SetAttachMode( status, mode ); + User::WaitForRequest( status ); + } + + } +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,377 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataConnectionPlugin implementation. +* +*/ + + +// User includes +#include "GSPDataConnectionPlugin.h" +#include "GSPDataConnectionModel.h" +#include +#include +#include // GUI Resource +#include +#include + +// System includes +#include +#include +#include +#include +#include +#include +#include // HlpLauncher +#include +#include +#include + +// Constants + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::CGSPDataConnectionPlugin() +// Constructor +// +// --------------------------------------------------------------------------- +// +CGSPDataConnectionPlugin::CGSPDataConnectionPlugin() + : iResources( *iCoeEnv ) + { + } + + +// --------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::~CGSPDataConnectionPlugin() +// Destructor +// +// --------------------------------------------------------------------------- +// +CGSPDataConnectionPlugin::~CGSPDataConnectionPlugin() + { + iResources.Close(); + + if( iModel ) + { + delete iModel; + } + } + + +// --------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::ConstructL(const TRect& aRect) +// Symbian OS two-phased constructor +// +// --------------------------------------------------------------------------- +// +void CGSPDataConnectionPlugin::ConstructL() + { + iModel = CGSPDataConnectionModel::NewL(); + OpenLocalizedResourceFileL( KPDataConnectionResourceFileName, iResources ); + BaseConstructL( R_GS_PDATACONNECTION_VIEW ); + } + + +// --------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::NewL() +// Static constructor +// +// --------------------------------------------------------------------------- +// +CGSPDataConnectionPlugin* CGSPDataConnectionPlugin::NewL( TAny* /*aInitParams*/ ) + { + CGSPDataConnectionPlugin* self = new( ELeave ) CGSPDataConnectionPlugin(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::Id +// +// +// ----------------------------------------------------------------------------- +// +TUid CGSPDataConnectionPlugin::Id() const + { + return KGSPDataConnectionPluginUID; + } + +// ----------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::DoActivateL +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataConnectionPlugin::DoActivateL( const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::DoDeactivate +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataConnectionPlugin::DoDeactivate() + { + } + + +// ========================= From CGSPluginInterface ================== + + +// ----------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::GetCaptionL +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataConnectionPlugin::GetCaptionL( TDes& aCaption ) const + { + HBufC* result = StringLoader::LoadL( R_GS_PDATACONNECTION_PLUGIN_CAPTION ); + aCaption.Copy( *result ); + delete result; + } + + +// ----------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::PluginProviderCategory +// +// +// ----------------------------------------------------------------------------- +// +TInt CGSPDataConnectionPlugin::PluginProviderCategory() const + { + return KGSPluginProviderInternal; + } + + +// ----------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::ItemType() +// +// +// ----------------------------------------------------------------------------- +// +TGSListboxItemTypes CGSPDataConnectionPlugin::ItemType() + { + return EGSItemTypeSettingDialog; + } + + +// ----------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::GetValue() +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataConnectionPlugin::GetValue( const TGSPluginValueKeys aKey, + TDes& aValue ) + { + TRAPD( err, GetValueL( aValue ) ); + if ( err != KErrNone ) + { + CGSPluginInterface::GetValue( aKey, aValue ); + } + } + + +// ----------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::GetValueL() +// +// Leaving version of GetValue() +// ----------------------------------------------------------------------------- +// +void CGSPDataConnectionPlugin::GetValueL( TDes& aValue ) + { + TInt attachState = iModel->PDataAttachL(); + HBufC* result; + + switch( attachState ) + { + case KAttachSettingWhenAvailable: + result = StringLoader::LoadL( R_GS_PDATACONN_WHEN_ENABLE_TEXT ); + aValue.Copy( *result ); + delete result; + break; + + case KAttachSettingWhenNeeded: + result = StringLoader::LoadL( R_GS_PDATACONN_WHEN_NEEDED_TEXT ); + aValue.Copy( *result ); + delete result; + default: + break; + } + + } + + +// ----------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::HandleSelection() +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataConnectionPlugin::HandleSelection( + const TGSSelectionTypes aSelectionType ) + { + switch( aSelectionType ) + { + case EGSSelectionBySelectionKey: + case EGSSelectionByMenu: + TRAP_IGNORE( SetAttachStateL() ); // Launch setting page to change value. + break; + default: + break; + } + + } + + +// ----------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::ShowAttachSettingPageL() +// +// Indexes of Attach on/off items in a listbox are not the same as aPDataConnectionState +// value. Therefore matching between these two is required. +// ----------------------------------------------------------------------------- +// +TBool CGSPDataConnectionPlugin::ShowAttachSettingPageL( TInt& aPDataConnectionState ) + { + TInt previousPDataConnectionState = aPDataConnectionState; + TBool isValueUpdated = EFalse; + + CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( + R_GS_PDATACONNECTION_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + + if( items->Count() != 2 ) + { + CAknRadioButtonSettingPage* dlg = + new (ELeave) CAknRadioButtonSettingPage + ( R_GS_PDATACONNECTION_SETTING_PAGE, + aPDataConnectionState, + items ); + dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); + } + else + { + if (aPDataConnectionState == 0) + { + aPDataConnectionState = 1; + } + else + { + aPDataConnectionState = 0; + } + } + + CleanupStack::PopAndDestroy( items ); + + // Check if aPDataConnectionState has been changed: + if( previousPDataConnectionState != aPDataConnectionState ) + { + isValueUpdated = ETrue; + } + return isValueUpdated; + } + + +// ----------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::SetAttachStateL() +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataConnectionPlugin::SetAttachStateL() + { + // Get information of if there are open connections + TInt PDataConnectionState = iModel->PDataAttachL(); + const TBool isValueUpdated = ShowAttachSettingPageL( PDataConnectionState ); + + if ( isValueUpdated ) + { + // Store updated Active Idle state: + iModel->SetPDataAttachL( PDataConnectionState ); + // Update Attach item's value to lbx: + CGSParentPlugin* parent = static_cast( + AppUi()->View( KGSPDataPluginUid ) );// This is the parent plugin + parent->UpdateView(); + } + } + + +// ----------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::OpenLocalizedResourceFileL() +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataConnectionPlugin::OpenLocalizedResourceFileL( + const TDesC& aResourceFileName, + RConeResourceLoader& aResourceLoader ) + { + RFs fsSession; + User::LeaveIfError( fsSession.Connect() ); + + // Find the resource file: + TParse parse; + parse.Set( aResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL ); + TFileName fileName( parse.FullName() ); + + // Get language of resource file: + BaflUtils::NearestLanguageFile( fsSession, fileName ); + + // Open resource file: + aResourceLoader.OpenL( fileName ); + + // If leave occurs before this, close is called automatically when the + // thread exits. + fsSession.Close(); + } + + +// ----------------------------------------------------------------------------- +// CGSPDataConnectionPlugin::TGSMenuActivationItems() +// +// +// ----------------------------------------------------------------------------- +// +TGSMenuActivationItems CGSPDataConnectionPlugin::MenuActivationItem() + { + return EGSMenuActivationItemChange; + } + + +// ---------------------------------------------------------------------------- +// CGSPDataConnectionPlugin +// +// Provides the visibility status of self to framework. +// ---------------------------------------------------------------------------- +// +TBool CGSPDataConnectionPlugin::Visible() const + { + if ( FeatureManager::FeatureSupported( KFeatureIdIpPush )) + { + return EFalse; + } + return ETrue; + } + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for GSPDataConnectionPlugin. +* +*/ + + +// User includes +#include "GSPDataConnectionPlugin.h" + +// System includes +#include +#include + + +// Constants +const TImplementationProxy KGSPDataConnectionSettingsPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x10282DC4, CGSPDataConnectionPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSPDataConnectionSettingsPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSPDataConnectionSettingsPluginImplementationTable; + } + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataHSDPAPlugin/GSPDataHSDPAPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/GSPDataHSDPAPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification file for GSPDataHSDPAPlugin. +* +*/ + +#include //this is needed for RESOURCE_FILES_DIR +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gspdatahsdpaplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10282DC7 +VENDORID VID_DEFAULT + +SOURCEPATH src +SOURCE GSPDataHSDPAModel.cpp +SOURCE GSPDataHSDPAPlugin.cpp +SOURCE GSPDataHSDPAPluginImplementationTable.cpp + +USERINCLUDE ../Logger +USERINCLUDE ../Cenrep +USERINCLUDE data +USERINCLUDE ../Data +USERINCLUDE inc +USERINCLUDE loc + +// System Includes + +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/cshelp +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH data + +//ECOM resource definition +START RESOURCE 10282DC7.rss +TARGET gspdatahsdpaplugin.rsc +TARGETPATH ECOM_RESOURCE_DIR +END // ECOM resource definition + +//PDataHSDPA resources +START RESOURCE GSPDataHSDPAPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // PDataHSDPA resources + +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY centralrepository.lib +LIBRARY commonengine.lib // RConeResourceLoader +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY etel.lib // RPhone +LIBRARY etelpckt.lib // RPacketService +LIBRARY euser.lib +LIBRARY featmgr.lib // FeatureManager +LIBRARY flogger.lib // RFileLogger +LIBRARY gsecomplugin.lib +LIBRARY gsframework.lib // Base classes +LIBRARY gslistbox.lib // CGSListBoxItemTextArray +LIBRARY hlplch.lib // HlpLauncher +LIBRARY apgrfx.lib +LIBRARY centralrepository.lib +LIBRARY customapi.lib +LIBRARY etelmm.lib +LIBRARY profileeng.lib +LIBRARY profileengine.lib +#ifdef RD_STARTUP_CHANGE +LIBRARY starterclient.lib +#endif + +//Documents. Defining these is optional. Used only by IDE's file browser. +SOURCEPATH data +DOCUMENT 10282DC7.rss +DOCUMENT GSPDataHSDPAPluginRsc.rss + +SOURCEPATH inc + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataHSDPAPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Information required for building GSPDataHSDPAPlugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSPDataHSDPAPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gspdatahsdpaplugin.iby ) +../rom/GSPDataHSDPAPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gspdatahsdpapluginresources.iby ) +loc/GSPDataHSDPAPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gspdatahsdpaplugin.loc ) + +PRJ_MMPFILES +#ifdef __HSXPA_SUPPORT + GSPDataHSDPAPlugin.mmp +#endif +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataHSDPAPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSPDataHSDPAPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataHSDPAPlugin/data/10282DC7.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/data/10282DC7.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for GSPDataHSDPAPlugin. +* +*/ + +#include + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x10282DC7; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10282DC8; // + version_no = 1; + display_name = "High-speed packet access"; + default_data = "0x1020724E"; // Parent UID + opaque_data = "30"; // Order number + } + }; + } + }; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataHSDPAPlugin/data/GSPDataHSDPAPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/data/GSPDataHSDPAPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,168 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for GSPDataHSDPAPlugin. +* +*/ + + +// RESOURCE IDENTIFIER +NAME HSPA // 4 letter ID + +// INCLUDES +#include + +#include +#include +#include // Avkon localized strings +#include +#include +#include +#include +#include + +// CONSTANTS + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// +// +// Needed or loading the resource fails! +// +//---------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + + +//---------------------------------------------------- +// +// r_gs_pdatahsdpa_plugin_caption +// Packet Data HSDPA Plugin caption. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_pdatahsdpa_plugin_caption + { + buf = qtn_set_hspa_setting; + } + +//---------------------------------------------------- +// +// r_gs_pdatahsdpa_view +// Packet Data HSDPA view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_pdatahsdpa_view + { + menubar = r_gs_menubar_change_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE; + } + + +//---------------------------------------------------- +// +// r_gs_pdatahsdpa_setting_page +// +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_gs_pdatahsdpa_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_set_hspa_setting; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + + +//---------------------------------------------------- +// +// r_gs_pdatahsdpa_setting_page_lbx +// +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_gs_pdatahsdpa_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_set_hspa_setting_enabled; + }, + LBUF + { + txt = qtn_set_hspa_setting_disabled; + } + }; + } + + +//---------------------------------------------------- +// +// r_gs_pdatahsdpa_on_text +// Packet Data HSDPA text for HSDPA value on. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_hsdpa_enable_text + { + buf = qtn_set_hspa_setting_enabled; + } + +//---------------------------------------------------- +// +// r_gs_pdatahsdpa_off_text +// Packet Data HSDPA text for HSDPA value Disable. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_hsdpa_disable_text + { + buf = qtn_set_hspa_setting_disabled; + } + + +// ----------------------------------------------------------------------------- +// r_confirm_nw_reset_hsdpa +// ----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_confirm_nw_reset_hsdpa + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + items = + { + DLG_LINE + { + type = EAknCtQuery; + itemflags = EEikDlgItemNonFocusing; + id = EGeneralQuery; + control= AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationLayout; + label = qtn_set_hspa_quest_change_via_offline; + animation = R_QGN_NOTE_QUERY_ANIM; + }; + } + }; + } +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataHSDPAPlugin/inc/GSPDataHSDPAModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/inc/GSPDataHSDPAModel.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataHSDPAPlugin model. +* +*/ + +#ifndef GSPDATAHSDPAMODEL_H +#define GSPDATAHSDPAMODEL_H + +// INCLUDES +// INCLUDES +#include +#include +#include +#include +#include +#include +// CONSTANTS + +const TInt KSettingHsdpaDisable = 0; +const TInt KSettingHsdpaEnable = 1; + + +// CLASS DEFINITIONS + +class CRfsHandler; +class RMmCustomAPI; +class RMobilePhone; +/** +* CGSPDataHSDPAModel is the model class of GS app. +* It provides functions to get and set setting values. +*/ +class CGSPDataHSDPAModel : public CBase + { + public: // Constructor and destructor + /** + * Two-phased constructor + */ + static CGSPDataHSDPAModel* NewL(); + + /** + * Destructor + */ + ~CGSPDataHSDPAModel(); + + public: //new + /** + * Returns packet data HSDPA state. + * @return 0: Disabled + * 1: Enabled + */ + TInt CurrentHSDPAItemL(); + + /** + * Set packet data HSDPA state. + * @param ahsdpaValue 0: Disabled + * 1: Enabled + */ + void SetHSDPAItemValueL( TInt aHsdpaValue ); + + /** + * Returns packet data HSDPA state. + * @return 1: Show + * 0 : Hide + */ + TInt HSDPAItemVisibilityL(); + + /** + * Set packet data HSDPA Visibility. + * @param aHsdpaVisible 0: Hide + * 1: Show + */ + void SetHSDPAItemVisibilityL( TInt aHsdpaVisible ); + + private: // Private constructors + /** + * Default C++ contructor + */ + CGSPDataHSDPAModel(); + + /** + * Symbian OS default constructor + * @return void + */ + void ConstructL(); + + private: // Data + // Handle to tel server. + RTelServer iTelServer; + + //Handle to Custom API + RMmCustomAPI iCustomAPI; + + // Handle to Mobile phone. + RMobilePhone iMobilePhone ; + + // Networking repository + CRepository* iNetworkRepository; + + }; +#endif // GSPDATAHSDPAMODEL_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataHSDPAPlugin/inc/GSPDataHSDPAPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/inc/GSPDataHSDPAPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,215 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataHSDPAPlugin implementation. +* +*/ + +#ifndef GSPDATAHSDPAPLUGIN_H +#define GSPDATAHSDPAPLUGIN_H + +// User includes + +// System includes +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Classes referenced +class CAknNavigationDecorator; +class CAknViewAppUi; +class CAknWaitDialog; +class CGSPDataHSDPAModel; + +// Constants +const TUid KGSPDataHSDPAPluginUID = { 0x10282DC8 }; +_LIT( KPDataHSDPAResourceFileName, "z:GSPDataHSDPAPluginRsc.rsc" ); + +// CLASS DECLARATION + +/** +* CGSPDataHSDPAPlugin view class. +* +* This class handles state and application logic of PDataHSDPA settings. +* The plugin is a type of EGSItemTypeSettingDialog and therefore the GS FW will +* call HandleSelection() instead of DoActivate(). +* +*/ +class CGSPDataHSDPAPlugin : public CGSPluginInterface, + public MGSSettingPSObserver, + public MProEngProfileActivationObserver + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return + */ + static CGSPDataHSDPAPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSPDataHSDPAPlugin(); + + public: // From CAknView + + /** + * See base class. + */ + TUid Id() const; + + public: // From CGSPluginInterface + + /** + * See base class. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + TInt PluginProviderCategory() const; + + /** + * See base class. + */ + TGSListboxItemTypes ItemType(); + + /** + * See base class. + */ + void GetValue( const TGSPluginValueKeys aKey, + TDes& aValue ); + + /** + * See base class. + */ + void HandleSelection( const TGSSelectionTypes aSelectionType ); + + /** + * See base class. + */ + TGSMenuActivationItems MenuActivationItem(); + + /** + * @see CGSPluginInterface header file. + */ + TBool Visible() const; + + public: //From MProEngProfileActivationObserver + + /** + * Callback for device profile change + * Used for observing offline mode activation + */ + void HandleProfileActivatedL( TInt aProfileId ); + + protected: // New + + /** + * C++ default constructor. + */ + CGSPDataHSDPAPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + protected: // From CAknView + + /** + * See base class. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * See base class. + */ + void DoDeactivate(); + + private: // New + + /** + * Sets HSDPA state. + * Launches a setting page with a confirmation dialog + */ + void SetHSDPAStateL(); + + /** + * Opens localized resource file. + */ + void OpenLocalizedResourceFileL( + const TDesC& aResourceFileName, + RConeResourceLoader& aResourceLoader ); + + /** + * Resets all Active Connections, If Any. + */ + void ResetActiveConnectionsL(); + + /* + * + * Indexes of HSDPA on/off items in a listbox are not the same as + * aPDataHSDPState value. Therefore matching between these two is + * required. + */ + TBool ShowHSDPASettingPageL( TInt& aHsdpaState ); + + /** + * Leaving version of GetValue() + */ + void GetValueL( TDes& aValue ); + + /** + * Updating parent view + */ + void UpdateParentViewL(); + + private: // From MGSSettingPSObserver + /** + * Callback from MGSSettingPSObserver + */ + void HandleNotifyPSL( const TUid aUid, const TInt& aKey, + const TRequestStatus& aStatus ); + + protected: // Data + + // PDataHSDPA model. + CGSPDataHSDPAModel* iModel; + + // Resource loader. + RConeResourceLoader iResources; + + //PubSub object for NW mode state listener + CGSPubSubsListener* iNwModeListener; + + MProfileEngine* iProfileEngine; + MProEngNotifyHandler* iNotifyHandler; + + TInt iNetworkMode; + + TBool iHSDPASettingSupport; + }; + +#endif // GSPDATAHSDPAPLUGIN_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataHSDPAPlugin/loc/GSPDataHSDPAPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/loc/GSPDataHSDPAPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSPDataHSDPAPlugin. +* +*/ + +// LOCALISATION STRINGS + +// **OPTIONS MENU +// **PACKET DATA (CONNECTION) VIEW + +//d:Text of a list item in Packet data setting list view's list +//d:Item opens High-speed packet access point name setting page +//l:list_setting_pane_t1 +//w: +//r:4.0 +// +#define qtn_set_hspa_setting "High-speed packet access" + + + +//d:Text in setting list item's current value field +//d:AHigh-speed packet access list item +//d:Current value field text when current value is Enabled +//l:list_set_graphic_pane_t1 +//w: +//r:4.0 +// +#define qtn_set_hspa_setting_enabled "Enabled" + + +//d:Text in setting list item's current value field +//d:AHigh-speed packet access list item +//d:Current value field text when current value is Disabled +//l:list_set_graphic_pane_t1 +//w: +//r:4.0 +// +#define qtn_set_hspa_setting_disabled "Disabled" + +//d:Used when changing hsdpa value +//d:To ensure that all the current network connections are reset +//d:Before actually changing the value in the UI +//l:popup_note_window +//w: +//r:4.0 +// +#define qtn_set_hspa_quest_change_via_offline "All active connections will be disconnected. Continue?" + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAModel.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,142 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Model for GSPDataHSDPAPlugin. +* +*/ + + +// INCLUDE FILES +#include "GSPDataHSDPAModel.h" +#include "GsLogger.h" + +#include +#include +#include + + +// CONSTANTS + +// ================= MEMBER FUNCTIONS ======================= + + +// ---------------------------------------------------------------------------- +// CGSPDataHSDPAModel::NewL +// +// EPOC two-phased constructor +// ---------------------------------------------------------------------------- +// +CGSPDataHSDPAModel* CGSPDataHSDPAModel::NewL() + { + CGSPDataHSDPAModel* self = new( ELeave ) CGSPDataHSDPAModel; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CGSPDataHSDPAModel::CGSPDataHSDPAModel +// +// C++ default constructor can NOT contain any code, that +// might leave. +// ---------------------------------------------------------------------------- +// +CGSPDataHSDPAModel::CGSPDataHSDPAModel() + { + __GSLOGSTRING( "[CGSPDataHSDPAModel] CGSPDataHSDPAModel()" ); + } + + +// ---------------------------------------------------------------------------- +// CGSPDataHSDPAModel::ConstructL +// +// EPOC default constructor can leave. +// ---------------------------------------------------------------------------- +// +void CGSPDataHSDPAModel::ConstructL() + { + if( FeatureManager::FeatureSupported( KFeatureIdLoggerGprs ) ) + { + User::LeaveIfError( iTelServer.Connect() ); + User::LeaveIfError( iMobilePhone.Open( iTelServer, KMmTsyPhoneName ) ); + User::LeaveIfError( iCustomAPI.Open( iMobilePhone ) ); + } + } + + +// ---------------------------------------------------------------------------- +// CGSPDataHSDPAModel::~CGSPDataHSDPAModel +// +// Destructor +// ---------------------------------------------------------------------------- +// +CGSPDataHSDPAModel::~CGSPDataHSDPAModel() + { + if( FeatureManager::FeatureSupported( KFeatureIdLoggerGprs ) ) + { + iCustomAPI.Close(); + iMobilePhone.Close(); + iTelServer.Close(); + } + __GSLOGSTRING( "[CGSPDataConnectionModel] Handles closed." ); + } + +// ---------------------------------------------------------------------------- +// CGSPDataModel::CurrentHSDPAItemL +// +// Returns 0( Disabled ) /1 (Enabled) . +// ---------------------------------------------------------------------------- +// +TInt CGSPDataHSDPAModel::CurrentHSDPAItemL() + { + TInt hsdpaValue = EFalse; + TRequestStatus status; + RMmCustomAPI::THSxPAStatus hSxPAStatus; + iCustomAPI.ReadHSxPAStatus( status,hSxPAStatus ); + User::WaitForRequest( status ); + if ( hSxPAStatus == RMmCustomAPI::EHSxPADisabled ) + { + hsdpaValue = EFalse; // HSDPA Disable + } + else if ( hSxPAStatus == RMmCustomAPI::EHSxPAEnabled ) + { + hsdpaValue = ETrue; //HSDPA Enable + } + return hsdpaValue; + } + +// ---------------------------------------------------------------------------- +// CGSPDataModel::CurrentHSDPAItemL +// +// Set 0( Disabled ) /1 (Enabled) . +// ---------------------------------------------------------------------------- +// +void CGSPDataHSDPAModel::SetHSDPAItemValueL( TInt aHsdpaValue ) + { + TRequestStatus status; + RMmCustomAPI::THSxPAStatus hSxPAStatus; + if ( aHsdpaValue == 0 ) + { + hSxPAStatus = RMmCustomAPI::EHSxPADisabled; + } + else + { + hSxPAStatus = RMmCustomAPI::EHSxPAEnabled; + } + iCustomAPI.WriteHSxPAStatus( status,hSxPAStatus ); + User::WaitForRequest( status ); + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,529 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataHSDPAPlugin implementation. +* +*/ + + +// User includes +#include "GSPDataHSDPAPlugin.h" +#include "GSPDataHSDPAModel.h" +#include +#include +#include // GUI Resource +#include +#include + +// System includes +#include +#include +#include +#include +#include +#include +#include +#include // HlpLauncher +#include +#include +#include +#include +#include +#include +#include +#ifdef RD_STARTUP_CHANGE +#include +#endif +#include +#include +#include "SettingsPrivateCRKeys.h" + +// Constants + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::CGSPDataHSDPAPlugin() +// Constructor +// +// --------------------------------------------------------------------------- +// +CGSPDataHSDPAPlugin::CGSPDataHSDPAPlugin() + : iResources( *iCoeEnv ) + { + } + + +// --------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::~CGSPDataHSDPAPlugin() +// Destructor +// +// --------------------------------------------------------------------------- +// +CGSPDataHSDPAPlugin::~CGSPDataHSDPAPlugin() + { + FeatureManager::UnInitializeLib(); + if ( iNwModeListener ) + { + delete iNwModeListener; + } + + iResources.Close(); + + if( iModel ) + { + delete iModel; + } + if( iProfileEngine ) + { + iProfileEngine->Release(); + iProfileEngine = NULL; + } + if( iNotifyHandler ) + { + delete iNotifyHandler; + iNotifyHandler = NULL; + } + } + + +// --------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::ConstructL(const TRect& aRect) +// Symbian OS two-phased constructor +// +// --------------------------------------------------------------------------- +// +void CGSPDataHSDPAPlugin::ConstructL() + { + FeatureManager::InitializeLibL(); + iModel = CGSPDataHSDPAModel::NewL(); + OpenLocalizedResourceFileL( KPDataHSDPAResourceFileName, + iResources ); + //PS listener initialization + iNwModeListener = CGSPubSubsListener::NewL( + KPSUidNetworkInfo, + KNWTelephonyNetworkMode, this ); + iNwModeListener->Get( iNetworkMode ); + + iProfileEngine = CreateProfileEngineL(); + + iNotifyHandler = ProEngFactory::NewNotifyHandlerL(); + iNotifyHandler->RequestProfileActivationNotificationsL( *this ); + + //Checking if HSDPA setting is suppose to be visible + CRepository* hsdpaRepository = CRepository::NewL( KCRUidNetworkSettings ); + User::LeaveIfError( hsdpaRepository->Get( KSettingsHSDPAVisbility, + iHSDPASettingSupport ) ); + + BaseConstructL( R_GS_PDATAHSDPA_VIEW ); + + delete hsdpaRepository; + } + + +// --------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::NewL() +// Static constructor +// +// --------------------------------------------------------------------------- +// +CGSPDataHSDPAPlugin* CGSPDataHSDPAPlugin::NewL( TAny* /*aInitParams*/ ) + { + CGSPDataHSDPAPlugin* self = + new( ELeave ) CGSPDataHSDPAPlugin(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::Id +// +// +// ----------------------------------------------------------------------------- +// +TUid CGSPDataHSDPAPlugin::Id() const + { + return KGSPDataHSDPAPluginUID; + } + +// ----------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::DoActivateL +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataHSDPAPlugin::DoActivateL( const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::DoDeactivate +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataHSDPAPlugin::DoDeactivate() + { + } + + +// ========================= From CGSPluginInterface ================== + + +// ----------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::GetCaptionL +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataHSDPAPlugin::GetCaptionL( TDes& aCaption ) const + { + HBufC* result = StringLoader::LoadL( R_GS_PDATAHSDPA_PLUGIN_CAPTION ); + aCaption.Copy( *result ); + delete result; + } + + +// ----------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::PluginProviderCategory +// +// +// ----------------------------------------------------------------------------- +// +TInt CGSPDataHSDPAPlugin::PluginProviderCategory() const + { + return KGSPluginProviderInternal; + } + + +// ----------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::ItemType() +// +// +// ----------------------------------------------------------------------------- +// +TGSListboxItemTypes CGSPDataHSDPAPlugin::ItemType() + { + return EGSItemTypeSettingDialog; + } + + +// ----------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::GetValue() +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataHSDPAPlugin::GetValue( const TGSPluginValueKeys aKey, + TDes& aValue ) + { + TRAPD( err, GetValueL( aValue ) ); + if ( err != KErrNone ) + { + CGSPluginInterface::GetValue( aKey, aValue ); + } + } + + +// ----------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::GetValueL() +// +// Leaving version of GetValue() +// ----------------------------------------------------------------------------- +// +void CGSPDataHSDPAPlugin::GetValueL( TDes& aValue ) + { + const TInt hsdpaState = iModel->CurrentHSDPAItemL(); + HBufC* result; + + switch( hsdpaState ) + { + case KSettingHsdpaEnable: + result = StringLoader::LoadL( R_GS_HSDPA_ENABLE_TEXT ); + aValue.Copy( *result ); + delete result; + break; + case KSettingHsdpaDisable: + result = StringLoader::LoadL( R_GS_HSDPA_DISABLE_TEXT ); + aValue.Copy( *result ); + delete result; + default: + break; + } + + } + + +// ----------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::HandleSelection() +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataHSDPAPlugin::HandleSelection( + const TGSSelectionTypes aSelectionType ) + { + switch( aSelectionType ) + { + // Launch setting page to change value. + case EGSSelectionBySelectionKey: + case EGSSelectionByMenu: + TRAP_IGNORE( SetHSDPAStateL() ); + break; + default: + break; + } + + } + + +// ----------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::ShowHSDPASettingPageL() +// +// Indexes of HSDPA on/off items in a listbox are not the same as aPDataHSDPAState +// value. Therefore matching between these two is required. +// ----------------------------------------------------------------------------- +// +TBool CGSPDataHSDPAPlugin::ShowHSDPASettingPageL( TInt& aHsdpaState ) + { + TInt prevHsdpaState = aHsdpaState; + TInt selectedIndex; + TBool isValueUpdated = EFalse; + + // Match HSDPA state to lbx item index: + switch( aHsdpaState ) + { + case KSettingHsdpaEnable: + selectedIndex = KSettingHsdpaDisable; + break; + case KSettingHsdpaDisable: + selectedIndex = KSettingHsdpaEnable; + break; + } + CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( + R_GS_PDATAHSDPA_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + + CAknRadioButtonSettingPage* dlg = + new (ELeave) CAknRadioButtonSettingPage + ( R_GS_PDATAHSDPA_SETTING_PAGE, + selectedIndex, + items ); + dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); + CleanupStack::PopAndDestroy( items ); + + // Match selected lbx item index to HSDPA state: + switch( selectedIndex ) + { + case KSettingHsdpaEnable: + aHsdpaState = KSettingHsdpaDisable; + break; + case KSettingHsdpaDisable: + aHsdpaState = KSettingHsdpaEnable; + break; + } + // Check if aPDataHSDPAState has been changed: + if( prevHsdpaState != aHsdpaState ) + { + TInt connectionErr(KErrNone); + TInt networkStatus; + + CRepository* repository = CRepository::NewL( KCRUidCoreApplicationUIs ); + connectionErr = repository->Get( KCoreAppUIsNetworkConnectionAllowed, + networkStatus ); + delete repository; + + if ( connectionErr == KErrNone ) + { + CAknQueryDialog* resetNote = CAknQueryDialog::NewL(); + if( resetNote->ExecuteLD( R_CONFIRM_NW_RESET_HSDPA ) ) + { + ResetActiveConnectionsL(); + isValueUpdated = ETrue; + } + } + } + return isValueUpdated; + } + +// ----------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::SetHSDPAStateL() +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataHSDPAPlugin::SetHSDPAStateL() + { + // Get information of if there are open connections + TInt hsdpaState = iModel->CurrentHSDPAItemL(); + const TBool isValueUpdated = ShowHSDPASettingPageL( hsdpaState ); + if ( isValueUpdated ) + { + // Store updated Active Idle state: + iModel->SetHSDPAItemValueL( hsdpaState ); + // Update HSDPA item's value to lbx: + UpdateParentViewL(); + } + } + +// ----------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::OpenLocalizedResourceFileL() +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataHSDPAPlugin::OpenLocalizedResourceFileL( + const TDesC& aResourceFileName, + RConeResourceLoader& aResourceLoader ) + { + RFs fsSession; + User::LeaveIfError( fsSession.Connect() ); + + // Find the resource file: + TParse parse; + parse.Set( aResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL ); + TFileName fileName( parse.FullName() ); + + // Get language of resource file: + BaflUtils::NearestLanguageFile( fsSession, fileName ); + + // Open resource file: + aResourceLoader.OpenL( fileName ); + + // If leave occurs before this, close is called automatically when the + // thread exits. + fsSession.Close(); + } + + +// ----------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::TGSMenuActivationItems() +// +// +// ----------------------------------------------------------------------------- +// +TGSMenuActivationItems CGSPDataHSDPAPlugin::MenuActivationItem() + { + return EGSMenuActivationItemChange; + } + + +// ---------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin +// +// Provides the visibility status of self to framework. +// ---------------------------------------------------------------------------- +// +TBool CGSPDataHSDPAPlugin::Visible() const + { + // We check for if HSDPA item is supported to make it visble + TBool hsdpaVisible = EFalse; + if ( FeatureManager::FeatureSupported( KFeatureIdHsxpaSupport ) && + iNetworkMode == ENWNetworkModeWcdma && + iProfileEngine->ActiveProfileId() != EProfileOffLineId && + iHSDPASettingSupport ) + { + hsdpaVisible = ETrue; + } + return hsdpaVisible; + } + +// --------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::ResetActiveConnectionsL +// +// All Active connections if any, are reset +// instead of rebooting the phone, this is all +// to make sure that HSDPA setting item is enabled or disabled +// from UI level which now doesnt conflict to exact functionality of CoreUi +// --------------------------------------------------------------------------- +// +void CGSPDataHSDPAPlugin::ResetActiveConnectionsL() +{ +#ifdef RD_STARTUP_CHANGE + RStarterSession rSession; + + if( iProfileEngine->ActiveProfileId() != EProfileOffLineId ) + { + User::LeaveIfError( rSession.Connect() ); + rSession.ResetNetwork(); + rSession.Close(); + } + +#endif +} + +// --------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::HandleNotifyPSL +// +// Handling PS keys change +// --------------------------------------------------------------------------- +// +void CGSPDataHSDPAPlugin::HandleNotifyPSL( const TUid aUid, const TInt& aKey, + const TRequestStatus& /* aStatus */ ) + { + // We check the NW mode value from PS Key + if ( aUid == KPSUidNetworkInfo && + aKey == KNWTelephonyNetworkMode ) + { + iNwModeListener->Get( iNetworkMode ); + } + UpdateParentViewL(); + } + + +// ---------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::HandleProfileActivatedL +// From MProEngProfileActivationObserver +// +// Callback for device profile change +// Used for observing offline mode activation +// ---------------------------------------------------------------------------- +// +void CGSPDataHSDPAPlugin::HandleProfileActivatedL( TInt /*aProfileId*/ ) + { + UpdateParentViewL(); + } + +// ---------------------------------------------------------------------------- +// CGSPDataHSDPAPlugin::UpdateParentViewL +// +// Updating parent view +// ---------------------------------------------------------------------------- +// +void CGSPDataHSDPAPlugin::UpdateParentViewL() + { + CGSParentPlugin* parent = static_cast( + AppUi()->View( KGSPDataPluginUid ) );// This is the parent plugin + + // Now let's check if Standby view is active + TGSCustomOperationType paramValue = EGSCustomOperationViewActive; + TAny* param = ¶mValue; + TAny* returnValue = parent->CustomOperationL( param, NULL ); + TBool* ViewActive = static_cast ( returnValue ); + + if ( *ViewActive ) + { + if ( parent ) + { + parent->UpdateView(); + } + } + } + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for GSPDataHSDPAPlugin. +* +*/ + + +// User includes +#include "GSPDataHSDPAPlugin.h" + +// System includes +#include +#include + + +// Constants +const TImplementationProxy KGSPDataHSDPAPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x10282DC8, CGSPDataHSDPAPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSPDataHSDPAPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSPDataHSDPAPluginImplementationTable; + } + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataPlugin/Data/1020724F.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataPlugin/Data/1020724F.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for GSPDataPlugin. +* +*/ + +#include + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x1020724F; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x1020724E; + version_no = 1; + display_name = "Packet Data Plugin"; + #ifdef RD_CONTROL_PANEL + default_data = "0x10283341"; // Parent UID + opaque_data = "10"; // Order number + #else //RD_CONTROL_PANEL + default_data = "0x10207250"; // Parent UID + opaque_data = "70"; // Order number + #endif //RD_CONTROL_PANEL + } + }; + } + }; + } + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataPlugin/Data/GSPDataPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataPlugin/Data/GSPDataPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for GSPDataPlugin. +* +*/ + + +// RESOURCE IDENTIFIER +NAME PDAT // 4 letter ID + +// INCLUDES +#include // PData localized strings + +#include +#include +#include // Avkon localized strings +#include +#include +#include +#include +#include + +// CONSTANTS + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// +// +// Needed or loading the resource fails! +// +//---------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +//---------------------------------------------------- +// +// r_gs_gprs_view_title +// Packet data view's title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_gprs_view_title + { + txt = qtn_set_title_settings_gprs; + } + +//---------------------------------------------------- +// +// r_gs_gprs_plugin_caption +// Packet Data Plugin caption. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_gprs_plugin_caption + { + buf = qtn_set_folder_conn_gprs; + } + +//---------------------------------------------------- +// +// r_gs_pdata_view +// Packet data view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_pdata_view + { + menubar = r_gs_menubar_change_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE; + } +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataPlugin/GSPDataPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataPlugin/GSPDataPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification file for GSPDataPlugin. +* +*/ + +#include //this is needed for RESOURCE_FILES_DIR +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gspdataplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x1020724F +VENDORID VID_DEFAULT + +SOURCEPATH Src +SOURCE GSPDataPlugin.cpp +SOURCE GSPDataPluginImplementationTable.cpp + +USERINCLUDE ../Logger +USERINCLUDE Data +USERINCLUDE ../Data +USERINCLUDE Inc +USERINCLUDE loc + +// System Includes + +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/cshelp +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH Data + +//ECOM resource definition +START RESOURCE 1020724F.rss +TARGET gspdataplugin.rsc +TARGETPATH ECOM_RESOURCE_DIR +END // ECOM resource definition + +//PData resources +START RESOURCE GSPDataPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // PData resources + + +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY commdb.lib +LIBRARY commonengine.lib // RConeResourceLoader +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY egul.lib // CGulIcon +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY etel.lib // RPhone +LIBRARY etelpckt.lib // RPacketService +LIBRARY euser.lib +LIBRARY featmgr.lib // FeatureManager +LIBRARY flogger.lib // RFileLogger +LIBRARY gsecomplugin.lib +LIBRARY gsframework.lib // Base classes +LIBRARY gslistbox.lib // CGSListBoxItemTextArray +LIBRARY hlplch.lib // HlpLauncher + +//Documents. Defining these is optional. Used only by IDE's file browser. +SOURCEPATH Data +DOCUMENT 1020724F.rss +DOCUMENT GSPDataPluginRsc.rss + +SOURCEPATH Inc + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataPlugin/Inc/GSPDataPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataPlugin/Inc/GSPDataPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,140 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataPlugin header. +* +*/ + + +#ifndef GSPDATAPLUGIN_H +#define GSPDATAPLUGIN_H + +// Includes +#include +#include +#include +#include +#include + +// Classes referenced +class CAknViewAppUi; +class RConeResourceLoader; + +// Constants +_LIT( KPDataResourceFileName, "z:GSPdataPluginRsc.rsc" ); +_LIT( KGSPDataPluginIconDirAndName, "z:GSPDataPlugin.mbm"); // Use KDC_BITMAP_DIR + +// CLASS DECLARATION + +/** +* CGSPDataPlugin view class. +* +* @since Series60_3.1 +*/ +class CGSPDataPlugin : public CGSParentPlugin + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return + */ + static CGSPDataPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSPDataPlugin(); + + public: // From CAknView + + /** + * See base class. + */ + TUid Id() const; + + /** + * See base class. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + /** + * See base class. + */ + void DoDeactivate(); + + public: // From CGSParentPlugin + + /** + * See base class. + */ + TUid UpperLevelViewUid(); + + /** + * See base class. + */ + TGSListboxTypes ListBoxType(); + + /** + * See base class. + */ + void GetHelpContext( TCoeHelpContext& aContext ); + + public: // From CGSPluginInterface + + /** + * See base class. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * See base class. + */ + TInt PluginProviderCategory() const; + + TAny* CustomOperationL( TAny* aParam1, TAny* aParam2 ); + + protected: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + protected: // New + /** + * C++ default constructor. + */ + CGSPDataPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + private: // Data + + // Resource loader. + RConeResourceLoader iResourceLoader; + + // Indicates view active status + TBool iViewActive; + + }; + + +#endif // GSPDATAPLUGIN_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataPlugin/Src/GSPDataPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataPlugin/Src/GSPDataPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,311 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataPlugin source code. +* +*/ + + +// Includes +#include "GSPDataPlugin.h" +#include "GsLogger.h" +#include +#include // Icons +#include +#include +#include +#include + +#include +#include +#include +#include // For TResourceReader +#include + + +// Constants + + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CGSPDataPlugin::CGSPDataPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSPDataPlugin::CGSPDataPlugin() + : CGSParentPlugin(), iResourceLoader( *iCoeEnv ), iViewActive ( EFalse ) + { + __GSLOGSTRING( "[CGSPDataPlugin] CGSPDataPlugin()" ); + + } + + +// --------------------------------------------------------------------------- +// CGSPDataPlugin::~CGSPDataPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSPDataPlugin::~CGSPDataPlugin() + { + __GSLOGSTRING( "[CGSPDataPlugin] ~CGSPDataPlugin()|->" ); + iResourceLoader.Close(); + __GSLOGSTRING( "[CGSPDataPlugin] ~CGSPDataPlugin()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSPDataPlugin::ConstructL() +// +// +// --------------------------------------------------------------------------- +// +void CGSPDataPlugin::ConstructL() + { + __GSLOGSTRING( "[CGSPDataPlugin] ConstructL()|->" ); + OpenLocalizedResourceFileL( KPDataResourceFileName, iResourceLoader ); + BaseConstructL( R_GS_PDATA_VIEW, R_GS_GPRS_VIEW_TITLE ); + __GSLOGSTRING( "[CGSPDataPlugin] ConstructL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSPDataPlugin::NewL() +// +// +// --------------------------------------------------------------------------- +// +CGSPDataPlugin* CGSPDataPlugin::NewL( TAny* /*aInitParams*/ ) + { + __GSLOGSTRING( "[CGSPDataPlugin] NewL()" ); + + CGSPDataPlugin* self = new(ELeave) CGSPDataPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::Id() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSPDataPlugin::Id() const + { + return KGSPDataPluginUid; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoActivateL() +// +// +// --------------------------------------------------------------------------- +// +void CGSPDataPlugin::DoActivateL + ( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + __GSLOGSTRING( "[CGSPDataPlugin] DoActivateL()|->" ); + CGSParentPlugin::DoActivateL( aPrevViewId, + aCustomMessageId, + aCustomMessage ); + CGSMainView* parent = + static_cast ( AppUi()->View( KGSMainViewUid ) ); + + iViewActive = ETrue; + + // Create tab group for this view (do only if casting parent succeeds): + __GSLOGSTRING( "[CGSPDataPlugin] DoActivateL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoDeactivate() +// +// +// --------------------------------------------------------------------------- +// +void CGSPDataPlugin::DoDeactivate() + { + __GSLOGSTRING( "[CGSPDataPlugin] DoDeactivate()|->" ); + CGSParentPlugin::DoDeactivate(); + iViewActive = EFalse; + __GSLOGSTRING( "[CGSPDataPlugin] DoDeactivate()-|" ); + } + + +// ========================= From CGSParentPlugin ===================== + + +// --------------------------------------------------------------------------- +// CGSPDataPlugin::UpperLevelViewUid() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSPDataPlugin::UpperLevelViewUid() + { + #ifdef RD_CONTROL_PANEL + return KGSAdminPluginUid; + #else //RD_CONTROL_PANEL + return KGSConPluginUid; + #endif //RD_CONTROL_PANEL + } + + +// ========================= From CGSPluginInterface ================== + + +// --------------------------------------------------------------------------- +// CGSPDataPlugin::GetCaptionL() +// +// +// --------------------------------------------------------------------------- +// +void CGSPDataPlugin::GetCaptionL( TDes& aCaption ) const + { + __GSLOGSTRING( "[CGSPDataPlugin] GetCaptionL()|->" ); + HBufC* result = StringLoader::LoadL( R_GS_GPRS_PLUGIN_CAPTION ); + aCaption.Copy( *result ); + delete result; + __GSLOGSTRING( "[CGSPDataPlugin] GetCaptionL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSPDataPlugin::PluginProviderCategory() +// +// +// --------------------------------------------------------------------------- +// +TInt CGSPDataPlugin::PluginProviderCategory() const + { + return KGSPluginProviderInternal; + } + + +// ----------------------------------------------------------------------------- +// CGSPDataPlugin::GetHelpContext() +// +// +// ----------------------------------------------------------------------------- +// +void CGSPDataPlugin::GetHelpContext( TCoeHelpContext& aContext ) + { + aContext.iMajor = KUidGS; + aContext.iContext = KSET_HLP_CONNEC_GPRS; + } + + +// ----------------------------------------------------------------------------- +// CGSPDataPlugin::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CGSPDataPlugin::CreateIconL( const TUid aIconType ) + { + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSPDataPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropSetConnGprs, + fp->FullName(), + EMbmGspdatapluginQgn_prop_set_conn_gprs, + EMbmGspdatapluginQgn_prop_set_conn_gprs_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + CleanupStack::PopAndDestroy( fp ); + + return icon; + } + +// --------------------------------------------------------------------------- +// CGSPDataPlugin::ListBoxType() +// +// +// --------------------------------------------------------------------------- +// + +TGSListboxTypes CGSPDataPlugin::ListBoxType() + { + return EGSListBoxTypeSettings; + } + + +// ---------------------------------------------------------------------------- +// CGSPDataPlugin::DynInitMenuPaneL() +// +// Display the dynamic menu +// ---------------------------------------------------------------------------- +void CGSPDataPlugin::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + FeatureManager::InitializeLibL(); + // show or hide the 'help' menu item when supported + if( aResourceId == R_GS_MENU_ITEM_HELP ) + { + User::LeaveIfNull( aMenuPane ); + + if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + FeatureManager::UnInitializeLib(); + } + + +// ---------------------------------------------------------------------------- +// CGSPDataPlugin::CustomOperationL() +// +// +// ---------------------------------------------------------------------------- +TAny* CGSPDataPlugin::CustomOperationL( TAny* aParam1, TAny* /*aParam2*/ ) + { + TGSCustomOperationType* operationType = + static_cast ( aParam1 ); + switch ( *operationType ) + { + case EGSCustomOperationViewActive: + // Returning view status - ETrue if the view is active, EFalse if + // it's not + return &iViewActive; + default: + break; + } + return NULL; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataPlugin/Src/GSPDataPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataPlugin/Src/GSPDataPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for GSPDataPlugin. +* +*/ + + +// User includes +#include "GSPDataPlugin.h" + +// System includes +#include +#include + + + +// Constants +const TImplementationProxy KGSPDataSettingsPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x1020724E, CGSPDataPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSPDataSettingsPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSPDataSettingsPluginImplementationTable; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Information required for building GSPDataPlugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSPDataPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gspdataplugin.iby ) +../rom/GSPDataPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gspdatapluginresources.iby ) +loc/GSPDataPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gspdataplugin.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gspdataplugin.mif + OPTION HEADERFILE gspdataplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_set_conn_gprs +END + + +PRJ_MMPFILES +GSPDataPlugin.mmp + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSPDataPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPDataPlugin/loc/GSPDataPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPDataPlugin/loc/GSPDataPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSPDataPlugin. +* +*/ + +// LOCALISATION STRINGS + + +// **PACKET DATA VIEW + +//d:Text in title pane +//d:Packet data setting list view +//l:title_pane_t2/opt9 +//w: +//r:4.0 +// +#define qtn_set_title_settings_gprs "Packet data" + + +//d:Packet data plugin caption. +//l:list_double_large_graphic_pane_t1_cp2 +//w: +//r:4.0 +// +#define qtn_set_folder_conn_gprs "Packet data" + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPowerSavingQueryPlugin/Data/2002120C.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Data/2002120C.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for Power Saving Query plugin. +* +*/ + +#include + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x2002120C; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x2002120D; + version_no = 1; + display_name = "Power Saving Query Plugin"; + default_data = "0x10283317";// Parent UID + opaque_data = "16";//Order number + } + }; + } + }; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPowerSavingQueryPlugin/Data/GSPowerSavingQueryPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Data/GSPowerSavingQueryPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -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: Resource file for GSPowerSavingQueryPlugin +* +*/ + + + +// RESOURCE IDENTIFIER +NAME POWE // 4 letter ID + +// INCLUDES +#include "GSPowerSavingQueryPlugin.hrh" +#include + +#include // Avkon localized strings +#include +#include +#include +#include +#include + +// CONSTANTS + +// RESOURCE DEFINITIONS + +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + + +RESOURCE TBUF + { + buf="POWE"; + } + +//---------------------------------------------------- +// +// EIK_APP_INFO +// It contains application information. +// +//---------------------------------------------------- +// +RESOURCE EIK_APP_INFO + { + } + + +//---------------------------------------------------- +// r_gs_power_saving_query_view_caption +// +// Power saving query view caption for plugin +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_power_saving_query_view_caption + { + buf = qtn_cp_power_saving_query_settings; + } + +//---------------------------------------------------- +// +// r_gs_power_saving_query_view_title +// Power saving query view's title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_power_saving_query_view_title + { + txt = qtn_cp_power_saving_query_settings; + } + +//---------------------------------------------------- +// +// r_gs_power_saving_query_view +// Power saving query view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_power_saving_query_view + { + menubar = r_gs_powersavingquery_menubar; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE; + } + +// ----------------------------------------------------------------------------- +// +// r_gs_powersavingquery_menubar +// GS_Powersavingquery_Plugin menu with 'change' and 'exit' items without help. +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_BAR r_gs_powersavingquery_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_gs_menu_item_exit; + }, + MENU_TITLE + { + menu_pane = r_gs_menu_item_change; + } + }; + } + +//---------------------------------------------------- +// +// r_power_saving_query_lbx +// Power saving query view's listbox. +// +//---------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_power_saving_query_lbx + { + items = + { + GS_FEATURE + { + txt = " \t"qtn_power_saving_query_settings_header"\t\t"; + item = KGSSettIdPowerSavingQuery; + } + }; + } + +//---------------------------------------------------- +// +// r_power_saving_query_setting_page +// Power saving query setting page. +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_power_saving_query_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_power_saving_query_settings_header; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +//---------------------------------------------------- +// +// r_power_saving_query_setting_page_lbx +// Power saving query setting page's listbox. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_power_saving_query_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_power_saving_query_settings_val_on; + }, + LBUF + { + txt = qtn_power_saving_query_settings_val_off; + } + }; + } + +//---------------------------------------------------- +// +// r_power_saving_query_on +// On value. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_power_saving_query_on + { + buf = qtn_power_saving_query_settings_val_on; + } + +//---------------------------------------------------- +// +// r_power_saving_query_off +// Off value. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_power_saving_query_off + { + buf = qtn_power_saving_query_settings_val_off; + } + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPowerSavingQueryPlugin/GSPowerSavingQueryPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/GSPowerSavingQueryPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification file. +* +*/ + + +#include // For RESOURCE_FILES_DIR +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gspowersavingqueryplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x2002120C +VENDORID VID_DEFAULT + + +SOURCEPATH Src +SOURCE GSPowerSavingQueryPlugin.cpp +SOURCE GSPowerSavingQueryPluginModel.cpp +SOURCE GSPowerSavingQueryPluginContainer.cpp +SOURCE GSPowerSavingQueryPluginImplementationTable.cpp + +//User include paths +USERINCLUDE Inc +USERINCLUDE Data // For *.rh +USERINCLUDE loc +USERINCLUDE ../Logger +USERINCLUDE ../Data // For GSCommonResources.rss + +//System include paths +SYSTEMINCLUDE /epoc32/include/ecom +// Default system include paths for middleware layer modules. +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH Data + +START RESOURCE 2002120C.rss +TARGET gspowersavingqueryplugin.rsc +END + +START RESOURCE GSPowerSavingQueryPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY egul.lib +LIBRARY eikdlg.lib // eikon dialogs +LIBRARY commdb.lib + +LIBRARY commonengine.lib // For RConeResourceLoader +LIBRARY featmgr.lib // Feature manager +LIBRARY aknskinsrv.lib // for enhanced skinning +LIBRARY aknskins.lib // for enhanced skinning +LIBRARY hlplch.lib // for "Help" options menu +LIBRARY gsframework.lib // For base classes +LIBRARY gslistbox.lib // For CGSListBoxItemTextArray +LIBRARY flogger.lib // For GSLogger +LIBRARY gsecomplugin.lib +LIBRARY centralrepository.lib // For CenRep + +// End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,161 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View for Data call settings. +* +*/ + + +#ifndef GSPOWERSAVINGQUERYPLUGIN_H +#define GSPOWERSAVINGQUERYPLUGIN_H + +// INCLUDES +#include +#include + +//CONSTANTS +const TUid KGSPowerSavingQueryPluginUid = { 0x2002120C }; +_LIT( KGSPowerSavingQueryPluginIconDirAndName, "z:GSPowerSavingQueryPlugin.mbm"); // Use KDC_BITMAP_DIR + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CGSPowerSavingQueryPluginContainer; + +// CLASS DEFINITION +/** +* CGSPowerSavingQueryPlugin view class for power saving query settings +* @since Series 60_5.1 +* +*/ +class CGSPowerSavingQueryPlugin : public CGSBaseView + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return GS connection view. + */ + static CGSPowerSavingQueryPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor + */ + ~CGSPowerSavingQueryPlugin(); + + public: // From CGSPluginInterface + + /** + * @see CGSPluginInterface header file. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * @see CGSPluginInterface header file. + */ + TInt PluginProviderCategory() const; + + /** + * @see CGSPluginInterface header file. + */ + TBool Visible() const; + + public: // from base classes + + /** + * Returns view id. + * @return TUid + */ + TUid Id() const; + + /** + * Handles commands. + * @param aCommand Command to be handled. + * + */ + void HandleCommandL( TInt aCommand ); + public: // From CAknView + + /** + * See base class. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ); + + /** + * See base class. + */ + void DoDeactivate(); + + public: // new + + /** + * Updates listbox's item's value. + * @param aItemId An item which is updated. + * + */ + void UpdateListBoxL( TInt aItemId ); + + /** + * Get CGSPowerSavingQueryPlugin's ccontainer. + */ + CGSPowerSavingQueryPluginContainer* Container(); + + protected: + + /** + * C++ default constructor. + */ + CGSPowerSavingQueryPlugin(); + + /** + * Symbian OS default constructor. + * + */ + void ConstructL(); + + private: // from CGSBaseView + + void NewContainerL(); + void HandleListBoxSelectionL(); + + private: // new methods + + /** + * Display power saving query setting page. + */ + void ShowSettingPageL(); + + /** + * SwitchOnOffValue + */ + void SwitchOnOffValue(TInt &aValue); + private: + // resource loader + RConeResourceLoader iResourceLoader; + + }; + +#endif //GSPOWERSAVINGQUERYPLUGIN_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPlugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPlugin.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains common definitions for menu id:s +* +*/ + + +#ifndef GSPOWERSAVINGQUERYPLUGIN_HRH +#define GSPOWERSAVINGQUERYPLUGIN_HRH + +// setting item id +enum TSettingItemId + { + KGSSettIdPowerSavingQuery + }; + +//Power saving query value +enum TGSPowerSavingQuery + { + EGSPowerSavingQueryOff = 0, + EGSPowerSavingQueryOn + }; + +#endif // GSPOWERSAVINGQUERYPLUGIN_HRH + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPluginContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPluginContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for Power saving query settings view. +* +*/ + + +#ifndef GSPOWERSAVINGQUERYPLUGINCONTAINER_H +#define GSPOWERSAVINGQUERYPLUGINCONTAINER_H + +// INCLUDES +#include + +// FORWARD DECLARATION +class CGSListBoxItemTextArray; +class CGSPowerSavingQueryPluginModel; + +// CLASS DECLARATION + +/** +* CGSPowerSavingQueryPluginContainer container class +* @since Series 60_3.1 +* +*/ +class CGSPowerSavingQueryPluginContainer : public CGSBaseContainer + { + public: // Constructors and destructor + + /** + * Symbian OS constructor. + * @param aRect Listbox's rect. + * + */ + void ConstructL( const TRect& aRect ); + + /** + * Destructor. + */ + ~CGSPowerSavingQueryPluginContainer(); + + public: //new + + /** + * Updates listbox's item's value. + * @param aFeatureId An item which is updated. + * + */ + void UpdateListBoxL( TInt aFeatureId ); + + /** + * Retrieves the currently selected listbox feature id + * @return feature id. + */ + TInt CurrentFeatureId() const; + + /** + * Retrieves the power saving query plugin data model + * @return the data model + */ + CGSPowerSavingQueryPluginModel* Model(); + + protected: // from CGSBaseContainer + void ConstructListBoxL( TInt aResLbxId ); + + private: // new + void CreateListBoxItemsL(); + + /* + * MakePowerSavingQueryItemL + */ + void MakePowerSavingQueryItemL(); + + private: // data + //Listbox item array model + CGSListBoxItemTextArray* iListboxItemArray; + //Data Model + CGSPowerSavingQueryPluginModel* iModel; + }; + +#endif //GSPOWERSAVINGQUERYPLUGINCONTAINER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPluginModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPluginModel.h Wed Sep 01 12:20:44 2010 +0100 @@ -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: Model for Power saving query plugin. +* +*/ + + +#ifndef GSPOWERSAVINGQUERYPLUGINMODEL_H +#define GSPOWERSAVINGQUERYPLUGINMODEL_H + +// INCLUDES +#include + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CRepository; +// CLASS DEFINITION +/** +* CGSPowerSavingQueryPluginModel is the model class of Power saving query plugin. +* It provides functions to get and set setting values. +* @lib GSPowerSavingQueryPlugin.lib +* @since Series 60_5.1 + +*/ + +class CGSPowerSavingQueryPluginModel : public CBase + { + public: // Constructor and destructor + /** + * Two-phased constructor + */ + static CGSPowerSavingQueryPluginModel* NewL(); + + /** + * Destructor + */ + ~CGSPowerSavingQueryPluginModel(); + + public: + /** + * Returns the power saving query value (0 or 1) + * + * @return TInt + */ + TInt PowerSavingQueryEnabled(); + + /** + * Sets the the power saving query value. + * @param aQuery TInt (0 or 1) + * + * @return ETrue: no errors + * EFalse: an error has occurred + */ + TBool EnablePowerSavingQuery( TInt aQueryValue ); + + private: // Private constructors + /** + * Default C++ contructor + */ + CGSPowerSavingQueryPluginModel(); + + /** + * Symbian OS default constructor + * @return void + */ + void ConstructL(); + + private: // data + CRepository* iDeviceManagementRepository; + + }; + + +#endif //GSPOWERSAVINGQUERYPLUGINMODEL_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,384 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View for Power saving query +* +*/ + + +// INCLUDE FILES +#include "GSPowerSavingQueryPlugin.h" +#include "GSPowerSavingQueryPluginContainer.h" +#include "GSPowerSavingQueryPluginModel.h" +#include "GSPowerSavingQueryPlugin.hrh" +#include "GsLogger.h" +#include // icons +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // for hlplauncher +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS +const TInt KGSSettingOff = 0; +const TInt KGSSettingOn = 1; +const TInt KGSIndexOff = 1; +const TInt KGSIndexOn = 0; + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +_LIT( KGSPowerSavingQueryPluginResourceFileName, "z:GSPowerSavingQueryPluginRsc.rsc" ); + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS ============================== + +// ========================= MEMBER FUNCTIONS ================================ + +// ---------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::CGSPowerSavingQueryPlugin() +// +// Constructor +// ---------------------------------------------------------------------------- +// +CGSPowerSavingQueryPlugin::CGSPowerSavingQueryPlugin() + : iResourceLoader( *iCoeEnv ) + { + } + + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::NewL() +// +// Symbian OS default constructor +// --------------------------------------------------------------------------- +CGSPowerSavingQueryPlugin* CGSPowerSavingQueryPlugin::NewL( TAny* /*aInitParams*/ ) + { + CGSPowerSavingQueryPlugin* self = new( ELeave ) CGSPowerSavingQueryPlugin(); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::ConstructL() +// +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +void CGSPowerSavingQueryPlugin::ConstructL() + { + FeatureManager::InitializeLibL(); + // Find the resource file + TParse parse; + parse.Set( KGSPowerSavingQueryPluginResourceFileName, + &KDC_RESOURCE_FILES_DIR, NULL ); + TFileName fileName( parse.FullName() ); + + // Get language of resource file + BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName ); + + // Open resource file + iResourceLoader.OpenL( fileName ); + + BaseConstructL( R_GS_POWER_SAVING_QUERY_VIEW ); + } + + +// ---------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::~CGSPowerSavingQueryPlugin +// +// Destructor +// ---------------------------------------------------------------------------- +CGSPowerSavingQueryPlugin::~CGSPowerSavingQueryPlugin() + { + FeatureManager::UnInitializeLib(); + iResourceLoader.Close(); + } + + +// --------------------------------------------------------------------------- +// TUid CGSPowerSavingQueryPlugin::Id() +// +// Returns view's ID. +// --------------------------------------------------------------------------- +TUid CGSPowerSavingQueryPlugin::Id() const + { + return KGSPowerSavingQueryPluginUid; + } + + +// ========================= From CGSPluginInterface ================== + +// ---------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::GetCaption +// +// Return application/view caption. +// ---------------------------------------------------------------------------- +// +void CGSPowerSavingQueryPlugin::GetCaptionL( TDes& aCaption ) const + { + // the resource file is already opened. + HBufC* result = StringLoader::LoadL( R_GS_POWER_SAVING_QUERY_VIEW_CAPTION ); + + aCaption.Copy( *result ); + delete result; + } + + +// ---------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::PluginProviderCategory +// +// A means to identify the location of this plug-in in the framework. +// ---------------------------------------------------------------------------- +// +TInt CGSPowerSavingQueryPlugin::PluginProviderCategory() const + { + //To identify internal plug-ins. + return KGSPluginProviderInternal; + } + + +// ---------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::Visible +// +// Provides the visibility status of self to framework. +// ---------------------------------------------------------------------------- +// +TBool CGSPowerSavingQueryPlugin::Visible() const + { + return ETrue; + } + + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::HandleCommandL(TInt aCommand) +// +// Handles commands directed to this class. +// --------------------------------------------------------------------------- +void CGSPowerSavingQueryPlugin::HandleCommandL( TInt aCommand ) + { + switch ( aCommand ) + { + case EGSMSKCmdAppChange: + HandleListBoxSelectionL(); + break; + case EGSCmdAppChange: + ShowSettingPageL(); + break; + case EAknSoftkeyBack: + iAppUi->ActivateLocalViewL( KGSDeviceManagementPluginUid ); + break; + default: + iAppUi->HandleCommandL( aCommand ); + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::UpdateListBoxL +// +// Updates listbox items. +// --------------------------------------------------------------------------- +// +void CGSPowerSavingQueryPlugin::UpdateListBoxL( TInt aItemId ) + { + if( Container() ) + { + Container()->UpdateListBoxL( aItemId ); + } + } + + +// ---------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::Container +// +// Return handle to container class. +// ---------------------------------------------------------------------------- +// +CGSPowerSavingQueryPluginContainer* CGSPowerSavingQueryPlugin::Container() + { + return static_cast( iContainer ); + } + + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::NewContainerL() +// +// Creates new iContainer. +// --------------------------------------------------------------------------- +// +void CGSPowerSavingQueryPlugin::NewContainerL() + { + iContainer = new( ELeave ) CGSPowerSavingQueryPluginContainer; + } + + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::DoActivateL() +// +// From CAknView +// --------------------------------------------------------------------------- +// +void CGSPowerSavingQueryPlugin::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + __GSLOGSTRING("[CGSPowerSavingQueryPlugin]-->CGSPowerSavingQueryPlugin::DoActivateL"); + + CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + + __GSLOGSTRING("[CGSPowerSavingQueryPlugin]<--CGSPowerSavingQueryPlugin::DoActivateL"); + } + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::DoActivateL() +// +// From CAknView +// --------------------------------------------------------------------------- +// +void CGSPowerSavingQueryPlugin::DoDeactivate() + { + CGSBaseView::DoDeactivate(); + } + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::HandleListBoxSelectionL() +// +// Handles events raised through a rocker key. +// --------------------------------------------------------------------------- +void CGSPowerSavingQueryPlugin::HandleListBoxSelectionL() + { + CGSPowerSavingQueryPluginModel* model = Container()->Model(); + + TInt queryValue( model->PowerSavingQueryEnabled() ); + + if ( EGSPowerSavingQueryOn == queryValue ) + { + queryValue = EGSPowerSavingQueryOff; + } + else + { + queryValue = EGSPowerSavingQueryOn; + } + + model->EnablePowerSavingQuery( queryValue ); + + UpdateListBoxL( KGSSettIdPowerSavingQuery ); + } + + + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::ShowDialupAutodisconSettingPageL +// +// Display dialup auto disconnect setting page. +// --------------------------------------------------------------------------- +// +void CGSPowerSavingQueryPlugin::ShowSettingPageL() + { + TBool queryValue = Container()->Model()->PowerSavingQueryEnabled(); + + SwitchOnOffValue( queryValue ); + + CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( + R_POWER_SAVING_QUERY_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + + CAknRadioButtonSettingPage* dlg = new( ELeave ) CAknRadioButtonSettingPage( + R_POWER_SAVING_QUERY_SETTING_PAGE, queryValue, items ); + + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { + SwitchOnOffValue( queryValue ); + Container()->Model()->EnablePowerSavingQuery( queryValue ); + UpdateListBoxL( KGSSettIdPowerSavingQuery ); + } + + CleanupStack::PopAndDestroy( items ); + } + +// ----------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CGSPowerSavingQueryPlugin::CreateIconL( const TUid aIconType ) + { + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSPowerSavingQueryPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropCpDevPsActivate, + fp->FullName(), + EMbmGspowersavingquerypluginQgn_prop_cp_dev_ps_activate, + EMbmGspowersavingquerypluginQgn_prop_cp_dev_ps_activate_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + CleanupStack::PopAndDestroy( fp ); + + return icon; + + } + +// ----------------------------------------------------------------------------- +// CGSPowerSavingQueryPlugin::SwitchOnOffValue() +// +// +// ----------------------------------------------------------------------------- +// +void CGSPowerSavingQueryPlugin::SwitchOnOffValue( TInt& aValue ) + { + if ( aValue == KGSSettingOn ) + { + aValue = KGSIndexOn; + } + else if ( aValue == KGSSettingOff ) + { + aValue = KGSIndexOff; + } + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,180 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for the Power saving query view +* +*/ + + +// INCLUDE FILES +#include "GSPowerSavingQueryPluginContainer.h" +#include "GSPowerSavingQueryPluginModel.h" +#include "GSPowerSavingQueryPlugin.hrh" +#include "GsLogger.h" +#include +#include +#include +#include +#include +#include + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPluginContainer::ConstructL() +// +// Symbian OS two phased constructor +// --------------------------------------------------------------------------- +// +void CGSPowerSavingQueryPluginContainer::ConstructL( const TRect& aRect ) + { + __GSLOGSTRING("[CGSPowerSavingQueryPluginContainer]-->CGSPowerSavingQueryPluginContainer::ConstructL"); + + iListBox = new( ELeave ) CAknSettingStyleListBox; + iModel = CGSPowerSavingQueryPluginModel::NewL(); + + BaseConstructL( aRect, R_GS_POWER_SAVING_QUERY_VIEW_TITLE, + R_POWER_SAVING_QUERY_LBX ); + + __GSLOGSTRING("[CGSPowerSavingQueryPluginContainer]<--CGSPowerSavingQueryPluginContainer::ConstructL"); + } + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPluginContainer::~CGSPowerSavingQueryPluginContainer() +// +// Destructor +// --------------------------------------------------------------------------- +// +CGSPowerSavingQueryPluginContainer::~CGSPowerSavingQueryPluginContainer() + { + delete iListboxItemArray; + delete iModel; + } + + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPluginContainer::ConstructListBoxL() +// +// Construct the listbox from resource array. +// --------------------------------------------------------------------------- +// +void CGSPowerSavingQueryPluginContainer::ConstructListBoxL( TInt aResLbxId ) + { + __GSLOGSTRING("[CGSPowerSavingQueryPluginContainer]-->CGSPowerSavingQueryPluginContainer::ConstructListBoxL"); + + iListBox->ConstructL( this, EAknListBoxSelectionList ); + + iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, + *iListBox, *iCoeEnv ); + iListBox->Model()->SetItemTextArray( iListboxItemArray ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + CreateListBoxItemsL(); + + __GSLOGSTRING("[CGSPowerSavingQueryPluginContainer]<--CGSPowerSavingQueryPluginContainer::ConstructListBoxL"); + } + + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPluginContainer::CreateListBoxItemsL() +// +// Create listbox items. +// --------------------------------------------------------------------------- +// +void CGSPowerSavingQueryPluginContainer::CreateListBoxItemsL() + { + __GSLOGSTRING("[CGSPowerSavingQueryPluginContainer]-->CGSPowerSavingQueryPluginContainer::CreateListBoxItemsL"); + + MakePowerSavingQueryItemL(); + + __GSLOGSTRING("[CGSPowerSavingQueryPluginContainer]<--CGSPowerSavingQueryPluginContainer::CreateListBoxItemsL"); + } + + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPluginContainer::UpdateListBoxL() +// +// Update listbox item. +// --------------------------------------------------------------------------- +// +void CGSPowerSavingQueryPluginContainer::UpdateListBoxL( TInt aFeatureId ) + { + switch( aFeatureId ) + { + case KGSSettIdPowerSavingQuery: + MakePowerSavingQueryItemL(); + break; + default: + break; + } + + iListBox->HandleItemAdditionL(); + } + + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPluginContainer::MakePowerSavingQueryItemL() +// +// Create Power saving query list item +// --------------------------------------------------------------------------- +// +void CGSPowerSavingQueryPluginContainer::MakePowerSavingQueryItemL() + { + __GSLOGSTRING("[CGSPowerSavingQueryPluginContainer]-->CGSPowerSavingQueryPluginContainer::MakePowerSavingQueryItemL"); + + TInt queryValue = iModel->PowerSavingQueryEnabled(); + + TInt resId( R_POWER_SAVING_QUERY_OFF ); + if ( EGSPowerSavingQueryOn == queryValue ) + { + resId = R_POWER_SAVING_QUERY_ON; + } + + HBufC* buf = iEikonEnv->AllocReadResourceL( resId ); + + TPtr bufPtr( buf->Des() ); + iListboxItemArray->SetDynamicTextL( KGSSettIdPowerSavingQuery, bufPtr ); + + // And add to listbox + iListboxItemArray->SetItemVisibilityL( KGSSettIdPowerSavingQuery, + CGSListBoxItemTextArray::EVisible ); + + delete buf; + + __GSLOGSTRING("[CGSPowerSavingQueryPluginContainer]<--CGSPowerSavingQueryPluginContainer::MakePowerSavingQueryItemL"); + + } + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPluginContainer::CurrentFeatureId() +// +// Return the feature id of selected listitem +// --------------------------------------------------------------------------- +// +TInt CGSPowerSavingQueryPluginContainer::CurrentFeatureId() const + { + return iListboxItemArray->CurrentFeature(); + } + +// --------------------------------------------------------------------------- +// CGSPowerSavingQueryPluginContainer::Model() +// +// Return the power saving query plugin data model +// --------------------------------------------------------------------------- +// +CGSPowerSavingQueryPluginModel* CGSPowerSavingQueryPluginContainer::Model() + { + return iModel; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for GSPowerSavingQueryPlugin +* +*/ + + +// INCLUDES +#include "GSPowerSavingQueryPlugin.h" +#include +#include + + +// CONSTANTS +const TImplementationProxy KGSPowerSavingQueryPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x2002120D, CGSPowerSavingQueryPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// +// Gate/factory function +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSPowerSavingQueryPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSPowerSavingQueryPluginImplementationTable; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginModel.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -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: Model for Power saving query plugin. +* +*/ + + +// INCLUDES +#include "GSPowerSavingQueryPluginModel.h" +#include +#include +#include "GSPowerSavingQueryPlugin.hrh" +#include "GsLogger.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// ============================= LOCAL FUNCTIONS ============================== + +// ========================= MEMBER FUNCTIONS ================================= + +// ---------------------------------------------------------------------------- +// CGSPowerSavingQueryPluginModel::NewL +// +// Symbian OS two-phased constructor +// ---------------------------------------------------------------------------- +// +CGSPowerSavingQueryPluginModel* CGSPowerSavingQueryPluginModel::NewL() + { + CGSPowerSavingQueryPluginModel* self = + new( ELeave ) CGSPowerSavingQueryPluginModel(); + + CleanupStack::PushL( self ); + self->ConstructL(); + + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CGSPowerSavingQueryPluginModel::CGSPowerSavingQueryPluginModel +// +// +// C++ default constructor can NOT contain any code, that might leave. +// ---------------------------------------------------------------------------- +// +CGSPowerSavingQueryPluginModel::CGSPowerSavingQueryPluginModel() + { + + } + + +// ---------------------------------------------------------------------------- +// CGSPowerSavingQueryPluginModel::ConstructL +// +// Symbian OS default constructor can leave. +// ---------------------------------------------------------------------------- +// +void CGSPowerSavingQueryPluginModel::ConstructL() + { + __GSLOGSTRING("[CGSPowerSavingQueryPluginModel]-->CGSPowerSavingQueryPluginModel::ConstructL"); + + iDeviceManagementRepository = + CRepository::NewL( KCRUidDeviceManagementSettings ); + + __GSLOGSTRING("[CGSPowerSavingQueryPluginModel]<--CGSPowerSavingQueryPluginModel::ConstructL"); + } + + +// ---------------------------------------------------------------------------- +// CGSPowerSavingQueryPluginModel::~CGSPowerSavingQueryPluginModel +// +// Destructor +// ---------------------------------------------------------------------------- +// +CGSPowerSavingQueryPluginModel::~CGSPowerSavingQueryPluginModel() + { + delete iDeviceManagementRepository; + } + +// ---------------------------------------------------------------------------- +// CGSPowerSavingQueryPluginModel::PowerSavingQueryEnabled(); +// +// Reads power saving query value from central repository +// ---------------------------------------------------------------------------- +// +TInt CGSPowerSavingQueryPluginModel::PowerSavingQueryEnabled() + { + TInt queryValue( EGSPowerSavingQueryOff ); + iDeviceManagementRepository->Get( KSettingsPowerSavingQuery, queryValue ); + return queryValue; + } + + +// ---------------------------------------------------------------------------- +// CGSPowerSavingQueryPluginModel::EnablePowerSavingQuery +// +// Writes power saving query value to central repository +// ---------------------------------------------------------------------------- +// +TBool CGSPowerSavingQueryPluginModel::EnablePowerSavingQuery( TInt aQueryValue ) + { + return iDeviceManagementRepository->Set( KSettingsPowerSavingQuery, + aQueryValue ); + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPowerSavingQueryPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSPowerSavingQueryPlugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSPowerSavingQueryPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gspowersavingqueryplugin.iby ) +../rom/GSPowerSavingQueryPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gspowersavingquerypluginresources.iby ) +loc/GSPowerSavingQueryPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gspowersavingqueryplugin.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE GSPowerSavingQueryPlugin.mif + OPTION HEADERFILE GSPowerSavingQueryPlugin.mbg + OPTION SOURCES -c8,8 qgn_prop_cp_dev_ps_activate +END + +PRJ_MMPFILES +GSPowerSavingQueryPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPowerSavingQueryPlugin/loc/GSPowerSavingQueryPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPowerSavingQueryPlugin/loc/GSPowerSavingQueryPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -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: Localization strings for GSPowerSavingQueryPlugin. +* +*/ + + +// LOCALISATION STRINGS + +//d:Text of a list item in parent view's list +//d:Item opens Power saving query plugin view +//l:list_single_large_graphic_pane_t1 +//w: +//r: 5.1 +#define qtn_cp_power_saving_query_settings "Power saving query" + +//d:Text of a list item in Power saving query plugin view +//l:list_setting_pane_t1 +//w: +//r: 5.1 +#define qtn_power_saving_query_settings_header "Power saving query" + +//d:Item in Power saving query setting page's list +//l:list_set_graphic_pane_t1 +//w: +//r: 5.1 +// +#define qtn_power_saving_query_settings_val_on "On" + +//d:Item in Power saving query setting page's list +//l:list_set_graphic_pane_t1 +//w: +//r: 5.1 +// +#define qtn_power_saving_query_settings_val_off "Off" + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPrslnPlugin/GSPrslnPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPrslnPlugin/GSPrslnPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for plugin. +* +*/ + +#include // For RESOURCE_FILES_DIR +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gsprslnplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10207253 +VENDORID VID_DEFAULT + +SOURCEPATH src +SOURCE GSPrslnPluginImplementationTable.cpp +SOURCE GSPrslnPlugin.cpp + +USERINCLUDE inc +USERINCLUDE data +USERINCLUDE ../data +USERINCLUDE ../Logger +USERINCLUDE loc + +SYSTEMINCLUDE /epoc32/include/ecom +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH data + +START RESOURCE 10207253.rss +TARGET gsprslnplugin.rsc +END + +// View resources +START RESOURCE GSPrslnPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // View resources + + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY commonengine.lib// For RConeResourceLoader +LIBRARY GSEcomPlugin.lib +LIBRARY GSFramework.lib +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY flogger.lib // For GSLogger +LIBRARY FeatMgr.lib // Feature manager + +//Documents. Defining these is optional. Used only by IDE's file browser. +SOURCEPATH data +DOCUMENT 10207253.rss +DOCUMENT GSPrslnPluginRsc.rss + +SOURCEPATH inc + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPrslnPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPrslnPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSPrslnPlugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSPrslnPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gsprslnplugin.iby ) +../rom/GSPrslnPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gsprslnpluginresources.iby ) +loc/GSPrslnPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gsprslnplugin.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gsprslnplugin.mif + OPTION HEADERFILE gsprslnplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_cp_perso +END + + +PRJ_MMPFILES +GSPrslnPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPrslnPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPrslnPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSPrslnPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPrslnPlugin/data/10207253.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPrslnPlugin/data/10207253.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM resource file for plugin. +* +*/ + +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x10207253; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10207252; + version_no = 1; + display_name = "Personalisation Settings Plugin"; // Debug name + #ifdef RD_CONTROL_PANEL + default_data = "0x1020723B";// Parent UID + opaque_data = "10";// Order number + #else //RD_CONTROL_PANEL + default_data = "0x10207237";// Parent UID + opaque_data = "0";// Order number + #endif //RD_CONTROL_PANEL + } + }; + } + }; + } + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPrslnPlugin/data/GSPrslnPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPrslnPlugin/data/GSPrslnPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,157 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for plugin. +* +*/ + + +// RESOURCE IDENTIFIER +NAME PRSN // 4 letter ID + +// INCLUDES +#include + +#include +#include +#include // Avkon localized strings +#include +#include +#include +#include +#include + +// CONSTANTS + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// +// +// Needed or loading the resource fails! +// +//---------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +//---------------------------------------------------- +// +// r_gs_prsln_view +// Personalisation Settings view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_prsln_view + { + menubar = r_gs_menubar_open_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN; + } + + +//---------------------------------------------------- +// +// r_gs_prsln_view_title +// Personalisation Settings view title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_prsln_view_title + { + #ifdef RD_CONTROL_PANEL + txt = qtn_cp_title_personal; + #else //RD_CONTROL_PANEL + txt = qtn_set_title_settings_gen_personalisation; + #endif //RD_CONTROL_PANEL + } + + +//---------------------------------------------------- +// +// r_gs_prsln_view_caption +// Personalisation View caption for plugin +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_prsln_view_caption + { + #ifdef RD_CONTROL_PANEL + buf = qtn_cp_folder_personal; + #else //RD_CONTROL_PANEL + buf = qtn_set_folder_personalisation; + #endif //RD_CONTROL_PANEL + } + +//---------------------------------------------------- +// +// r_gs_psln_softkeys_options_back_open +// Text association with MSK ( OPEN ) +// +//---------------------------------------------------- +// +RESOURCE CBA r_gs_psln_softkeys_options_back_open + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id=EGSCmdAppOpen; + txt = qtn_msk_open; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_psln_softkeys_options_exit_open +// Text association with MSK ( OPEN ) +// +//---------------------------------------------------- +// +RESOURCE CBA r_gs_psln_softkeys_options_exit_open + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyExit; + txt = text_softkey_exit; + }, + CBA_BUTTON + { + id=EGSCmdAppOpen; + txt = qtn_msk_open; + } + }; + } + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPrslnPlugin/inc/GSPrslnPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPrslnPlugin/inc/GSPrslnPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for plugin. +* +*/ + + +#ifndef GSPRSLNPLUGIN_H +#define GSPRSLNPLUGIN_H + +// Includes +#include +#include + +#include +#include +#include + + +// Classes referenced +class CAknViewAppUi; +class RConeResourceLoader; +class CGSTabHelper; + +// Constants +_LIT( KGSPrslnPluginResourceFileName, "z:GSPrslnPluginRsc.rsc" ); +_LIT( KGSPrslnPluginIconDirAndName, "z:gsprslnplugin.mbm"); // Use KDC_BITMAP_DIR + +// CLASS DECLARATION + +/** +* CGSPrslnPlugin view class. +* +* @since Series60_3.1 +*/ +class CGSPrslnPlugin : public CGSParentPlugin + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return + */ + static CGSPrslnPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSPrslnPlugin(); + + public: // From CAknView + + /** + * See base class. + */ + TUid Id() const; + + /** + * See base class. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + /** + * See base class. + */ + void DoDeactivate(); + + public: // From CGSParentPlugin + + /** + * See base class. + */ + TUid UpperLevelViewUid(); + + /** + * See base class. + */ + TGSListboxTypes ListBoxType(); + + /** + * See base class. + */ + void GetHelpContext( TCoeHelpContext& aContext ); + + public: // From CGSPluginInterface + + /** + * See base class. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * See base class. + */ + TInt PluginProviderCategory() const; + + protected: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + protected: // New + /** + * C++ default constructor. + */ + CGSPrslnPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + private: // Data + + // Resource loader. + RConeResourceLoader iResourceLoader; + + // Tab hepler. + CGSTabHelper* iTabHelper; + + //Indicates if cba is already constructed + TBool iCbaConstructed; + }; + + +#endif // GSPRSLNPLUGIN_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPrslnPlugin/loc/GSPrslnPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPrslnPlugin/loc/GSPrslnPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSPrslnPlugin. +* +*/ + + +// LOCALISATION STRINGS + +// **CAPTIONS + +//d:Plugin title. +//d:Long string. +//l:title_pane_t2/opt9 +//w: +//r:3.1 +// +#define qtn_set_title_settings_gen_personalisation "Personalisation" + +//d:Plugin caption. +//d:Used BY GS FW. +//l:list_single_large_graphic_pane_t1 +//w: +//r:3.1 +// +#define qtn_set_folder_personalisation "Personalisation" + +// **OPTIONS MENU + +//d:Command in Options list. +//d:Opens the highlighted item. +//l:list_single_pane_t1_cp2 +//w: +//r:3.1 +// +#define qtn_set_options_open "Open" + +//d:Plugin title. +//d:Long string. +//l:title_pane_t2/opt9 +//w: +//r:5.0 +// +#define qtn_cp_title_personal "Personal" + +//d:Plugin caption. +//d:Used BY GS FW. +//l:list_single_large_graphic_pane_t1 +//w: +//r:5.0 +// +#define qtn_cp_folder_personal "Personal" + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPrslnPlugin/src/GSPrslnPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPrslnPlugin/src/GSPrslnPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,318 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Cpp file for plugin. +* +*/ + + +// Includes +#include "GSPrslnPlugin.h" +#include "GSLogger.h" + +#include +#include + +// Includes from GS framework: +#include +#include +#include +#include + +#include +#include +#include // For TResourceReader +#include +#include + +#include + +#ifndef RD_CONTROL_PANEL + #include +#endif //RD_CONTROL_PANEL + +// Constants +// Active Idle UID. +const TUid KScutActiveIdleUid = { 0x102750F0 }; + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CGSPrslnPlugin::CGSPrslnPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSPrslnPlugin::CGSPrslnPlugin() + : CGSParentPlugin(), iResourceLoader( *iCoeEnv ), iCbaConstructed( EFalse ) + { + __GSLOGSTRING( "[CGSPrslnPlugin] CGSPrslnPlugin()" ); + + } + + +// --------------------------------------------------------------------------- +// CGSPrslnPlugin::~CGSPrslnPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSPrslnPlugin::~CGSPrslnPlugin() + { + iResourceLoader.Close(); + + #ifndef RD_CONTROL_PANEL + delete iTabHelper; + #endif //RD_CONTROL_PANEL + __GSLOGSTRING( "[CGSPrslnPlugin] ~CGSPrslnPlugin()" ); + } + + +// --------------------------------------------------------------------------- +// CGSPrslnPlugin::ConstructL() +// +// +// --------------------------------------------------------------------------- +// +void CGSPrslnPlugin::ConstructL() + { + __GSLOGSTRING( "[CGSPrslnPlugin] ConstructL()" ); + OpenLocalizedResourceFileL( KGSPrslnPluginResourceFileName, + iResourceLoader ); + BaseConstructL( R_GS_PRSLN_VIEW, R_GS_PRSLN_VIEW_TITLE ); + + #ifndef RD_CONTROL_PANEL + iTabHelper = CGSTabHelper::NewL(); + #endif //RD_CONTROL_PANEL + } + + +// --------------------------------------------------------------------------- +// CGSPrslnPlugin::NewL() +// +// +// --------------------------------------------------------------------------- +// +CGSPrslnPlugin* CGSPrslnPlugin::NewL( TAny* /*aInitParams*/ ) + { + __GSLOGSTRING( "[CGSPrslnPlugin] NewL()" ); + CGSPrslnPlugin* self = new(ELeave) CGSPrslnPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::Id() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSPrslnPlugin::Id() const + { + __GSLOGSTRING1( "[CGSPrslnPlugin] Id():0x%X", KGSPrslnPluginUid.iUid ); + return KGSPrslnPluginUid; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoActivateL() +// +// +// --------------------------------------------------------------------------- +// +void CGSPrslnPlugin::DoActivateL + ( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + + CEikButtonGroupContainer* cba = Cba(); + + if ( aCustomMessageId == KScutActiveIdleUid && !iCbaConstructed ) + { + cba->SetCommandSetL( R_GS_PSLN_SOFTKEYS_OPTIONS_EXIT_OPEN ); + cba->DrawDeferred(); + } + iCbaConstructed = ETrue; + + CGSParentPlugin::DoActivateL( aPrevViewId, + aCustomMessageId, + aCustomMessage ); + CGSMainView* parent = + static_cast ( AppUi()->View( KGSMainViewUid ) ); + + #ifndef RD_CONTROL_PANEL + // Create tab group for this view (do only if casting parent succeeds): + if( parent ) + { + iTabHelper->CreateTabGroupL( Id(), parent ); + } + #endif //RD_CONTROL_PANEL + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoDeactivate() +// +// +// --------------------------------------------------------------------------- +// +void CGSPrslnPlugin::DoDeactivate() + { + CGSParentPlugin::DoDeactivate(); + + #ifndef RD_CONTROL_PANEL + iTabHelper->RemoveTabGroup(); + #endif //RD_CONTROL_PANEL + } + + +// ========================= From CGSParentPlugin ===================== + + +// --------------------------------------------------------------------------- +// CGSPrslnPlugin::UpperLevelViewUid() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSPrslnPlugin::UpperLevelViewUid() + { + #ifdef RD_CONTROL_PANEL + return KGSMainViewUid; + #else //RD_CONTROL_PANEL + return KGSGenPluginUid; + #endif //RD_CONTROL_PANEL + } + + +// ----------------------------------------------------------------------------- +// CGSPrslnPlugin::GetHelpContext() +// +// +// ----------------------------------------------------------------------------- +// +void CGSPrslnPlugin::GetHelpContext( TCoeHelpContext& aContext ) + { + aContext.iMajor = KUidGS; + aContext.iContext = KCP_HLP_PERSONAL; + } + + +// ========================= From CGSPluginInterface ================== + + +// --------------------------------------------------------------------------- +// CGSPrslnPlugin::GetCaptionL() +// +// +// --------------------------------------------------------------------------- +// +void CGSPrslnPlugin::GetCaptionL( TDes& aCaption ) const + { + // The resource file is already opened by iResourceLoader. + HBufC* result = StringLoader::LoadL( R_GS_PRSLN_VIEW_CAPTION ); + aCaption.Copy( *result ); + delete result; + } + + +// --------------------------------------------------------------------------- +// CGSPrslnPlugin::CreateIconL +// +// Return the icon, if has one. +// --------------------------------------------------------------------------- +// +CGulIcon* CGSPrslnPlugin::CreateIconL( const TUid aIconType ) + { + //EMbm + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSPrslnPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropCpPerso, + fp->FullName(), + EMbmGsprslnpluginQgn_prop_cp_perso, + EMbmGsprslnpluginQgn_prop_cp_perso_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + CleanupStack::PopAndDestroy( fp ); + + return icon; + } + +// --------------------------------------------------------------------------- +// CGSPrslnPlugin::PluginProviderCategory() +// +// +// --------------------------------------------------------------------------- +// +TInt CGSPrslnPlugin::PluginProviderCategory() const + { + return KGSPluginProviderInternal; + } + + +// --------------------------------------------------------------------------- +// CGSPrslnPlugin::ListBoxType() +// +// +// --------------------------------------------------------------------------- +// +TGSListboxTypes CGSPrslnPlugin::ListBoxType() + { + return EGSListBoxTypeSingleLarge; + } + + +// ---------------------------------------------------------------------------- +// CGSPrslnPlugin::DynInitMenuPaneL() +// +// Display the dynamic menu +// ---------------------------------------------------------------------------- +void CGSPrslnPlugin::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + FeatureManager::InitializeLibL(); + // show or hide the 'help' menu item when supported + if( aResourceId == R_GS_MENU_ITEM_HELP ) + { + User::LeaveIfNull( aMenuPane ); + + if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + + FeatureManager::UnInitializeLib(); + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSPrslnPlugin/src/GSPrslnPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSPrslnPlugin/src/GSPrslnPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM prxy table for plugin. +* +*/ + + +// System includes +#include +#include + +// User includes +#include "GSPrslnPlugin.h" + +// Constants +const TImplementationProxy KGSPrslnPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x10207252, CGSPrslnPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSPrslnPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSPrslnPluginImplementationTable; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSecurityPlugin/Data/1020743A.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSecurityPlugin/Data/1020743A.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for Security plugin. +* +*/ + +// INCLUDES +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x1020743A; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x1020743B; + version_no = 1; + display_name = "Security Plugin"; + #ifdef RD_CONTROL_PANEL + default_data = "0x10283317"; + opaque_data = "30";//Order number + #else //RD_CONTROL_PANEL + default_data = "0x10207237"; + opaque_data = "4";//Order number + #endif //RD_CONTROL_PANEL + } + }; + } + }; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSecurityPlugin/Data/GSSecurityPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSecurityPlugin/Data/GSSecurityPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for General Settings +* +*/ + + + +// RESOURCE IDENTIFIER +NAME GSSE // 4 letter ID + +// INCLUDES +#include + +#include // Avkon localized strings +#include +#include +#include +#include +#include + + +// CONSTANTS + +// RESOURCE DEFINITIONS + +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + + +//---------------------------------------------------- +// r_gs_security_view_caption +// +// Security view caption for plugin +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_security_view_caption + { + buf = qtn_set_folder_security; + } + + +//---------------------------------------------------- +// +// r_gs_security_view_title +// Security view title +// +//---------------------------------------------------- +// + +RESOURCE TITLE_PANE r_gs_security_view_title + { + txt = qtn_set_title_settings_security; + } + + +//---------------------------------------------------- +// +// r_gs_security_view +// Security view's menu +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_security_view + { + menubar=r_gs_menubar_open_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN; + } + + +//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSecurityPlugin/GSSecurityPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSecurityPlugin/GSSecurityPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification file. +* +*/ + + +#include "../Logger/GsLoggingConfiguration.h" +#include // For RESOURCE_FILES_DIR + +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gssecurityplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x1020743A +VENDORID VID_DEFAULT + + +SOURCEPATH Src +SOURCE GSSecurityPluginImplementationTable.cpp +SOURCE GSSecurityPlugin.cpp + + +//User include paths +USERINCLUDE Inc +USERINCLUDE Data // For *.rh +USERINCLUDE loc +USERINCLUDE ../Data +USERINCLUDE ../Logger + +//System include paths +SYSTEMINCLUDE /epoc32/include/ecom +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH Data + +START RESOURCE 1020743A.rss +TARGET gssecurityplugin.rsc +END + +START RESOURCE GSSecurityPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY egul.lib +LIBRARY flogger.lib // File logging + +LIBRARY commonengine.lib // For RConeResourceLoader +LIBRARY featmgr.lib // Feature manager +LIBRARY centralrepository.lib +LIBRARY aknskinsrv.lib // for enhanced skinning +LIBRARY aknskins.lib // for enhanced skinning +LIBRARY gsecomplugin.lib +LIBRARY hlplch.lib // for "Help" options menu +LIBRARY gsframework.lib // For base classes +LIBRARY gslistbox.lib // For CGSListBoxItemTextArray + +// End of File \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSecurityPlugin/Inc/GSSecurityPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSecurityPlugin/Inc/GSSecurityPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for the Security sub-folder +* +*/ + + +#ifndef GSSECURITYPLUGIN_H +#define GSSECURITYPLUGIN_H + +// Includes +#include +#include +#include +#include +#include + +// Classes referenced +class CAknViewAppUi; +class RConeResourceLoader; + + +// CLASS DECLARATION + +/** +* CGSSecurityPlugin view class. +* +* @since Series60_3.1 +*/ +class CGSSecurityPlugin : public CGSParentPlugin + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return + */ + static CGSSecurityPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSSecurityPlugin(); + + public: // From CAknView + + /** + * See base class. + */ + TUid Id() const; + + /** + * See base class. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + /** + * See base class. + */ + void DoDeactivate(); + + public: // From CGSParentPlugin + + /** + * See base class. + */ + TUid UpperLevelViewUid(); + + /** + * See base class. + */ + TGSListboxTypes ListBoxType(); + + /** + * See base class. + */ + void GetHelpContext( TCoeHelpContext& aContext ); + + public: // From CGSPluginInterface + + /** + * See base class. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + TInt PluginProviderCategory() const; + + /** + * @see CGSPluginInterface header file. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + protected: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + protected: // New + /** + * C++ default constructor. + */ + CGSSecurityPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + private: // Data + + // Resource loader. + RConeResourceLoader iResourceLoader; + + }; + +#endif //GSSECURITYPLUGIN_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSecurityPlugin/Src/GSSecurityPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSecurityPlugin/Src/GSSecurityPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,281 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Source file for CGSSecurityPlugin class +* +*/ + + +// Includes +#include "GSSecurityPlugin.h" +#include "GsLogger.h" + +#include +#include +#include // For TResourceReader +#include + +// Includes from GS framework: +#include +#include + +// Plugin includes: +#include +#include +#include +#include + + +// CONSTANTS +_LIT( KGSSecurityPluginResourceFileName, "z:GSSecurityPluginRsc.rsc" ); + +#ifdef __SCALABLE_ICONS + // svg file + _LIT( KGSSecPluginIconFileName, "\\resource\\apps\\GSSecPlugin.mif"); +#else + // bitmap + _LIT( KGSSecPluginIconFileName, "\\resource\\apps\\GSSecPlugin.mbm"); +#endif // __SCALABLE_ICONS + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CGSSecurityPlugin::CGSSecurityPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSSecurityPlugin::CGSSecurityPlugin() + : CGSParentPlugin(), iResourceLoader( *iCoeEnv ) + { + } + + +// --------------------------------------------------------------------------- +// CGSSecurityPlugin::~CGSSecurityPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSSecurityPlugin::~CGSSecurityPlugin() + { + iResourceLoader.Close(); + } + + +// --------------------------------------------------------------------------- +// CGSSecurityPlugin::ConstructL() +// +// +// --------------------------------------------------------------------------- +// +void CGSSecurityPlugin::ConstructL() + { + __GSLOGSTRING( "[CGSSecurityPlugin] ConstructL()|->" ); + OpenLocalizedResourceFileL( KGSSecurityPluginResourceFileName, + iResourceLoader ); + BaseConstructL( R_GS_SECURITY_VIEW, R_GS_SECURITY_VIEW_TITLE ); + __GSLOGSTRING( "[CGSSecurityPlugin] ConstructL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSSecurityPlugin::NewL() +// +// +// --------------------------------------------------------------------------- +// +CGSSecurityPlugin* CGSSecurityPlugin::NewL( TAny* /*aInitParams*/ ) + { + CGSSecurityPlugin* self = new( ELeave ) CGSSecurityPlugin(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::Id() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSSecurityPlugin::Id() const + { + return KGSSecurityPluginUid; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoActivateL() +// +// +// --------------------------------------------------------------------------- +// +void CGSSecurityPlugin::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + CGSParentPlugin::DoActivateL( aPrevViewId, aCustomMessageId, + aCustomMessage ); + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoDeactivate() +// +// +// --------------------------------------------------------------------------- +// +void CGSSecurityPlugin::DoDeactivate() + { + CGSParentPlugin::DoDeactivate(); + } + + +// ========================= From CGSParentPlugin ===================== + + +// --------------------------------------------------------------------------- +// CGSSecurityPlugin::UpperLevelViewUid() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSSecurityPlugin::UpperLevelViewUid() + { + #ifdef RD_CONTROL_PANEL + return KGSDeviceManagementPluginUid; + #else //RD_CONTROL_PANEL + return KGSGenPluginUid; + #endif //RD_CONTROL_PANEL + } + + +// ----------------------------------------------------------------------------- +// CGSSecurityPlugin::GetHelpContext() +// +// +// ----------------------------------------------------------------------------- +// +void CGSSecurityPlugin::GetHelpContext( TCoeHelpContext& aContext ) + { + aContext.iMajor = KUidGS; + aContext.iContext = KCP_HLP_SECURITY; + } + + +// ========================= From CGSPluginInterface ================== + + +// --------------------------------------------------------------------------- +// CGSSecurityPlugin::GetCaptionL() +// +// +// --------------------------------------------------------------------------- +// +void CGSSecurityPlugin::GetCaptionL( TDes& aCaption ) const + { + __GSLOGSTRING( "[CGSSecurityPlugin] GetCaptionL()|->" ); + // The resource file is already opened by iResourceLoader. + HBufC* result = StringLoader::LoadL( R_GS_SECURITY_VIEW_CAPTION ); + aCaption.Copy( *result ); + delete result; + __GSLOGSTRING( "[CGSSecurityPlugin] GetCaptionL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSSecurityPlugin::PluginProviderCategory() +// +// +// --------------------------------------------------------------------------- +// +TInt CGSSecurityPlugin::PluginProviderCategory() const + { + return KGSPluginProviderInternal; + } + +// --------------------------------------------------------------------------- +// CGSSecurityPlugin::CreateIconL +// +// Return the icon, if has one. +// --------------------------------------------------------------------------- +// +CGulIcon* CGSSecurityPlugin::CreateIconL( const TUid aIconType ) + { + __GSLOGSTRING( "[CGSSecurityPlugin] CreateIconL()|->" ); + //EMbm + CGulIcon* icon; + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropSetSecSub, + KGSSecPluginIconFileName, + EMbmGssecpluginQgn_prop_set_sec_sub, + EMbmGssecpluginQgn_prop_set_sec_sub_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + __GSLOGSTRING( "[CGSSecurityPlugin] CreateIconL()-|" ); + return icon; + } + + +// ----------------------------------------------------------------------------- +// CGSSecurityPlugin::ListBoxType() +// +// +// ----------------------------------------------------------------------------- +// +TGSListboxTypes CGSSecurityPlugin::ListBoxType() + { + return EGSListBoxTypeSettings; + } + + +// ---------------------------------------------------------------------------- +// CGSSecurityPlugin::DynInitMenuPaneL() +// +// Display the dynamic menu +// ---------------------------------------------------------------------------- +void CGSSecurityPlugin::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + FeatureManager::InitializeLibL(); + // show or hide the 'help' menu item when supported + if( aResourceId == R_GS_MENU_ITEM_HELP ) + { + User::LeaveIfNull( aMenuPane ); + + if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + FeatureManager::UnInitializeLib(); + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSecurityPlugin/Src/GSSecurityPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSecurityPlugin/Src/GSSecurityPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for this plugin +* +*/ + + +// System includes +#include +#include + +// User includes +#include "GSSecurityPlugin.h" + +// Constants +const TImplementationProxy KGSSecurityPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x1020743B, CGSSecurityPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSSecurityPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSSecurityPluginImplementationTable; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSecurityPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSecurityPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSSecurityPlugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSSecurityPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gssecurityplugin.iby ) +../rom/GSSecurityPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gssecuritypluginresources.iby ) +loc/GSSecurityPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gssecurityplugin.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gssecplugin.mif + OPTION HEADERFILE gssecplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_set_sec_sub +END + + +PRJ_MMPFILES +GSSecurityPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSecurityPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSecurityPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSSecurityPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSecurityPlugin/loc/GSSecurityPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSecurityPlugin/loc/GSSecurityPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSSecurityPlugin +* +*/ + + +// LOCALISATION STRINGS + +//d:Text of a list item in General folder list +//d:Item opens Security folder +//l:list_single_large_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_set_folder_security "Security" + +//d:Text in title pane +//d:Security settings view +//l:title_pane_t2/opt9 +//w: +//r: 3.1 +#define qtn_set_title_settings_security "Security settings" + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSynchronisationPlugin/GSSynchronisationPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSynchronisationPlugin/GSSynchronisationPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSSynchronisationPlugin project specification file. +* +*/ + +#include // For RESOURCE_FILES_DIR + +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gssynchronisationplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10283318 +VENDORID VID_DEFAULT + +SOURCEPATH src +SOURCE GSSynchronisationPluginImplementationTable.cpp +SOURCE GSSynchronisationPlugin.cpp + +USERINCLUDE inc +USERINCLUDE data +USERINCLUDE ../Data +USERINCLUDE loc +USERINCLUDE ../Logger + +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + +SOURCEPATH data + +START RESOURCE 10283318.rss +TARGET gssynchronisationplugin.rsc +END + +// View resources +START RESOURCE GSSynchronisationPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // View resources + + +// Libraries + +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY commonengine.lib// For RConeResourceLoader +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY egul.lib // CGulIcon +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY euser.lib +LIBRARY flogger.lib // For GSLogger +LIBRARY gsframework.lib +LIBRARY gsecomplugin.lib +LIBRARY gslistbox.lib// For CGSListBoxItemTextArray +LIBRARY ws32.lib // For RWsSession + +//Documents. Defining these is optional. Used only by IDE's file browser. +SOURCEPATH data +DOCUMENT 10283318.rss +DOCUMENT GSSynchronisationPluginRsc.rss + +SOURCEPATH inc + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSynchronisationPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSynchronisationPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSSynchronisationPlugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSSynchronisationPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gssynchronisationplugin.iby ) +../rom/GSSynchronisationPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gssynchronisationpluginresources.iby ) +loc/GSSyncPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gssyncplugin.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gssynchronisationplugin.mif + OPTION HEADERFILE gssynchronisationplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_cp_conn_sync +END + + +PRJ_MMPFILES +GSSynchronisationPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSynchronisationPlugin/clean.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSynchronisationPlugin/clean.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +del *.cwlink +del *.mcp +del *.xml +del *.resources +del *_UID_.cpp +rd GSSynchronisationPlugin_Data /s /q \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSynchronisationPlugin/data/10283318.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSynchronisationPlugin/data/10283318.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for GSSynchronisationPlugin. +* +*/ + +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x10283318; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10283319; + version_no = 1; + display_name = "GSSynchronisationPlugin"; // Debug name + default_data = "0x10207250";// Parent UID + opaque_data = "80";// Order number + } + }; + } + }; + } + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSynchronisationPlugin/data/GSSynchronisationPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSynchronisationPlugin/data/GSSynchronisationPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file GSSynchronisationPlugin. +* +*/ + + +// RESOURCE IDENTIFIER +NAME SYNC // 4 letter ID + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// CONSTANTS + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// +// +// Needed or loading the resource fails! +// +//---------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +//---------------------------------------------------- +// +// r_gs_synchronisation_view +// Device management view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_synchronisation_view + { + menubar = r_gs_menubar_open_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN; + } + + +//---------------------------------------------------- +// +// r_gs_synchronisation_view_title +// View title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_synchronisation_view_title + { + txt = qtn_cp_title_synchronisation; + } + + +//---------------------------------------------------- +// r_gs_synchronisation_view_caption +// +// Caption for plugin +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_synchronisation_view_caption + { + buf = qtn_cp_folder_synchronisation; + } + + + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSynchronisationPlugin/inc/GSSynchronisationPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSynchronisationPlugin/inc/GSSynchronisationPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSSynchronisationPlugin header. +* +*/ + + +#ifndef GSSYNCHRONISATIONPLUGIN_H +#define GSSYNCHRONISATIONPLUGIN_H + +// Includes +#include +#include +#include +#include + +// Classes referenced +class CAknViewAppUi; +class RConeResourceLoader; +class CGSTabHelper; + +// Constants +_LIT( KGSSynchronisationPluginResourceFileName, "z:GSSynchronisationPluginrsc.rsc" ); +_LIT( KGSSynchronisationPluginIconDirAndName, "z:GSSynchronisationPlugin.mbm"); // Use KDC_BITMAP_DIR + +// CLASS DECLARATION + +/** +* CGSSynchronisationPlugin view class. +* +* @since Series60_3.2 +*/ +class CGSSynchronisationPlugin : public CGSParentPlugin + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return + */ + static CGSSynchronisationPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSSynchronisationPlugin(); + + public: // From CAknView + + /** + * See base class. + */ + TUid Id() const; + + /** + * See base class. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + /** + * See base class. + */ + void DoDeactivate(); + + public: // From CGSParentPlugin + + /** + * See base class. + */ + TUid UpperLevelViewUid(); + + /** + * See base class. + */ + void GetHelpContext( TCoeHelpContext& aContext ); + + public: // From CGSPluginInterface + + /** + * See base class. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * See base class. + */ + TInt PluginProviderCategory() const; + + protected: // New + /** + * C++ default constructor. + */ + CGSSynchronisationPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + private: // Data + + // Resource loader. + RConeResourceLoader iResourceLoader; + }; + + +#endif // GSSYNCHRONISATIONPLUGIN_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSynchronisationPlugin/loc/GSSyncPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSynchronisationPlugin/loc/GSSyncPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSSynchronisationPlugin. +* +*/ + + +// LOCALISATION STRINGS + +// **CAPTIONS + +//d:Plugin title. +//d:Long string. +//l:title_pane_t2/opt9 +//w: +//r:5.0 +// +#define qtn_cp_title_synchronisation "Data transfer" + +//d:Plugin caption. +//d:Used by GS FW. +//l:list_single_large_graphic_pane_t1_cp2 +//w: +//r:5.0 +// +#define qtn_cp_folder_synchronisation "Data transfer" + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSynchronisationPlugin/src/GSSynchronisationPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSynchronisationPlugin/src/GSSynchronisationPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,245 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSSynchronisationPlugin source code. +* +*/ + + +// Includes +#include "GSSynchronisationPlugin.h" +#include "GsLogger.h" +#include +#include // Icons +#include +#include +#include +#include +#include + + +#include +#include +#include +#include // For TResourceReader + + +// Constants + + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CGSSynchronisationPlugin::CGSSynchronisationPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSSynchronisationPlugin::CGSSynchronisationPlugin() + : CGSParentPlugin(), iResourceLoader( *iCoeEnv ) + { + __GSLOGSTRING( "[CGSSynchronisationPlugin] CGSSynchronisationPlugin()" ); + + } + + +// --------------------------------------------------------------------------- +// CGSSynchronisationPlugin::~CGSSynchronisationPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSSynchronisationPlugin::~CGSSynchronisationPlugin() + { + __GSLOGSTRING( "[CGSSynchronisationPlugin] ~CGSSynchronisationPlugin()|->" ); + iResourceLoader.Close(); + __GSLOGSTRING( "[CGSSynchronisationPlugin] ~CGSSynchronisationPlugin()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSSynchronisationPlugin::ConstructL() +// +// +// --------------------------------------------------------------------------- +// +void CGSSynchronisationPlugin::ConstructL() + { + __GSLOGSTRING( "[CGSSynchronisationPlugin] ConstructL()|->" ); + OpenLocalizedResourceFileL( KGSSynchronisationPluginResourceFileName, + iResourceLoader ); + BaseConstructL( R_GS_SYNCHRONISATION_VIEW, R_GS_SYNCHRONISATION_VIEW_TITLE ); + __GSLOGSTRING( "[CGSSynchronisationPlugin] ConstructL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSSynchronisationPlugin::NewL() +// +// +// --------------------------------------------------------------------------- +// +CGSSynchronisationPlugin* CGSSynchronisationPlugin::NewL( TAny* /*aInitParams*/ ) + { + __GSLOGSTRING( "[CGSSynchronisationPlugin] NewL()" ); + + CGSSynchronisationPlugin* self = new(ELeave) CGSSynchronisationPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::Id() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSSynchronisationPlugin::Id() const + { + __GSLOGSTRING1( "[CGSSynchronisationPlugin] Id():0x%X", KGSSynchronisationPluginUid.iUid ); + return KGSSynchronisationPluginUid; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoActivateL() +// +// +// --------------------------------------------------------------------------- +// +void CGSSynchronisationPlugin::DoActivateL + ( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + __GSLOGSTRING( "[CGSSynchronisationPlugin] DoActivateL()|->" ); + CGSParentPlugin::DoActivateL( aPrevViewId, + aCustomMessageId, + aCustomMessage ); + + __GSLOGSTRING( "[CGSSynchronisationPlugin] DoActivateL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoDeactivate() +// +// +// --------------------------------------------------------------------------- +// +void CGSSynchronisationPlugin::DoDeactivate() + { + __GSLOGSTRING( "[CGSSynchronisationPlugin] DoDeactivate()|->" ); + CGSParentPlugin::DoDeactivate(); + __GSLOGSTRING( "[CGSSynchronisationPlugin] DoDeactivate()-|" ); + } + + +// ========================= From CGSParentPlugin ===================== + + +// --------------------------------------------------------------------------- +// CGSSynchronisationPlugin::UpperLevelViewUid() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSSynchronisationPlugin::UpperLevelViewUid() + { + return KGSConPluginUid; + } + + +// ========================= From CGSPluginInterface ================== + + +// --------------------------------------------------------------------------- +// CGSSynchronisationPlugin::GetCaptionL() +// +// +// --------------------------------------------------------------------------- +// +void CGSSynchronisationPlugin::GetCaptionL( TDes& aCaption ) const + { + __GSLOGSTRING( "[CGSSynchronisationPlugin] GetCaptionL()|->" ); + // The resource file is already opened by iResourceLoader. + HBufC* result = StringLoader::LoadL( R_GS_SYNCHRONISATION_VIEW_CAPTION ); + aCaption.Copy( *result ); + delete result; + __GSLOGSTRING( "[CGSSynchronisationPlugin] GetCaptionL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSSynchronisationPlugin::PluginProviderCategory() +// +// +// --------------------------------------------------------------------------- +// +TInt CGSSynchronisationPlugin::PluginProviderCategory() const + { + return KGSPluginProviderInternal; + } + + +// ----------------------------------------------------------------------------- +// CGSSynchronisationPlugin::GetHelpContext() +// +// +// ----------------------------------------------------------------------------- +// +void CGSSynchronisationPlugin::GetHelpContext( TCoeHelpContext& aContext ) + { + aContext.iMajor = KUidGS; + aContext.iContext = KCP_HLP_SYNCHRONISATION; + } + + +// ----------------------------------------------------------------------------- +// CGSSynchronisationPlugin::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CGSSynchronisationPlugin::CreateIconL( const TUid aIconType ) + { + //EMbm + CGulIcon* icon; + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + fp->Set( KGSSynchronisationPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropCpConnSync, + fp->FullName(), + EMbmGssynchronisationpluginQgn_prop_cp_conn_sync, + EMbmGssynchronisationpluginQgn_prop_cp_conn_sync_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + CleanupStack::PopAndDestroy( fp ); + + return icon; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSSynchronisationPlugin/src/GSSynchronisationPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSSynchronisationPlugin/src/GSSynchronisationPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for GSSynchronisationPlugin. +* +*/ + + +// System includes +#include +#include + +// User includes +#include "GSSynchronisationPlugin.h" + +// Constants +const TImplementationProxy KGSSynchronisationPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x10283319, CGSSynchronisationPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSSynchronisationPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSSynchronisationPluginImplementationTable; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSTelPlugin/Data/1020723E.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSTelPlugin/Data/1020723E.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM plugin resource file for Telephony Settings plugin. +* +*/ + + +// INCLUDES +#include + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x1020723E; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x1020723D; + version_no = 1; + display_name = "Telephony Settings Plugin"; + default_data = "0x1020723B";//Parent UID + #ifdef RD_CONTROL_PANEL + opaque_data = "40";//Order number + #else //RD_CONTROL_PANEL + opaque_data = "1";//Order number + #endif //RD_CONTROL_PANEL + } + }; + } + }; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSTelPlugin/Data/GSTelPluginRsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSTelPlugin/Data/GSTelPluginRsc.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for plugin. +* +*/ + + +// RESOURCE IDENTIFIER +NAME TELP // 4 letter ID + +// INCLUDES +#include + +#include +#include +#include // Avkon localized strings +#include +#include +#include +#include +#include + +// CONSTANTS + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// +// +// Needed or loading the resource fails! +// +//---------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// Common resources among GS +#include "GSCommonResources.rss" + +//---------------------------------------------------- +// +// r_gs_tel_view +// Telephony Settings view. +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_tel_view + { + menubar = r_gs_menubar_open_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_OPEN; + } + + +//---------------------------------------------------- +// +// r_gs_tel_view_title +// Telephony Settings view title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_tel_view_title + { + #ifdef RD_CONTROL_PANEL + txt = qtn_set_title_telephony; + #else //RD_CONTROL_PANEL + txt = qtn_set_title_settings_telephone; + #endif //RD_CONTROL_PANEL + } + + +//---------------------------------------------------- +// +// r_gs_tel_view_caption +// Telephony View caption for plugin +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_tel_view_caption + { + #ifdef RD_CONTROL_PANEL + buf = qtn_cp_folder_telephony; + #else //RD_CONTROL_PANEL + buf = qtn_set_folder_telephone; + #endif //RD_CONTROL_PANEL + } + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSTelPlugin/GSTelPlugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSTelPlugin/GSTelPlugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for plugin. +* +*/ + +#include // For RESOURCE_FILES_DIR + +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gstelplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x1020723E +VENDORID VID_DEFAULT + +SOURCEPATH Src +SOURCE GSTelPluginImplementationTable.cpp +SOURCE GSTelPlugin.cpp + +USERINCLUDE Inc +USERINCLUDE Data +USERINCLUDE ../Data +USERINCLUDE ../Logger +USERINCLUDE loc + +SYSTEMINCLUDE /epoc32/include/ecom +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH Data + +START RESOURCE 1020723E.rss +TARGET gstelplugin.rsc +END + +// View resources +START RESOURCE GSTelPluginRsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // View resources + + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY commonengine.lib// For RConeResourceLoader +LIBRARY gsecomplugin.lib +LIBRARY gsframework.lib +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY flogger.lib // For GSLogger +LIBRARY featmgr.lib // feature manager + +//Documents. Defining these is optional. Used only by IDE's file browser. +SOURCEPATH Data +DOCUMENT GSTelPluginRsc.rss + +SOURCEPATH Inc + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSTelPlugin/Inc/GSPhoneSettingConstants.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSTelPlugin/Inc/GSPhoneSettingConstants.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,164 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Constants to use for Call, Barring and Network settings +* +*/ + + +#ifndef GSPHONESETTINGCONSTANTS_H +#define GSPHONESETTINGCONSTANTS_H + + +enum TGeneralSettingsPanic { + EInvalidIndex, + EInvalidCurrentItem, + EInvalidDivertAction, + ECFDefaultNumberCountError, + EAIViewCompleteWithNullViewId, + EAIViewCreateWithNonNullViewId + }; + +// LOCAL FUNCTIONS +GLDEF_C inline void Panic( TDesC aClassName, TGeneralSettingsPanic aPanic ) + { + User::Panic( aClassName, aPanic ); + } + +// maximum string length for resource strings +const TInt KGSMaxStringLength = 64; + +// barring pwd length +const TInt KGSBarringPasswordLength = 4; + +// custom message id, when trying to activate view from phone +const TInt KGSCustomActivateNetView = 9000; + +// on/off setting ON +const TInt KGSSettingOn = 1; + +// on/off setting OFF +const TInt KGSSettingOff = 0; + +// on/off setting's index 1 is OFF +const TInt KGSIndexOff = 1; + +// on/off setting's index 0 is ON +const TInt KGSIndexOn = 0; + +// manual select mode +const TInt KGSManualSelectMode = 1; + +// automatic select mode +const TInt KGSAutomaticSelectMode = 0; + +// CLIR values +const TInt KGSCliDefault = 0; +const TInt KGSCliOn = 1; +const TInt KGSCliOff = 2; + +// ALS block values +const TInt KGSAlsBlockOn = 0; +const TInt KGSAlsBlockOff = 1; + +// array granularity +const TInt KGSNetworkInfoArrayGranularity = 10; + +// Granularity of the arrays in Popup menus +const TInt KGSCallPopupMenuItems = 4; +const TInt KGSNetPopupMenuItems = 3; + +//Error note type ID - for Net view internal usage only +const TInt KGSErrorNote = 5001; + +//Confirmation note type ID - for Net view internal usage only +const TInt KGSConfirmationNote = 5002; + +//Information note type ID - for Net view internal usage only +const TInt KGSInformationNote = 5003; + +// PIN query OK +const TInt KGSPinQueryOk = 1; + +// MCN is active +const TInt KGSMcnServiceOn = 1; + +// Single match for CF search. +const TInt KCFSingleContact = 1; + +//Number of default CF numbers. +const TInt KCFDefaultNumbers = 3; + +//Number of Delay times. +const TInt KGSNrOfDelays = 6; + +//Increment of each delay step. +const TInt KCFDelayStep = 5; //5,10,15,20,25,30 + +//Number has several '+''s in it. +const TInt KCFErrIllegalNumber = 1; + +//No delay time is needed. +const TInt KCFNoNeedToGetTimeValue = 1; + +//Divert to mailbox number. +const TInt KCFDivertToMailBox = 0; + +//How many characters to use for CF match. +const TInt KCFCharactersToMatch = 7; + +//Max. number of target items for CFs. +const TInt KCFMaxNrOfTargets = 5; + +//If none of the four special characters are found from CF number, +//this value is returned. KErrNotFound(-1)*4 = -4. +const TInt KCFValidPhoneNumber = -4; + +//Invalid characters in the CF number. +_LIT ( KCFInvalidChars, "*#pw" ); + +//Plus sign. +_LIT ( KCFPlusSign, "+"); + +//Length of a setting item. +const TInt KGSSettingItemLength = 128; + +//Typedef for setting items. +typedef TBuf TSettingItem; + +//Length of short network name. +const TInt KGSNwShortNameLength = 10; + +//Length of long network name. +const TInt KGSNwLongNameLength = 20; + +//Network setting item typedef. +typedef TBuf TNetworkID; + +//Length of SMS txt editor. +const TInt KGSSMSTxtEditorLength = 160; + +//Typedef for SMS txt editor. +typedef TBuf TGSSMSTextEditor; + +//Empty space. +_LIT( KGSEmptySpace, " " ); + +//unused parameter +const TInt KGSNotUsed = -1; + +//Japanese replace prefix max length +const TInt KGSReplacePrefixTextLength = 10; + +#endif //GSPHONESETTINGCONSTANTS_H +//End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSTelPlugin/Inc/GSTelPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSTelPlugin/Inc/GSTelPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSTelPlugin header. +* +*/ + + +#ifndef GSTELPLUGIN_H +#define GSTELPLUGIN_H + +// Includes +#include +#include +#include +#include +#include + +// Classes referenced +class CAknViewAppUi; +class RConeResourceLoader; +class CGSTabHelper; + +// Constants +_LIT( KGSTelPluginResourceFileName, "z:GSTelPluginRsc.rsc" ); +_LIT( KGSDefaultTelIconFileName, "Z:\\resource\\apps\\GSTelplugin.mbm"); +_LIT( KGSTelPluginIconFileName, "\\resource\\apps\\GSTelplugin.mif"); + +// CLASS DECLARATION + +/** +* CGSGenPlugin view class. +* +* @since Series60_3.1 +*/ +class CGSTelPlugin : public CGSParentPlugin + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return + */ + static CGSTelPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSTelPlugin(); + + public: // From CAknView + + /** + * See base class. + */ + TUid Id() const; + + /** + * See base class. + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + /** + * See base class. + */ + void DoDeactivate(); + + public: // From CGSParentPlugin + + /** + * See base class. + */ + TUid UpperLevelViewUid(); + + /** + * See base class. + */ + //TGSListboxTypes ListBoxType(); + + /** + * See base class. + */ + void GetHelpContext( TCoeHelpContext& aContext ); + + public: // From CGSPluginInterface + + /** + * See base class. + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * See base class. + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * See base class. + */ + TInt PluginProviderCategory() const; + + protected: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + protected: // New + /** + * C++ default constructor. + */ + CGSTelPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + private: // Data + + // Resource loader. + RConeResourceLoader iResourceLoader; + + // Tab hepler. + CGSTabHelper* iTabHelper; + }; + + +#endif // GSTELPLUGIN_H +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSTelPlugin/Src/GSTelPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSTelPlugin/Src/GSTelPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,292 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSTelPlugin source code. +* +*/ + + +// Includes +#include "GSTelPlugin.h" +#include "GsLogger.h" +#include +#include // Icons +#include +#include +#include +#include +#include +#include +#include +#include // For TResourceReader +#include + +#ifndef RD_CONTROL_PANEL + #include +#endif //RD_CONTROL_PANEL + + +// Constants + + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CGSTelPlugin::CGSTelPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSTelPlugin::CGSTelPlugin() + : CGSParentPlugin(), iResourceLoader( *iCoeEnv ) + { + __GSLOGSTRING( "[CGSTelPlugin] CGSTelPlugin()" ); + + } + + +// --------------------------------------------------------------------------- +// CGSTelPlugin::~CGSTelPlugin() +// +// +// --------------------------------------------------------------------------- +// +CGSTelPlugin::~CGSTelPlugin() + { + __GSLOGSTRING( "[CGSTelPlugin] ~CGSTelPlugin()|->" ); + iResourceLoader.Close(); + + #ifndef RD_CONTROL_PANEL + if ( iTabHelper ) + { + delete iTabHelper; + } + #endif //RD_CONTROL_PANEL + __GSLOGSTRING( "[CGSTelPlugin] ~CGSTelPlugin()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSTelPlugin::ConstructL() +// +// +// --------------------------------------------------------------------------- +// +void CGSTelPlugin::ConstructL() + { + __GSLOGSTRING( "[CGSTelPlugin] ConstructL()|->" ); + OpenLocalizedResourceFileL( KGSTelPluginResourceFileName, + iResourceLoader ); + BaseConstructL( R_GS_TEL_VIEW, R_GS_TEL_VIEW_TITLE ); + + #ifndef RD_CONTROL_PANEL + iTabHelper = CGSTabHelper::NewL(); + #endif //RD_CONTROL_PANEL + __GSLOGSTRING( "[CGSTelPlugin] ConstructL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSTelPlugin::NewL() +// +// +// --------------------------------------------------------------------------- +// +CGSTelPlugin* CGSTelPlugin::NewL( TAny* /*aInitParams*/ ) + { + __GSLOGSTRING( "[CGSTelPlugin] NewL()" ); + + CGSTelPlugin* self = new(ELeave) CGSTelPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::Id() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSTelPlugin::Id() const + { + __GSLOGSTRING1( "[CGSTelPlugin] Id():0x%X", KGSTelPluginUid.iUid ); + return KGSTelPluginUid; + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoActivateL() +// +// +// --------------------------------------------------------------------------- +// +void CGSTelPlugin::DoActivateL + ( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + __GSLOGSTRING( "[CGSTelPlugin] DoActivateL()|->" ); + CGSParentPlugin::DoActivateL( aPrevViewId, + aCustomMessageId, + aCustomMessage ); + CGSMainView* parent = + static_cast ( AppUi()->View( KGSMainViewUid ) ); + + #ifndef RD_CONTROL_PANEL + // Create tab group for this view (do only if casting parent succeeds): + if( parent ) + { + iTabHelper->CreateTabGroupL( Id(), parent ); + } + #endif //RD_CONTROL_PANEL + __GSLOGSTRING( "[CGSTelPlugin] DoActivateL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSParentPlugin::DoDeactivate() +// +// +// --------------------------------------------------------------------------- +// +void CGSTelPlugin::DoDeactivate() + { + __GSLOGSTRING( "[CGSTelPlugin] DoDeactivate()|->" ); + CGSParentPlugin::DoDeactivate(); + + #ifndef RD_CONTROL_PANEL + iTabHelper->RemoveTabGroup(); + #endif //RD_CONTROL_PANEL + __GSLOGSTRING( "[CGSTelPlugin] DoDeactivate()-|" ); + } + + +// ========================= From CGSParentPlugin ===================== + + +// --------------------------------------------------------------------------- +// CGSTelPlugin::UpperLevelViewUid() +// +// +// --------------------------------------------------------------------------- +// +TUid CGSTelPlugin::UpperLevelViewUid() + { + return KGSMainViewUid; + } + + +// ========================= From CGSPluginInterface ================== + + +// --------------------------------------------------------------------------- +// CGSTelPlugin::GetCaptionL() +// +// +// --------------------------------------------------------------------------- +// +void CGSTelPlugin::GetCaptionL( TDes& aCaption ) const + { + __GSLOGSTRING( "[CGSTelPlugin] GetCaptionL()|->" ); + // The resource file is already opened by iResourceLoader. + HBufC* result = StringLoader::LoadL( R_GS_TEL_VIEW_CAPTION ); + aCaption.Copy( *result ); + delete result; + __GSLOGSTRING( "[CGSTelPlugin] GetCaptionL()-|" ); + } + + +// --------------------------------------------------------------------------- +// CGSTelPlugin::PluginProviderCategory() +// +// +// --------------------------------------------------------------------------- +// +TInt CGSTelPlugin::PluginProviderCategory() const + { + return KGSPluginProviderInternal; + } + + +// ----------------------------------------------------------------------------- +// CGSTelPlugin::GetHelpContext() +// +// +// ----------------------------------------------------------------------------- +// +void CGSTelPlugin::GetHelpContext( TCoeHelpContext& aContext ) + { + aContext.iMajor = KUidGS; + aContext.iContext = KCP_HLP_TELEPHONY; + } + + +// ----------------------------------------------------------------------------- +// CGSTelPlugin::CreateIconL() +// +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CGSTelPlugin::CreateIconL( const TUid aIconType ) + { + //EMbm + CGulIcon* icon; + + if( aIconType == KGSIconTypeLbxItem ) + { + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropCpTele, + KGSDefaultTelIconFileName, + EMbmGstelpluginQgn_prop_cp_tele, + EMbmGstelpluginQgn_prop_cp_tele_mask ); + } + else + { + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + return icon; + } + +// ---------------------------------------------------------------------------- +// CGSTelPlugin::DynInitMenuPaneL() +// +// Display the dynamic menu +// ---------------------------------------------------------------------------- +void CGSTelPlugin::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + FeatureManager::InitializeLibL(); + // show or hide the 'help' menu item when supported + if( aResourceId == R_GS_MENU_ITEM_HELP ) + { + User::LeaveIfNull( aMenuPane ); + + if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } + } + + FeatureManager::UnInitializeLib(); + } +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSTelPlugin/Src/GSTelPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSTelPlugin/Src/GSTelPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECOM proxy table for GSTelPlugin. +* +*/ + + +// System includes +#include +#include + +// User includes +#include "GSTelPlugin.h" + +// Constants +const TImplementationProxy KGSTelPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x1020723D, CGSTelPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KGSTelPluginImplementationTable ) + / sizeof( TImplementationProxy ); + return KGSTelPluginImplementationTable; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSTelPlugin/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSTelPlugin/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSTelPlugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/GSTelPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH( gstelplugin.iby ) +../rom/GSTelPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( gstelpluginresources.iby ) +loc/GSTelPlugin.loc MW_LAYER_LOC_EXPORT_PATH( gstelplugin.loc ) + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE gstelplugin.mif + OPTION HEADERFILE gstelplugin.mbg + OPTION SOURCES -c8,8 qgn_prop_cp_tele +END + +PRJ_MMPFILES +GSTelPlugin.mmp + + +PRJ_TESTMMPFILES + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/GSTelPlugin/loc/GSTelPlugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSTelPlugin/loc/GSTelPlugin.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization strings for GSPrslnPlugin. +* +*/ + + +// LOCALISATION STRINGS + +// **CAPTIONS + +//d:Text in title pane +//d:Telephone setting list view +//l:title_pane_t2/opt9 +//w: +//r: 3.1 +#define qtn_set_title_settings_telephone "Telephone" + +//d:Text of a list item in main view's folder list +//d:Item opens Telephone folder +//l:list_single_large_graphic_pane_t1 +//w: +//r: 3.1 +#define qtn_set_folder_telephone "Telephone" + +// **OPTIONS MENU + +//d:Command in Options list. +//d:Opens the highlighted item. +//l:list_single_pane_t1_cp2 +//w: +//r:3.1 +// +#define qtn_set_options_open "Open" + + +//CONTROL PANEL + +//d:Text in title pane +//d:Telephone setting list view +//l: title_pane_t2/opt9 +//w: +//r: 5.0 +#define qtn_set_title_telephony "Calling" + +//d:Text of a list item in main view's folder list +//d:Item opens Telephone folder +//l:list_single_large_graphic_pane_t1 +//w: +//r: 5.0 +#define qtn_cp_folder_telephony "Calling" + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/Logger/GsLogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/Logger/GsLogger.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Macro definition file for logging. +* +* +*/ + + + +#ifndef GSLOGGER_H +#define GSLOGGER_H + +#include "GsLoggingConfiguration.h" +#include +#include +#include + +_LIT( KLogsDir, "Gs"); +_LIT( KLogFileName, "Gs.log"); + +/* + We have 3 possible logging methods: + + set GS_LOGGING_METHOD to 0 to get no logging at all + set GS_LOGGING_METHOD to 1 to get logging via RDebug::Print + set GS_LOGGING_METHOD to 2 to get logging to log file + + Switching on/off is done in the Configuration file (GsLoggingConfiguration.h) + */ + +#if ( defined (_GSLOGGING) ) + #if ( defined (_GS_LOGGING_TO_FILE)) + #define GS_LOGGING_METHOD 2 + #else + #define GS_LOGGING_METHOD 1 + #endif +#else + #define GS_LOGGING_METHOD 0 +#endif + + +#if (GS_LOGGING_METHOD==0) + #define __GSLOGSTRING(C) + #define __GSLOGSTRING1(C, X) + #define __GSLOGSTRING2(C, X, Y) + #define __GSLOGSTRING3(C, X, Y, Z) + #define __GSLOGSTRING4(C, X, Y, Z, A) +#endif +#if (GS_LOGGING_METHOD==1) + #define __GSLOGSTRING(C) RDebug::Print(_L(C)); + #define __GSLOGSTRING1(C, X) RDebug::Print(_L(C),X); + #define __GSLOGSTRING2(C, X, Y) RDebug::Print(_L(C),X, Y); + #define __GSLOGSTRING3(C, X, Y, Z) RDebug::Print(_L(C),X, Y, Z); + #define __GSLOGSTRING4(C, X, Y, Z, A) RDebug::Print(_L(C),X, Y, Z, A); +#endif +#if (GS_LOGGING_METHOD==2) + #define __GSLOGSTRING(C) {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, tempLogDes());} + #define __GSLOGSTRING1(C, X) {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue(tempLogDes()),X);} + #define __GSLOGSTRING2(C, X, Y) {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue(tempLogDes()),X,Y);} + #define __GSLOGSTRING3(C, X, Y, Z) {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue(tempLogDes()),X,Y,Z);} + #define __GSLOGSTRING4(C, X, Y, Z, A) {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue(tempLogDes()),X,Y,Z,A);} +#endif + +#endif // GSLOGGER_H diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/Logger/GsLoggingConfiguration.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/Logger/GsLoggingConfiguration.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Macro definition file for logging configuration. +* Note: This file has to be separate from the logging header +* file to be able to include it in mmp file. If not, we +* will get warning about not used flogger.lib in other + logging cases where flogger.lib is not used. +* +*/ + + + +#ifndef GSCONFIGURATION_H +#define GSCONFIGURATION_H + +#ifdef _DEBUG // logging to file in debug only + +/** +* Have this line active if you want to have logging for this component. +* Comment this line out if you don't want any logging for this component. +*/ +//#define _GSLOGGING + +/** +* Have this line active if you want to have logging to file. +* Comment this line out if you want to have logging via RDebug::Print. +*/ +//#define _GS_LOGGING_TO_FILE + +/** +* Have this line active in case you want to have plugin loading performance +* measurements activated. +*/ +//#define _GS_PERFORMANCE_TRACES + +/** +* Have this line active in case you want to have verbose messages for plugin +* loading. This is helpful if loading of plugin(s) is failing. +*/ +//#define _GS_PLUGINLOADER_VERBOSE_TRACES + +/** +* Enable to get traces about plugin sorting. Usable to get each sorted view +* items. +*/ +//#define _GS_PLUGINLOADER_FINAL_SORTING_TRACES + +/** +* Enable to get traces about plugin sorting for each iteration. Usable if +* sorting logic fails. +*/ +//#define _GS_PLUGINLOADER_ITERATION_SORTING_TRACES + +/** +* Enable to active verbose messages for CGSWatchDog. This is helpful if plugins +* are missing or disabled from GS incorrectly. +*/ +//#define _GS_WATCHDOG_VERBOSE_TRACES + +/** +* Activate to get traces of lbx format strings. Good for finding how and which +* icons and texts are used for lbx items. +*/ +//#define _GS_PARENTPLUGIN_LBX_FORMAT_TRACES + + + +#endif // _DEBUG + +#endif // GSCONFIGURATION_H diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/conf/s60settingsuis.confml Binary file gssettingsuis/Gs/conf/s60settingsuis.confml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/conf/s60settingsuis_1000A82B.crml Binary file gssettingsuis/Gs/conf/s60settingsuis_1000A82B.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/conf/s60settingsuis_101F8751.crml Binary file gssettingsuis/Gs/conf/s60settingsuis_101F8751.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/conf/s60settingsuis_101F877A.crml Binary file gssettingsuis/Gs/conf/s60settingsuis_101F877A.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/conf/s60settingsuis_101F877B.crml Binary file gssettingsuis/Gs/conf/s60settingsuis_101F877B.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/conf/s60settingsuis_101F877C.crml Binary file gssettingsuis/Gs/conf/s60settingsuis_101F877C.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/conf/s60settingsuis_101F877E.crml Binary file gssettingsuis/Gs/conf/s60settingsuis_101F877E.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/conf/s60settingsuis_101F877F.crml Binary file gssettingsuis/Gs/conf/s60settingsuis_101F877F.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/conf/s60settingsuis_101F8780.crml Binary file gssettingsuis/Gs/conf/s60settingsuis_101F8780.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/conf/s60settingsuis_101F8781.crml Binary file gssettingsuis/Gs/conf/s60settingsuis_101F8781.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/conf/s60settingsuis_101F8782.crml Binary file gssettingsuis/Gs/conf/s60settingsuis_101F8782.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/conf/s60settingsuis_101F8831.crml Binary file gssettingsuis/Gs/conf/s60settingsuis_101F8831.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/conf/s60settingsuis_101F883B.crml Binary file gssettingsuis/Gs/conf/s60settingsuis_101F883B.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/conf/s60settingsuis_1020720A.crml Binary file gssettingsuis/Gs/conf/s60settingsuis_1020720A.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/conf/s60settingsuis_1028239D.crml Binary file gssettingsuis/Gs/conf/s60settingsuis_1028239D.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/conf/s60settingsuis_2002120B.crml Binary file gssettingsuis/Gs/conf/s60settingsuis_2002120B.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* General Settings. +* +*/ + + +#ifndef RD_GS_RENOVATION // This is the old GS + + PRJ_PLATFORMS + DEFAULT + + PRJ_EXPORTS + ../Data/backup_registration.xml z:/private/100058EC/backup_registration.xml + + PRJ_MMPFILES + + ../group/GS.mmp + + +#else // This is the RD_GS_RENOVATION + + + #include + + // GS Modules: + #include "../GSBackgroundImage/bld.inf" + #include "../GSListBox/bld.inf" + + #include "../GSFramework/bld.inf" + #include "../GSApplication/bld.inf" + + // Main view plugins: + #include "../GSAppsPlugin/bld.inf" + #include "../GSConPlugin/bld.inf" + #include "../GSGenPlugin/bld.inf" + #include "../GSTelPlugin/bld.inf" + + // Sub view plugins: + #include "../GSDataCallPlugin/bld.inf" + #include "../GSDisplayPlugin/bld.inf" + #include "../GSOpticalJoystickPlugin/bld.inf" + #include "../GSPDataPlugin/bld.inf" +// #include "../GSPrslnPlugin/bld.inf" + #include "../GSSecurityPlugin/bld.inf" + #include "../GSCallPlugin/bld.inf" + #include "../GSCallDivertPlugin/bld.inf" + #include "../GSCallBarringPlugin/bld.inf" + #include "../GSNetworkPlugin/bld.inf" + #include "../GSPDataAccessPointPlugin/bld.inf" + #include "../GSPDataConnectionPlugin/bld.inf" + #include "../GSPowerSavingQueryPlugin/bld.inf" + + #ifdef RD_CONTROL_PANEL + #include "../GSDeviceManagementPlugin/bld.inf" + #include "../GSSynchronisationPlugin/bld.inf" + #include "../GSInstallationsPlugin/bld.inf" + #include "../GSAdminPlugin/bld.inf" +// #include "../GSAutoKeyguardPlugin/bld.inf" + #endif //RD_CONTROL_PANEL + + #ifdef __HSXPA_SUPPORT + #include "../GSPDataHSDPAPlugin/bld.inf" + #endif + + #include "../gslauncher/group/bld.inf" + #include "../GSIndicatorPlugin/group/bld.inf" + #include "../help/group/bld.inf" + + PRJ_EXPORTS + //Configuration tool migration + ../conf/s60settingsuis.confml MW_LAYER_CONFML(s60settingsuis.confml) + ../conf/s60settingsuis_101F877A.crml MW_LAYER_CRML(s60settingsuis_101f877a.crml) + ../conf/s60settingsuis_101F877B.crml MW_LAYER_CRML(s60settingsuis_101f877b.crml) + ../conf/s60settingsuis_101F877C.crml MW_LAYER_CRML(s60settingsuis_101f877c.crml) + ../conf/s60settingsuis_101F877E.crml MW_LAYER_CRML(s60settingsuis_101f877e.crml) + ../conf/s60settingsuis_101F877F.crml MW_LAYER_CRML(s60settingsuis_101f877f.crml) + ../conf/s60settingsuis_101F883B.crml MW_LAYER_CRML(s60settingsuis_101f883b.crml) + ../conf/s60settingsuis_101F8751.crml MW_LAYER_CRML(s60settingsuis_101f8751.crml) + ../conf/s60settingsuis_101F8780.crml MW_LAYER_CRML(s60settingsuis_101f8780.crml) + ../conf/s60settingsuis_101F8781.crml MW_LAYER_CRML(s60settingsuis_101f8781.crml) + ../conf/s60settingsuis_101F8782.crml MW_LAYER_CRML(s60settingsuis_101f8782.crml) + ../conf/s60settingsuis_101F8831.crml MW_LAYER_CRML(s60settingsuis_101f8831.crml) + ../conf/s60settingsuis_1000A82B.crml MW_LAYER_CRML(s60settingsuis_1000a82b.crml) + ../conf/s60settingsuis_1020720A.crml MW_LAYER_CRML(s60settingsuis_1020720a.crml) + ../conf/s60settingsuis_1028239D.crml MW_LAYER_CRML(s60settingsuis_1028239d.crml) + ../conf/s60settingsuis_2002120B.crml MW_LAYER_CRML(s60settingsuis_2002120b.crml) + + PRJ_TESTMMPFILES + +#endif // RD_GS_RENOVATION + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/gslauncher/bwins/gslauncheru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/gslauncher/bwins/gslauncheru.def Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,5 @@ +EXPORTS + ?LaunchGSViewL@CGSLauncher@@QAEXVTUid@@0ABVTDesC8@@@Z @ 1 NONAME ; void CGSLauncher::LaunchGSViewL(class TUid, class TUid, class TDesC8 const &) + ?NewL@CGSLauncher@@SAPAV1@XZ @ 2 NONAME ; class CGSLauncher * CGSLauncher::NewL(void) + ?NewLC@CGSLauncher@@SAPAV1@XZ @ 3 NONAME ; class CGSLauncher * CGSLauncher::NewLC(void) + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/gslauncher/eabi/gslauncheru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/gslauncher/eabi/gslauncheru.def Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,5 @@ +EXPORTS + _ZN11CGSLauncher13LaunchGSViewLE4TUidS0_RK6TDesC8 @ 1 NONAME + _ZN11CGSLauncher4NewLEv @ 2 NONAME + _ZN11CGSLauncher5NewLCEv @ 3 NONAME + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/gslauncher/group/GSLauncher.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/gslauncher/group/GSLauncher.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project GSLauncher +* +*/ + + +#include +#include + +TARGET gslauncher.dll +TARGETTYPE DLL +UID 0x1000008d 0x2000F859 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE GSLauncher.cpp + +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ws32.lib // wssession +LIBRARY viewcli.lib +LIBRARY apgrfx.lib +LIBRARY estor.lib + +DEFFILE gslauncher.def + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/gslauncher/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/gslauncher/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project GSLauncher +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/gslauncher.iby CORE_MW_LAYER_IBY_EXPORT_PATH(gslauncher.iby) + +PRJ_MMPFILES +GSLauncher.mmp + +PRJ_TESTMMPFILES +// This is no good -tsrc's bld.inf should be compiled instead since it has copy script +// ../tsrc/public/basic/group/T_CGSLauncher.mmp + +PRJ_TESTEXPORTS +// ../test/inc/mytestcommon.h /epoc32/somewhere/mytestcommon.h diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/gslauncher/inc/GSLauncher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/gslauncher/inc/GSLauncher.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Launches GS views. +* +*/ + + + +#ifndef C_GSLAUNCHER_H +#define C_GSLAUNCHER_H + +#include +#include +#include + + + +class CGSLauncherExtension; +/** + * Launches general settings with specific plug-in opened. + * Using this API, a client may request a general settings view to be shown. + * Implementation will launch general settings if it is not yet running. + * + * Example usage of the interface: + * @code + * CGSLauncher* l = CGSLauncher::NewLC(); + * l->LaunchGSViewL ( yourPluginUid, TUid::Uid(0), KNullDesC8 ); + * CleanupStack::PopAndDestroy(l); + * @endcode + * + * @lib gslauncher.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS(CGSLauncher) : public CBase + { + +public: + + /** + * Two-phased constructors. + */ + IMPORT_C static CGSLauncher* NewL(); + + IMPORT_C static CGSLauncher* NewLC(); + + + /** + * Destructor. + */ + virtual ~CGSLauncher(); + + /** + * Launches general settings with specific plug-in activated. + * Launching of plug-in's local views is not supported directly. + * Custom message to can be used to achieve this. + * General settings application is started if it's not running. + * Any application embedded into general settings will be closed. + * + * Needs capability: SwEvent + * + * @since S60 5.0 + * @param aTarget Target plug-in as identified in ecom registration + * resource ("implementation_uid"). + * @param aCustomMessageId For client data. Passed to the plug-in. + * @param aCustomMessage For client data. Passed to the plug-in. + * @return none + */ + IMPORT_C void LaunchGSViewL( const TUid aTarget,const TUid aCustomMessageId + ,const TDesC8& aCustomMessage ); + + +protected: + +private: + + CGSLauncher(); + + void ConstructL(); + +private: // data + CGSLauncherExtension* iExt; + }; + +#endif // C_GSLAUNCHER_H diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/gslauncher/rom/gslauncher.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/gslauncher/rom/gslauncher.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image description file for project GSLauncher +* +*/ + + +#ifndef GSLAUNCHER_IBY +#define GSLAUNCHER_IBY + +#include + +file=ABI_DIR\BUILD_DIR\gslauncher.dll SHARED_LIB_DIR\gslauncher.dll + +#endif // GSLAUNCHER_IBY diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/gslauncher/src/GSLauncher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/gslauncher/src/GSLauncher.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,135 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Launches GS views. +* +*/ + +#include "GSLauncher.h" + +#include +#include +#include +#include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif + +#include +#include + + +const TUid KGSMessageViewLaunch = { 0x1 }; +const TInt KGSApaMsgLength = 1024; + +// ======== MEMBER FUNCTIONS ======== +// --------------------------------------------------------------------------- +// description_if_needed +// --------------------------------------------------------------------------- +// +CGSLauncher::CGSLauncher() + { + } + + +// --------------------------------------------------------------------------- +// description_if_needed +// --------------------------------------------------------------------------- +// +void CGSLauncher::ConstructL() + { + //code + } + + +// --------------------------------------------------------------------------- +// description_if_needed +// --------------------------------------------------------------------------- +// +EXPORT_C CGSLauncher* CGSLauncher::NewL() + { + CGSLauncher* self = CGSLauncher::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// description_if_needed +// --------------------------------------------------------------------------- +// +EXPORT_C CGSLauncher* CGSLauncher::NewLC() + { + CGSLauncher* self = new( ELeave ) CGSLauncher; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// description_if_needed +// --------------------------------------------------------------------------- +// +CGSLauncher::~CGSLauncher() + { + } + +// --------------------------------------------------------------------------- +// implementation_description +// --------------------------------------------------------------------------- +// +EXPORT_C void CGSLauncher::LaunchGSViewL( const TUid aTarget, + const TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + RProperty prop; + RWsSession ws; + User::LeaveIfError(ws.Connect()); + CleanupClosePushL( ws ); + + TApaTaskList l(ws); + TApaTask gs = l.FindApp(KUidGS); + + // GS not running, launch via avkon + if ( !gs.Exists() ) + { + CVwsSessionWrapper* wsw = CVwsSessionWrapper::NewLC(); + const TVwsViewId viewId( KUidGS, aTarget ); + wsw->CreateActivateViewEvent( viewId,aCustomMessageId, aCustomMessage ); + CleanupStack::PopAndDestroy( wsw ); + } + else + { + // GS running, send parameters in string + // Pachage custom message + CBufFlat* buffer = CBufFlat::NewL( KGSApaMsgLength ); // etc + CleanupStack::PushL( buffer ); + RBufWriteStream stream( *buffer ); + stream << aTarget; + // In case none plugin needs custom message currently, set it to NULL. + stream << aCustomMessageId; + stream << aCustomMessage; +// stream << TUid::Uid(0); +// stream << KNullDesC8; + stream.CommitL(); + stream.Close(); + TPtr8 pBuffer( buffer->Ptr( 0 ) ); + + gs.SendMessage( KGSMessageViewLaunch, pBuffer ); + CleanupStack::PopAndDestroy( buffer ); + gs.BringToForeground(); + } + CleanupStack::PopAndDestroy( &ws ); + } + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/help/data/xhtml.zip Binary file gssettingsuis/Gs/help/data/xhtml.zip has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/help/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/help/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - Initial contribution +* +* Contributors: +* +* +* Description: +* Export help related files. +* +*/ + +#include +PRJ_EXPORTS +:zip ../data/xhtml.zip /epoc32/data/z/resource/ overwrite +:zip ../data/xhtml.zip /epoc32/winscw/c/resource/ overwrite + +../inc/cp.hlp.hrh MW_LAYER_PLATFORM_EXPORT_PATH(csxhelp/cp.hlp.hrh) +../rom/gssettingsuishelps_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(gssettingsuishelps_variant.iby) diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/help/inc/cp.hlp.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/help/inc/cp.hlp.hrh Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// +// cp.hlp.hrh generated by CSXHelp Utilities. +// + +#ifndef __CP_HLP_HRH__ +#define __CP_HLP_HRH__ + +_LIT(KSET_HLP_SETTINGS_KEYPAD_COVER, "SET_HLP_SETTINGS_KEYPAD_COVER"); // +_LIT(KCP_HLP_ADMINISTRATIVE_SETTINGS, "CP_HLP_ADMINISTRATIVE_SETTINGS"); // +_LIT(KSET_HLP_TELEP_NETWORK_SET, "SET_HLP_TELEP_NETWORK_SET"); // +_LIT(KCP_HLP_DEVICE_MANAGEMENT, "CP_HLP_DEVICE_MANAGEMENT"); // +_LIT(KSET_HLP_WLAN_WPA_MAIN, "SET_HLP_WLAN_WPA_MAIN"); // +_LIT(KSET_HLP_WLAN_8021X_MAIN, "SET_HLP_WLAN_8021X_MAIN"); // +_LIT(KSET_HLP_WLAN_ADV_SETTINGS, "SET_HLP_WLAN_ADV_SETTINGS"); // +_LIT(KSET_HLP_WLAN_EAP_PLUGINS_IAP, "SET_HLP_WLAN_EAP_PLUGINS_IAP"); // +_LIT(KSET_HLP_WLAN_EAP_AKA, "SET_HLP_WLAN_EAP_AKA"); // +_LIT(KSET_HLP_WLAN_EAP_SIM, "SET_HLP_WLAN_EAP_SIM"); // +_LIT(KSET_HLP_WLAN_EAP_GTC, "SET_HLP_WLAN_EAP_GTC"); // +_LIT(KSET_HLP_WLAN_EAP_TTLS_TYPES, "SET_HLP_WLAN_EAP_TTLS_TYPES"); // +_LIT(KSET_HLP_WLAN_EAP_TTLS_SUITES, "SET_HLP_WLAN_EAP_TTLS_SUITES"); // +_LIT(KSET_HLP_WLAN_EAP_TTLS_SETT, "SET_HLP_WLAN_EAP_TTLS_SETT"); // +_LIT(KSET_HLP_WLAN_EAP_TLS_SUITES, "SET_HLP_WLAN_EAP_TLS_SUITES"); // +_LIT(KSET_HLP_WLAN_EAP_TLS_SETT, "SET_HLP_WLAN_EAP_TLS_SETT"); // +_LIT(KSET_HLP_WLAN_EAP_PEAP_TYPES, "SET_HLP_WLAN_EAP_PEAP_TYPES"); // +_LIT(KSET_HLP_WLAN_EAP_PEAP_SUITES, "SET_HLP_WLAN_EAP_PEAP_SUITES"); // +_LIT(KSET_HLP_WLAN_EAP_PEAP_SETT, "SET_HLP_WLAN_EAP_PEAP_SETT"); // +_LIT(KSET_HLP_WLAN_EAP_MSCHAPV2, "SET_HLP_WLAN_EAP_MSCHAPV2"); // +_LIT(KSET_HLP_WLAN_EAP_PLAIN_MSCHAP, "SET_HLP_WLAN_EAP_PLAIN_MSCHAP"); // +_LIT(KDIV_HLP_CALL_FORW_DAT, "DIV_HLP_CALL_FORW_DAT"); // +_LIT(KSET_HLP_WLAN_EAP_LEAP, "SET_HLP_WLAN_EAP_LEAP"); // +_LIT(KSET_HLP_WLAN_EAP_FAST_TYPES, "SET_HLP_WLAN_EAP_FAST_TYPES"); // +_LIT(KSET_HLP_WLAN_EAP_FAST_SUITES, "SET_HLP_WLAN_EAP_FAST_SUITES"); // +_LIT(KSET_HLP_WLAN_EAP_FAST_SETT, "SET_HLP_WLAN_EAP_FAST_SETT"); // +_LIT(KSET_HLP_WLAN_EAP_PAP, "SET_HLP_WLAN_EAP_PAP"); // +_LIT(KSET_HLP_WLAN_WEP_KEY_SETT, "SET_HLP_WLAN_WEP_KEY_SETT"); // +_LIT(KSET_HLP_WLAN_WEP_MAIN, "SET_HLP_WLAN_WEP_MAIN"); // +_LIT(KACL_HLP_MAIN, "ACL_HLP_MAIN"); // +_LIT(KSIP_HLP_PROF_PARAMS, "SIP_HLP_PROF_PARAMS"); // +_LIT(KSIP_HLP_MAIN, "SIP_HLP_MAIN"); // +_LIT(KSIP_HLP_PROXY_PARAMS, "SIP_HLP_PROXY_PARAMS"); // +_LIT(KSIP_HLP_REGISTRAR_PARAM, "SIP_HLP_REGISTRAR_PARAM"); // +_LIT(KHLP_OCC_CONN_SETTINGS, "HLP_OCC_CONN_SETTINGS"); // +_LIT(KSET_HLP_CONN_DEST_VIEW, "SET_HLP_CONN_DEST_VIEW"); // +_LIT(KSET_HLP_DEFAULT_CONN, "SET_HLP_DEFAULT_CONN"); // +_LIT(KSET_HLP_VPN_DEST_ASSOC_VIEW, "SET_HLP_VPN_DEST_ASSOC_VIEW"); // +_LIT(KSET_HLP_CONN_METHODS_VIEW, "SET_HLP_CONN_METHODS_VIEW"); // +_LIT(KCP_HLP_DEVICE_LOCKING, "CP_HLP_DEVICE_LOCKING"); // +_LIT(K0x100058EC, "0x100058EC"); // SSET_HLP_MAIN_VIEW +_LIT(KSET_HLP_APP_DEST_ASSOC_VIEW, "SET_HLP_APP_DEST_ASSOC_VIEW"); // +_LIT(KCP_HLP_APPILICATION_SETTINGS, "CP_HLP_APPILICATION_SETTINGS"); // +_LIT(KSCP_HLP_CALL, "SCP_HLP_CALL"); // +_LIT(KCP_HLP_CONNECTIVITY, "CP_HLP_CONNECTIVITY"); // +_LIT(KCP_HLP_DISPLAY, "CP_HLP_DISPLAY"); // +_LIT(KCP_HLP_DEVICE, "CP_HLP_DEVICE"); // +_LIT(KCP_HLP_LANGUAGE, "CP_HLP_LANGUAGE"); // +_LIT(KCP_HLP_MAIN_VIEW, "CP_HLP_MAIN_VIEW"); // +_LIT(KCP_HLP_NETWORK, "CP_HLP_NETWORK"); // +_LIT(KCP_HLP_PEN_INPUT, "CP_HLP_PEN_INPUT"); // +_LIT(KCP_HLP_PERSONAL, "CP_HLP_PERSONAL"); // +_LIT(KCP_HLP_SECURITY, "CP_HLP_SECURITY"); // +_LIT(KSET_HLP_SECURITY_DEVICE_SIM, "SET_HLP_SECURITY_DEVICE_SIM"); // +_LIT(KCP_HLP_IDLE, "CP_HLP_IDLE"); // +_LIT(KCP_HLP_TELEPHONY, "CP_HLP_TELEPHONY"); // +_LIT(KCP_HLP_WRITING_LANGUAGE, "CP_HLP_WRITING_LANGUAGE"); // +_LIT(KDIAGNOSTICS_HLP_MAIN_VIEW, "DIAGNOSTICS_HLP_MAIN_VIEW"); // +_LIT(KDIAGNOSTICS_HLP_CONNECT_VIEW, "DIAGNOSTICS_HLP_CONNECT_VIEW"); // +_LIT(KDIAGNOSTICS_HLP_COVERAGE_VIEW, "DIAGNOSTICS_HLP_COVERAGE_VIEW"); // +_LIT(KDIAGNOSTICS_HLP_HARDWARE_VIEW, "DIAGNOSTICS_HLP_HARDWARE_VIEW"); // +_LIT(KDIAGNOSTICS_HLP_SERVICES_VIEW, "DIAGNOSTICS_HLP_SERVICES_VIEW"); // +_LIT(KES_HLP_LIGHT_MAIN, "ES_HLP_LIGHT_MAIN"); // +_LIT(KES_HLP_LIGHT_BLINKING, "ES_HLP_LIGHT_BLINKING"); // +_LIT(KSET_HLP_ACCESSORIES_LIST, "SET_HLP_ACCESSORIES_LIST"); // +_LIT(KSSET_HLP_MAIN_VIEW, "SSET_HLP_MAIN_VIEW"); // +_LIT(KSET_HLP_AP_SETTING_GPRS, "SET_HLP_AP_SETTING_GPRS"); // +_LIT(KSET_HLP_AP_SETTING_GPRS_AS, "SET_HLP_AP_SETTING_GPRS_AS"); // +_LIT(KSET_HLP_AP_DATA_AS_IPV4, "SET_HLP_AP_DATA_AS_IPV4"); // +_LIT(KSET_HLP_AP_DATA_AS_IPV6, "SET_HLP_AP_DATA_AS_IPV6"); // +_LIT(KSET_HLP_AP_SETTING_DATA, "SET_HLP_AP_SETTING_DATA"); // +_LIT(KSET_HLP_AP_SETTING_DATA_AS, "SET_HLP_AP_SETTING_DATA_AS"); // +_LIT(KSET_HLP_AP_SETTING_WLAN_AS, "SET_HLP_AP_SETTING_WLAN_AS"); // +_LIT(KSET_HLP_VPN_AP_SETTINGS_VIEW, "SET_HLP_VPN_AP_SETTINGS_VIEW"); // +_LIT(KSET_HLP_AP_SETTING_WLAN, "SET_HLP_AP_SETTING_WLAN"); // +_LIT(KSET_HLP_AP_WLAN_AS_IPV4, "SET_HLP_AP_WLAN_AS_IPV4"); // +_LIT(KSET_HLP_AP_WLAN_AS_IPV6, "SET_HLP_AP_WLAN_AS_IPV6"); // +_LIT(KCP_HLP_AUTOKEYGUARD, "CP_HLP_AUTOKEYGUARD"); // +_LIT(KRD_HLP_REMOTE_DRIVE_CONFIG, "RD_HLP_REMOTE_DRIVE_CONFIG"); // +_LIT(KRD_HLP_REMOTE_DRIVES, "RD_HLP_REMOTE_DRIVES"); // +_LIT(KSET_HLP_BARRING_SETTINGS, "SET_HLP_BARRING_SETTINGS"); // +_LIT(KDIV_HLP_BARRING_MAIN, "DIV_HLP_BARRING_MAIN"); // +_LIT(KDIV_HLP_CALL_FORW_VID, "DIV_HLP_CALL_FORW_VID"); // +_LIT(KDIV_HLP_CALL_FORW_MAIN, "DIV_HLP_CALL_FORW_MAIN"); // +_LIT(KDIV_HLP_CALL_FORW_VOI, "DIV_HLP_CALL_FORW_VOI"); // +_LIT(KDIV_HLP_CALL_FORW_VOIP, "DIV_HLP_CALL_FORW_VOIP"); // +_LIT(KSET_HLP_WLAN_SETTINGS, "SET_HLP_WLAN_SETTINGS"); // +_LIT(KCP_HLP_SYNCHRONISATION, "CP_HLP_SYNCHRONISATION"); // +_LIT(KCP_HLP_INSTALLATIONS, "CP_HLP_INSTALLATIONS"); // +_LIT(KSET_HLP_ACCESSORIES_HEADPHONE, "SET_HLP_ACCESSORIES_HEADPHONE"); // +_LIT(KSET_HLP_ACCESSORIES_HEADSET, "SET_HLP_ACCESSORIES_HEADSET"); // +_LIT(KSET_HLP_ACCESS_WIRED_CK, "SET_HLP_ACCESS_WIRED_CK"); // +_LIT(KSET_HLP_ACCESS_WIRELESS_CK, "SET_HLP_ACCESS_WIRELESS_CK"); // +_LIT(KSET_HLP_ACCESSORIES_LOOPSET, "SET_HLP_ACCESSORIES_LOOPSET"); // +_LIT(KSET_HLP_ACCESSORIES_MUSIC_ST, "SET_HLP_ACCESSORIES_MUSIC_ST"); // +_LIT(KSET_HLP_ACCESSORIES_TTY, "SET_HLP_ACCESSORIES_TTY"); // +_LIT(KSET_HLP_ACCESSORIES_TVOUT, "SET_HLP_ACCESSORIES_TVOUT"); // +_LIT(KPREDINPUT_HLP_VIRTUAL_ITI_SETTINGS, "PREDINPUT_HLP_VIRTUAL_ITI_SETTINGS"); // +_LIT(KPREDINPUT_HLP_VIRTUAL_ITI, "PREDINPUT_HLP_VIRTUAL_ITI"); // +_LIT(KPREDINPUT_HLP_USERDICT, "PREDINPUT_HLP_USERDICT"); // +_LIT(KSET_HLP_GENERAL_ORIG_SET, "SET_HLP_GENERAL_ORIG_SET"); // +_LIT(KPREDINPUT_HLP_SHORTCUT, "PREDINPUT_HLP_SHORTCUT"); // +_LIT(KPREDINPUT_HLP_INPUT, "PREDINPUT_HLP_INPUT"); // +_LIT(KPREDINPUT_HLP_INPUT_SETTINGS, "PREDINPUT_HLP_INPUT_SETTINGS"); // +#endif \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/help/rom/gssettingsuishelps_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/help/rom/gssettingsuishelps_variant.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __GSSETTINGSUISHELPS_VARIANT_IBY__ +#define __GSSETTINGSUISHELPS_VARIANT_IBY__ + +#if defined(FF_S60_HELPS_IN_USE) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058EC\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x100058EC\contents.zip) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058EC\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x100058EC\index.xml) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058EC\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x100058EC\keywords.xml) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058EC\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x100058EC\meta.xml) +#endif + +#endif \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/readme.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/readme.txt Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,35 @@ +GS RENOVATION framework notes. + +On default the old GS is used. + +Activate RD_GS_RENOVATION flag in the group\bld.inf if RD_GS_RENOVATION framework is +to be used. Remember to use abld reallyclean before building the project when +switching between ond and renoved GS framework or you will get mixed files from +the old and new frameworks: + 1. Define/undefine RD_GS_RENOVATION + 2. abld reallyclean + 3. bldmake bldfiles + 4. abld build + + +Do not use UIDs used by other plugins even for testing purposes. ECOM framework +seems to have some issues with updating the ECOM plugins implementaions and +their UIDs. + +Implemented: +- Main view. +- Default icons. +- Plugins. +- GS FW for loading the plugins. +- Helper classes. + +Functionality not implemented yet: +- Help. +- Btimaps in addition to scalable icons. + +Bugs not fixed in GS renovation: +-GSAppsPlugin does not handle "trap" panics. + + + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSActiveIdlePlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSActiveIdlePlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSActiveIdlePlugin ROM resources. +* +*/ + +#ifndef GSACTIVEIDLEPLUGIN_IBY +#define GSACTIVEIDLEPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + #ifndef RD_BOOT_CUSTOMIZABLE_AI + ECOM_PLUGIN( GSActiveIdlePlugin.dll, 102750C3.rsc ) + //data=DATAZ_\BITMAP_DIR\GSActiveIdlePlugin.mif BITMAP_DIR\GSActiveIdlePlugin.mif + #endif //RD_BOOT_CUSTOMIZABLE_AI + #endif // RD_GS_RENOVATION + +#endif // GSACTIVEIDLEPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSActiveIdlePluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSActiveIdlePluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSActiveIdlePlugin ROM resources. +* +*/ + +#ifndef GSACTIVEIDLEPLUGINRESOURCES_IBY +#define GSACTIVEIDLEPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + #ifndef RD_BOOT_CUSTOMIZABLE_AI + data=DATAZ_\RESOURCE_FILES_DIR\GSActiveIdlePluginRsc.rsc RESOURCE_FILES_DIR\GSActiveIdlePluginRsc.rsc + #endif //RD_BOOT_CUSTOMIZABLE_AI + #endif // RD_GS_RENOVATION + +#endif // GSACTIVEIDLEPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSAdminPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSAdminPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSAdminPlugin ROM files. +* +*/ + +#ifndef GSADMINPLUGIN_IBY +#define GSADMINPLUGIN_IBY + + #ifdef RD_CONTROL_PANEL + + ECOM_PLUGIN( GSAdminPlugin.dll, 10283340.rsc ) + data=DATAZ_\BITMAP_DIR\GSAdminPlugin.mif BITMAP_DIR\GSAdminPlugin.mif + + #endif // RD_CONTROL_PANEL + +#endif // GSADMINPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSAdminPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSAdminPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSAdminPlugin ROM resources. +* +*/ + +#ifndef GSADMINPLUGINRESOURCES_IBY +#define GSADMINPLUGINRESOURCES_IBY + + #ifdef RD_CONTROL_PANEL + + data=DATAZ_\RESOURCE_FILES_DIR\GSAdminPluginRsc.rsc RESOURCE_FILES_DIR\GSAdminPluginRsc.rsc + + #endif // RD_CONTROL_PANEL + +#endif // GSADMINPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSApp.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSApp.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSApp ROM files. +* +*/ + +#ifndef GSAPP_IBY +#define GSAPP_IBY + + #ifdef RD_GS_RENOVATION + + // GS Application: + file=ABI_DIR\BUILD_DIR\GSApp.exe PROGRAMS_DIR\GSApp.exe + + // AIF icons/files: + #ifdef __SCALABLE_ICONS + data=DATAZ_\APP_BITMAP_DIR\GSApp_aif.MIF APP_BITMAP_DIR\GSApp_aif.mif + #else + AUTO-BITMAP=DATAZ_\APP_BITMAP_DIR\GSApp_aif.MBM APP_BITMAP_DIR\GSApp_aif.mbm + #endif //__SCALABLE_ICONS + + // Non-localisable resource file, can be defined in application IBY + data=ZSYSTEM\..\PRIVATE\10003A3F\APPS\GSApp_reg.RSC Private\10003a3f\apps\GSApp_reg.rsc + + // GS Framework: + file=ABI_DIR\BUILD_DIR\GSFramework.dll SHARED_LIB_DIR\GSFramework.dll + file=ABI_DIR\BUILD_DIR\GSEcomPlugin.dll SHARED_LIB_DIR\GSEcomPlugin.dll + + // Normal icons: + data=DATAZ_\BITMAP_DIR\Gsfwicon.mif BITMAP_DIR\Gsfwicon.mif + data=DATAZ_\private\100058EC\backup_registration.xml private\100058EC\backup_registration.xml + + #endif // RD_GS_RENOVATION + +#endif // GSAPP_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSAppResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSAppResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSAppResources ROM files. +* +*/ + +#ifndef GSAPPRESOURCES_IBY +#define GSAPPRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + // Resource file(s) for GENERAL SETTINGS application (Gs.iby) + data=DATAZ_\APP_RESOURCE_DIR\GSApp.RSC APP_RESOURCE_DIR\GSApp.rsc + + // GS Framework: + data=DATAZ_\RESOURCE_FILES_DIR\GSParentPluginRsc.rsc RESOURCE_FILES_DIR\GSParentPluginRsc.rsc + data=DATAZ_\RESOURCE_FILES_DIR\GSFrameworkRsc.rsc RESOURCE_FILES_DIR\GSFrameworkRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSAPPRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSAppsPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSAppsPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSAppsPlugin ROM files. +* +*/ + +#ifndef GSAPPSPLUGIN_IBY +#define GSAPPSPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + + ECOM_PLUGIN( GSAppsPlugin.dll,1020723A.rsc ) + data=DATAZ_\BITMAP_DIR\GSAppsPlugin.mif BITMAP_DIR\GSAppsPlugin.mif + + #endif // RD_GS_RENOVATION + +#endif // GSAPPSPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSAppsPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSAppsPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSAppsPluginResources ROM files. +* +*/ + +#ifndef GSAPPSPLUGINRESOURCES_IBY +#define GSAPPSPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSAppsPluginRsc.rsc RESOURCE_FILES_DIR\GSAppsPluginRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSAPPSPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSAutoKeyguardPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSAutoKeyguardPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* 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: GSAutoKeyguardPlugin ROM files. +* +*/ + +#ifndef GSAUTOKEYGUARDPLUGIN_IBY +#define GSAUTOKEYGUARDPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + + ECOM_PLUGIN( GSAutoKeyguardPlugin.dll, 200110f0.rsc ) + data=DATAZ_\BITMAP_DIR\gsautokeyguardplugin.mif BITMAP_DIR\gsautokeyguardplugin.mif + + #endif // RD_GS_RENOVATION + +#endif // GSAUTOKEYGUARDPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSAutoKeyguardPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSAutoKeyguardPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* 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: GSAutoKeyguardPlugin ROM resources. +* +*/ + +#ifndef GSAUTOKEYGUARDPLUGINRESOURCES_IBY +#define GSAUTOKEYGUARDPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSAutoKeyguardPluginRsc.rsc RESOURCE_FILES_DIR\GSAutoKeyguardPluginRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSAUTOKEYGUARDPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSBackgroundImage.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSBackgroundImage.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef _BACKGROUNDIMAGE_IBY_ +#define _BACKGROUNDIMAGE_IBY_ + +file=ABI_DIR\BUILD_DIR\BackgroundImage.dll SHARED_LIB_DIR\BackgroundImage.dll + +#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSCallBarringPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSCallBarringPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSCallBarringPlugin ROM files. +* +*/ + +#ifndef GSCALLBARRINGPLUGIN_IBY +#define GSCALLBARRINGPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + + ECOM_PLUGIN( GSCallBarringPlugin.dll,102824A5.rsc ) + data=DATAZ_\BITMAP_DIR\GSCallBarringplugin.mif BITMAP_DIR\GSCallBarringplugin.mif + + #endif // RD_GS_RENOVATION + +#endif // GSCALLBARRINGPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSCallBarringPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSCallBarringPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSCallBarringPluginResources ROM resources. +* +*/ + +#ifndef GSCALLBARRINGPLUGINRESOURCES_IBY +#define GSCALLBARRINGPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSCallBarringPluginRsc.rsc RESOURCE_FILES_DIR\GSCallBarringPluginRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSCALLBARRINGPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSCallDivertPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSCallDivertPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSCallDivertPlugin ROM files. +* +*/ + +#ifndef GSCALLDIVERTPLUGIN_IBY +#define GSCALLDIVERTPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + + ECOM_PLUGIN( GSCallDivertPlugin.dll,102824A3.rsc ) + data=DATAZ_\BITMAP_DIR\GSCallDivertplugin.mif BITMAP_DIR\GSCallDivertplugin.mif + + #endif // RD_GS_RENOVATION + +#endif // GSCALLDIVERTPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSCallDivertPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSCallDivertPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSCallDivertPluginResources ROM resources. +* +*/ + +#ifndef GSCALLDIVERTPLUGINRESOURCES_IBY +#define GSCALLDIVERTPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSCallDivertPluginRsc.rsc RESOURCE_FILES_DIR\GSCallDivertPluginRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSCALLDIVERTPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSCallPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSCallPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSCallPlugin ROM files. +* +*/ + +#ifndef GSCALLPLUGIN_IBY +#define GSCALLPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + + ECOM_PLUGIN( GSCallPlugin.dll,102824A1.rsc ) + data=DATAZ_\BITMAP_DIR\GSCallplugin.mif BITMAP_DIR\GSCallplugin.mif + + #endif // RD_GS_RENOVATION + +#endif // GSCALLPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSCallPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSCallPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSCallPluginResources ROM resources. +* +*/ + +#ifndef GSCALLPLUGINRESOURCES_IBY +#define GSCALLPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSCallPluginRsc.rsc RESOURCE_FILES_DIR\GSCallPluginRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSCALLPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSConPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSConPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSConPlugin ROM files. +* +*/ + +#ifndef GSCONPLUGIN_IBY +#define GSCONPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + + ECOM_PLUGIN( GSConPlugin.dll, 10207251.rsc ) + data=DATAZ_\BITMAP_DIR\GSConPlugin.mif BITMAP_DIR\GSConPlugin.mif + + #endif // RD_GS_RENOVATION + +#endif // GSCONPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSConPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSConPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSConPluginResources ROM files. +* +*/ + +#ifndef GSCONPLUGINRESOURCES_IBY +#define GSCONPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSConPluginRsc.rsc RESOURCE_FILES_DIR\GSConPluginRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSCONPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSDataCallPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSDataCallPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSDataCallPlugin ROM file. +* +*/ + +#ifndef GSDATACALLPLUGIN_IBY +#define GSDATACALLPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + + ECOM_PLUGIN( GSDataCallPlugin.dll, 10207437.rsc ) + data=DATAZ_\BITMAP_DIR\GSDataCallPlugin.mif BITMAP_DIR\GSDataCallPlugin.mif + + #endif // RD_GS_RENOVATION + +#endif // GSDATACALLPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSDataCallPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSDataCallPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSDataCallPlugin ROM resources +* +*/ + +#ifndef GSDATACALLPLUGINRESOURCES_IBY +#define GSDATACALLPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSDataCallPluginRsc.rsc RESOURCE_FILES_DIR\GSDataCallPluginRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSDATACALLPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSDeviceManagementPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSDeviceManagementPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSDeviceManagementPlugin ROM resources. +* +*/ + +#ifndef GSDEVICEMANAGEMENTPLUGIN_IBY +#define GSDEVICEMANAGEMENTPLUGIN_IBY + + #ifdef RD_CONTROL_PANEL + + ECOM_PLUGIN( GSDeviceManagementPlugin.dll, 10207238.rsc ) + data=DATAZ_\BITMAP_DIR\GSDeviceManagementPlugin.mif BITMAP_DIR\GSDeviceManagementPlugin.mif + + #endif // RD_CONTROL_PANEL + +#endif // GSDEVICEMANAGEMENTPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSDeviceManagementPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSDeviceManagementPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSDeviceManagementPlugin ROM resources. +* +*/ + +#ifndef GSDEVICEMANAGEMENTPLUGINRESOURCES_IBY +#define GSDEVICEMANAGEMENTPLUGINRESOURCES_IBY + + #ifdef RD_CONTROL_PANEL + + data=DATAZ_\RESOURCE_FILES_DIR\GSDeviceManagementPluginRsc.rsc RESOURCE_FILES_DIR\GSDeviceManagementPluginRsc.rsc + + #endif // RD_CONTROL_PANEL + +#endif // GSDEVICEMANAGEMENTPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSDisplayPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSDisplayPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSDisplayPlugin ROM file +* +*/ + +#ifndef GSDISPLAYPLUGIN_IBY +#define GSDISPLAYPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + + ECOM_PLUGIN( GSDisplayPlugin.dll, 10207440.rsc ) + data=DATAZ_\BITMAP_DIR\GSDisplayplugin.mif BITMAP_DIR\GSDisplayplugin.mif + +#ifdef FF_POWER_SAVE + data=ZPRIVATE\2000B187\2000B591.xml private\2000B187\2000B591.xml +#endif // FF_POWER_SAVE + + #endif // RD_GS_RENOVATION + +#endif // GSDISPLAYPLUGIN_IBY +// End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSDisplayPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSDisplayPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSDisplayPlugin ROM resources. +* +*/ + +#ifndef GSDISPLAYPLUGINRESOURCES_IBY +#define GSDISPLAYPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSDisplayPluginRsc.rsc RESOURCE_FILES_DIR\GSDisplayPluginRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSDISPLAYPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSGenPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSGenPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSGenPlugin ROM resources. +* +*/ + +#ifndef GSGENPLUGIN_IBY +#define GSGENPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + + ECOM_PLUGIN( GSGenPlugin.dll, 10207238.rsc ) + data=DATAZ_\BITMAP_DIR\GSGenPlugin.mif BITMAP_DIR\GSGenPlugin.mif + + #endif // RD_GS_RENOVATION + +#endif // GSGENPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSGenPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSGenPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSGenPlugin ROM resources. +* +*/ + +#ifndef GSGENPLUGINRESOURCES_IBY +#define GSGENPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSGenPluginRsc.rsc RESOURCE_FILES_DIR\GSGenPluginRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSGENPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSInstallationsPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSInstallationsPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSInstallationsPlugin ROM resources. +* +*/ + +#ifndef GSINSTALLATIONSPLUGIN_IBY +#define GSINSTALLATIONSPLUGIN_IBY + + #ifdef RD_CONTROL_PANEL + + ECOM_PLUGIN( GSInstallationsPlugin.dll, 10207238.rsc ) + data=DATAZ_\BITMAP_DIR\GSInstallationsPlugin.mif BITMAP_DIR\GSInstallationsPlugin.mif + + #endif // RD_CONTROL_PANEL + +#endif // GSINSTALLATIONSPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSInstallationsPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSInstallationsPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSInstallationsPlugin ROM resources. +* +*/ + +#ifndef GSINSTALLATIONSPLUGINRESOURCES_IBY +#define GSINSTALLATIONSPLUGINRESOURCES_IBY + + #ifdef RD_CONTROL_PANEL + + data=DATAZ_\RESOURCE_FILES_DIR\GSInstallationsPluginRsc.rsc RESOURCE_FILES_DIR\GSInstallationsPluginRsc.rsc + + #endif // RD_CONTROL_PANEL + +#endif // GSINSTALLATIONSPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSInteractionPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSInteractionPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSInteractionPlugin ROM files. +* +*/ + +#ifndef GSINTERACTIONPLUGIN_IBY +#define GSINTERACTIONPLUGIN_IBY + + #ifdef RD_CONTROL_PANEL + + ECOM_PLUGIN( GSInteractionPlugin.dll, 10283340.rsc ) + data=DATAZ_\BITMAP_DIR\gsinteractionplugin.mif BITMAP_DIR\GSInteractionPlugin.mif + + #endif // RD_CONTROL_PANEL + +#endif // GSINTERACTIONPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSInteractionPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSInteractionPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSInteractionPlugin ROM resources. +* +*/ + +#ifndef GSINTERACTIONPLUGINRESOURCES_IBY +#define GSINTERACTIONPLUGINRESOURCES_IBY + + #ifdef RD_CONTROL_PANEL + + data=DATAZ_\RESOURCE_FILES_DIR\GSInteractionPluginRsc.rsc RESOURCE_FILES_DIR\GSInteractionPluginRsc.rsc + + #endif // RD_CONTROL_PANEL + +#endif // GSINTERACTIONPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSListBox.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSListBox.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef _GSLISTBOX_IBY_ +#define _GSLISTBOX_IBY_ + +file=ABI_DIR\BUILD_DIR\GSListBox.dll SHARED_LIB_DIR\GSListBox.dll + +#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSNetworkPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSNetworkPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSNetworkPlugin ROM files. +* +*/ + +#ifndef GSNETWORKPLUGIN_IBY +#define GSNETWORKPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + + ECOM_PLUGIN( GSNetworkPlugin.dll,102824A7.rsc ) + data=DATAZ_\BITMAP_DIR\GSNetworkplugin.mif BITMAP_DIR\GSNetworkplugin.mif + + #ifdef FF_POWER_SAVE + data=ZPRIVATE\2000B187\2000B593.xml private\2000B187\2000B593.xml + #endif // FF_POWER_SAVE + + #endif // RD_GS_RENOVATION + +#endif // GSNETWORKPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSNetworkPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSNetworkPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSNetworkPluginResources ROM resources. +* +*/ + +#ifndef GSNETWORKPLUGINRESOURCES_IBY +#define GSNETWORKPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSNetworkPluginRsc.rsc RESOURCE_FILES_DIR\GSNetworkPluginRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSNETWORKPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSOpticalJoystickPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSOpticalJoystickPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSOpticalJoystickPlugin ROM file. +* +*/ + +#ifndef GSOPTICALJOYSTICKPLUGIN_IBY +#define GSOPTICALJOYSTICKPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + + ECOM_PLUGIN( GSOpticalJoystickPlugin.dll, 1028331A.rsc ) + data=DATAZ_\BITMAP_DIR\GSOpticalJoystickPlugin.mif BITMAP_DIR\GSOpticalJoystickPlugin.mif + + #endif // RD_GS_RENOVATION + +#endif // GSOPTICALJOYSTICKPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSOpticalJoystickPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSOpticalJoystickPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSOpticalJoystickPlugin ROM resources +* +*/ + +#ifndef GSOPTICALJOYSTICKPLUGINRESOURCES_IBY +#define GSOPTICALJOYSTICKPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSOpticalJoystickPluginRsc.rsc RESOURCE_FILES_DIR\GSOpticalJoystickPluginRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSOPTICALJOYSTICKPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSPDataAccessPointPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSPDataAccessPointPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataAccessPointPlugin ROM files. +* +*/ + +#ifndef GSPDATAACCESSPOINTPLUGIN_IBY +#define GSPDATAACCESSPOINTPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + ECOM_PLUGIN( GSPDataAccessPointPlugin.dll,10282DC5.rsc ) + #endif // RD_GS_RENOVATION + +#endif // GSCALLDIVERTPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSPDataAccessPointPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSPDataAccessPointPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataAccessPointPluginResources ROM resources. +* +*/ + +#ifndef GSPDATAACCESSPOINTPLUGINRESOURCES_IBY +#define GSPDATAACCESSPOINTPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSPDataAccessPointPluginRsc.rsc RESOURCE_FILES_DIR\GSPDataAccessPointPluginRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSPDATAACCESSPOINTPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSPDataConnectionPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSPDataConnectionPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataConnectionPlugin ROM files. +* +*/ + +#ifndef GSPDATACONNECTIONPLUGIN_IBY +#define GSPDATACONNECTIONPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + ECOM_PLUGIN( GSPDataConnectionPlugin.dll,10282DC3.rsc ) + #endif // RD_GS_RENOVATION + +#endif // GSCALLPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSPDataConnectionPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSPDataConnectionPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataConnectionPluginResources ROM resources. +* +*/ + +#ifndef GSPDATACONNECTIONPLUGINRESOURCES_IBY +#define GSPDATACONNECTIONPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + data=DATAZ_\RESOURCE_FILES_DIR\GSPDataConnectionPluginRsc.rsc RESOURCE_FILES_DIR\GSPDataConnectionPluginRsc.rsc + #endif // RD_GS_RENOVATION + +#endif // GSPDATACONNECTIONPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSPDataHSDPAPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSPDataHSDPAPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataHSDPAPlugin ROM files. +* +*/ + +#ifndef GSPDATAHSDPAPLUGIN_IBY +#define GSPDATAHSDPAPLUGIN_IBY + + #ifdef __HSXPA_SUPPORT + ECOM_PLUGIN( GSPDataHSDPAPlugin.dll,10282DC7.rsc ) + #endif // __HSXPA_SUPPORT + +#endif // GSNETWORKPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSPDataHSDPAPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSPDataHSDPAPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataHSDPAPluginResources ROM resources. +* +*/ + +#ifndef GSPDATAHSDPAPLUGINRESOURCES_IBY +#define GSPDATAHSDPAPLUGINRESOURCES_IBY + + #ifdef __HSXPA_SUPPORT + + data=DATAZ_\RESOURCE_FILES_DIR\GSPDataHSDPAPluginRsc.rsc RESOURCE_FILES_DIR\GSPDataHSDPAPluginRsc.rsc + + #endif // __HSXPA_SUPPORT + +#endif // GSPDATAHSDPAPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSPDataPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSPDataPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataPlugin ROM files. +* +*/ + +#ifndef GSPDATAPLUGIN_IBY +#define GSPDATAPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + + ECOM_PLUGIN( GSPDataPlugin.dll,1020724F.rsc ) + data=DATAZ_\BITMAP_DIR\GSPDataPlugin.mif BITMAP_DIR\GSPDataPlugin.mif + + #endif // RD_GS_RENOVATION + +#endif // GSPDATAPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSPDataPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSPDataPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPDataPlugin ROM resources. +* +*/ + +#ifndef GSPDATAPLUGINRESOURCES_IBY +#define GSPDATAPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSPDataPluginRsc.rsc RESOURCE_FILES_DIR\GSPDataPluginRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSPDATAPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSPowerSavingQueryPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSPowerSavingQueryPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPowerSavingQueryPlugin ROM file. +* +*/ + +#ifndef GSPOWERSAVINGQUERYPLUGIN_IBY +#define GSPOWERSAVINGQUERYPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + + ECOM_PLUGIN( GSPowerSavingQueryPlugin.dll, 2002120C.rsc ) + data=DATAZ_\BITMAP_DIR\GSPowerSavingQueryPlugin.mif BITMAP_DIR\GSPowerSavingQueryPlugin.mif + + #endif // RD_GS_RENOVATION + +#endif // GSPOWERSAVINGQUERYPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSPowerSavingQueryPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSPowerSavingQueryPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPowerSavingQueryPlugin ROM resources +* +*/ + +#ifndef GSPOWERSAVINGQUERYPLUGINRESOURCE_IBY +#define GSPOWERSAVINGQUERYPLUGINRESOURCE_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSPowerSavingQueryPluginRsc.rsc RESOURCE_FILES_DIR\GSPowerSavingQueryPluginRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSPOWERSAVINGQUERYPLUGINRESOURCE_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSPrslnPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSPrslnPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPrslnPlugin ROM files. +* +*/ + +#ifndef GSPRSLNPLUGIN_IBY +#define GSPRSLNPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + + ECOM_PLUGIN( GSPrslnPlugin.dll, 10207253.rsc ) + data=DATAZ_\BITMAP_DIR\GSPrslnPlugin.mif BITMAP_DIR\GSPrslnPlugin.mif + + #endif // RD_GS_RENOVATION + +#endif // GSPRSLNPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSPrslnPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSPrslnPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSPrslnPlugin ROM resources. +* +*/ + +#ifndef GSPRSLNPLUGINRESOURCES_IBY +#define GSPRSLNPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSPrslnPluginRsc.rsc RESOURCE_FILES_DIR\GSPrslnPluginRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSPRSLNPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSSecurityPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSSecurityPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSAccsPlugin ROM files. +* +*/ + +#ifndef GSSECURITYPLUGIN_IBY +#define GSSECURITYPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + + ECOM_PLUGIN( GSSecurityPlugin.dll, 1020743A.rsc ) + data=DATAZ_\BITMAP_DIR\GSSecPlugin.mif BITMAP_DIR\GSSecPlugin.mif + + #endif // RD_GS_RENOVATION + +#endif // GSSECURITYPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSSecurityPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSSecurityPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSSecurityPlugin ROM resources. +* +*/ + +#ifndef GSSECURITYPLUGINRESOURCES_IBY +#define GSSECURITYPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSSecurityPluginRsc.rsc RESOURCE_FILES_DIR\GSSecurityPluginRsc.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSSECURITYPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSSynchronisationPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSSynchronisationPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSSynchronisationPlugin ROM resources. +* +*/ + +#ifndef GSSYNCHRONISATIONPLUGIN_IBY +#define GSSYNCHRONISATIONPLUGIN_IBY + + #ifdef RD_CONTROL_PANEL + + ECOM_PLUGIN( GSSynchronisationPlugin.dll, 10207238.rsc ) + data=DATAZ_\BITMAP_DIR\GSSynchronisationPlugin.mif BITMAP_DIR\GSSynchronisationPlugin.mif + + #endif // RD_CONTROL_PANEL + +#endif // GSSYNCHRONISATIONPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSSynchronisationPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSSynchronisationPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSSynchronisationPlugin ROM resources. +* +*/ + +#ifndef GSSYNCHRONISATIONPLUGINRESOURCES_IBY +#define GSSYNCHRONISATIONPLUGINRESOURCES_IBY + + #ifdef RD_CONTROL_PANEL + + data=DATAZ_\RESOURCE_FILES_DIR\GSSynchronisationPluginRsc.rsc RESOURCE_FILES_DIR\GSSynchronisationPluginRsc.rsc + + #endif // RD_CONTROL_PANEL + +#endif // GSSYNCHRONISATIONPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSTelPlugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSTelPlugin.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSTelPlugin ROM files. +* +*/ + +#ifndef GSTELPLUGIN_IBY +#define GSTELPLUGIN_IBY + + #ifdef RD_GS_RENOVATION + + ECOM_PLUGIN( GSTelPlugin.dll,1020723E.rsc ) + data=DATAZ_\BITMAP_DIR\GSTelplugin.mif BITMAP_DIR\GSTelplugin.mif + + #endif // RD_GS_RENOVATION + +#endif // GSTELPLUGIN_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GSTelPluginResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GSTelPluginResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSTelPluginResources ROM resources. +* +*/ + +#ifndef GSTELPLUGINRESOURCES_IBY +#define GSTELPLUGINRESOURCES_IBY + + #ifdef RD_GS_RENOVATION + + data=DATAZ_\RESOURCE_FILES_DIR\GSTelPluginRsc.rsc RESOURCE_FILES_DIR\GSTelPluginRsc.rsc + data=DATAZ_\RESOURCE_FILES_DIR\SoftReject.rsc RESOURCE_FILES_DIR\SoftReject.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSTELPLUGINRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/rom/GsResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/rom/GsResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: GSResources ROM files. +* +*/ + +#ifndef GSRESOURCES_IBY +#define GSRESOURCES_IBY + + #ifndef RD_GS_RENOVATION + + //Resource file(s) for GENERAL SETTINGS application (Gs.iby) + data=DATAZ_\APP_RESOURCE_DIR\GS.RSC APP_RESOURCE_DIR\GS.rsc + data=DATAZ_\RESOURCE_FILES_DIR\SoftReject.RSC RESOURCE_FILES_DIR\SoftReject.rsc + + #endif // RD_GS_RENOVATION + +#endif // GSRESOURCES_IBY +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,463 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS HEADER +#include "T_CGSPluginInterface.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include + +#include "GSWatchDog.h" + +// INTERNAL INCLUDES + + + +CGSPluginIndexer* CGSPluginIndexer::NewL( TUid aInterface ) + { + CGSPluginIndexer* self = new( ELeave ) CGSPluginIndexer( aInterface ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +CGSPluginIndexer::CGSPluginIndexer( TUid aInterface ) + : iInterfaceUid( aInterface) + { + } + + +CGSPluginIndexer::~CGSPluginIndexer() + { + iImplInfoArray.ResetAndDestroy();// This is needed + iImplInfoArray.Close(); + } + + +void CGSPluginIndexer::ConstructL() + { + REComSession::ListImplementationsL( iInterfaceUid, + iImplInfoArray ); + iIndex = 0; + } + + +TBool CGSPluginIndexer::HasNext() + { + if( iImplInfoArray.Count() >= iIndex + 1 ) + { + return ETrue; + } + else + { + EUNIT_PRINT( _L("CGSPluginIndexer(%d/%d)"), iIndex, iImplInfoArray.Count() ); + return EFalse; + } + } + + +TUid CGSPluginIndexer::NextUid() + { + EUNIT_PRINT( _L("NextUid(%d/%d)"), iIndex, iImplInfoArray.Count() ); + return iImplInfoArray[ iIndex++ ]->ImplementationUid(); + } + + +void CGSPluginIndexer::ResetIndex() + { + iIndex = 0; + } + + +TInt CGSPluginIndexer::Index() + { + return iIndex; + } + +TInt CGSPluginIndexer::Count() + { + return iImplInfoArray.Count(); + } + +/////////////////////////////////////////////////////////////// + + +// CONSTRUCTION +T_CGSPluginInterface* T_CGSPluginInterface::NewL() + { + T_CGSPluginInterface* self = T_CGSPluginInterface::NewLC(); + CleanupStack::Pop(); + return self; + } + +T_CGSPluginInterface* T_CGSPluginInterface::NewLC() + { + T_CGSPluginInterface* self = new( ELeave ) T_CGSPluginInterface(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// Destructor (virtual by CBase) +T_CGSPluginInterface::~T_CGSPluginInterface() + { + delete iPluginIndexer; + } + +// Default constructor +T_CGSPluginInterface::T_CGSPluginInterface() + { + } + +// Second phase construct +void T_CGSPluginInterface::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + + // Create iterator for plugins: + iPluginIndexer = CGSPluginIndexer::NewL( KGSPluginInterfaceUid ); + } + +// METHODS + + +void T_CGSPluginInterface::SetupL( ) + { + if( !iPluginIndexer->HasNext() ) + { + iPluginIndexer->ResetIndex(); + } + } + +void T_CGSPluginInterface::Teardown( ) + { +// REComSession::DestroyedImplementation( iCGSPluginInterface->DestructorID() ); +// delete iCGSPluginInterface; +// iCGSPluginInterface = NULL; +// REComSession::FinalClose(); + } + + +void T_CGSPluginInterface::T_CGSPluginInterface_SetToBlacklistL() + { + TUid toBeBlacklisted = { 0x10282E06 }; + EUNIT_PRINT( _L("Setting 0x%X to blacklist..."), toBeBlacklisted.iUid ); + + CGSWatchDog* dog = CGSWatchDog::NewL(); + CleanupStack::PushL( dog ); + dog->QuarantineL( toBeBlacklisted ); + // Destroying watchdog without removing from quarantine will blacklist the + // plugin. + CleanupStack::PopAndDestroy( dog ); + + dog = CGSWatchDog::NewL(); + CleanupStack::PushL( dog ); + dog->QuarantineL( toBeBlacklisted ); + // Destroying watchdog without removing from quarantine will blacklist the + // plugin. Do this twice as dog does not blacklist for the first run. + CleanupStack::PopAndDestroy( dog ); + + dog = CGSWatchDog::NewL(); + CleanupStack::PushL( dog ); + + EUNIT_ASSERT_DESC( dog->IsInBlackList( toBeBlacklisted ), + "The plugin should be in the blacklist"); + + CleanupStack::PopAndDestroy( dog ); + EUNIT_PRINT( _L("setting to blacklist done.") ); + } + + +void T_CGSPluginInterface::T_CGSPluginInterface_ResetBlacklistL() + { + EUNIT_PRINT( _L("Resetting blacklist...") ); + TInt runs = KGSDefaultMaxPluginBlackListedRuns + 1; + for( TInt i = 0; i < runs; i++ ) + { + CGSWatchDog* dog = CGSWatchDog::NewL(); + CleanupStack::PushL( dog ); + dog->ReportCleanExitL(); + CleanupStack::PopAndDestroy( dog ); + } + EUNIT_PRINT( _L("Resetting blacklist done.") ); + } + + +void T_CGSPluginInterface::T_CGSPluginInterface_CheckHeapL() + { + EUNIT_PRINT( _L("CheckHeapL...") ); + RHeap heap = User::Heap(); + TInt maxBlock; + TInt free; + TInt delta; + TBuf<256> buf; + TUid plgId; + _LIT( KCaptionErr, "Caption unavailable"); + + CGSWatchDog* dog = CGSWatchDog::NewL(); + CleanupStack::PushL( dog ); + + while( iPluginIndexer->HasNext() ) + { + EUNIT_PRINT( _L("Heap test (%d/%d)..."), iPluginIndexer->Index()+1, iPluginIndexer->Count() ); + plgId = iPluginIndexer->NextUid(); + if( dog->IsInBlackList( plgId ) ) + { + EUNIT_PRINT( _L("Blacklisted: 0x%X"), plgId.iUid ); + continue; + } + dog->QuarantineL( plgId ); + + free = heap.Available( maxBlock ); + + CGSPluginInterface* plugin = CGSPluginInterface::NewL( plgId, NULL ); + TRAPD( + err, + plugin->GetCaptionL( buf ); + ); + if( err ) + { + buf = KCaptionErr; + } + EUNIT_PRINT( _L("Releasing (0x%X %S)..."), plgId.iUid, &buf ); + REComSession::DestroyedImplementation( plugin->DestructorID() ); + EUNIT_PRINT( _L("Deleting (0x%X %S)..."), plgId.iUid, &buf ); + delete plugin; + plugin = NULL; + EUNIT_PRINT( _L("REComSession::FinalClose()...") ); + REComSession::FinalClose(); + + delta = heap.Available( maxBlock ) - free; + + EUNIT_PRINT( _L("Plugin heap alloc (%S, 0x%X) delta:%d"), &buf, plgId.iUid, delta ); + if( delta > 0 ) + { + EUNIT_PRINT( _L("MEMORY LEAK: %S(0x%X) delta:%d"), &buf, plgId.iUid, delta ); + } + dog->RemoveFromQuarantineL( plgId ); + } + dog-> ReportCleanExitL(); + CleanupStack::PopAndDestroy( dog ); + EUNIT_ASSERT_DESC( ETrue, "Wow, the test ran here without a crash!"); + EUNIT_PRINT( _L("CheckHeapL finished.") ); + } + + +void T_CGSPluginInterface::T_CGSPluginInterface__CGSPluginInterfaceL( ) + { +// iCGSPluginInterface->~CGSPluginInterface( ); + EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real"); + } + +void T_CGSPluginInterface::T_CGSPluginInterface_GetCaptionLL( ) + { + // iCGSPluginInterface->GetCaptionL( ); + EUNIT_PRINT( _L("Caption test...") ); + EUNIT_ASSERT_DESC( /*EFalse*/ETrue, "Generated assert, replace with real"); + } + +void T_CGSPluginInterface::T_CGSPluginInterface_GetValueL( ) + { + // iCGSPluginInterface->GetValue( ); + EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real"); + } + +void T_CGSPluginInterface::T_CGSPluginInterface_HandleSelectionL( ) + { + // iCGSPluginInterface->HandleSelection( ); + EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real"); + } + +void T_CGSPluginInterface::T_CGSPluginInterface_ItemTypeL( ) + { + iCGSPluginInterface->ItemType( ); + EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real"); + } + +void T_CGSPluginInterface::T_CGSPluginInterface_MenuActivationItemL( ) + { + iCGSPluginInterface->MenuActivationItem( ); + EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real"); + } + +void T_CGSPluginInterface::T_CGSPluginInterface_CreateIconLL( ) + { + // iCGSPluginInterface->CreateIconL( ); + EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real"); + } + +void T_CGSPluginInterface::T_CGSPluginInterface_PluginProviderCategoryL( ) + { + iCGSPluginInterface->PluginProviderCategory( ); + EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real"); + } + +void T_CGSPluginInterface::T_CGSPluginInterface_CustomOperationLL( ) + { + // iCGSPluginInterface->CustomOperationL( ); + EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real"); + } + +void T_CGSPluginInterface::T_CGSPluginInterface_VisibleL( ) + { + iCGSPluginInterface->Visible( ); + EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real"); + } + +void T_CGSPluginInterface::T_CGSPluginInterface_ResetSelectedItemIndexL( ) + { + iCGSPluginInterface->ResetSelectedItemIndex( ); + EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real"); + } + +void T_CGSPluginInterface::T_CGSPluginInterface_SetOrderL( ) + { + // iCGSPluginInterface->SetOrder( ); + EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real"); + } + + +// TEST TABLE +EUNIT_BEGIN_TEST_TABLE( + T_CGSPluginInterface, + "Add test suite description here.", + "UNIT" ) + +EUNIT_TEST( + "~CGSPluginInterface - test0", + "CGSPluginInterface", + "~CGSPluginInterface - test0", + "FUNCTIONALITY", + SetupL, T_CGSPluginInterface__CGSPluginInterfaceL, Teardown) + +EUNIT_TEST( + "GetCaptionL - test1", + "CGSPluginInterface", + "GetCaptionL - test1", + "FUNCTIONALITY", + SetupL, T_CGSPluginInterface_GetCaptionLL, Teardown) + +EUNIT_TEST( + "GetValue - test2", + "CGSPluginInterface", + "GetValue - test2", + "FUNCTIONALITY", + SetupL, T_CGSPluginInterface_GetValueL, Teardown) + +EUNIT_TEST( + "HandleSelection - test3", + "CGSPluginInterface", + "HandleSelection - test3", + "FUNCTIONALITY", + SetupL, T_CGSPluginInterface_HandleSelectionL, Teardown) + +EUNIT_TEST( + "ItemType - test4", + "CGSPluginInterface", + "ItemType - test4", + "FUNCTIONALITY", + SetupL, T_CGSPluginInterface_ItemTypeL, Teardown) + +EUNIT_TEST( + "MenuActivationItem - test5", + "CGSPluginInterface", + "MenuActivationItem - test5", + "FUNCTIONALITY", + SetupL, T_CGSPluginInterface_MenuActivationItemL, Teardown) + +EUNIT_TEST( + "CreateIconL - test6", + "CGSPluginInterface", + "CreateIconL - test6", + "FUNCTIONALITY", + SetupL, T_CGSPluginInterface_CreateIconLL, Teardown) + +EUNIT_TEST( + "PluginProviderCategory - test7", + "CGSPluginInterface", + "PluginProviderCategory - test7", + "FUNCTIONALITY", + SetupL, T_CGSPluginInterface_PluginProviderCategoryL, Teardown) + +EUNIT_TEST( + "CustomOperationL - test8", + "CGSPluginInterface", + "CustomOperationL - test8", + "FUNCTIONALITY", + SetupL, T_CGSPluginInterface_CustomOperationLL, Teardown) + +EUNIT_TEST( + "Visible - test9", + "CGSPluginInterface", + "Visible - test9", + "FUNCTIONALITY", + SetupL, T_CGSPluginInterface_VisibleL, Teardown) + +EUNIT_TEST( + "ResetSelectedItemIndex - test10", + "CGSPluginInterface", + "ResetSelectedItemIndex - test10", + "FUNCTIONALITY", + SetupL, T_CGSPluginInterface_ResetSelectedItemIndexL, Teardown) + +EUNIT_TEST( + "SetOrder - test11", + "CGSPluginInterface", + "SetOrder - test11", + "FUNCTIONALITY", + SetupL, T_CGSPluginInterface_SetOrderL, Teardown) + +EUNIT_TEST( + "Check heap - test12", + "CGSPluginInterface", + "Check heap - test12", + "FUNCTIONALITY", + SetupL, T_CGSPluginInterface_CheckHeapL, Teardown) + +EUNIT_TEST( + "Reset blacklist - test13", + "CGSPluginInterface", + "Reset blacklist - test13", + "FUNCTIONALITY", + SetupL, T_CGSPluginInterface_ResetBlacklistL, Teardown) + + EUNIT_TEST( + "Set to blacklist - test14", + "CGSPluginInterface", + "Set to blacklist - test14", + "FUNCTIONALITY", + SetupL, T_CGSPluginInterface_SetToBlacklistL, Teardown) + + + +EUNIT_END_TEST_TABLE + + + + + + + + +// END OF FILE diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,157 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __T_CGSPLUGININTERFACE_H__ +#define __T_CGSPLUGININTERFACE_H__ + +// EXTERNAL INCLUDES +#include +#include + + +// INTERNAL INCLUDES +#include + +// FORWARD DECLARATIONS + + +// CLASS DEFINITION + +/** + * Utility go through all ECOM plugins for a certain interface. + */ +NONSHARABLE_CLASS( CGSPluginIndexer ) : public CBase + { + public: + + /** + * @param aInterface Interface Id for which the plugins should be + * listed. + */ + static CGSPluginIndexer* NewL( TUid aInterface ); + + ~CGSPluginIndexer(); + void ConstructL(); + + /** + * @return ETrue if has still items and NextUid() can be called. + */ + TBool HasNext(); + + /** + * @return Next Uid of the listed plugins. + */ + TUid NextUid(); + + /** + * Resets the interator location to the first item [0]. + */ + void ResetIndex(); + + /** + * @return Current position in the list. + */ + TInt Index(); + + /** + * @return Number of items in the list. + */ + TInt Count(); + + private: + + CGSPluginIndexer( TUid aInterface ); + TUid iInterfaceUid; + TInt iIndex; + RImplInfoPtrArray iImplInfoArray; + }; + + +/** + * Auto-generated EUnit test suite + * + */ +NONSHARABLE_CLASS( T_CGSPluginInterface ) + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static T_CGSPluginInterface* NewL(); + static T_CGSPluginInterface* NewLC(); + /** + * Destructor + */ + ~T_CGSPluginInterface(); + + private: // Constructors and destructors + + T_CGSPluginInterface(); + void ConstructL(); + + private: // New methods + + void SetupL(); + + void Teardown(); + + /** + * Functions for testing memory leaks... + */ + void T_CGSPluginInterface_CheckHeapL(); + void T_CGSPluginInterface_ResetBlacklistL(); + void T_CGSPluginInterface_SetToBlacklistL(); + + void T_CGSPluginInterface__CGSPluginInterfaceL(); + + void T_CGSPluginInterface_GetCaptionLL(); + + void T_CGSPluginInterface_GetValueL(); + + void T_CGSPluginInterface_HandleSelectionL(); + + void T_CGSPluginInterface_ItemTypeL(); + + void T_CGSPluginInterface_MenuActivationItemL(); + + void T_CGSPluginInterface_CreateIconLL(); + + void T_CGSPluginInterface_PluginProviderCategoryL(); + + void T_CGSPluginInterface_CustomOperationLL(); + + void T_CGSPluginInterface_VisibleL(); + + void T_CGSPluginInterface_ResetSelectedItemIndexL(); + + void T_CGSPluginInterface_SetOrderL(); + + + private: // Data + + CGSPluginInterface* iCGSPluginInterface; + CGSPluginIndexer* iPluginIndexer; + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __T_CGSPLUGININTERFACE_H__ + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface_DllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface_DllMain.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS HEADER +#include "T_CGSPluginInterface.h" + +// EXTERNAL INCLUDES +#include + +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return T_CGSPluginInterface::NewL(); + } + +#ifndef EKA2 +GLDEF_C TInt E32Dll( TDllReason ) + { + return KErrNone; + } +#endif + +// END OF FILE diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/private/T_CGSPluginInterface.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/private/T_CGSPluginInterface.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include // For RESOURCE_FILES_DIR + +#include + + +TARGET T_CGSPluginInterface.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 + +CAPABILITY ALL -TCB //-DRM +VENDORID 0x00000000 + +SOURCEPATH Src +SOURCE T_CGSPluginInterface.cpp + +// Sources required by the test suite +SOURCEPATH Src +SOURCE T_CGSPluginInterface_DllMain.cpp + +USERINCLUDE Src + +// User include folders required by the tested code +USERINCLUDE ../../../../devmngt_dom/settings_plugin_api/inc +USERINCLUDE ../../GSFramework/inc\ + +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/Digia/EUnit +SYSTEMINCLUDE /epoc32/include/ecom + +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY euser.lib +LIBRARY GSFramework.lib +LIBRARY GSEcomPlugin.lib +LIBRARY ecom.lib + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/private/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/private/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +PRJ_PLATFORMS + ARMV5 WINSCW + +PRJ_EXPORTS + +PRJ_MMPFILES + + +PRJ_TESTMMPFILES +T_CGSPluginInterface.mmp + + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/private/move_T_GSPluginInterface.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/private/move_T_GSPluginInterface.bat Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,17 @@ +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 + +copy \epoc32\RELEASE\winscw\udeb\T_CGSPluginInterface.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /Y \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/BWINS/MT_CGSLauncherU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/BWINS/MT_CGSLauncherU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,2 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * __cdecl CreateTestSuiteL(void) diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/BWINS/MT_GSFrameworku.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/BWINS/MT_GSFrameworku.def Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/BWINS/T_GSBackgroundImageU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/BWINS/T_GSBackgroundImageU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,2 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * __cdecl CreateTestSuiteL(void) diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/BWINS/T_GSListBoxu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/BWINS/T_GSListBoxu.def Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/EABI/MT_CGSLauncherU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/EABI/MT_CGSLauncherU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/EABI/MT_GSFrameworku.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/EABI/MT_GSFrameworku.def Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/EABI/T_GSBackgroundImageU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/EABI/T_GSBackgroundImageU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/EABI/T_GSListBoxu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/EABI/T_GSListBoxu.def Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,304 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS HEADER +#include "T_GSBackgroundImage.h" + +// EXTERNAL INCLUDES +#include +#include +#include + +// INTERNAL INCLUDES +//#include "BackgroundImage.cpp" + +// CONSTANTS +_LIT( KGSTestEmptyString, "" ); +_LIT( KGSTestDestinationPath, "c:\\data\\bin\\test_path"); + +// CONSTRUCTION +T_GSBackgroundImage* T_GSBackgroundImage::NewL() + { + T_GSBackgroundImage* self = T_GSBackgroundImage::NewLC(); + CleanupStack::Pop(); + + return self; + } + +T_GSBackgroundImage* T_GSBackgroundImage::NewLC() + { + T_GSBackgroundImage* self = new( ELeave ) T_GSBackgroundImage(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +T_GSBackgroundImage::~T_GSBackgroundImage() + { + } + +// Default constructor +T_GSBackgroundImage::T_GSBackgroundImage() + { + } + +// Second phase construct +void T_GSBackgroundImage::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + +void T_GSBackgroundImage::EmptySetupL( ) + { + } + +void T_GSBackgroundImage::EmptyTeardown( ) + { + } + +void T_GSBackgroundImage::SetupBackgroundImageL() + { + iFs.Connect(); + iCGSBackgroundImage = CGSBackgroundImage::NewL(); + } + +void T_GSBackgroundImage::SetupBackgroundImageAndAsyncHandlerL() + { + iFs.Connect(); + iCGSBackgroundImage = CGSBackgroundImage::NewL(); + iImgHandler = CGSAsyncImageHandling::NewL( iFs, + this, KGSTestDestinationPath ); + } + +void T_GSBackgroundImage::Teardown( ) + { + if( iCGSBackgroundImage ) + { + delete iCGSBackgroundImage; + iCGSBackgroundImage = NULL; + } + iFs.Close(); + + if( iImgHandler ) + { + iImgHandler->Cancel(); + delete iImgHandler; + iImgHandler = NULL; + } + } + + +void T_GSBackgroundImage::T_Global_BackgroundImage_NewL( ) + { + CGSBackgroundImage* image = CGSBackgroundImage::NewL(); + CleanupStack::PushL( image ); + EUNIT_ASSERT( image != NULL ); + CleanupStack::PopAndDestroy( image ); + } + +void T_GSBackgroundImage::T_Global_BackgroundImage_GetPlnsStatus() + { + TInt returnValue; + EUNIT_ASSERT_NO_LEAVE( returnValue = iCGSBackgroundImage->GetPlnsStatus() ); + EUNIT_PRINT( _L("returnValue = %d"), returnValue ); + } + +void T_GSBackgroundImage::T_Global_BackgroundImage_BackgroundImageL() + { + TInt returnValue; + EUNIT_ASSERT_NO_LEAVE( returnValue = iCGSBackgroundImage->BackgroundImageL() ); + EUNIT_PRINT( _L("returnValue = %d"), returnValue ); + } + +void T_GSBackgroundImage::T_Global_BackgroundImage_SetBackgroundImageL() + { + TInt setValue = 1; + EUNIT_ASSERT_NO_LEAVE( iCGSBackgroundImage->SetBackgroundImageL( + setValue ) ); + } + +void T_GSBackgroundImage::T_Global_BackgroundImage_SetBackgroundImagePathL() + { + EUNIT_ASSERT_NO_LEAVE( iCGSBackgroundImage->SetBackgroundImagePathL( + KGSTestEmptyString ) ); + } + +void T_GSBackgroundImage::T_Global_BackgroundImage_SetBackgroundImagePath2L() + { + TInt desLenght = 25; + RBuf rbuf; + rbuf.CreateL( KGSTestDestinationPath ); + rbuf.CleanupClosePushL(); + //TBuf destinationPath( KGSTestDestinationPath ); + EUNIT_ASSERT_NO_LEAVE(iCGSBackgroundImage->SetBackgroundImagePathL( + KGSTestEmptyString, rbuf ) ); + CleanupStack::PopAndDestroy(); + } + +void T_GSBackgroundImage::T_Global_BackgroundImage_SetBackgroundImagePath3L() + { + TGSWallpaperType wallType = EGSWallpaperIdle; + RBuf rbuf; + rbuf.CreateL( KGSTestDestinationPath ); + rbuf.CleanupClosePushL(); + EUNIT_ASSERT_NO_LEAVE(iCGSBackgroundImage->SetBackgroundImagePathL( + KGSTestEmptyString, rbuf, wallType ) ); + CleanupStack::PopAndDestroy(); + } + +void T_GSBackgroundImage::T_Global_BackgroundImage_CreateImageHandlingAsyncObjectL() + { + EUNIT_ASSERT_NO_LEAVE( iImgHandler = CGSAsyncImageHandling::NewL( iFs, + this, KGSTestDestinationPath ) ); + } + + +void T_GSBackgroundImage::T_Global_BackgroundImage_SetWelcomeNoteImageL() + { + EUNIT_ASSERT_NO_LEAVE( iCGSBackgroundImage-> + SetWelcomeNoteImageL( KGSTestDestinationPath, *iImgHandler ) ); + } + +void T_GSBackgroundImage::T_Global_BackgroundImage_SetVtStillImagePathL() + { + EUNIT_ASSERT_NO_LEAVE( iCGSBackgroundImage->SetVTStillImagePathL( + KGSTestDestinationPath, *iImgHandler ) ); + } + +void T_GSBackgroundImage::T_Global_BackgroundImage_IsPersonalisationApplicationL() + { + EUNIT_ASSERT_NO_LEAVE( iCGSBackgroundImage-> + IsPersonalisationApplicationL() ); + } + +void T_GSBackgroundImage::T_Global_BackgroundImage_DeleteImageL() + { + EUNIT_ASSERT_LEAVE( iCGSBackgroundImage-> + DeleteImageL( KGSTestDestinationPath ) ); + } + +void T_GSBackgroundImage::ImageHandlingCompleteL( TInt /*aError*/ ) + { + + } + +// TEST TABLE +EUNIT_BEGIN_TEST_TABLE( + T_GSBackgroundImage, + "Testing BackgroundImage.dll functionality", + "UNIT" ) + +EUNIT_TEST( + "BackgroundImage - NewL construction", //case description + "CGSBackgroundImage", //class being tested + "NewL", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + EmptySetupL, T_Global_BackgroundImage_NewL, EmptyTeardown ) + +EUNIT_TEST( + "BackgroundImage - GetPlnsStatus()", + "CGSBackgroundImage", + "GetPlnsStatus", + "FUNCTIONALITY", + SetupBackgroundImageL, T_Global_BackgroundImage_GetPlnsStatus, Teardown ) + +EUNIT_TEST( + "BackgroundImage - BackgroundImage()", + "CGSBackgroundImage", + "BackgroundImage", + "FUNCTIONALITY", + SetupBackgroundImageL, T_Global_BackgroundImage_BackgroundImageL, Teardown ) + +EUNIT_TEST( + "BackgroundImage - SetBackgroundImageL()", + "CGSBackgroundImage", + "SetBackgroundImageL", + "FUNCTIONALITY", + SetupBackgroundImageL, T_Global_BackgroundImage_SetBackgroundImageL, Teardown ) + +EUNIT_TEST( + "BackgroundImage - SetBackgroundImagePathL()", + "CGSBackgroundImage", + "SetBackgroundImagePathL", + "FUNCTIONALITY", + SetupBackgroundImageL, T_Global_BackgroundImage_SetBackgroundImagePathL, Teardown ) + +EUNIT_TEST( + "BackgroundImage - SetBackgroundImagePath2L()", + "CGSBackgroundImage", + "Overloaded version of SetBackgroundImagePathL", + "FUNCTIONALITY", + SetupBackgroundImageL, T_Global_BackgroundImage_SetBackgroundImagePath2L, Teardown ) + +EUNIT_TEST( + "BackgroundImage - SetBackgroundImagePath3L()", + "CGSBackgroundImage", + "Second overloaded version of SetBackgroundImagePathL", + "FUNCTIONALITY", + SetupBackgroundImageL, T_Global_BackgroundImage_SetBackgroundImagePath3L, Teardown ) + +EUNIT_TEST( + "BackgroundImage - IsPersonalisationApplicationL()", + "CGSBackgroundImage", + "IsPersonalisationApplicationL", + "FUNCTIONALITY", + SetupBackgroundImageL, + T_Global_BackgroundImage_IsPersonalisationApplicationL, Teardown ) + +EUNIT_TEST( + "BackgroundImage - DeleteImageL()", + "CGSBackgroundImage", + "DeleteImageL", + "FUNCTIONALITY", + SetupBackgroundImageL, T_Global_BackgroundImage_DeleteImageL, Teardown ) + +EUNIT_TEST( + "BackgroundImage - Creation of AsyncImageHandler()", + "CGSAsyncImageHandling", + "NewL", + "FUNCTIONALITY", + SetupBackgroundImageL, + T_Global_BackgroundImage_CreateImageHandlingAsyncObjectL, Teardown ) + +EUNIT_TEST( + "BackgroundImage - SetWelcomeNoteImageL()", + "CGSBackgroundImage", + "SetWelcomeNoteImageL", + "FUNCTIONALITY", + SetupBackgroundImageAndAsyncHandlerL, + T_Global_BackgroundImage_SetWelcomeNoteImageL, Teardown ) + +EUNIT_TEST( + "BackgroundImage - SetVtStillImagePathL()", + "CGSBackgroundImage", + "SetVtStillImagePathL", + "FUNCTIONALITY", + SetupBackgroundImageAndAsyncHandlerL, + T_Global_BackgroundImage_SetVtStillImagePathL, Teardown ) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __T_GSBACKGROUNDIMAGE_H__ +#define __T_GSBACKGROUNDIMAGE_H__ + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include + +// INTERNAL INCLUDES +//#include "BackgroundImage.cpp" + +// FORWARD DECLARATIONS + + +// CLASS DEFINITION +NONSHARABLE_CLASS( T_GSBackgroundImage ) + : public CEUnitTestSuiteClass, + public MGSAsyncImageHandlingObserver + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static T_GSBackgroundImage* NewL(); + static T_GSBackgroundImage* NewLC(); + /** + * Destructor + */ + ~T_GSBackgroundImage(); + + public: //From MGSAsyncImageHandlingObserver + void ImageHandlingCompleteL( TInt aError ); + + private: // Constructors and destructors + + T_GSBackgroundImage(); + void ConstructL(); + + private: // New methods + + void EmptySetupL(); + + void EmptyTeardown(); + + void Teardown(); + + void SetupBackgroundImageL(); + void SetupBackgroundImageAndAsyncHandlerL(); + + void T_Global_BackgroundImage_NewL(); + void T_Global_BackgroundImage_GetPlnsStatus(); + void T_Global_BackgroundImage_BackgroundImageL(); + void T_Global_BackgroundImage_SetBackgroundImageL(); + void T_Global_BackgroundImage_SetBackgroundImagePathL(); + void T_Global_BackgroundImage_SetBackgroundImagePath2L(); + void T_Global_BackgroundImage_SetBackgroundImagePath3L(); + void T_Global_BackgroundImage_CreateImageHandlingAsyncObjectL(); + void T_Global_BackgroundImage_SetWelcomeNoteImageL(); + void T_Global_BackgroundImage_SetVtStillImagePathL(); + void T_Global_BackgroundImage_IsPersonalisationApplicationL(); + void T_Global_BackgroundImage_DeleteImageL(); + + + private: // Data + + CGSBackgroundImage* iCGSBackgroundImage; + CGSAsyncImageHandling* iImgHandler; + RFs iFs; + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __T_GSBACKGROUNDIMAGE_H__ + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage_DllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage_DllMain.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS HEADER +#include "T_GSBackgroundImage.h" + +// EXTERNAL INCLUDES +#include + +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return T_GSBackgroundImage::NewL(); + } + +#ifndef EKA2 +GLDEF_C TInt E32Dll( TDllReason ) + { + return KErrNone; + } +#endif + +// END OF FILE diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,1315 @@ +/* +* Copyright (c) 2002 - 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS HEADER +#include "MT_GSFramework.h" + +// EXTERNAL INCLUDES +#include +#include + +//#include <..\..\..\..\GSFramework\src\GSParentContainer.cpp> +#include // RApaLsSession + +#include "TestGSPlugin.h" + + +// INTERNAL INCLUDES + +const TUid KTestActiveViewId = { 0x10 }; +const TUid KTestWhateverPubSubId = { 0x00 }; +const TInt KTestWhateverPubSubKey = 0; + + +// CONSTRUCTION +MT_GSFramework* MT_GSFramework::NewL() + { + MT_GSFramework* self = MT_GSFramework::NewLC(); + CleanupStack::Pop(); + + return self; + } + +MT_GSFramework* MT_GSFramework::NewLC() + { + MT_GSFramework* self = new( ELeave ) MT_GSFramework(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +MT_GSFramework::~MT_GSFramework() + { + } + +// Default constructor +MT_GSFramework::MT_GSFramework() + { + } + +// Second phase construct +void MT_GSFramework::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +void MT_GSFramework::SetupNone() + { + } + + +void MT_GSFramework::TeardownNone() + { + } + + + +////////////////// CGSTabHelper test cases ////////////////////////////////// + + +void MT_GSFramework::SetupTabHelperL( ) + { + iCGSTabHelper = CGSTabHelper::NewL(); + iPlugins = new (ELeave) CArrayPtrFlat(2); + iTabbedViews = new (ELeave) CArrayPtrFlat(2); + } + + +void MT_GSFramework::TeardownTabHelper() + { + delete iCGSTabHelper; + iCGSTabHelper = NULL; + delete iPlugins; + iPlugins = NULL; + delete iTabbedViews; + iTabbedViews = NULL; + } + + +void MT_GSFramework::T_CGSTabHelper_NewLL() + { + CGSTabHelper* ptr = CGSTabHelper::NewL(); + EUNIT_ASSERT( ptr ); + delete ptr; + } + +void MT_GSFramework::T_CGSTabHelper_NewLCL() + { + CGSTabHelper* ptr = CGSTabHelper::NewLC(); + EUNIT_ASSERT( ptr ); + CleanupStack::PopAndDestroy(); + } + + + +void MT_GSFramework::T_CGSTabHelper__CGSTabHelperL( ) + { + RHeap heap = User::Heap(); + TInt block = 0; + TInt after; + CGSTabHelper* th; + + TInt before = heap.Available( block ); + + th = CGSTabHelper::NewL(); + delete th; + + after = heap.Available( block ); + TInt delta = before - after; + + EUNIT_ASSERT_DESC( before <= after, "Possible heap memory leak"); + } + +void MT_GSFramework::T_CGSTabHelper_CreateTabGroupLL( ) + { + iCGSTabHelper->CreateTabGroupL( KTestActiveViewId, this ); + EUNIT_ASSERT_DESC( ETrue, "Tab group pseudo creation done"); + } + +void MT_GSFramework::T_CGSTabHelper_CreateTabGroupL2L( ) + { + iCGSTabHelper->CreateTabGroupL( KTestActiveViewId, iPlugins ); + EUNIT_ASSERT_DESC( ETrue, "Run this far wihout panic?"); + } + +void MT_GSFramework::T_CGSTabHelper_CreateTabGroupL3L( ) + { + iCGSTabHelper->CreateTabGroupL( KTestActiveViewId, iTabbedViews ); + EUNIT_ASSERT_DESC( ETrue, "Run this far without panic?"); + } + +void MT_GSFramework::T_CGSTabHelper_RemoveTabGroupL( ) + { + iCGSTabHelper->RemoveTabGroup(); + EUNIT_ASSERT_DESC( ETrue, "Run this far without panic?"); + } + +void MT_GSFramework::T_CGSTabHelper_TabChangedLL( ) + { + TInt tabIndex = 0; + iCGSTabHelper->TabChangedL( tabIndex ); + EUNIT_ASSERT_DESC( ETrue, "Run this far without panic?"); + } + +// MGSTabbedViewOwner +CArrayPtrFlat* MT_GSFramework::TabbedViews() + { + return iPlugins; + } + +// MGSTabbedViewOwner +void MT_GSFramework::TabChangedL( TUid /*selectedTabUid*/ ) + { + + } + +// MGSPluginLoadObserver +void MT_GSFramework::HandlePluginLoaded( KGSPluginLoaderStatus aStatus ) + { + + } + + +/////////////////////// CGSPluginLoader test cases /////////////////////////////////// +void MT_GSFramework::SetupPluginLoaderL() + { + iPlugins = new (ELeave) CArrayPtrFlat(2); + + CAknViewAppUi* appUi = (CAknViewAppUi*)CEikonEnv::Static()->EikAppUi(); + iCGSPluginLoader = CGSPluginLoader::NewL( appUi ); + } + +void MT_GSFramework::TearDownPluginLoader() + { + delete iCGSPluginLoader; + iCGSPluginLoader = NULL; + + delete iPlugins; + iPlugins = NULL; + } + + +void MT_GSFramework::T_CGSPluginLoader_NewL() + { + CAknViewAppUi* appUi = (CAknViewAppUi*)CEikonEnv::Static()->EikAppUi(); + iCGSPluginLoader = CGSPluginLoader::NewL( appUi ); + delete iCGSPluginLoader; + iCGSPluginLoader = NULL; + + EUNIT_ASSERT_DESC( ETrue, "Run this far?"); + } + +void MT_GSFramework::T_CGSPluginLoader__CGSPluginLoader() + { + CAknViewAppUi* appUi = (CAknViewAppUi*)CEikonEnv::Static()->EikAppUi(); + iCGSPluginLoader = CGSPluginLoader::NewL( appUi ); + delete iCGSPluginLoader; + iCGSPluginLoader = NULL; + + EUNIT_ASSERT_DESC( ETrue, "Run this far?"); + } + +void MT_GSFramework::T_CGSPluginLoader_LoadAsyncL() + { + iCGSPluginLoader->LoadAsyncL( KGSPluginInterfaceUid, + KTestActiveViewId, + iPlugins ); + + EUNIT_ASSERT_DESC( ETrue, "Run this far?"); + } + +void MT_GSFramework::T_CGSPluginLoader_SetObserver() + { + iCGSPluginLoader->SetObserver( this ); + EUNIT_ASSERT_DESC( ETrue, "Run this far?"); + } + +void MT_GSFramework::T_CGSPluginLoader_AbortAsyncLoad() + { + iCGSPluginLoader->AbortAsyncLoad(); + EUNIT_ASSERT_DESC( ETrue, "Run this far?"); + } + +void MT_GSFramework::T_CGSPluginLoader_SortPluginsL() + { + iCGSPluginLoader->SortPluginsL( iPlugins ); + EUNIT_ASSERT_DESC( ETrue, "Run this far?"); + } + + + +/////////////// CGSParentContainer test cases ////////////////////////////// + + +// CGSParentContainer +void MT_GSFramework::SetupParentContainerL() + { +// iGSParentContainer = new (ELeave) CGSParentContainer(); +// iGSParentContainer->ConstructL(); + } + + +void MT_GSFramework::TearDownParentContainer() + { +// delete iGSParentContainer; +// iGSParentContainer = NULL; + } + + +// CGSParentContainer test cases: +void MT_GSFramework::T_CGSParentContainer_FocusChanged() + { +// iGSParentContainer->FocusChanged( ENoDrawNow ); +#pragma message("TODO: implement real test case!") + EUNIT_ASSERT_DESC( EFalse, "Not implemented."); + } + + +///////////////////// CGSPubSubsListener test cases /////////////////////// + +void MT_GSFramework::SetupPubSubsListenerL() + { + iCGSPubSubsListener = CGSPubSubsListener::NewL( KTestWhateverPubSubId, + KTestWhateverPubSubKey, + this ); + } + +void MT_GSFramework::TearDownPubSubsListener() + { + delete iCGSPubSubsListener; + iCGSPubSubsListener = NULL; + } + + +void MT_GSFramework::T_CGSPubSubsListener_NewL() + { + CGSPubSubsListener* psl = CGSPubSubsListener::NewL( KTestWhateverPubSubId, + KTestWhateverPubSubKey, + this ); + delete psl; + psl = NULL; + + EUNIT_ASSERT_DESC( ETrue, "Run this far?"); + } + +void MT_GSFramework::T_CGSPubSubsListener__CGSPubSubsListener() + { + CGSPubSubsListener* psl = CGSPubSubsListener::NewL( KTestWhateverPubSubId, + KTestWhateverPubSubKey, + this ); + delete psl; + psl = NULL; + + EUNIT_ASSERT_DESC( ETrue, "Run this far?"); + } + +void MT_GSFramework::T_CGSPubSubsListener_Get1() + { + TInt val = 0; + iCGSPubSubsListener->Get( val ); + EUNIT_ASSERT_DESC( ETrue, "Run this far?"); + } + +void MT_GSFramework::T_CGSPubSubsListener_Get2() + { + TBuf8<25> buf; + iCGSPubSubsListener->Get( buf ); + EUNIT_ASSERT_DESC( ETrue, "Run this far?"); + } + +void MT_GSFramework::T_CGSPubSubsListener_Get3() + { + TBuf16<25> buf; + iCGSPubSubsListener->Get( buf ); + EUNIT_ASSERT_DESC( ETrue, "Run this far?"); + } + + +// From MGSSettingPSObserver +void MT_GSFramework::HandleNotifyPSL( const TUid aUid, + const TInt& aKey, + const TRequestStatus& aStatus ) + { + + } + +// ------------------------------- Launch Gs application test cases ---------------------------------------// + +void MT_GSFramework::SetupLaunch() + { + iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); + + // Launch Gs application... + RApaLsSession lsSession; + User::LeaveIfError( lsSession.Connect() ); + CleanupClosePushL( lsSession ); + + TApaAppInfo appInfo; + TUid uid; + uid.iUid = 0x100058EC; // Gs application uid + User::LeaveIfError( lsSession.GetAppInfo(appInfo, uid) ); + TFileName appName = appInfo.iFullName; + + CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); + cmdLine->SetExecutableNameL( appName ); + cmdLine->SetCommandL( EApaCommandRun ); + User::LeaveIfError( lsSession.StartApp( *cmdLine ) ); + + CleanupStack::PopAndDestroy( cmdLine ); + CleanupStack::PopAndDestroy(); // lsSession + } + + +void MT_GSFramework::TeardownLaunch() + { + if ( !iPeriodic->IsActive() ) + { + iPeriodic->Start( 2000000, 1000000, TCallBack( CloseTopMostWindow, static_cast( this ) ) ); + } + + CActiveScheduler::Start(); + + // Close the error note + ikeySimulateCase = 0; + iKeyNumber = 0; + if ( !iPeriodic->IsActive() ) + { + iPeriodic->Start( 2000000, 500000, TCallBack( SimulateKeyEvent, static_cast( this ) ) ); + } + + CActiveScheduler::Start(); + + if ( iPeriodic ) + { + iPeriodic->Cancel(); + } + delete iPeriodic; + } + + +TBool MT_GSFramework::GetKeyCodeCase0( TKeyCode& aKeyCode ) + { + TBool ret = ETrue; + iKeyNumber++; + + switch ( iKeyNumber ) + { + case 1: + aKeyCode = EKeyOK; + break; + default: + ret = EFalse; + } + + return ret; + } + + +TInt MT_GSFramework::CloseTopMostWindow( TAny* aPtr ) + { + MT_GSFramework* instL = static_cast( aPtr ); + instL->DoCloseTopMostWindowL(); + + CActiveScheduler::Stop(); + return KErrNone; + } + +void MT_GSFramework::DoCloseTopMostWindowL() + { + RWsSession* ws = &CCoeEnv::Static()->WsSession(); + + // Get a list of IDs of the all the window groups + CArrayFixFlat* windowList = new CArrayFixFlat(4); + CleanupStack::PushL(windowList); + // Get a list of window group IDs + User::LeaveIfError(ws->WindowGroupList(0, windowList)); + + // Get the top most window group + TInt wgId = (*windowList)[0]; + + CleanupStack::PopAndDestroy(); // windowList + + TApaTask task(*ws); + task.SetWgId(wgId); + task.SendSystemEvent(EApaSystemEventShutdown); + + iPeriodic->Cancel(); + } + +TInt MT_GSFramework::SimulateKeyEvent( TAny* aPtr ) + { + MT_GSFramework* instL = static_cast( aPtr ); + + instL->DoSimulateKeyEventL(); + + return KErrNone; + } + +void MT_GSFramework::DoSimulateKeyEventL() + { + TKeyCode keyCode; + TBool hasKey; + + switch ( ikeySimulateCase ) + { + case 0: + hasKey = GetKeyCodeCase0( keyCode ); + break; + case 1: + hasKey = GetKeyCodeCase1( keyCode ); + break; + case 2: + hasKey = GetKeyCodeCase2( keyCode ); + break; + case 3: + hasKey = GetKeyCodeCase3( keyCode ); + break; + case 4: + hasKey = GetKeyCodeCase4( keyCode ); + break; + default: + hasKey = EFalse; + } + + if ( hasKey ) + { + TKeyEvent event; + event.iCode = keyCode; + event.iScanCode = 0; + event.iRepeats = 0; + event.iModifiers = 0; + + TWsEvent wsEvent; + *( wsEvent.Key() ) = event; + wsEvent.SetType( EEventKey ); + wsEvent.SetTimeNow(); + + RWsSession* ws = &CCoeEnv::Static()->WsSession(); + + TInt wgId = ws->GetFocusWindowGroup(); + ws->SendEventToWindowGroup( wgId, wsEvent ); + } + else + { + iPeriodic->Cancel(); + CActiveScheduler::Stop(); + } + } +void MT_GSFramework::LaunchGsApp1L() + { + ikeySimulateCase = 1; + iKeyNumber = 0; + if ( !iPeriodic->IsActive() ) + { + iPeriodic->Start( 2000000, 1000000, TCallBack( SimulateKeyEvent, static_cast( this ) ) ); + } + + CActiveScheduler::Start(); + } + +TBool MT_GSFramework::GetKeyCodeCase1( TKeyCode& aKeyCode ) + { + TBool ret = ETrue; + iKeyNumber++; + + switch ( iKeyNumber ) + { + case 1: + aKeyCode = EKeyDownArrow; + break; + case 2: + aKeyCode = EKeyDownArrow; + break; + case 3: + aKeyCode = EKeyUpArrow; + break; + case 4: + aKeyCode = EKeyEnter; // Phone + break; + case 5: + aKeyCode = EKeyEnter; // Date & time + break; + case 6: + aKeyCode = EKeyEnter; // Time + break; + case 7: + aKeyCode = EKeyCBA2; + break; + case 8: + aKeyCode = EKeyDownArrow; + break; + case 9: + aKeyCode = EKeyEnter; // Time Zone + break; + case 10: + aKeyCode = EKeyCBA2; + break; + case 11: + aKeyCode = EKeyDownArrow; + break; + case 12: + aKeyCode = EKeyEnter; // Date + break; + case 13: + aKeyCode = EKeyCBA2; + break; + case 14: + aKeyCode = EKeyDownArrow; + break; + case 15: + aKeyCode = EKeyEnter; // Date format + break; + case 16: + aKeyCode = EKeyDownArrow; + break; + case 17: + aKeyCode = EKeyCBA1; + break; + case 18: + aKeyCode = EKeyDownArrow; + break; + case 19: + aKeyCode = EKeyEnter; // Date separator + break; + case 20: + aKeyCode = EKeyCBA2; + break; + case 21: + aKeyCode = EKeyDownArrow; + break; + case 22: + aKeyCode = EKeyEnter; // Time format + break; + case 23: + aKeyCode = EKeyDownArrow; + break; + case 24: + aKeyCode = EKeyEnter; // Time separator + break; + case 25: + aKeyCode = EKeyDownArrow; + break; + case 26: + aKeyCode = EKeyEnter; // Clock type + break; + case 27: + aKeyCode = EKeyDownArrow; + break; + case 28: + aKeyCode = EKeyEnter; // Clock Alarm Tone + break; + case 29: + User::After(2000000); + aKeyCode = EKeyCBA2; + break; + case 30: + aKeyCode = EKeyDownArrow; + break; + case 31: + aKeyCode = EKeyEnter; // Alarm Snooze Time + break; + case 32: + aKeyCode = EKeyCBA2; + break; + case 33: + aKeyCode = EKeyDownArrow; + break; + case 34: + aKeyCode = EKeyEnter; // Workdays + break; + case 35: + aKeyCode = EKeyCBA2; + break; + case 36: + aKeyCode = EKeyCBA2; + break; + case 37: + aKeyCode = EKeyCBA2; + break; + default: + ret = EFalse; + } + + return ret; + } + +void MT_GSFramework::LaunchGsApp2L() + { + ikeySimulateCase = 2; + iKeyNumber = 0; + if ( !iPeriodic->IsActive() ) + { + iPeriodic->Start( 2000000, 1000000, TCallBack( SimulateKeyEvent, static_cast( this ) ) ); + } + + CActiveScheduler::Start(); + } + +TBool MT_GSFramework::GetKeyCodeCase2( TKeyCode& aKeyCode ) + { + TBool ret = ETrue; + iKeyNumber++; + + switch ( iKeyNumber ) + { + case 1: + aKeyCode = EKeyDownArrow; + break; + case 2: + aKeyCode = EKeyEnter; // phone + break; + case 3: + aKeyCode = EKeyDownArrow; + break; + case 4: + aKeyCode = EKeyDownArrow; + break; + case 5: + aKeyCode = EKeyDownArrow; + break; + case 6: + aKeyCode = EKeyEnter; // Display + break; + case 7: + aKeyCode = EKeyEnter; // Light sensor + break; + case 8: + aKeyCode = EKeyCBA2; + break; + case 9: + aKeyCode = EKeyDownArrow; + break; + case 10: + aKeyCode = EKeyEnter; // Display text size + break; + case 11: + aKeyCode = EKeyCBA2; + break; + case 12: + aKeyCode = EKeyDownArrow; + break; + case 13: + aKeyCode = EKeyEnter; // Screen save time-out + break; + case 14: + aKeyCode = EKeyCBA2; + break; + case 15: + aKeyCode = EKeyDownArrow; + break; + case 16: + aKeyCode = EKeyEnter; // Welcome note or image + break; + case 17: + aKeyCode = EKeyCBA1; + break; + case 18: + aKeyCode = EKeyDownArrow; + break; + case 19: + aKeyCode = EKeyEnter; // Backlight time-out + break; + case 20: + aKeyCode = EKeyCBA2; + break; + case 21: + aKeyCode = EKeyCBA2; + break; + case 22: + aKeyCode = EKeyCBA2; + break; + default: + ret = EFalse; + } + + return ret; + } + +void MT_GSFramework::LaunchGsApp3L() + { + ikeySimulateCase = 3; + iKeyNumber = 0; + if ( !iPeriodic->IsActive() ) + { + iPeriodic->Start( 2000000, 1000000, TCallBack( SimulateKeyEvent, static_cast( this ) ) ); + } + + CActiveScheduler::Start(); + } + +TBool MT_GSFramework::GetKeyCodeCase3( TKeyCode& aKeyCode ) + { + TBool ret = ETrue; + iKeyNumber++; + + switch ( iKeyNumber ) + { + case 1: + aKeyCode = EKeyEnter; // open Persional + break; + case 2: + aKeyCode = EKeyDownArrow; + break; + case 3: + aKeyCode = EKeyDownArrow; + break; + case 4: + aKeyCode = EKeyDownArrow; + break; + case 5: + aKeyCode = EKeyEnter; // open Standby + break; + case 6: + aKeyCode = EKeyEnter; // open Shortcut + break; + case 7: + aKeyCode = EKeyEnter; // open Lift idle softkey + break; + case 8: + aKeyCode = EKeyCBA2; + break; + case 9: + aKeyCode = EKeyCBA2; + break; +/* case 10: + aKeyCode = EKeyCBA2; + break; + case 11: + aKeyCode = EKeyCBA2; + break;*/ + default: + ret = EFalse; + } + + return ret; + } + +void MT_GSFramework::LaunchGsApp4L() + { + ikeySimulateCase = 4; + iKeyNumber = 0; + if ( !iPeriodic->IsActive() ) + { + iPeriodic->Start( 2000000, 1000000, TCallBack( SimulateKeyEvent, static_cast( this ) ) ); + } + + CActiveScheduler::Start(); + } + +TBool MT_GSFramework::GetKeyCodeCase4( TKeyCode& aKeyCode ) + { + TBool ret = ETrue; + iKeyNumber++; + + switch ( iKeyNumber ) + { + case 1: + aKeyCode = EKeyEnter; // open Persional + break; + case 2: + aKeyCode = EKeyDownArrow; + break; + case 3: + aKeyCode = EKeyDownArrow; + break; + case 4: + aKeyCode = EKeyEnter; // open Standby + break; + case 5: + aKeyCode = EKeyEnter; // open Shortcut + break; + case 6: + aKeyCode = EKeyEnter; // open Lift idle softkey + break; + case 7: + aKeyCode = EKeyCBA2; + break; + case 8: + aKeyCode = EKeyCBA2; + break; +/* case 10: + aKeyCode = EKeyCBA2; + break; + case 11: + aKeyCode = EKeyCBA2; + break;*/ + default: + ret = EFalse; + } + + return ret; + } + +// ----------------------------- CGSBaseView test cases ------------------------------------ // +void MT_GSFramework::SetupCGSBaseViewL() + { + iTestBaseView = CTestGSBaseView::NewL(); + } + +void MT_GSFramework::TeardownCGSBaseView() + { + delete iTestBaseView; + iTestBaseView = NULL; + } + +void MT_GSFramework::MT_CGSBaseView_SetCurrentItemL() + { + iTestBaseView->SetCurrentItem( 0 ); + } + +void MT_GSFramework::MT_CGSBaseView_ContainerL() + { + iTestBaseView->Container(); + } + +void MT_GSFramework::MT_CGSBaseView_SetNaviPaneLL() + { + iTestBaseView->SetNaviPaneL(); + } + +void MT_GSFramework::MT_CGSBaseView_CreateNaviPaneContextLL() + { + iTestBaseView->CreateNaviPaneContextL( 1 ); + } + + + + +// ------------------------------- CGSParentPlugin test cases -------------------------------- // +void MT_GSFramework::SetupCGSParentPluginL() + { + iParentPlugin = static_cast ( CTestGSPlugin::NewL() ); + } + +void MT_GSFramework::TeardownCGSParentPlugin() + { + delete iParentPlugin; + iParentPlugin = NULL; + } + + +void MT_GSFramework::MT_CGSParentPlugin_UpperLevelViewUidL() + { + EUNIT_ASSERT_NO_LEAVE( iParentPlugin->UpperLevelViewUid() ); + } + +void MT_GSFramework::MT_CGSParentPlugin_UpdateViewL() + { + EUNIT_ASSERT_NO_LEAVE( iParentPlugin->UpdateView() ); + } + +void MT_GSFramework::MT_CGSParentPlugin_SetOptionFlagsL() + { + TBitFlags optionFlags; + EUNIT_ASSERT_NO_LEAVE( iParentPlugin->SetOptionFlags( optionFlags ) ); + } + +void MT_GSFramework::MT_CGSParentPlugin_OptionFlagsL() + { + EUNIT_ASSERT_NO_LEAVE( iParentPlugin->OptionFlags() ); + } + +void MT_GSFramework::MT_CGSParentPlugin_GetHelpContextL() + { + TCoeHelpContext context; + EUNIT_ASSERT_NO_LEAVE( iParentPlugin->GetHelpContext( context ) ); + } + +void MT_GSFramework::MT_CGSParentPlugin_SelectedPluginL() + { + CGSPluginInterface* plug = iParentPlugin->SelectedPlugin(); + EUNIT_ASSERT( plug == NULL ); + } + +void MT_GSFramework::MT_CGSParentPlugin_TransferDynamicPluginLL() + { + TRAPD( err, iParentPlugin->TransferDynamicPluginL( NULL ) ) + EUNIT_PRINT( _L("error = %d"), err ); + } + +// ---------------------------- CGSPluginInterface test cases -------------------------- // +void MT_GSFramework::MT_CGSPluginInterface_ItemTypeL() + { + CGSPluginInterface* plugInterface = static_cast ( iParentPlugin ); + EUNIT_ASSERT_NO_LEAVE( plugInterface->ItemType() ); + } + +void MT_GSFramework::MT_CGSPluginInterface_HandleSelectionL() + { + CGSPluginInterface* plugInterface = static_cast ( iParentPlugin ); + TGSSelectionTypes selectionType = EGSSelectionBySelectionKey; + EUNIT_ASSERT_NO_LEAVE( plugInterface->HandleSelection( selectionType ) ); + } + +void MT_GSFramework::MT_CGSPluginInterface_PluginProviderCategoryL() + { + CGSPluginInterface* plugInterface = static_cast ( iParentPlugin ); + EUNIT_ASSERT_NO_LEAVE( plugInterface->PluginProviderCategory() ); + } + +void MT_GSFramework::MT_CGSPluginInterface_CustomOperationLL() + { + CGSPluginInterface* plugInterface = static_cast ( iParentPlugin ); + TAny* any = plugInterface->CustomOperationL( NULL, NULL ); + EUNIT_ASSERT( any == NULL ); + } + +void MT_GSFramework::MT_CGSPluginInterface_SetOrderL() + { + CGSPluginInterface* plugInterface = static_cast ( iParentPlugin ); + EUNIT_ASSERT_NO_LEAVE( plugInterface->SetOrder( 0 ) ); + } + +void MT_GSFramework::MT_CGSPluginInterface_CreateIconLL() + { + CGSPluginInterface* plugInterface = static_cast ( iParentPlugin ); + CGulIcon* icon = plugInterface->CreateIconL( KGSIconTypeLbxItem ); + CleanupStack::PushL( icon ); + EUNIT_ASSERT( icon != NULL ); + CleanupStack::PopAndDestroy( icon ); + } + + +void MT_GSFramework::MT_CGSPluginInterface_GetEcomDestructorKey() + { + CGSPluginInterface* plugInterface = static_cast ( iParentPlugin ); + TUid dTorID; + EUNIT_ASSERT_NO_LEAVE( dTorID = plugInterface->GetEcomDestructorKey() ); + } + + + +/** + * @param text1 Textual description of the test case. + * @param text2 The class to be tested. + * @param text3 The method to be tested. + * @param text4 Test case type: refer to EUnit User Manual for correct values. + * @param setupFunc Test setup function. + * @param runFunc Test run function. + * @param teardownFunc Test teardown function. + */ + +// TEST TABLE +EUNIT_BEGIN_TEST_TABLE( + MT_GSFramework, + "Tests for GSFramework.dll.", + "MODULE" ) + +EUNIT_TEST( + "#1 launch Gs application", + "Settings framework classes", + "settings framework api", + "FUNCTIONALITY", + SetupLaunch, LaunchGsApp1L, TeardownLaunch) + +EUNIT_TEST( + "#2 launch Gs application", + "Settings framework classes", + "settings framework api", + "FUNCTIONALITY", + SetupLaunch, LaunchGsApp2L, TeardownLaunch) + +EUNIT_TEST( + "#3 launch Gs application", + "Settings framework classes", + "settings framework api", + "FUNCTIONALITY", + SetupLaunch, LaunchGsApp3L, TeardownLaunch) + +EUNIT_TEST( + "#4 launch Gs application", + "Settings framework classes", + "settings framework api", + "FUNCTIONALITY", + SetupLaunch, LaunchGsApp4L, TeardownLaunch) + +EUNIT_TEST( + "GSBsView:SetCurrentItem", + "CGSBaseView", + "SetCurrentItem", + "FUNCTIONALITY", + SetupCGSBaseViewL, MT_CGSBaseView_SetCurrentItemL, TeardownCGSBaseView) + +EUNIT_TEST( + "GSBsView:Container", + "CGSBaseView", + "Container", + "FUNCTIONALITY", + SetupCGSBaseViewL, MT_CGSBaseView_ContainerL, TeardownCGSBaseView) + +EUNIT_TEST( + "GSBsView:SetNaviPaneL", + "CGSBaseView", + "SetNaviPaneL", + "FUNCTIONALITY", + SetupCGSBaseViewL, MT_CGSBaseView_SetNaviPaneLL, TeardownCGSBaseView) + +EUNIT_TEST( + "GSBsView:CreateNaviPaneContextL", + "CGSBaseView", + "CreateNaviPaneContextL", + "FUNCTIONALITY", + SetupCGSBaseViewL, MT_CGSBaseView_CreateNaviPaneContextLL, TeardownCGSBaseView) + +EUNIT_TEST( + "GSPrntPlg:UpperLevelViewUid", + "CGSParentPlugin", + "UpperLevelViewUid", + "FUNCTIONALITY", + SetupCGSParentPluginL, MT_CGSParentPlugin_UpperLevelViewUidL, TeardownCGSParentPlugin) + +EUNIT_TEST( + "GSPrntPlg:UpdateView", + "CGSParentPlugin", + "UpdateView", + "FUNCTIONALITY", + SetupCGSParentPluginL, MT_CGSParentPlugin_UpdateViewL, TeardownCGSParentPlugin) + +EUNIT_TEST( + "GSPrntPlg:SetOptionFlags", + "CGSParentPlugin", + "SetOptionFlags", + "FUNCTIONALITY", + SetupCGSParentPluginL, MT_CGSParentPlugin_SetOptionFlagsL, TeardownCGSParentPlugin) + +EUNIT_TEST( + "GSPrntPlg:OptionFlags", + "CGSParentPlugin", + "OptionFlags", + "FUNCTIONALITY", + SetupCGSParentPluginL, MT_CGSParentPlugin_OptionFlagsL, TeardownCGSParentPlugin) + +EUNIT_TEST( + "GSPrntPlg:GetHelpContext", + "CGSParentPlugin", + "GetHelpContext", + "FUNCTIONALITY", + SetupCGSParentPluginL, MT_CGSParentPlugin_GetHelpContextL, TeardownCGSParentPlugin) + +EUNIT_TEST( + "GSPrntPlg:SelectedPlugin", + "CGSParentPlugin", + "SelectedPlugin", + "FUNCTIONALITY", + SetupCGSParentPluginL, MT_CGSParentPlugin_SelectedPluginL, TeardownCGSParentPlugin) + +EUNIT_TEST( + "GSPrntPlg:TransferDynamicPluginL", + "CGSParentPlugin", + "TransferDynamicPluginL", + "FUNCTIONALITY", + SetupCGSParentPluginL, MT_CGSParentPlugin_TransferDynamicPluginLL, TeardownCGSParentPlugin) + +EUNIT_TEST( + "GSPlgIF:ItemType", + "CGSPluginInterface", + "ItemType", + "FUNCTIONALITY", + SetupCGSParentPluginL, MT_CGSPluginInterface_ItemTypeL, TeardownCGSParentPlugin) + +EUNIT_TEST( + "GSPlgIF:HandleSelection", + "CGSPluginInterface", + "HandleSelection", + "FUNCTIONALITY", + SetupCGSParentPluginL, MT_CGSPluginInterface_HandleSelectionL, TeardownCGSParentPlugin) + +EUNIT_TEST( + "GSPlgIF:PluginProviderCategory", + "CGSPluginInterface", + "PluginProviderCategory", + "FUNCTIONALITY", + SetupCGSParentPluginL, MT_CGSPluginInterface_PluginProviderCategoryL, TeardownCGSParentPlugin) + +EUNIT_TEST( + "GSPlgIF:CustomOperationL", + "CGSPluginInterface", + "CustomOperationL", + "FUNCTIONALITY", + SetupCGSParentPluginL, MT_CGSPluginInterface_CustomOperationLL, TeardownCGSParentPlugin) + +EUNIT_TEST( + "GSPlgIF:SetOrder", + "CGSPluginInterface", + "SetOrder", + "FUNCTIONALITY", + SetupCGSParentPluginL, MT_CGSPluginInterface_SetOrderL, TeardownCGSParentPlugin) + +EUNIT_TEST( + "GSPlgIF:CreateIconL", + "CGSPluginInterface", + "CreateIconL", + "FUNCTIONALITY", + SetupCGSParentPluginL, MT_CGSPluginInterface_CreateIconLL, TeardownCGSParentPlugin) + +EUNIT_TEST( + "GSPlgIF:GetEcomDestructorKey", + "CGSPluginInterface", + "GetEcomDestructorKey", + "FUNCTIONALITY", + SetupCGSParentPluginL, MT_CGSPluginInterface_GetEcomDestructorKey, TeardownCGSParentPlugin) + +EUNIT_TEST( + "GSTabHlpr:~CGSTabHelper", + "CGSTabHelper", + "~CGSTabHelper", + "FUNCTIONALITY", + SetupTabHelperL, T_CGSTabHelper__CGSTabHelperL, TeardownTabHelper) + +EUNIT_TEST( + "GSTabHlpr:CreateTabGroupL", + "CGSTabHelper", + "CreateTabGroupL", + "FUNCTIONALITY", + SetupTabHelperL, T_CGSTabHelper_CreateTabGroupLL, TeardownTabHelper) + +EUNIT_TEST( + "GSTabHlpr:CreateTabGroupL2", + "CGSTabHelper", + "CreateTabGroupL2", + "FUNCTIONALITY", + SetupTabHelperL, T_CGSTabHelper_CreateTabGroupL2L, TeardownTabHelper) + +EUNIT_TEST( + "GSTabHlpr:CreateTabGroupL3", + "CGSTabHelper", + "CreateTabGroupL3", + "FUNCTIONALITY", + SetupTabHelperL, T_CGSTabHelper_CreateTabGroupL3L, TeardownTabHelper) + +EUNIT_TEST( + "GSTabHlpr:RemoveTabGroupL", + "CGSTabHelper", + "RemoveTabGroupL", + "FUNCTIONALITY", + SetupTabHelperL, T_CGSTabHelper_RemoveTabGroupL, TeardownTabHelper) + +EUNIT_TEST( + "GSTabHlpr:TabChangedL", + "CGSTabHelper", + "TabChangedL", + "FUNCTIONALITY", + SetupTabHelperL, T_CGSTabHelper_TabChangedLL, TeardownTabHelper) + +EUNIT_TEST( + "GSTabHlpr:NewL", + "CGSTabHelper", + "NewL", + "FUNCTIONALITY", + SetupNone, T_CGSTabHelper_NewLL, TeardownNone) + +EUNIT_TEST( + "GSTabHlpr:NewLC", + "CGSTabHelper", + "NewLC", + "FUNCTIONALITY", + SetupNone, T_CGSTabHelper_NewLCL, TeardownNone) +/* +EUNIT_TEST( + "FocusChanged", + "CGSParentContainer", + "FocusChanged", + "FUNCTIONALITY", + SetupParentContainerL, T_CGSParentContainer_FocusChanged, TearDownParentContainer) +*/ + +EUNIT_TEST( + "GSPlgLdr:NewL", + "CGSPluginLoader", + "NewL", + "FUNCTIONALITY", + SetupNone, T_CGSPluginLoader_NewL, TeardownNone) + +EUNIT_TEST( + "GSPlgLdr:Destructor", + "CGSPluginLoader", + "~CGSPluginLoader", + "FUNCTIONALITY", + SetupNone, T_CGSPluginLoader__CGSPluginLoader, TeardownNone) + +EUNIT_TEST( + "GSPlgLdr:LoadAsyncL", + "CGSPluginLoader", + "LoadAsyncL", + "FUNCTIONALITY", + SetupPluginLoaderL, T_CGSPluginLoader_LoadAsyncL, TearDownPluginLoader) + +EUNIT_TEST( + "GSPlgLdr:SetObserver", + "CGSPluginLoader", + "SetObserver", + "FUNCTIONALITY", + SetupPluginLoaderL, T_CGSPluginLoader_SetObserver, TearDownPluginLoader) + +EUNIT_TEST( + "GSPlgLdr:AbortAsyncLoad", + "CGSPluginLoader", + "AbortAsyncLoad", + "FUNCTIONALITY", + SetupPluginLoaderL, T_CGSPluginLoader_AbortAsyncLoad, TearDownPluginLoader) + +EUNIT_TEST( + "GSPlgLdr:SortPluginsL", + "CGSPluginLoader", + "SortPluginsL", + "FUNCTIONALITY", + SetupPluginLoaderL, T_CGSPluginLoader_SortPluginsL, TearDownPluginLoader) + +EUNIT_TEST( + "GSPSLsnr:NewL", + "CGSPubSubsListener", + "NewL", + "FUNCTIONALITY", + SetupNone, T_CGSPubSubsListener_NewL, TeardownNone) + +EUNIT_TEST( + "GSPSLsnr:CGSPubSubsListener", + "CGSPubSubsListener", + "~CGSPubSubsListener", + "FUNCTIONALITY", + SetupNone, T_CGSPubSubsListener__CGSPubSubsListener, TeardownNone) + +EUNIT_TEST( + "GSPSLsnr:Get1", + "CGSPubSubsListener", + "Get1", + "FUNCTIONALITY", + SetupPubSubsListenerL, T_CGSPubSubsListener_Get1, TearDownPubSubsListener) + +EUNIT_TEST( + "GSPSLsnr:Get2", + "CGSPubSubsListener", + "Get2", + "FUNCTIONALITY", + SetupPubSubsListenerL, T_CGSPubSubsListener_Get2, TearDownPubSubsListener) + +EUNIT_TEST( + "GSPSLsnr:Get3", + "CGSPubSubsListener", + "Get3", + "FUNCTIONALITY", + SetupPubSubsListenerL, T_CGSPubSubsListener_Get3, TearDownPubSubsListener) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,207 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MT_GSFRAMEWORK_H__ +#define __MT_GSFRAMEWORK_H__ + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include +#include + +// INTERNAL INCLUDES +#include "TestGSBaseView.h" + +// FORWARD DECLARATIONS + + +// CLASS DEFINITION +NONSHARABLE_CLASS( MT_GSFramework ) + : public CEUnitTestSuiteClass, MGSTabbedViewOwner, MGSPluginLoadObserver, MGSSettingPSObserver + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static MT_GSFramework* NewL(); + static MT_GSFramework* NewLC(); + /** + * Destructor + */ + ~MT_GSFramework(); + + public: + // From MGSTabbedViewOwner + CArrayPtrFlat* TabbedViews(); + void TabChangedL( TUid selectedTabUid ); + + // From MGSPluginLoadObserver + void HandlePluginLoaded( KGSPluginLoaderStatus aStatus ); + + // From MGSSettingPSObserver + void HandleNotifyPSL( const TUid aUid, + const TInt& aKey, + const TRequestStatus& aStatus ); + + + private: // Constructors and destructors + + MT_GSFramework(); + void ConstructL(); + + private: + // Test setup and teardown functions + + // CGSTabHelper + void SetupTabHelperL(); + void TeardownTabHelper(); + + // CGSTabHelper test cases + void T_CGSTabHelper_NewLL(); + void T_CGSTabHelper_NewLCL(); + //~Destructor + void T_CGSTabHelper__CGSTabHelperL(); + void T_CGSTabHelper_CreateTabGroupLL(); + void T_CGSTabHelper_CreateTabGroupL2L(); + void T_CGSTabHelper_CreateTabGroupL3L(); + void T_CGSTabHelper_RemoveTabGroupL(); + void T_CGSTabHelper_TabChangedLL(); + + // CGSParentContainer test cases + void SetupParentContainerL(); + void TearDownParentContainer(); + + void T_CGSParentContainer_FocusChanged(); + + // CGSPluginLoader test cases + void SetupPluginLoaderL(); + void TearDownPluginLoader(); + + void T_CGSPluginLoader_NewL(); + void T_CGSPluginLoader__CGSPluginLoader(); + void T_CGSPluginLoader_LoadAsyncL(); + void T_CGSPluginLoader_SetObserver(); + void T_CGSPluginLoader_AbortAsyncLoad(); + void T_CGSPluginLoader_SortPluginsL(); + + + // CGSPubSubsListener test cases + void SetupPubSubsListenerL(); + void TearDownPubSubsListener(); + + void T_CGSPubSubsListener_NewL(); + void T_CGSPubSubsListener__CGSPubSubsListener(); + void T_CGSPubSubsListener_Get1(); + void T_CGSPubSubsListener_Get2(); + void T_CGSPubSubsListener_Get3(); + + + // Empty Setup & TearDown + void SetupNone(); + void TeardownNone(); + + + void SetupLaunch(); + void TeardownLaunch(); + + static TInt CloseTopMostWindow( TAny* aPtr ); + void DoCloseTopMostWindowL(); + + void LaunchGsApp1L(); + TBool GetKeyCodeCase1( TKeyCode& aKeyCode ); + + void LaunchGsApp2L(); + TBool GetKeyCodeCase2( TKeyCode& aKeyCode ); + + void LaunchGsApp3L(); + TBool GetKeyCodeCase3( TKeyCode& aKeyCode ); + + void LaunchGsApp4L(); + TBool GetKeyCodeCase4( TKeyCode& aKeyCode ); + + static TInt SimulateKeyEvent( TAny* aPtr ); + void DoSimulateKeyEventL(); + + TBool GetKeyCodeCase0( TKeyCode& aKeyCode ); + + + // CGSBaseView test cases + void SetupCGSBaseViewL(); + void TeardownCGSBaseView(); + void MT_CGSBaseView_SetCurrentItemL(); + void MT_CGSBaseView_ContainerL(); + void MT_CGSBaseView_SetNaviPaneLL(); + void MT_CGSBaseView_CreateNaviPaneContextLL(); + + // CGSParentPlugin test cases + void SetupCGSParentPluginL(); + void TeardownCGSParentPlugin(); + void MT_CGSParentPlugin_UpperLevelViewUidL(); + void MT_CGSParentPlugin_UpdateViewL(); + void MT_CGSParentPlugin_SetOptionFlagsL(); + void MT_CGSParentPlugin_OptionFlagsL(); + void MT_CGSParentPlugin_GetHelpContextL(); + void MT_CGSParentPlugin_SelectedPluginL(); + void MT_CGSParentPlugin_TransferDynamicPluginLL(); + + // CGSPluginInterface test cases + void MT_CGSPluginInterface_ItemTypeL(); + void MT_CGSPluginInterface_HandleSelectionL(); + void MT_CGSPluginInterface_PluginProviderCategoryL(); + void MT_CGSPluginInterface_CustomOperationLL(); + void MT_CGSPluginInterface_SetOrderL(); + void MT_CGSPluginInterface_CreateIconLL(); + void MT_CGSPluginInterface_GetEcomDestructorKey(); + + + private: // Data + + // For CGSTabHelper + CGSTabHelper* iCGSTabHelper; + CArrayPtrFlat* iPlugins; + CArrayPtrFlat* iTabbedViews; + + // For CGSPluginLoader + CGSPluginLoader* iCGSPluginLoader; + + // For CGSPubSubsListener + CGSPubSubsListener* iCGSPubSubsListener; + + // For launching Gs application test cases + CPeriodic* iPeriodic; + TInt ikeySimulateCase; + TInt iKeyNumber; + + // For CTestGSBaseView + CTestGSBaseView* iTestBaseView; + + // For CGSParentPlugin + CGSParentPlugin* iParentPlugin; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __MT_GSFRAMEWORK_H__ + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework_DllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework_DllMain.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS HEADER +#include "MT_GSFramework.h" + +// EXTERNAL INCLUDES +#include + +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return MT_GSFramework::NewL(); + } + +#ifndef EKA2 +GLDEF_C TInt E32Dll( TDllReason ) + { + return KErrNone; + } +#endif + +// END OF FILE diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSBaseView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSBaseView.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#include "TestGSBaseView.h" + + + +// CONSTRUCTION +CTestGSBaseView* CTestGSBaseView::NewL() + { + CTestGSBaseView* self = CTestGSBaseView::NewLC(); + CleanupStack::Pop(); + + return self; + } + +CTestGSBaseView* CTestGSBaseView::NewLC() + { + CTestGSBaseView* self = new( ELeave ) CTestGSBaseView(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor +CTestGSBaseView::~CTestGSBaseView() + { + } + +// Default constructor +CTestGSBaseView::CTestGSBaseView() + { + } + +// Second phase construct +void CTestGSBaseView::ConstructL() + { + } + +// METHODS + +void CTestGSBaseView::NewContainerL() + { + } + +void CTestGSBaseView::HandleListBoxSelectionL() + { + } + +void CTestGSBaseView::GetCaptionL( TDes& aCaption ) const + { + + } + +TUid CTestGSBaseView::Id() const + { + + } + +void CTestGSBaseView::SetNaviPaneL() + { + CGSBaseView::SetNaviPaneL(); + } + +void CTestGSBaseView::CreateNaviPaneContextL( TInt aResourceId ) + { + CGSBaseView::CreateNaviPaneContextL( aResourceId ); + } +// END OF FILE diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSBaseView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSBaseView.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef TESTGSBASEVIEW_H +#define TESTGSBASEVIEW_H + +// INCLUDES +#include + + + +// CLASS DECLARATION + +class CTestGSBaseView : public CGSBaseView + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static CTestGSBaseView* NewL(); + static CTestGSBaseView* NewLC(); + /** + * Destructor + */ + ~CTestGSBaseView(); + + + public: // From CGSBaseView + + void SetNaviPaneL(); + + void CreateNaviPaneContextL( TInt aResourceId ); + + private: // Constructors and destructors + + CTestGSBaseView(); + void ConstructL(); + + + + protected: + + void NewContainerL(); + + + private: + + void HandleListBoxSelectionL(); + + void GetCaptionL( TDes& aCaption ) const; + + TUid Id() const; + + }; + +#endif // TESTGSBASEVIEW_H +// End of File \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSPlugin.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "TestGSPlugin.h" + + + +// CONSTRUCTION +CTestGSPlugin* CTestGSPlugin::NewL() + { + CTestGSPlugin* self = CTestGSPlugin::NewLC(); + CleanupStack::Pop(); + + return self; + } + +CTestGSPlugin* CTestGSPlugin::NewLC() + { + CTestGSPlugin* self = new( ELeave ) CTestGSPlugin(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor +CTestGSPlugin::~CTestGSPlugin() + { + } + +// Default constructor +CTestGSPlugin::CTestGSPlugin() + { + } + +// Second phase construct +void CTestGSPlugin::ConstructL() + { + } + + +void CTestGSPlugin::GetCaptionL( TDes& aCaption ) const + { + + } + +TUid CTestGSPlugin::Id() const + { + + } + +// END OF FILE \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef TESTGSPLUGIN_H +#define TESTGSPLUGIN_H + +// INCLUDES +#include + + + +// CLASS DECLARATION + +class CTestGSPlugin : public CGSParentPlugin + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static CTestGSPlugin* NewL(); + static CTestGSPlugin* NewLC(); + /** + * Destructor + */ + ~CTestGSPlugin(); + + + public: + + void GetCaptionL( TDes& aCaption ) const; + + TUid Id() const; + + private: // Constructors and destructors + + CTestGSPlugin(); + void ConstructL(); + + }; + +#endif // TESTGSPLUGIN_H +// End of File \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,548 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS HEADER +#include "T_GSListBox.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include //TResourceReader +#include +#include +#include //for resource IDs + + +// INTERNAL INCLUDES +//#include "ListBox.cpp" + +// CONSTANTS +_LIT( KGSTestCaption, "Test caption" ); +const TInt KGSTestLocalFeatureId = 0; + +// CONSTRUCTION +T_GSListBox* T_GSListBox::NewL() + { + T_GSListBox* self = T_GSListBox::NewLC(); + CleanupStack::Pop(); + + return self; + } + +T_GSListBox* T_GSListBox::NewLC() + { + T_GSListBox* self = new( ELeave ) T_GSListBox(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +T_GSListBox::~T_GSListBox() + { + } + +// Default constructor +T_GSListBox::T_GSListBox() + { + } + +// Second phase construct +void T_GSListBox::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + +void T_GSListBox::SetupL( ) + { + + } + +void T_GSListBox::SetupResourceL() + { + iOffset = CCoeEnv::Static()->AddResourceFileL( _L("Z:\\resource\\GSNetworkPluginRsc.rsc") ); + } + + +void T_GSListBox::Teardown( ) + { + if( iListboxEntry ) + { + delete iListboxEntry; + iListboxEntry = NULL; + } + if( iItemTextArray ) + { + delete iItemTextArray; + iItemTextArray = NULL; + } + if( iRBSPArray ) + { + delete iRBSPArray; + iRBSPArray = NULL; + } + + if ( iLBITextArray ) + { + delete iLBITextArray; + iLBITextArray = NULL; + } + + if ( iOffset ) + { + CCoeEnv::Static()->DeleteResourceFile( iOffset ); + iOffset = 0; + } + } + +// CGSListboxEntry test cases + +void T_GSListBox::SetupListBoxEntryL() + { + SetupResourceL(); + + TResourceReader resReader; + CCoeEnv::Static()->CreateResourceReaderLC( resReader, R_NETSL_NETSELECTMODE_LBX ); + // Just read, not actually needed anywhere + resReader.ReadInt16(); + + iListboxEntry = CGSListboxEntry::NewLC( resReader ); + EUNIT_ASSERT( iListboxEntry != NULL ); + CleanupStack::Pop( iListboxEntry ); + + CleanupStack::PopAndDestroy(); + } + +void T_GSListBox::T_Global_GSListBox_NewLC() + { + TResourceReader resReader; + CCoeEnv::Static()->CreateResourceReaderLC( resReader, R_NETSL_NETSELECTMODE_LBX ); + // Just read, not actually needed anywhere + resReader.ReadInt16(); + + iListboxEntry = CGSListboxEntry::NewLC( resReader ); + EUNIT_ASSERT( iListboxEntry != NULL ); + CleanupStack::Pop( iListboxEntry ); + + CleanupStack::PopAndDestroy(); + } + +void T_GSListBox::T_Global_GSListBox_New2LC() + { + TInt localFeatureId = 0; + iListboxEntry = CGSListboxEntry::NewLC( localFeatureId ); + EUNIT_ASSERT( iListboxEntry != NULL ); + CleanupStack::Pop(); + } + +void T_GSListBox::T_Global_GSListBox_New3LC() + { + TInt localFeatureId = 0; + TUint32 resourceId = R_NETSL_NETSELECTMODE_LBX; + iListboxEntry = CGSListboxEntry::NewLC( resourceId, *CCoeEnv::Static(), localFeatureId ); + EUNIT_ASSERT( iListboxEntry != NULL ); + CleanupStack::Pop(); + } + +void T_GSListBox::T_Global_GSListBox_FeatureIdL() + { + TInt localFeatureId; + EUNIT_ASSERT_NO_LEAVE( localFeatureId = iListboxEntry->FeatureId() ); + } + +void T_GSListBox::T_Global_GSListBox_TypeL() + { + TInt type; + EUNIT_ASSERT_NO_LEAVE( type = iListboxEntry->Type() ); + } + +void T_GSListBox::T_Global_GSListBox_CaptionL() + { + //Here we can add comparision of the returned string to the + //previously saved one + EUNIT_ASSERT_NO_LEAVE( iListboxEntry->Caption() ); + } + +void T_GSListBox::T_Global_GSListBox_SetDynamicTextL() + { + EUNIT_ASSERT_NO_LEAVE( iListboxEntry->SetDynamicTextL( KGSTestCaption ) ); + } + +void T_GSListBox::T_Global_GSListBox_SetDynamicTextDoublePaneL() + { + EUNIT_ASSERT_NO_LEAVE( iListboxEntry->SetDynamicTextDoublePaneL( KGSTestCaption ) ); + } + + +// CGSItemTextArray test cases + +void T_GSListBox::SetupGSItemTextArrayL() + { + SetupResourceL(); + iItemTextArray = + CGSItemTextArray::NewL( R_NETSL_NETSELECTMODE_LBX, *CCoeEnv::Static() ); + } + +void T_GSListBox::T_Global_GSItemTextArray_SetupL() + { + EUNIT_ASSERT_NO_LEAVE( iItemTextArray = + CGSItemTextArray::NewL( R_NETSL_NETSELECTMODE_LBX, *CCoeEnv::Static() ) ); + } + +void T_GSListBox::T_Global_GSItemTextArray_MdcaCountL() + { + TInt itemCount = 0; + EUNIT_ASSERT_NO_LEAVE( itemCount = iItemTextArray->MdcaCount() ); + } + +void T_GSListBox::T_Global_GSItemTextArray_MdcaPointL() + { + TInt itemIndex = 0; + EUNIT_ASSERT_NO_LEAVE( iItemTextArray->MdcaPoint( itemIndex ) ); + } + +void T_GSListBox::T_Global_GSItemTextArray_SetDynamicTextL() + { + TInt featureId = 1; + EUNIT_ASSERT_NO_LEAVE( iItemTextArray->SetDynamicTextL( + featureId, KGSTestCaption ) ); + } + +void T_GSListBox::T_Global_GSItemTextArray_SetDynamicTextDoublePaneL() + { + TInt featureId = 1; + EUNIT_ASSERT_NO_LEAVE( iItemTextArray->SetDynamicTextDoublePaneL( + featureId, KGSTestCaption ) ); + } + +void T_GSListBox::T_Global_GSItemTextArray_SetItemVisibilityL() + { + TInt featureId = 1; + CGSItemTextArray::TVisibility itemVisibility = CGSItemTextArray::EVisible; + EUNIT_ASSERT_NO_LEAVE( iItemTextArray->SetItemVisibilityL( + featureId, itemVisibility ) ); + } + +void T_GSListBox::T_Global_GSItemTextArray_CurrentFeatureL() + { + EUNIT_ASSERT_NO_LEAVE( iItemTextArray->CurrentFeature() ); + } + +void T_GSListBox::T_Global_GSItemTextArray_IndexForFeatureIdL() + { + TInt featureId = 4; + EUNIT_ASSERT_NO_LEAVE( iItemTextArray->IndexForFeatureIdL( + featureId ) ); + } + +void T_GSListBox::T_Global_GSItemTextArray_FeatureIdByIndexL() + { + TInt itemIndex = 5; + EUNIT_ASSERT_NO_LEAVE( iItemTextArray->FeatureIdByIndex( + itemIndex ) ); + } + +void T_GSListBox::T_Global_GSItemTextArray_FeatureByIdL() + { + TInt featureId = 6; + EUNIT_ASSERT_NO_LEAVE( iItemTextArray->FeatureByIdL( + featureId ) ); + } + +void T_GSListBox::T_Global_GSItemTextArray_GetItemCaptionFromFeatureIdLC() + { + TInt featureId = 6; + HBufC* itemCaption; + itemCaption = CGSItemTextArray::GetItemCaptionFromFeatureIdLC( + R_NETSL_NETSELECTMODE_LBX, featureId, *CCoeEnv::Static() ); + CleanupStack::PopAndDestroy(); + } + + +// CGSRadioButtonSettingPageItemTextArray test cases + +void T_GSListBox::T_Global_GSRBSPItemTextArray_NewL() + { + CGSRadioButtonSettingPageItemTextArray* itemArray = + CGSRadioButtonSettingPageItemTextArray::NewL( R_NETSL_NETSELECTMODE_LBX, *CCoeEnv::Static(), NULL ); + CleanupStack::PushL( itemArray ); + EUNIT_ASSERT( itemArray ); + CleanupStack::PopAndDestroy(); + } + +void T_GSListBox::Setup_GSRBSPItemTextArrayL() + { + SetupResourceL(); + + iRBSPArray = CGSRadioButtonSettingPageItemTextArray::NewL( R_NETSL_NETSELECTMODE_LBX, + *CCoeEnv::Static(), NULL ); + } + +void T_GSListBox::T_Global_GSRBSPItemTextArray_CurrentFeatureL() + { + EUNIT_ASSERT_PANIC( iRBSPArray->CurrentFeature(), "GSEngItemArray", 0 ); + } + +void T_GSListBox::T_Global_GSRBSPItemTextArray_SetRadioButtonSettingPageL() + { + TUint32 resId = 1; + TInt currentItem = 0; + CAknRadioButtonSettingPage* dlg = new (ELeave ) CAknRadioButtonSettingPage( + resId, + currentItem, iItemTextArray ); + CleanupStack::PushL( dlg ); + EUNIT_ASSERT_NO_LEAVE( iRBSPArray->SetRadioButtonSettingPage( *dlg ) ); + CleanupStack::PopAndDestroy(); + } + + +// CGSListBoxItemTextArray test cases + +void T_GSListBox::Setup_CGSLBITextArrayL() + { + SetupResourceL(); + TUint32 resId = R_NETSL_NETSELECTMODE_LBX; + iLBITextArray = CGSListBoxItemTextArray::NewL( + resId, *iListBox, *CCoeEnv::Static() ); + } + +void T_GSListBox::T_Global_CGSLBITextArray_NewL() + { + TUint32 resId = R_NETSL_NETSELECTMODE_LBX; + EUNIT_ASSERT_NO_LEAVE( iLBITextArray = CGSListBoxItemTextArray::NewL( + resId, *iListBox, *CCoeEnv::Static() ) ); + } + +void T_GSListBox::T_Global_CGSLBITextArray_New2L() + { + TUint32 resId = R_NETSL_NETSELECTMODE_LBX; + TInt itemCount = 10; + EUNIT_ASSERT_NO_LEAVE( iLBITextArray = CGSListBoxItemTextArray::NewL( + resId, *iListBox, *CCoeEnv::Static(), itemCount ) ); + } + +void T_GSListBox::T_Global_CGSLBITextArray_CurrentFeatureL() + { + TInt currentFeature = 0; + EUNIT_ASSERT_NO_LEAVE( currentFeature = iLBITextArray->CurrentFeature() ); + } + + +// TEST TABLE +EUNIT_BEGIN_TEST_TABLE( + T_GSListBox, + "Testing GSListBox.dll functionality", + "UNIT" ) + + +// CGSListboxEntry test cases +EUNIT_TEST( + "ListBox - NewL construction", //case description + "CGSListboxEntry", //class being tested + "NewLC", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupResourceL, T_Global_GSListBox_NewLC, Teardown ) + +EUNIT_TEST( + "ListBox - NewL overloaded construction", //case description + "CGSListboxEntry", //class being tested + "NewLC", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupL, T_Global_GSListBox_New2LC, Teardown ) + +EUNIT_TEST( + "ListBox - NewL another overloaded construction", //case description + "CGSListboxEntry", //class being tested + "NewLC", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupResourceL, T_Global_GSListBox_New3LC, Teardown ) + +EUNIT_TEST( + "ListBox - FeatureId()", //case description + "CGSListboxEntry", //class being tested + "FeatureId", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupListBoxEntryL, T_Global_GSListBox_FeatureIdL, Teardown ) + +EUNIT_TEST( + "ListBox - Caption()", //case description + "CGSListboxEntry", //class being tested + "Caption", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupListBoxEntryL, T_Global_GSListBox_CaptionL, Teardown ) + +EUNIT_TEST( + "ListBox - Type()", //case description + "CGSListboxEntry", //class being tested + "Type", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupListBoxEntryL, T_Global_GSListBox_TypeL, Teardown ) + +EUNIT_TEST( + "ListBox - SetDynamicTextL()", //case description + "CGSListboxEntry", //class being tested + "SetDynamicTextL", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupListBoxEntryL, T_Global_GSListBox_SetDynamicTextL, Teardown ) + +EUNIT_TEST( + "ListBox - SetDynamicTextDoublePaneL()", //case description + "CGSListboxEntry", //class being tested + "SetDynamicTextDoublePaneL", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupListBoxEntryL, T_Global_GSListBox_SetDynamicTextDoublePaneL, Teardown ) + + +// CGSItemTextArray test cases + +EUNIT_TEST( + "CGSItemTextArray - construction()", //case description + "CGSItemTextArray", //class being tested + "NewL", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupResourceL, T_Global_GSItemTextArray_SetupL, Teardown ) + +EUNIT_TEST( + "CGSItemTextArray - MdcaCount()", //case description + "CGSItemTextArray", //class being tested + "MdcaCount", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupGSItemTextArrayL, T_Global_GSItemTextArray_MdcaCountL, Teardown ) + +EUNIT_TEST( + "CGSItemTextArray - MdcaPoint()", //case description + "CGSItemTextArray", //class being tested + "MdcaPoint", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupGSItemTextArrayL, T_Global_GSItemTextArray_MdcaPointL, Teardown ) + +EUNIT_TEST( + "CGSItemTextArray - SetDynamicTextL()", //case description + "CGSItemTextArray", //class being tested + "SetDynamicTextL", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupGSItemTextArrayL, T_Global_GSItemTextArray_SetDynamicTextL, Teardown ) + +EUNIT_TEST( + "CGSItemTextArray - SetDynamicTextDoublePaneL()", //case description + "CGSItemTextArray", //class being tested + "SetDynamicTextDoublePaneL", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupGSItemTextArrayL, T_Global_GSItemTextArray_SetDynamicTextDoublePaneL, Teardown ) + +EUNIT_TEST( + "CGSItemTextArray - SetItemVisibilityL()", //case description + "CGSItemTextArray", //class being tested + "SetItemVisibilityL", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupGSItemTextArrayL, T_Global_GSItemTextArray_SetItemVisibilityL, Teardown ) + +EUNIT_TEST( + "CGSItemTextArray - CurrentFeature()", //case description + "CGSItemTextArray", //class being tested + "CurrentFeature", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupGSItemTextArrayL, T_Global_GSItemTextArray_CurrentFeatureL, Teardown ) + +EUNIT_TEST( + "CGSItemTextArray - IndexForFeatureIdL()", //case description + "CGSItemTextArray", //class being tested + "IndexForFeatureIdL", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupGSItemTextArrayL, T_Global_GSItemTextArray_IndexForFeatureIdL, Teardown ) + +EUNIT_TEST( + "CGSItemTextArray - FeatureIdByIndex()", //case description + "CGSItemTextArray", //class being tested + "FeatureIdByIndex", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupGSItemTextArrayL, T_Global_GSItemTextArray_FeatureIdByIndexL, Teardown ) + +EUNIT_TEST( + "CGSItemTextArray - FeatureByIdL()", //case description + "CGSItemTextArray", //class being tested + "FeatureByIdL", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupGSItemTextArrayL, T_Global_GSItemTextArray_FeatureByIdL, Teardown ) + +EUNIT_TEST( + "CGSItemTextArray - GetItemCaptionFromFeatureIdLC()", //case description + "CGSItemTextArray", //class being tested + "GetItemCaptionFromFeatureIdLC", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupGSItemTextArrayL, T_Global_GSItemTextArray_GetItemCaptionFromFeatureIdLC, Teardown ) + + +// CGSRadioButtonSettingPageItemTextArray test cases + +EUNIT_TEST( + "CGSRadioButtonSettingPageItemTextArray - NewL()", //case description + "CGSRadioButtonSettingPageItemTextArray", //class being tested + "NewL", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupResourceL, T_Global_GSRBSPItemTextArray_NewL, Teardown ) + +EUNIT_TEST( + "CGSRadioButtonSettingPageItemTextArray - CurrentFeatureL()", //case description + "CGSRadioButtonSettingPageItemTextArray", //class being tested + "CurrentFeatureL", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + Setup_GSRBSPItemTextArrayL, T_Global_GSRBSPItemTextArray_CurrentFeatureL, Teardown ) + +EUNIT_TEST( + "CGSRadioButtonSettingPageItemTextArray - SetRadioButtonSettingPageL()", //case description + "CGSRadioButtonSettingPageItemTextArray", //class being tested + "SetRadioButtonSettingPageL", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + Setup_GSRBSPItemTextArrayL, T_Global_GSRBSPItemTextArray_SetRadioButtonSettingPageL, Teardown ) + + +// CGSListBoxItemTextArray test cases + +EUNIT_TEST( + "CGSListBoxItemTextArray - NewL()", //case description + "CGSListBoxItemTextArray", //class being tested + "NewL", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupResourceL, T_Global_CGSLBITextArray_NewL, Teardown ) + +EUNIT_TEST( + "CGSListBoxItemTextArray - another NewL()", //case description + "CGSListBoxItemTextArray", //class being tested + "overloaded NewL", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + SetupResourceL, T_Global_CGSLBITextArray_New2L, Teardown ) + +EUNIT_TEST( + "CGSListBoxItemTextArray - CurrentFeature()", //case description + "CGSListBoxItemTextArray", //class being tested + "CurrentFeature", //method being tested + "FUNCTIONALITY", //FUNCTIONALITY, BOUNDARY, ERRORHANDLING + Setup_CGSLBITextArrayL, T_Global_CGSLBITextArray_CurrentFeatureL, Teardown ) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __T_GSLISTBOX_H__ +#define __T_GSLISTBOX_H__ + +// EXTERNAL INCLUDES +#include +#include +#include + +// INTERNAL INCLUDES + +// FORWARD DECLARATIONS + + +// CLASS DEFINITION +NONSHARABLE_CLASS( T_GSListBox ) + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static T_GSListBox* NewL(); + static T_GSListBox* NewLC(); + /** + * Destructor + */ + ~T_GSListBox(); + + private: // Constructors and destructors + + T_GSListBox(); + void ConstructL(); + + private: // New methods + + void SetupL(); + void Teardown(); + + // CGSListboxEntry test cases + void SetupListBoxEntryL(); + void T_Global_GSListBox_NewLC(); + void T_Global_GSListBox_New2LC(); + void T_Global_GSListBox_New3LC(); + void T_Global_GSListBox_FeatureIdL(); + void T_Global_GSListBox_TypeL(); + void T_Global_GSListBox_CaptionL(); + void T_Global_GSListBox_SetDynamicTextL(); + void T_Global_GSListBox_SetDynamicTextDoublePaneL(); + + // CGSItemTextArray test cases + void SetupGSItemTextArrayL(); + void T_Global_GSItemTextArray_SetupL(); + void T_Global_GSItemTextArray_MdcaCountL(); + void T_Global_GSItemTextArray_MdcaPointL(); + void T_Global_GSItemTextArray_SetDynamicTextL(); + void T_Global_GSItemTextArray_SetDynamicTextDoublePaneL(); + void T_Global_GSItemTextArray_SetItemVisibilityL(); + void T_Global_GSItemTextArray_CurrentFeatureL(); + void T_Global_GSItemTextArray_IndexForFeatureIdL(); + void T_Global_GSItemTextArray_FeatureIdByIndexL(); + void T_Global_GSItemTextArray_FeatureByIdL(); + void T_Global_GSItemTextArray_GetItemCaptionFromFeatureIdLC(); + + // CGSRadioButtonSettingPageItemTextArray test cases + void SetupResourceL(); + void T_Global_GSRBSPItemTextArray_NewL(); + void Setup_GSRBSPItemTextArrayL(); + void T_Global_GSRBSPItemTextArray_CurrentFeatureL(); + void T_Global_GSRBSPItemTextArray_SetRadioButtonSettingPageL(); + + // CGSListBoxItemTextArray test cases + void Setup_CGSLBITextArrayL(); + void T_Global_CGSLBITextArray_NewL(); + void T_Global_CGSLBITextArray_New2L(); + void T_Global_CGSLBITextArray_CurrentFeatureL(); + + + + private: // Data + CGSListboxEntry* iListboxEntry; + CGSItemTextArray* iItemTextArray; + CGSRadioButtonSettingPageItemTextArray* iRBSPArray; + CGSListBoxItemTextArray* iLBITextArray; + CEikListBox* iListBox; + + TInt iOffset; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __T_GSLISTBOX_H__ + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox_DllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox_DllMain.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS HEADER +#include "T_GSListBox.h" + +// EXTERNAL INCLUDES +#include + +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return T_GSListBox::NewL(); + } + +#ifndef EKA2 +GLDEF_C TInt E32Dll( TDllReason ) + { + return KErrNone; + } +#endif + +// END OF FILE diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,193 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS HEADER +#include "MT_CGSLauncher.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include + +// INTERNAL INCLUDES + + +// CONSTRUCTION +MT_CGSLauncher* MT_CGSLauncher::NewL() + { + MT_CGSLauncher* self = MT_CGSLauncher::NewLC(); + CleanupStack::Pop(); + + return self; + } + +MT_CGSLauncher* MT_CGSLauncher::NewLC() + { + MT_CGSLauncher* self = new( ELeave ) MT_CGSLauncher(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +MT_CGSLauncher::~MT_CGSLauncher() + { + } + +// Default constructor +MT_CGSLauncher::MT_CGSLauncher() + { + } + +// Second phase construct +void MT_CGSLauncher::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + +void MT_CGSLauncher::EmptySetupL( ) + { + } + +void MT_CGSLauncher::SetupL( ) + { + iCGSLauncher = CGSLauncher::NewL();; + } + + +void MT_CGSLauncher::Teardown( ) + { + if ( iCGSLauncher ) + { + delete iCGSLauncher; + iCGSLauncher = NULL; + } + } + + +void MT_CGSLauncher::T_CGSLauncher_NewLL( ) + { + CGSLauncher* Launcher = CGSLauncher::NewL(); + CleanupStack::PushL( Launcher ); + EUNIT_ASSERT_DESC( Launcher != NULL, "An instance of CGSLauncher is not created"); + CleanupStack::PopAndDestroy(); + } + +void MT_CGSLauncher::T_CGSLauncher_LaunchGSViewLL( ) + { + // iCGSLauncher->LaunchGSViewL( ); + EUNIT_ASSERT_DESC( EFalse, "Generated assert, replace with real"); + } + +//---------------------------------------------------------------------------- +TBool MT_CGSLauncher::KillGSL() + { + RDebug::Print(_L("T_CGSLauncher::KillGSL()")); + TUid gsuid = TUid::Uid(0x100058EC); + TBool taskFoundAndEnded(EFalse); + RWsSession ws; + ws.Connect(); + TApaTaskList l(ws); + TBool GSExist = l.FindApp(gsuid).Exists(); + TInt i=5; + if ( GSExist ) + { + while ( 1 ) + { + RDebug::Print(_L("T_CGSLauncher::KillGSL() trying to End GS")); + TApaTask gs = l.FindApp(gsuid); + if( !gs.Exists() || i-- < 0) + { + taskFoundAndEnded = i>0 ? ETrue : EFalse; + break; + } + gs.EndTask(); + RDebug::Print(_L("T_CGSLauncher::KillGSL Ended GS")); + User::After(TTimeIntervalMicroSeconds32 (100000)); + } + } + ws.Close(); + return taskFoundAndEnded; + } + +// --------------------------------------------------------------------------- +// Launches GS view, waits 8 sec and kills GS application (success criteria) +void MT_CGSLauncher::LaunchGWView_gs_not_running( ) + { + RDebug::Print(_L("T_CGSLauncher::T_CGSLauncher_LaunchGSViewL( )")); + iCGSLauncher->LaunchGSViewL( KGSTelPluginUid,TUid::Uid(0),_L8("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") ); // telephony + User::After(TTimeIntervalMicroSeconds32 (8000000)); + TBool endedSuccesfully=KillGSL(); + EUNIT_ASSERT_DESC( endedSuccesfully, "test result"); + } + +// --------------------------------------------------------------------------- +// Launches GS view, waits 8 sec and launches other GS view. +// Waits 2 sec and kills GS application (success criteria) +void MT_CGSLauncher::LaunchGWView_gs_is_running() + { + RDebug::Print(_L("T_CGSLauncher::LaunchGWView_gs_is_running( )")); + + iCGSLauncher->LaunchGSViewL( KGSGenPluginUid,TUid::Uid(0),_L8("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") ); // security view + User::After(TTimeIntervalMicroSeconds32 (8000000)); + + iCGSLauncher->LaunchGSViewL( KGSConPluginUid,TUid::Uid(0),KNullDesC8 ); // connection view + User::After(TTimeIntervalMicroSeconds32 (3000000)); + + TBool endedSuccesfully=KillGSL(); + EUNIT_ASSERT_DESC( endedSuccesfully, "test result"); + } + +// TEST TABLE +EUNIT_BEGIN_TEST_TABLE( + MT_CGSLauncher, + "Add test suite description here.", + "MODULE" ) + +EUNIT_TEST( + "NewL and NewLC - test", + "CGSLauncher", + "NewL and NewLC", + "FUNCTIONALITY", + EmptySetupL, T_CGSLauncher_NewLL, Teardown) + +EUNIT_TEST( + "Launch GS once", + "CGSLauncher", + "LaunchGSViewL", + "FUNCTIONALITY", + SetupL, LaunchGWView_gs_not_running, Teardown) + +EUNIT_TEST( + "Launch GS twice", + "CGSLauncher", + "LaunchGSViewL", + "FUNCTIONALITY", + SetupL, LaunchGWView_gs_is_running, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MT_CGSLAUNCHER_H__ +#define __MT_CGSLAUNCHER_H__ + +// EXTERNAL INCLUDES +#include +#include +#include + +// INTERNAL INCLUDES + + +// FORWARD DECLARATIONS + + +// CLASS DEFINITION +/** + * Auto-generated test suite + * + */ +NONSHARABLE_CLASS( MT_CGSLauncher ) + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static MT_CGSLauncher* NewL(); + static MT_CGSLauncher* NewLC(); + /** + * Destructor + */ + ~MT_CGSLauncher(); + + private: // Constructors and destructors + + MT_CGSLauncher(); + void ConstructL(); + + private: // New methods + + void EmptySetupL(); + + void SetupL(); + + void Teardown(); + + TBool KillGSL(); + + void T_CGSLauncher_NewLL(); + + void T_CGSLauncher_LaunchGSViewLL(); + + void LaunchGWView_gs_not_running(); + + void LaunchGWView_gs_is_running(); + + + private: // Data + + CGSLauncher* iCGSLauncher; + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __MT_CGSLAUNCHER_H__ + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher_DllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher_DllMain.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// CLASS HEADER +#include "MT_CGSLauncher.h" + +// EXTERNAL INCLUDES +#include + +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return MT_CGSLauncher::NewL(); + } + +#ifndef EKA2 +GLDEF_C TInt E32Dll( TDllReason ) + { + return KErrNone; + } +#endif + +// END OF FILE diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/group/MT_CGSLauncher.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/group/MT_CGSLauncher.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include + +TARGET MT_CGSLauncher.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 + +CAPABILITY ALL -TCB +VENDORID 0x00000000 + +SOURCEPATH ../MT_GSLauncher +SOURCE MT_CGSLauncher.cpp + +// Sources required by the test suite +SOURCEPATH ../MT_GSLauncher +SOURCE MT_CGSLauncher_DllMain.cpp + + +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE /epoc32/include/Digia/EUnit + +// System include folders required by the tested code +SYSTEMINCLUDE ../../../../gslauncher/inc + +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY euser.lib + +LIBRARY gslauncher.lib +LIBRARY ws32.lib // wssession +LIBRARY viewcli.lib +LIBRARY apgrfx.lib + + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/group/MT_GSFramework.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/group/MT_GSFramework.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include // For RESOURCE_FILES_DIR + +#include + + + +TARGET MT_GSFramework.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 + +CAPABILITY ALL -TCB +VENDORID 0x00000000 + + +// Sources required by the test suite +SOURCEPATH ../GSFramework +SOURCE MT_GSFramework.cpp +SOURCE TestGSBaseView.cpp +SOURCE TestGSPlugin.cpp +SOURCE MT_GSFramework_DllMain.cpp + +// Sources that mus be compiled and included into test dll. +//SOURCEPATH ../../../../GSFramework/src +//SOURCE ../../../../GSFramework/src/GSParentContainer.cpp + + +// User include folders required by the tested code +USERINCLUDE ../../../../GSFramework/inc +USERINCLUDE ../../../../Logger +USERINCLUDE ../../../../GSInteractionPlugin/inc + + +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/Digia/EUnit + + +// Utility & EUnit libraries +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY euser.lib +LIBRARY cone.lib + +// Tested libraries +LIBRARY GSFramework.lib +LIBRARY GSEcomPlugin.lib +LIBRARY apgrfx.lib // RApaLsSession +LIBRARY apparc.lib // TApaAppInfo +LIBRARY ws32.lib // RWsSession +LIBRARY avkon.lib +LIBRARY eikcore.lib + + + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/group/T_GSBackgroundImage.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/group/T_GSBackgroundImage.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include + +TARGET T_GSBackgroundImage.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 + +CAPABILITY ALL -TCB +VENDORID 0x00000000 + +// Sources required by the test suite +USERINCLUDE ../GSBackgroundImage +SOURCEPATH ../GSBackgroundImage +SOURCE T_GSBackgroundImage_DllMain.cpp +SOURCE T_GSBackgroundImage.cpp + + +SYSTEMINCLUDE /epoc32/include +SYSTEMINCLUDE /epoc32/include/Digia/EUnit +APP_LAYER_SYSTEMINCLUDE + +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY euser.lib +LIBRARY sysutil.lib +// Libraries required by the tested code +LIBRARY backgroundimage.lib +LIBRARY efsrv.lib + +// End of file + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/group/T_GSListBox.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/group/T_GSListBox.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include + +TARGET T_GSListBox.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 + +CAPABILITY ALL -TCB +VENDORID 0x00000000 + +SOURCEPATH ../GSListBox +SOURCE T_GSListBox.cpp + +// Sources required by the test suite +SOURCE T_GSListBox_DllMain.cpp + +USERINCLUDE ../GSListBox + +SYSTEMINCLUDE /epoc32/include +SYSTEMINCLUDE /epoc32/include/Digia/EUnit +APP_LAYER_SYSTEMINCLUDE + +// System include folders required by the tested code + + +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY euser.lib +LIBRARY sysutil.lib +// Libraries required by the tested code +LIBRARY efsrv.lib GSListBox.lib cone.lib avkon.lib bafl.lib + +// End of file + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -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: +* +*/ + +PRJ_PLATFORMS +DEFAULT +// ARMV5 GCCE WINSCW + +PRJ_EXPORTS + +PRJ_MMPFILES + + +PRJ_TESTMMPFILES +MT_GSFramework.mmp +T_GSBackgroundImage.mmp +T_GSListBox.mmp +MT_CGSLauncher.mmp + +gnumakefile copy_binaries_to_sys_dir.mk + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/group/copy_binaries_to_sys_dir.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/group/copy_binaries_to_sys_dir.mk Wed Sep 01 12:20:44 2010 +0100 @@ -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: +# + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + del \epoc32\RELEASE\winscw\udeb\Z\sys\bin\MT_GSFramework.dll /f + del \epoc32\RELEASE\winscw\udeb\Z\sys\bin\T_GSBackgroundImage.dll /f + del \epoc32\RELEASE\winscw\udeb\Z\sys\bin\T_GSListBox.dll /f + del \epoc32\RELEASE\winscw\udeb\Z\sys\bin\MT_CGSLauncher.dll /f + + +LIB : do_nothing + +CLEANLIB : do_nothing + +RESOURCE : do_nothing + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : do_nothing + +FINAL : + echo COPYING + copy \epoc32\RELEASE\winscw\udeb\MT_GSFramework.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /y + copy \epoc32\RELEASE\winscw\udeb\T_GSBackgroundImage.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /y + copy \epoc32\RELEASE\winscw\udeb\T_GSListBox.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /y + copy \epoc32\RELEASE\winscw\udeb\MT_CGSLauncher.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /y diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/group/move.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/group/move.cmd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,22 @@ +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 + +Copy \epoc32\RELEASE\winscw\udeb\MT_GSFramework.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /Y +Copy \epoc32\RELEASE\winscw\udeb\T_GSBackgroundImage.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /Y +Copy \epoc32\RELEASE\winscw\udeb\T_GSListBox.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /Y +Copy \epoc32\RELEASE\winscw\udeb\MT_CGSLauncher.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /Y + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/Gs/tsrc/public/basic/test.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/tsrc/public/basic/test.xml Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,147 @@ + + + Gs - Automated Tests + + + + + + + + + + + + + + + + + + + + makedir + + + + + + + + install + + + + + + + + + install + + + + + + + + + install + + + + + + + + + install + + + + + + + + + + + + execute + + + + + + + + + makedir + + + + + + + + execute + + + + + + + + + + + + execute + + + + + + + + + + fetch-log + + + + + + + + + + + ATS3Drop/images/sydo_gs_ats3_image.fpsx + ATS3Drop/images/sydo_gs_ats3_image_udaerase.fpsx + ATS3Drop/armv5_urel/MT_GSFramework.dll + ATS3Drop/armv5_urel/T_GSBackgroundImage.dll + ATS3Drop/armv5_urel/T_GSListBox.dll + ATS3Drop/armv5_urel/MT_CGSLauncher.dll + + + + + SendEmailAction + + + + + + + + + + + + FileStoreAction + + + + + diff -r 8ee96d21d9bf -r 7e0eff37aedb gssettingsuis/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,19 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#include "../Gs/group/bld.inf" diff -r 8ee96d21d9bf -r 7e0eff37aedb layers.sysdef.xml --- a/layers.sysdef.xml Tue Aug 31 15:29:50 2010 +0300 +++ b/layers.sysdef.xml Wed Sep 01 12:20:44 2010 +0100 @@ -1,27 +1,14 @@ - ]> - + - - - - - - - - - - - - - diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/BWINS/FileListU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/BWINS/FileListU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,38 @@ +EXPORTS + ??1CFLDController@@UAE@XZ @ 1 NONAME ; CFLDController::~CFLDController(void) + ??1CFLDFileListContainer@@UAE@XZ @ 2 NONAME ; CFLDFileListContainer::~CFLDFileListContainer(void) + ?AddExclusiveMediaTypeL@CFLDFileListContainer@@QAEXJ@Z @ 3 NONAME ; void CFLDFileListContainer::AddExclusiveMediaTypeL(long) + ?AddExclusiveMimeTypeL@CFLDFileListContainer@@QAEXABVTDesC16@@@Z @ 4 NONAME ; void CFLDFileListContainer::AddExclusiveMimeTypeL(class TDesC16 const &) + ?CompleteConstructionL@CFLDController@@QAEXAAVRWindow@@@Z @ 5 NONAME ; void CFLDController::CompleteConstructionL(class RWindow &) + ?HandleFileListBoxEventL@CFLDController@@UAEXW4TFileListBoxEvent@MFLDFileListBoxObserver@@ABVTDesC16@@@Z @ 6 NONAME ; void CFLDController::HandleFileListBoxEventL(enum MFLDFileListBoxObserver::TFileListBoxEvent, class TDesC16 const &) + ?InsertEndNullItemL@CFLDFileListContainer@@QAEXABVTDesC16@@0@Z @ 7 NONAME ; void CFLDFileListContainer::InsertEndNullItemL(class TDesC16 const &, class TDesC16 const &) + ?InsertEndNullItemL@CFLDFileListContainer@@QAEXABVTDesC16@@@Z @ 8 NONAME ; void CFLDFileListContainer::InsertEndNullItemL(class TDesC16 const &) + ?InsertNullItemL@CFLDFileListContainer@@QAEXABVTDesC16@@0@Z @ 9 NONAME ; void CFLDFileListContainer::InsertNullItemL(class TDesC16 const &, class TDesC16 const &) + ?InsertNullItemL@CFLDFileListContainer@@QAEXABVTDesC16@@@Z @ 10 NONAME ; void CFLDFileListContainer::InsertNullItemL(class TDesC16 const &) + ?LaunchL@CFLDFileListContainer@@QAEHAAVTDes16@@ABVTDesC16@@@Z @ 11 NONAME ; int CFLDFileListContainer::LaunchL(class TDes16 &, class TDesC16 const &) + ?NewL@CFLDController@@SAPAV1@HVTTimeIntervalMicroSeconds32@@@Z @ 12 NONAME ; class CFLDController * CFLDController::NewL(int, class TTimeIntervalMicroSeconds32) + ?NewL@CFLDFileListContainer@@SAPAV1@H@Z @ 13 NONAME ; class CFLDFileListContainer * CFLDFileListContainer::NewL(int) + ?NewL@CFLDFileListContainer@@SAPAV1@HH@Z @ 14 NONAME ; class CFLDFileListContainer * CFLDFileListContainer::NewL(int, int) + ?NewL@CFLDFileListContainer@@SAPAV1@XZ @ 15 NONAME ; class CFLDFileListContainer * CFLDFileListContainer::NewL(void) + ?NewLC@CFLDController@@SAPAV1@HVTTimeIntervalMicroSeconds32@@@Z @ 16 NONAME ; class CFLDController * CFLDController::NewLC(int, class TTimeIntervalMicroSeconds32) + ?NewLC@CFLDFileListContainer@@SAPAV1@H@Z @ 17 NONAME ; class CFLDFileListContainer * CFLDFileListContainer::NewLC(int) + ?NewLC@CFLDFileListContainer@@SAPAV1@HH@Z @ 18 NONAME ; class CFLDFileListContainer * CFLDFileListContainer::NewLC(int, int) + ?NewLC@CFLDFileListContainer@@SAPAV1@XZ @ 19 NONAME ; class CFLDFileListContainer * CFLDFileListContainer::NewLC(void) + ?ResetExclusiveMediaTypes@CFLDFileListContainer@@QAEXXZ @ 20 NONAME ; void CFLDFileListContainer::ResetExclusiveMediaTypes(void) + ?ResetExclusiveMimeTypes@CFLDFileListContainer@@QAEXXZ @ 21 NONAME ; void CFLDFileListContainer::ResetExclusiveMimeTypes(void) + ?SetAutomatedType@CFLDFileListContainer@@QAEXW4TDRMHelperAutomatedType@CDRMHelper@@@Z @ 22 NONAME ; void CFLDFileListContainer::SetAutomatedType(enum CDRMHelper::TDRMHelperAutomatedType) + ?SetDelay@CFLDController@@QAEXVTTimeIntervalMicroSeconds32@@@Z @ 23 NONAME ; void CFLDController::SetDelay(class TTimeIntervalMicroSeconds32) + ?SetDelay@CFLDFileListContainer@@QAEXVTTimeIntervalMicroSeconds32@@@Z @ 24 NONAME ; void CFLDFileListContainer::SetDelay(class TTimeIntervalMicroSeconds32) + ?SetFileObserver@CFLDController@@QAEXPAVMFLDFileObserver@@@Z @ 25 NONAME ; void CFLDController::SetFileObserver(class MFLDFileObserver *) + ?SetMaxFileSize@CFLDFileListContainer@@QAEXH@Z @ 26 NONAME ; void CFLDFileListContainer::SetMaxFileSize(int) + ?SetRingingType@CFLDController@@QAEXH@Z @ 27 NONAME ; void CFLDController::SetRingingType(int) + ?SetRingingType@CFLDFileListContainer@@QAEXH@Z @ 28 NONAME ; void CFLDFileListContainer::SetRingingType(int) + ?SetVibra@CFLDController@@QAEXH@Z @ 29 NONAME ; void CFLDController::SetVibra(int) + ?SetVibra@CFLDFileListContainer@@QAEXH@Z @ 30 NONAME ; void CFLDFileListContainer::SetVibra(int) + ?SetVolume@CFLDController@@QAEXH@Z @ 31 NONAME ; void CFLDController::SetVolume(int) + ?SetVolume@CFLDFileListContainer@@QAEXH@Z @ 32 NONAME ; void CFLDFileListContainer::SetVolume(int) + ?SetWantedMediaTypesL@CFLDFileListContainer@@QAEXABV?$TArray@W4TCLFMediaType@@@@@Z @ 33 NONAME ; void CFLDFileListContainer::SetWantedMediaTypesL(class TArray const &) + ?SetWantedMimeTypesL@CFLDFileListContainer@@QAEXABVMDesC16Array@@@Z @ 34 NONAME ; void CFLDFileListContainer::SetWantedMimeTypesL(class MDesC16Array const &) + ?Set3dEffects@CFLDController@@QAEXH@Z @ 35 NONAME ; void CFLDController::Set3dEffects(int) + ?Set3dEffects@CFLDFileListContainer@@QAEXH@Z @ 36 NONAME ; void CFLDFileListContainer::Set3dEffects(int) + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/EABI/FileListU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/EABI/FileListU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,49 @@ +EXPORTS + _ZN14CFLDController14SetRingingTypeEi @ 1 NONAME + _ZN14CFLDController15SetFileObserverEP16MFLDFileObserver @ 2 NONAME + _ZN14CFLDController21CompleteConstructionLER7RWindow @ 3 NONAME + _ZN14CFLDController23HandleFileListBoxEventLEN23MFLDFileListBoxObserver17TFileListBoxEventERK7TDesC16 @ 4 NONAME + _ZN14CFLDController4NewLEi27TTimeIntervalMicroSeconds32 @ 5 NONAME + _ZN14CFLDController5NewLCEi27TTimeIntervalMicroSeconds32 @ 6 NONAME + _ZN14CFLDController8SetDelayE27TTimeIntervalMicroSeconds32 @ 7 NONAME + _ZN14CFLDController8SetVibraEi @ 8 NONAME + _ZN14CFLDController9SetVolumeEi @ 9 NONAME + _ZN14CFLDControllerD0Ev @ 10 NONAME + _ZN14CFLDControllerD1Ev @ 11 NONAME + _ZN14CFLDControllerD2Ev @ 12 NONAME + _ZN21CFLDFileListContainer14SetMaxFileSizeEi @ 13 NONAME + _ZN21CFLDFileListContainer14SetRingingTypeEi @ 14 NONAME + _ZN21CFLDFileListContainer15InsertNullItemLERK7TDesC16 @ 15 NONAME + _ZN21CFLDFileListContainer15InsertNullItemLERK7TDesC16S2_ @ 16 NONAME + _ZN21CFLDFileListContainer16SetAutomatedTypeEN10CDRMHelper23TDRMHelperAutomatedTypeE @ 17 NONAME + _ZN21CFLDFileListContainer18InsertEndNullItemLERK7TDesC16 @ 18 NONAME + _ZN21CFLDFileListContainer18InsertEndNullItemLERK7TDesC16S2_ @ 19 NONAME + _ZN21CFLDFileListContainer19SetWantedMimeTypesLERK12MDesC16Array @ 20 NONAME + _ZN21CFLDFileListContainer20SetWantedMediaTypesLERK6TArrayI13TCLFMediaTypeE @ 21 NONAME + _ZN21CFLDFileListContainer21AddExclusiveMimeTypeLERK7TDesC16 @ 22 NONAME + _ZN21CFLDFileListContainer22AddExclusiveMediaTypeLEl @ 23 NONAME + _ZN21CFLDFileListContainer23ResetExclusiveMimeTypesEv @ 24 NONAME + _ZN21CFLDFileListContainer24ResetExclusiveMediaTypesEv @ 25 NONAME + _ZN21CFLDFileListContainer4NewLEi @ 26 NONAME + _ZN21CFLDFileListContainer4NewLEii @ 27 NONAME + _ZN21CFLDFileListContainer4NewLEv @ 28 NONAME + _ZN21CFLDFileListContainer5NewLCEi @ 29 NONAME + _ZN21CFLDFileListContainer5NewLCEii @ 30 NONAME + _ZN21CFLDFileListContainer5NewLCEv @ 31 NONAME + _ZN21CFLDFileListContainer7LaunchLER6TDes16RK7TDesC16 @ 32 NONAME + _ZN21CFLDFileListContainer8SetDelayE27TTimeIntervalMicroSeconds32 @ 33 NONAME + _ZN21CFLDFileListContainer8SetVibraEi @ 34 NONAME + _ZN21CFLDFileListContainer9SetVolumeEi @ 35 NONAME + _ZN21CFLDFileListContainerD0Ev @ 36 NONAME + _ZN21CFLDFileListContainerD1Ev @ 37 NONAME + _ZN21CFLDFileListContainerD2Ev @ 38 NONAME + _ZTI14CFLDController @ 39 NONAME ; ## + _ZTI21CFLDFileListContainer @ 40 NONAME ; ## + _ZTV14CFLDController @ 41 NONAME ; ## + _ZTV21CFLDFileListContainer @ 42 NONAME ; ## + _ZThn4_N14CFLDController23HandleFileListBoxEventLEN23MFLDFileListBoxObserver17TFileListBoxEventERK7TDesC16 @ 43 NONAME ; ## + _ZThn4_N14CFLDControllerD0Ev @ 44 NONAME ; ## + _ZThn4_N14CFLDControllerD1Ev @ 45 NONAME ; ## + _ZN14CFLDController12Set3dEffectsEi @ 46 NONAME + _ZN21CFLDFileListContainer12Set3dEffectsEi @ 47 NONAME + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Inc/CFLDFileListModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Inc/CFLDFileListModel.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,379 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This class implements a model of a file list. +* The class is inherited from MDesCArray, so it can be used directly +* as a model for a listbox. +* +* +*/ + + + +#ifndef __CFLDFILELISTMODEL_H__ +#define __CFLDFILELISTMODEL_H__ + +// INTERNAL INCLUDES + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CFLDOperationObserver; +class CFLDChangedItemObserver; +class MCLFContentListingEngine; +class MCLFItemListModel; +class CFLDEntryReference; +class MFLDEntryFormatter; +class CFLDWaitNote; +class RConeResourceLoader; +class TResourceReader; +class MCLFModifiableItem; +class CFLDPopupList; + +// CLASS DECLARATION +/** +* This class implements a model of a file list. +* The class is inherited from MDesCArray, so it can be used directly +* as a model for a listbox. +* +* @lib filelist.lib +* @since 2.1 +*/ +NONSHARABLE_CLASS( CFLDFileListModel ) + : public CBase, public MDesCArray, public MCLFPostFilter + { + public: // Constructors and destructors + + /** + * Two-phased static constructor. + * @param aModelResourceId A CLF model resource, see CLFContentListing.rh + * @param aDirectoriesResourceId A resource using FILELISTDIRECTORIES + * structure, see FileListModel.rh for details + * @return A pointer to a constructed CFLDFileListModel object + */ + static CFLDFileListModel* NewL( + const TInt aModelResourceId, const TInt aDirectoriesResourceId ); + + /** + * Two-phased static constructor. + * @param aModelResourceId A CLF model resource, see CLFContentListing.rh + * @param aDirectoriesResourceId A resource using FILELISTDIRECTORIES + * structure, see FileListModel.rh for details + * @return A pointer to a constructed CFLDFileListModel object + */ + static CFLDFileListModel* NewLC( + const TInt aModelResourceId, const TInt aDirectoriesResourceId ); + + /** + * Destructor. + */ + virtual ~CFLDFileListModel(); + + private: // Constructors and destructors + + /** + * Constructor + */ + CFLDFileListModel(); + + /** + * Second phase constructor + * @param aModelResourceId A CLF model resource, see CLFContentListing.rh + * @param aDirectoriesResourceId A resource using FILELISTDIRECTORIES + * structure, see FileListModel.rh for details + */ + void ConstructL( + const TInt aModelResourceId, const TInt aDirectoriesResourceId ); + + public: // New methods + + /** + * Returns file media type + * @param aFileName A descriptor containing the media file name + * @return Media file type (see TCLFMediaType enumeration + * inside CFLContentListing.hrh) + */ + TInt32 MediaFileType( const TDesC& aFileName ) const; + + /** + * Adds a new MIME type into blocking list. + * @param aMimeType The blocked MIME type + */ + void AddExclusiveMimeTypeL( const TDesC& aMimeType ); + + /** + * Adds a new media type into blocking list. + * @param aMediaType The blocked media type (see TCLFMediaType enumeration + * inside CFLContentListing.hrh) + */ + void AddExclusiveMediaTypeL( const TInt32 aMediaType ); + + /** + * Removes all the defined exlusive MIME types + */ + void ResetExclusiveMimeTypes(); + + /** + * Removes all the defined exlusive media types + */ + void ResetExclusiveMediaTypes(); + + /** + * Sets wanted mime types. Overrides all settings defined inside + * resource, defined with AddExclusive -methods or with + * SetWanted -methods. + * @param aMimeTypes The array containing wanted MIME types + */ + void SetWantedMimeTypesL( const MDesCArray& aMimeTypes ); + + /** + * Sets wanted media types. Overrides all settings defined inside + * resource, defined with AddExclusive -methods or with + * SetWanted -methods. + * @param aMediaTypes The array containing wanted media types + */ + void SetWantedMediaTypesL( const TArray& aMediaTypes ); + + /** + * Refreshes the file list. + */ + void RefreshEntryListL(); + + /** + * Sets popup list to Model. Needed to update the listbox after the + * model has changed (e.g. after inserting a memory card). + * @param aPopupList The popup list + */ + void SetPopupList( CFLDPopupList* aPopupList ); + + /** + * Retrieves a full path of an entry (e.g. "c:\folder\file.ext") + * @param aFileName A modifiable descriptor where the path and filename + * is placed, or KNullDesc if aIndex points to the null text item. + * Note: aFileName.Length() >= KMaxFileName + * @param aIndex Index of the entry to retrieve + */ + void GetFileName( TDes& aFileName, const TInt aIndex ); + + /** + * Sets an MFLDEntryFormatter inherited for the model. Ownership of the given + * object is transferred to CFLDFileListModel. + * @param aFormatter A pointer to a MFLDEntryFormatter inherited object. + */ + void SetEntryFormatter( MFLDEntryFormatter* aFormatter ); + + /** + * Adds a text (e.g. "None") as the first item of the list, + * which will not be sorted among the file name items. + * @param aItemText A descriptor containing the null item text + */ + void InsertNullItemL( const TDesC& aItemText ); + + /** + * Adds a text (e.g. "None") as the first item of the list, + * which will not be sorted among the file name items. + * @param aItemText A descriptor containing the null item text + * @param aFileName A descriptor containing the ringing tone file name form null item + */ + void InsertNullItemL( const TDesC& aItemText, const TDesC& aFileName ); + + /** + * Adds a text (e.g. "None") as the last item of the list, + * which will not be sorted among the file name items. + * @param aItemText A descriptor containing the null item text + */ + void InsertEndNullItemL( const TDesC& aItemText ); + + /** + * Adds a text (e.g. "None") as the last item of the list, + * which will not be sorted among the file name items. + * @param aItemText A descriptor containing the null item text + * @param aFileName A descriptor containing the ringing tone file name form null item + */ + void InsertEndNullItemL( const TDesC& aItemText, const TDesC& aFileName ); + + /** + * Find a file from the model's list + * @param aFileName The file name to be searched + * @return An index to the searched file, or KErrNotFound + */ + TInt FindFileL( const TDesC& aFileName ); + + /** + * Sets the maximum file size for the list. + * @param aMaxFileSize The maximum file size in bytes. If you want to allow all file + * sizes, set this to KFLDNoSizeFiltering (defined in FileListModel.hrh). + */ + void SetMaxFileSize( const TInt aMaxFileSize ); + + /** + * Returns PopupList. + */ + CFLDPopupList* GetPopupList(); + + private: // Methods derived from MDesCArray + + TPtrC16 MdcaPoint( TInt aIndex ) const; + + TInt MdcaCount() const; + + private: // Methods derived from MCLFPostFilter + + void FilterItemsL( const TArray& aItemList, + RPointerArray& aFilteredItemList ); + + private: // New methods + + /* + * Checks if file needs to be filtered out from model + * @param aMimeType Media MIME type + * @param aMediaType Media type + * @param aPathAndFileName Path and filename + * @return EFalse if MO should be filtered out + */ + TBool CheckRules( + TPtrC& aMimeType, TInt32 aMediaType, TPtrC& aPathAndFileName ); + + /** + * Fill the entry reference list according to the added directories list + * and filtering parameters + */ + void PopulateReferenceListL(); + + /** + * List all files from the list model to the list box. + */ + void PopulateListBoxL(); + + /** + * Gets a filename at specific index. + * @param aIndex Index of the file (whole list is indexed) + * @param aFileName Descriptor where the filename is stored. + */ + void GetFileNameAtIndex( TInt aIndex, TDes& aFileName ) const; + + /** + * Scans user defined Rom directories and adds found entries + * into iRomRingingToneArray + */ + void ScanRomDirectoriesL(); + + /** + * Scans user defined Rom directories and adds found entries + * into iRomRingingToneArray + */ + void ScanRomDirectoriesAndInsertL(); + + /** + * Adds directory into iDirectoryPaths + * @param aDirectory Directory to be scanned + */ + TInt AddDirectoryL( const TDesC& aDirectory ); + + /** + * Adds directory into iRomDirectoryPaths + * @param aDirectory Directory to be scanned + */ + TInt AddRomDirectoryL( const TDesC& aDirectory ); + + /** + * Loads directories from resource file + * @param aDirectoriesResourceId Resource ID to directory structure + */ + void LoadDirectoriesL( const TInt aDirectoriesResourceId ); + + /** + * Checks ringing tone file size. + * @param aFile file to check. + * @param aSizeLimit maximum allowed file size in bytes. + * @return KErrNone, if ok. + * KErrTooBig, if configurable file size limit exceeded. + */ + TInt CheckToneFileSizeL( const TDesC& aFile, TInt aSizeLimit ); + + private: // Data + + /// Own: Content listing engine + MCLFContentListingEngine* iEngine; + + /// Own: Content listing model + MCLFItemListModel* iModel; + + /// Own: Content listeng operation observer + CFLDOperationObserver* iObserver; + + /// Own: Content listeng operation observer + CFLDChangedItemObserver* iChangedItemObserver; + + /// Own: MFLDEntryFormatter to use in formatting the entries + MFLDEntryFormatter* iEntryFormatter; + + /// Own: Wait note dialog for indicating refreshing process of the List Model + CFLDWaitNote* iWaitNote; + + /// Contains references to all the entries. This is the list that + /// gets sorted and filtered + RPointerArray iEntryReferences; + + /// Optional text items in the beginning of the list + RPointerArray iNullTextArray; + + /// Optional ringing tones for null texts + RPointerArray iNullTextRingingToneArray; + + /// Optional text items in the end of the list + RPointerArray iEndNullTextArray; + + /// Optional ringing tones for end null items + RPointerArray iEndNullTextRingingToneArray; + + /// For waiting the asynchronous refresh operation to complete + CActiveSchedulerWait iWait; + + /// Array for exclusive mimetypes. + CDesCArraySeg iExclusiveMimeTypes; + + /// Array for exclusive mediatypes. + RArray iExclusiveMediaTypes; + + /// Contains descriptors containing + /// the user-defined phone directory paths + CDesCArraySeg iDirectoryPaths; + + /// Contains descriptors containing + /// the user-defined ROM directory paths + CDesCArraySeg iRomDirectoryPaths; + + /// Array for user-defined ringingtones + RPointerArray iRomRingingToneArray; + + /// Maximum file size in bytes + TInt iMaxFileSize; + + /// Popup list + CFLDPopupList* iPopupList; + + /// Using ROM tones only + TBool iRomTonesOnly; + }; + +#endif // __CFLDFILELISTMODEL_H__ + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDBrowserLauncher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDBrowserLauncher.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for Download tones feature +* +*/ + + + +// CLASS HEADER +#include "CFLDBrowserLauncher.h" + +// INTERNAL INCLUDES +#include "CFLDCommandAbsorbingControl.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include +#include // Context Id:s + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CFLDBrowserLauncher::CFLDBrowserLauncher +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CFLDBrowserLauncher::CFLDBrowserLauncher() + { + } + +// ----------------------------------------------------------------------------- +// CFLDBrowserLauncher::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CFLDBrowserLauncher::ConstructL() + { + iBrowserLauncher = CBrowserLauncher::NewL(); + iDocumentHandler = CDocumentHandler::NewL( CEikonEnv::Static()->Process() ); + } + +// ----------------------------------------------------------------------------- +// CFLDBrowserLauncher::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CFLDBrowserLauncher* CFLDBrowserLauncher::NewLC() + { + CFLDBrowserLauncher* self = new( ELeave ) CFLDBrowserLauncher(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// Destructor +CFLDBrowserLauncher::~CFLDBrowserLauncher() + { + delete iDocumentHandler; + delete iBrowserLauncher; + } + +// ----------------------------------------------------------------------------- +// CFLDBrowserLauncher::HandleContentL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CFLDBrowserLauncher::HandleContentL( + const TDesC& aFileName, + const CAiwGenericParamList& aParamList, TBool& aContinue ) + { + TBool isSaved( EFalse ); + + if( aParamList.Count() > 0 ) + { + TInt index( 0 ); + aParamList.FindFirst( index, EGenericParamFileSaved ); + + if( index != KErrNotFound ) + { + isSaved = ( aParamList[ index ].Value().AsTInt32() ); + } + + } + + // Tone is NOT yet saved by a browser, save it by using DocHandler + if(!isSaved) + { + //Let documenthandler to find out the datatype + TDataType nullType; + iDocumentHandler->CopyL( aFileName, KNullDesC, nullType, NULL ); + } + + aContinue = ETrue; + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CFLDBrowserLauncher::HandleContentL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TAny* CFLDBrowserLauncher::DownloadedContentHandlerReserved1( TAny* /*aAnyParam*/ ) + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// CFLDBrowserLauncher::LaunchBrowserL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDBrowserLauncher::LaunchBrowserL() + { + // Absorb all key events and commands until browsing is finished + CFLDCommandAbsorbingControl::NewLC(); // Discard pointer, it's in stack. + + iBrowserLauncher->LaunchBrowserSyncEmbeddedL( + KFavouritesAudioContextId ); + + CleanupStack::PopAndDestroy(); // Browsing finished, remove command absorber. + + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDBrowserLauncher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDBrowserLauncher.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for Download tones feature +* +*/ + + + +#ifndef CFLDBROWSERLAUNCHER_H +#define CFLDBROWSERLAUNCHER_H + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CDocumentHandler; +class CBrowserLauncher; + +// CLASS DECLARATION + +/** +* Implementation for Download tones feature. +* +* @lib FileList.lib +* @since 2.1 +*/ +NONSHARABLE_CLASS( CFLDBrowserLauncher ) : public CBase, + public MDownloadedContentHandler + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CFLDBrowserLauncher* NewLC(); + + virtual ~CFLDBrowserLauncher(); + + public: // New functions + + /** + * Launches Browser embedded. Waits until Browser is closed. + * @since 2.1 + */ + void LaunchBrowserL(); + + public: // Functions from base classes + + TBool HandleContentL( + const TDesC& aFileName, + const CAiwGenericParamList& aParamList, TBool& aContinue ); + + TAny* DownloadedContentHandlerReserved1( TAny* aAnyParam ); + + private: + + /** + * Default constructor + */ + CFLDBrowserLauncher(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + /// Own: Browser Launcher + CBrowserLauncher* iBrowserLauncher; + + /// Own: Document Handler for saving downloaded tones. + CDocumentHandler* iDocumentHandler; + + }; + +#endif // CFLDBROWSERLAUNCHER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDChangedItemObserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDChangedItemObserver.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the CFLDChangedItemObserver. +* +*/ + + + +// CLASS HEADER +#include "CFLDChangedItemObserver.h" + +// INTERNAL INCLUDES +#include "CFLDFileListModel.h" +#include "CFLDWaitNote.h" +#include "CFLDPopupList.h" +#include "CFLDController.h" + +const TInt KDefaultDelay( 3000000 ); +// EXTERNAL INCLUDES + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CFLDChangedItemObserver::CFLDChangedItemObserver +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CFLDChangedItemObserver::CFLDChangedItemObserver() + : iModel( NULL ) + { + } + +// ----------------------------------------------------------------------------- +// CFLDChangedItemObserver::CFLDChangedItemObserver +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CFLDChangedItemObserver::CFLDChangedItemObserver(CFLDWaitNote* aWaitNote) + : iModel( NULL ), + iDelay(KDefaultDelay) + { + } + +// ----------------------------------------------------------------------------- +// CFLDChangedItemObserver::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CFLDChangedItemObserver* CFLDChangedItemObserver::NewL() + { + CFLDChangedItemObserver* self = new (ELeave) CFLDChangedItemObserver(); + return self; + } + +// ----------------------------------------------------------------------------- +// CFLDChangedItemObserver::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CFLDChangedItemObserver* CFLDChangedItemObserver::NewL(CFLDWaitNote* aWaitNote) + { + CFLDChangedItemObserver* self = new (ELeave) CFLDChangedItemObserver(aWaitNote); + CleanupStack::PushL( self ); + self->ConstructL(aWaitNote); + CleanupStack::Pop( self ); + return self; + + } + +// ----------------------------------------------------------------------------- +// CFLDChangedItemObserver::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CFLDChangedItemObserver::ConstructL( CFLDWaitNote* aWaitNote) + { + iTimer = CPeriodic::NewL( EPriorityNormal ); + iWaitNote = aWaitNote; + } + +// Destructor +CFLDChangedItemObserver::~CFLDChangedItemObserver() + { + if (iTimer) + { + iTimer->Cancel(); + delete iTimer; + } + + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::SetFileListModel +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDChangedItemObserver::SetFileListModel( CFLDFileListModel* aModel ) + { + iModel = aModel; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::HandleItemChangeL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDChangedItemObserver::HandleItemChangeL( const TArray& /*aItemIDArray*/ ) + { + if( iModel ) + { + TRAP_IGNORE( static_cast(iModel->GetPopupList()->GetFileListBoxObserver())->Release()); + } + + if( iWaitNote && !iWaitNote->IsRunning() ) + { + iWaitNote->OpenWaitNoteL(); + } + + + if (iModel) + { + iTimer->Cancel(); + iTimer->Start( iDelay, iDelay, TCallBack( HandleModelRefreshL, this ) ); // CSI: 10 # iTimer is cancelled in Release() + + // When video screen is closed, + // listbox must be forced to be refreshed + // ( otherwise scrollbar is not redrawn) + iModel->GetPopupList()->ListBox()->SetDimmed( EFalse ); + iModel->GetPopupList()->ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse ); + iModel->GetPopupList()->DrawNow( CEikonEnv::Static()->EikAppUi()->ApplicationRect() ); + } + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::HandleModelRefreshL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CFLDChangedItemObserver::HandleModelRefreshL( TAny* aPtr ) + { + CFLDChangedItemObserver* observer= reinterpret_cast< CFLDChangedItemObserver* >( aPtr ); + observer->iTimer->Cancel(); + observer->iModel->RefreshEntryListL(); + + return 0; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::HandleError +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDChangedItemObserver::HandleError( TInt /*aError*/ ) + { + } +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDChangedItemObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDChangedItemObserver.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,121 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CLF changed item Observer. +* +*/ + + + +#ifndef __CFLDCHANGEDITEMOBSERVER_H__ +#define __CFLDCHANGEDITEMOBSERVER_H__ + +// INTERNAL INCLUDES + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CFLDFileListModel; +class CFLDWaitNote; +class CFLDController; +// CLASS DECLARATION + +/** +* CLF changed item Observer. +* CFLDChangedItemObserver receives operation events of Content +* Listing Framework. Operation event is generated when model +* has been changed ( for example file has been renamed ) +*/ +NONSHARABLE_CLASS( CFLDChangedItemObserver ) + : public CBase, + public MCLFChangedItemObserver + { + public: // Constructors and destructor + + /** + * Creates and returns a new instance of this class. + * @return Pointer to the CFLDChangedItemObserver object + */ + static CFLDChangedItemObserver* NewL(); + + /** + * Creates and returns a new instance of this class. + * @return Pointer to the CFLDChangedItemObserver object + */ + static CFLDChangedItemObserver* NewL(CFLDWaitNote* aWaitNote); + + /** + * Destructor. + */ + virtual ~CFLDChangedItemObserver(); + + private: // Constructors + /** + * C++ default constructor. + */ + CFLDChangedItemObserver(); + + /** + * C++ constructor. + */ + CFLDChangedItemObserver(CFLDWaitNote* aWaitNote); + + /** + * Second phase constructor + */ + void ConstructL(CFLDWaitNote* aWaitNote ); + + protected: // Methods derived from MCLFChangedItemObserver + + void HandleItemChangeL( const TArray& aItemIDArray ); + + void HandleError( TInt aError ); + + public: // New functions + /* + * Sets callback instance of filelist model + * @param aModel Instance of filelist model + */ + void SetFileListModel( CFLDFileListModel* aModel ); + + private: // New methods + + /** + * This callback method is called when the timer expires. Calls + * CFLDFileListModel::RefreshEntryListL(). + * @param aPtr pointer to CFLDChangedItemObserver + * @return Returns always zero + */ + static TInt HandleModelRefreshL( TAny* aPtr ); + + private: // Data + + /// Ref: FileList Model + CFLDFileListModel* iModel; + + /// Ref: Wait note dialog for indicating refreshing process of the List Model + CFLDWaitNote* iWaitNote; + + /// Own: Pointer to timer + CPeriodic* iTimer; + + /// The delay in microseconds until timer expires + TTimeIntervalMicroSeconds32 iDelay; + + }; + +#endif // __CFLDCHANGEDITEMOBSERVER_H__ + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDCommandAbsorbingControl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDCommandAbsorbingControl.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Command absorber to eat all key presses. +* +*/ + +// CLASS HEADER +#include "CFLDCommandAbsorbingControl.h" + +// INTERNAL INCLUDES + +// EXTERNAL INCLUDES +#include +#include +#include +#include + +// CONSTANTS +namespace + { + //position 0 --> left + const TInt KLeftPosition( 0 ); + //position 2 --> right + const TInt KRightPosition( 2 ); + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CFLDCommandAbsorbingControl::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CFLDCommandAbsorbingControl* CFLDCommandAbsorbingControl::NewL() + { + CFLDCommandAbsorbingControl* self = CFLDCommandAbsorbingControl::NewLC(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CFLDCommandAbsorbingControl::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CFLDCommandAbsorbingControl* CFLDCommandAbsorbingControl::NewLC() + { + CFLDCommandAbsorbingControl* self = new ( ELeave ) CFLDCommandAbsorbingControl(); + + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// Destructor +CFLDCommandAbsorbingControl::~CFLDCommandAbsorbingControl() + { + Release(); + } + + +// ----------------------------------------------------------------------------- +// CFLDCommandAbsorbingControl::CFLDPopupList +// C++ constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CFLDCommandAbsorbingControl::CFLDCommandAbsorbingControl() + { + } + + + +// ----------------------------------------------------------------------------- +// CFLDCommandAbsorbingControl::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CFLDCommandAbsorbingControl::ConstructL() + { + //if we don't have aplication ui, + //then there is no need to consume commands + iAppUi = CEikonEnv::Static()->EikAppUi(); + if( iAppUi ) + { + //add self to eat key events + iAppUi->AddToStackL( this, ECoeStackPriorityDialog ); + } + } + + +// ----------------------------------------------------------------------------- +// CFLDCommandAbsorbingControl::OfferKeyEventL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TKeyResponse CFLDCommandAbsorbingControl::OfferKeyEventL( const TKeyEvent& /*aKeyEvent*/, + TEventCode /*aType*/ ) + { + return EKeyWasConsumed; + } + +// ----------------------------------------------------------------------------- +// CFLDCommandAbsorbingControl::Release() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDCommandAbsorbingControl::Release() + { + if( iAppUi ) + { + //remove self + iAppUi->RemoveFromStack( this ); + } + } + +// ----------------------------------------------------------------------------- +// CFLDCommandAbsorbingControl::MakeCbaVisible() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDCommandAbsorbingControl::MakeCbaVisible( TBool aVisible ) const + { + //position 0 --> left + TInt leftId( iCba->ButtonGroup()->CommandId( KLeftPosition ) ); + //position 2 --> right + TInt rightId( iCba->ButtonGroup()->CommandId( KRightPosition ) ); + + iCba->MakeCommandVisible( leftId, aVisible ); + iCba->MakeCommandVisible( rightId, aVisible ); + + iCba->DrawNow(); + } + + +// End of File + + + + + + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDCommandAbsorbingControl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDCommandAbsorbingControl.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,108 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Command absorber to eat all key presses. +* +*/ + +#ifndef __CFLDCOMMANDABSORBINGCONTROL_H +#define __CFLDCOMMANDABSORBINGCONTROL_H + +// INTERNAL INCLUDES + +// EXTERNAL INCLUDES +#include + + +// FORWARD DECLARATIONS +class CEikAppUi; +class CEikButtonGroupContainer; + +// CLASS DECLARATION +/** + * Command absorber. + * + * Puts empty CBA on the screen and absorbs + * all the key events. + * + * @lib FileList.lib + * @since 2.1 + */ +NONSHARABLE_CLASS( CFLDCommandAbsorbingControl ) : public CCoeControl + { + public: + + /** + * Two-phased constructor. + */ + static CFLDCommandAbsorbingControl* NewL(); + + /** + * Two-phased constructor. + * Leaves object on the CleanupStack. + */ + static CFLDCommandAbsorbingControl* NewLC(); + + /** + * Destructor. + */ + virtual ~CFLDCommandAbsorbingControl(); + + private: + + /** + * Symbian OS constructor. + */ + void ConstructL(); + + + /** + * C++ default constructor. + */ + CFLDCommandAbsorbingControl(); + + public: // From CCoeControl + + /** + * Absorbing OfferkeyEvent() method. + * Absorbs all offered key events (returns + * always EKeyWasConsumed). + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + private: // own helpers + + void Release(); + + /** + * Alters CBA visibility. + * + * @since 2.1 + * @param aVisible If ETrue makes buttons visible. Else + * makes them invisible. + */ + void MakeCbaVisible( TBool aVisible ) const; + + private: //data + + /// Ref: Application under what we are running + CEikAppUi* iAppUi; + + /// Ref: Used CBA button container + CEikButtonGroupContainer* iCba; + }; + +#endif // __CFLDCOMMANDABSORBINGCONTROL_H +// End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDController.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDController.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,414 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CFLDController observes the list box and invokes a MFLDFileProcessor +* if the timer expires. +* +* +*/ + + +// CLASS HEADER +#include "CFLDController.h" + +// INTERNAL INCLUDES +#include "MFLDFileObserver.h" +#include "CFLDRingingTonePlayer.h" + +#ifdef RD_VIDEO_AS_RINGING_TONE + #include "CFLDVideoPlayer.h" + #include "CFLDSoftKeyChanger.h" +#endif + +// EXTERNAL INCLUDES +#include +#include +#include +#include // For PathInfo + +#include +#include + + +// CONSTANTS +namespace + { + _LIT( KFLDResourceFileName, "FileList.RSC" ); + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CFLDController::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CFLDController* CFLDController::NewL( TBool aShowErrorMsgs, + TTimeIntervalMicroSeconds32 aDelay ) + { + CFLDController* self = CFLDController::NewLC( aShowErrorMsgs, aDelay ); + CleanupStack::Pop( self ); // self + + return self; + } + +// ----------------------------------------------------------------------------- +// CFLDController::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CFLDController* CFLDController::NewLC( TBool aShowErrorMsgs, + TTimeIntervalMicroSeconds32 aDelay ) + { + CFLDController* self = new( ELeave ) CFLDController( aShowErrorMsgs, aDelay ); + CleanupStack::PushL( self ); + + self->ConstructL( ); + return self; + } + +// Destructor +EXPORT_C CFLDController::~CFLDController() + { + iResourceLoader.Close(); + + Release(); + + delete iTimer; + delete iAudioProcessor; + +#ifdef RD_VIDEO_AS_RINGING_TONE + delete iSoftKeyChanger; + delete iVideoProcessor; +#endif + } + +// ----------------------------------------------------------------------------- +// CFLDController::Release +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDController::Release() + { + iTimer->Cancel(); + iAudioProcessor->Cancel(); + +#ifdef RD_VIDEO_AS_RINGING_TONE + iVideoProcessor->Cancel(); +#endif + } + +// ----------------------------------------------------------------------------- +// CFLDController::CFLDFileListModel +// C++ constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CFLDController::CFLDController( TBool aShowErrorMsgs, + TTimeIntervalMicroSeconds32 aDelay ) + : iDelay( aDelay ), + iShowErrorMsgs( aShowErrorMsgs ), + iResourceLoader( *( CCoeEnv::Static() ) ) + { + } + +// ----------------------------------------------------------------------------- +// CFLDController::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CFLDController::ConstructL() + { + TFileName* fn = new (ELeave) TFileName + ( TParsePtrC( PathInfo::RomRootPath() ).Drive() ); + CleanupStack::PushL( fn ); + + fn->Append( KDC_RESOURCE_FILES_DIR ); + fn->Append( KFLDResourceFileName ); + iResourceLoader.OpenL( *fn ); + CleanupStack::PopAndDestroy( fn ); + + iTimer = CPeriodic::NewL( EPriorityNormal ); + iAudioProcessor = CFLDRingingTonePlayer::NewL( iShowErrorMsgs ); + +#ifdef RD_VIDEO_AS_RINGING_TONE + iVideoProcessor = CFLDVideoPlayer::NewL( iShowErrorMsgs ); + iSoftKeyChanger = CFLDSoftKeyChanger::NewL(); +#endif + } + +// ----------------------------------------------------------------------------- +// CFLDController::CompleteConstructionL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDController::CompleteConstructionL( RWindow& aWindow ) + { + iWindow = &aWindow; + } + +// ----------------------------------------------------------------------------- +// CFLDController::SetDelay() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDController::SetDelay( TTimeIntervalMicroSeconds32 aDelay ) + { + iDelay = aDelay; + } + + +// ----------------------------------------------------------------------------- +// CFLDController::SetVolume() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDController::SetVolume( TInt aVolume ) + { + iRingingVolume = aVolume; + iAudioProcessor->SetVolume( iRingingVolume ); + +#ifdef RD_VIDEO_AS_RINGING_TONE + iVideoProcessor->SetVolume( iRingingVolume ); +#endif + } + +// ----------------------------------------------------------------------------- +// CFLDController::SetRingingType() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDController::SetRingingType( TInt aRingingType ) + { + iRingingType = aRingingType; + iAudioProcessor->SetRingingType( iRingingType ); + +#ifdef RD_VIDEO_AS_RINGING_TONE + iVideoProcessor->SetRingingType( iRingingType ); +#endif + } + +// ----------------------------------------------------------------------------- +// CFLDController::SetVibra() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDController::SetVibra( TBool aVibra ) + { + iVibra = aVibra; + iAudioProcessor->SetVibra( iVibra ); + +#ifdef RD_VIDEO_AS_RINGING_TONE + iVideoProcessor->SetVibra( iVibra ); +#endif + } + +// ----------------------------------------------------------------------------- +// CFLDController::SetFileObserver() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDController::SetFileObserver( MFLDFileObserver* aFileObserver ) + { + iFileObserver = aFileObserver; + } + +// ----------------------------------------------------------------------------- +// CFLDController::Set3dEffects() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDController::Set3dEffects( TBool a3dEffects ) + { + i3dEffects = a3dEffects; + iAudioProcessor->Set3dEffects( i3dEffects ); + } + +// ----------------------------------------------------------------------------- +// CFLDController::HandleSoftKeyState() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDController::HandleSoftKeyState( TFileListSoftKeyState& aSoftKeyState ) + { +#ifdef RD_VIDEO_AS_RINGING_TONE + aSoftKeyState = iSoftKeyChanger->SoftKeyState(); +#else + aSoftKeyState = EToneSelectionSoftKeyState; // Just remove compiler warnings +#endif + } + +// ----------------------------------------------------------------------------- +// CFLDController::HandleFileListBoxEventL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDController::HandleFileListBoxEventL( TFileListBoxEvent aEvent, + const TDesC& aFileName ) + { + iCurrentFile = aFileName; + + switch( aEvent ) + { + // User changes focus in tonelist + case EFocusChanged: + { + Release(); +#ifdef RD_VIDEO_AS_RINGING_TONE + iSoftKeyChanger->RestoreOldToneSelectionSoftKeysL(); +#endif + + if( iDelay >= TTimeIntervalMicroSeconds32( 0 ) ) + { + iTimer->Start( iDelay, iDelay, TCallBack( HandleTimerTickL, this ) ); // CSI: 10 # iTimer is cancelled in Release() + } + break; + } + + // Some other key was pressed than softkeys + case EOtherKeyEvent: + { + Release(); +#ifdef RD_VIDEO_AS_RINGING_TONE + iSoftKeyChanger->RestoreOldToneSelectionSoftKeysL(); +#endif + break; + } + + // User selects the video or audio as ringingtone in tonelist + case EListBoxClosed: + { + Release(); + + if( iDelay >= TTimeIntervalMicroSeconds32( 0 ) ) + { + iTimer->Start( iDelay, iDelay, TCallBack( HandleTimerTickL, this ) ); // CSI: 10 # iTimer is cancelled in Release() + } + break; + } + +#ifdef RD_VIDEO_AS_RINGING_TONE + // Video has been focused for 1s and preview cba is selected + case EVideoPreview: + { + Release(); + iSoftKeyChanger->ChangeNewSoftKeysPreviewL(); + if( iRingingType != ERingingTypeBeepOnce ) + { + iVideoProcessor->ProcessFileL( iCurrentFile, iWindow ); + } + else + { + // BeebOnce + iAudioProcessor->ProcessFileL( iCurrentFile, NULL ); + iVideoProcessor->ProcessFileL( iCurrentFile, iWindow ); + } + iSoftKeyChanger->ChangeNewSoftKeysPreviewSelectL(); + break; + } + + + // Video is running in preview window and user has selected it + case EVideoPreviewSelected: + { + // Cleanup is done in destructor + break; + } + + // Video is running in preview window and user has canceled it + case EVideoPreviewCanceled: + { + // Only cancel and restore softkeys if video is being previewed + if( iSoftKeyChanger->SoftKeyState() == EPreviewSelectSoftKeyState ) + { + Release(); + iSoftKeyChanger->RestoreOldToneSelectionSoftKeysL(); + } + break; + } +#endif + + default: + { + break; + } + + }; + } + +// ----------------------------------------------------------------------------- +// CFLDController::HandleTimerTickL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CFLDController::HandleTimerTickL( TAny* aPtr ) + { + CFLDController* controller = reinterpret_cast< CFLDController* >( aPtr ); + controller->iTimer->Cancel(); + +#ifdef RD_VIDEO_AS_RINGING_TONE + TBool isVideo( EFalse ); + if( controller->iFileObserver ) + { + if( controller->iFileObserver->MediaFileType( + controller->iCurrentFile ) == ECLFMediaTypeVideo ) + { + isVideo = ETrue; + } + } + + if( isVideo ) + { + // File is video + // If it is OMA DRM 2 protected, it cannot be previewed in FileList (yet) + using namespace ContentAccess; + CContent* content = CContent::NewLC( controller->iCurrentFile, + EContentShareReadWrite ); + TInt deliveryMethod = 0; + content->GetAttribute( EDeliveryMethod, deliveryMethod ); + CleanupStack::PopAndDestroy(); // content + if( deliveryMethod != EOmaDrm2 ) + { + // Change softkeys for preview + controller->iSoftKeyChanger->ChangeNewSoftKeysPreviewL(); + } + } + else + { + // File is audio + if( ( controller->iFileObserver && + !controller->iFileObserver->IsFileValidL( + controller->iCurrentFile, MFLDFileObserver::EPlay ) ) ) + { + // If there is a file observer and the file is not valid, + // don't call ProcessFileL. + return 0; + } + controller->iAudioProcessor->ProcessFileL( controller->iCurrentFile, NULL ); + } +#else + if( ( controller->iFileObserver && + !controller->iFileObserver->IsFileValidL( + controller->iCurrentFile, MFLDFileObserver::EPlay ) ) ) + { + // If there is a file observer and the file is not valid, + // don't call ProcessFileL. + return 0; + } + controller->iAudioProcessor->ProcessFileL( controller->iCurrentFile, NULL ); +#endif + + return 0; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDDRMImplementation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDDRMImplementation.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,451 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the CFLDDRMImplementation. +* +*/ + + + +// CLASS HEADER +#include "CFLDDRMImplementation.h" + +// INTERNAL INCLUDES +#include "CFLDRingingTonePlayer.h" // KFLDResourceFileName + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include + +#ifdef RD_DRM_COMMON_INTERFACE_FOR_OMA_AND_WMDRM +#include +#include +#endif + +// CONSTANTS +namespace + { + _LIT( KFLDROMDriveLetter, "Z:" ); + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CFLDDRMImplementation::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CFLDDRMImplementation::ConstructL() + { + iProfilesFeatures = &( ProfileUtilityInstanceL().ProfilesLocalFeatures() ); + iDRMCommon = DRMCommon::NewL(); + User::LeaveIfError( iDRMCommon->Connect() ); + iDRMHelper = CDRMHelper::NewL( *CCoeEnv::Static() ); + } + +// Destructor +CFLDDRMImplementation::~CFLDDRMImplementation() + { + delete iDRMHelper; + + if( iDRMCommon ) + { + iDRMCommon->Disconnect(); // ignore possible error + delete iDRMCommon; + } + ReleaseProfileUtility(); + } + +// ----------------------------------------------------------------------------- +// CFLDDRMImplementation::SetAutomatedType +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDDRMImplementation::SetAutomatedType( + CDRMHelper::TDRMHelperAutomatedType aAutomatedType ) + { + iAutomatedType = aAutomatedType; + } + +// ----------------------------------------------------------------------------- +// CFLDDRMImplementation::IsFileValidL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CFLDDRMImplementation::IsFileValidL( + const TDesC& aFileName, TIntention aIntention ) + { + // If the destructor is empty, return that it's valid + if( aFileName.Compare( KNullDesC ) == 0 ) + { + return ETrue; + } + + // Tone files on ROM are always valid + if( ( aFileName.Left( KFLDROMDriveLetter().Length() ).CompareF( + KFLDROMDriveLetter ) == 0 ) ) + { + return ETrue; + } + + // Check if file is WMDRM protected + TBool prot( EFalse ); + TRAPD( err, prot = IsFileWMDRMProtectedL( aFileName ) ); + if( err != KErrNone ) + { + ShowErrorNoteL( R_FLD_QTN_FILE_FORMAT_ERROR ); + return EFalse; + } + if( prot ) + { + ShowErrorNoteL( R_FLD_QTN_PROFILES_INFO_TONE_DRM_PROTECTED ); + return EFalse; + } + + ContentAccess::TVirtualPathPtr path( aFileName, + ContentAccess::KDefaultContentObject ); + CData* data = CData::NewLC( path, EContentShareReadWrite ); + TInt isProtected; + TInt error = data->GetAttribute( EIsProtected, isProtected ); + CleanupStack::PopAndDestroy(); // data + + if( error != DRMCommon::EOk ) + { + // DRM Helper class knows at least rights db corrupted error message. + // Leaves on system-wide error code. + iDRMHelper->HandleErrorL( error, aFileName ); + return EFalse; + } + + // Obtain information whether the file can be set as automated content + TBool canSetAutomated( EFalse ); + TInt canSetAutomatedErr( iDRMHelper->CanSetAutomated( aFileName, canSetAutomated ) ); + + if( !isProtected && canSetAutomated ) + { + // The file in question is not DRM protected. + // Return ETrue if file is also Ok unprotected, otherwise EFalse. + return IsFileValidUnprotectedL( aFileName, aIntention ); + } + + // Operator requirement: Check restrictions if file is mp4 audio + TBuf dataType( DataTypeL( aFileName ).Des() ); + if( iProfilesFeatures->IsBlockedProtectedType( dataType ) ) + { + ShowErrorNoteL( R_FLD_QTN_PROFILES_INFO_TONE_DRM_PROTECTED ); + return EFalse; + } + + if ( canSetAutomatedErr == DRMCommon::ERightsExpired || + canSetAutomatedErr == DRMCommon::ENoRights ) + { + // Rights are expired, future rights or missing + iDRMHelper->HandleErrorL( canSetAutomatedErr, aFileName ); + return EFalse; + } + + // Operator requirement: Check DRM v2 tones + if( !canSetAutomated ) + { + // This is DRM v2 file OR count based v1 tone + ShowErrorNoteL( aIntention == EPlay ? + R_FLD_QTN_DRM_PREV_RIGHTS_USE : R_FLD_QTN_DRM_PREV_RIGHTS_SET); + return EFalse; + } + + TInt32 infoBits( 0x00000000 ); + + // Find out rights information + if( !CFLDDRMImplementation::GetFileInfoL( + aFileName, infoBits ) ) + { + // Corrupted file or "No rights" situation + return EFalse; + } + + // Operator requirement: Check CFM protection + if ( infoBits & ENoRingingTone ) + { + // This is CFM protected file, ringingtone is set to "no" + ShowErrorNoteL( aIntention == EPlay ? + R_FLD_QTN_DRM_PREV_RIGHTS_USE : R_FLD_QTN_DRM_PREV_RIGHTS_SET); + return EFalse; + } + + if( aIntention == ESelect ) + { + // Rights are good to go, and intention is selection + // call SetAutomatedPassive to show 'activation query' + iDRMHelper->SetAutomatedType( iAutomatedType ); + error = iDRMHelper->SetAutomatedPassive( aFileName ); + if( error != KErrCancel ) + { + // User accepted dialog + User::LeaveIfError( error ); + // New way, does not require DRM capability + data = CData::NewLC( path, EContentShareReadWrite ); + error = data->ExecuteIntent( ContentAccess::EPlay ); + // Wrongly requires DRM after all. According to Risto Vilkman + // from DRM, KErrAccessDenied can be ignored, since if + // CanSetAutomated says the tone is OK, it's OK. + if ( error != KErrNone && error != KErrAccessDenied ) + { + User::Leave( error ); + } + CleanupStack::PopAndDestroy(); // data + } + else + { + // User canceled dialog + return EFalse; + } + } + + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CFLDDRMImplementation::GetFileInfo +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CFLDDRMImplementation::GetFileInfoL( + const TDesC& aFileName, TInt32& aInfoBits ) const + { + DRMCommon::TContentProtection contentProtection; // ignored + HBufC8* mimeType = NULL; // ignored + TUint dataLength( 0 ); // ignored + HBufC8* contentURI( NULL ); + + // Obtain content URI + TInt error = iDRMCommon->GetFileInfo( + aFileName, contentProtection, mimeType, contentURI, dataLength ); + delete mimeType; + + if( error != DRMCommon::EOk ) + { + delete contentURI; + // Handle possible corrupt file situation + iDRMHelper->HandleErrorL( error, aFileName ); + return EFalse; + } + + // Obtain rights object + CDRMRights* rights = NULL; + error = iDRMCommon->GetActiveRights( *contentURI, DRMCommon::EPlay, rights ); + delete contentURI; + + if( error == DRMCommon::ENoRights ) + { + delete rights; + // There is no rights for given file + // Should never arrive here, ENoRights is handled + // already in IsFileValidL() + iDRMHelper->HandleErrorL( error, aFileName ); + return EFalse; + } + + // Obtain infobits ( needed only for CFM case ) + aInfoBits = rights->GetPermission().iInfoBits; + delete rights; + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// +// Functions related to WMDRM protection check +// +// ----------------------------------------------------------------------------- + +#ifndef RD_DRM_COMMON_INTERFACE_FOR_OMA_AND_WMDRM + +// Some magic constants +static const TInt KMinContentLength( 16 ); +//_LIT8( KContentProtectionType, "DRM" ); +_LIT8( KASFHeaderObject, "75B22630668E11CFA6D900AA0062CE6C" ); +_LIT8( KWrmHeader, "W\0R\0M\0H\0E\0A\0D\0E\0R\0" ); + +// ----------------------------------------------------------------------------- +// FormatGUID +// ----------------------------------------------------------------------------- +// +LOCAL_C void FormatGUID( TDes8& aGUID ) + { + TBuf8<16> copyGUID( aGUID ); + TInt i; + for( i = 0; i < 4; i++ ) + { + copyGUID[i] = aGUID[3-i]; + } + for( i = 4; i < 6; i++ ) + { + copyGUID[i] = aGUID[9 - i]; + } + for( i = 6; i < 8; i++ ) + { + copyGUID[i] = aGUID[13 - i]; + } + for( i = 8; i < 16 ; i++ ) + { + copyGUID[i] = aGUID[i]; + } + aGUID.Delete( 0, 32 ); + for( i = 0; i <16; i++ ) + { + aGUID.AppendNumFixedWidthUC( copyGUID[i], EHex, 2 ); + } + } + +// ----------------------------------------------------------------------------- +// ConvertToInt64 +// ----------------------------------------------------------------------------- +// +LOCAL_C TInt64 ConvertToInt64( TDesC8& aDes ) + { + TInt64 num = 0; + TInt i; + for( i = 7 ; i >= 0; i-- ) + { + num <<= 8; + num |= aDes[i]; + } + return num; + } + + +// ----------------------------------------------------------------------------- +// IsProtectedWmDrmL +// returns ETrue, if file is protected WMDRM file +// EFalse if file is not protected WMDRM file +// Leaves with KErrUnderflow if file has too little data to decide +// whether WmDrm or not +// may also leave with other system wide error code +// ----------------------------------------------------------------------------- +// +LOCAL_C TBool IsProtectedWmDrmL( RFile& aFileHandle ) + { + TInt r( KErrNone ); + HBufC8* buffer( NULL ); + TInt pos( 0 ); + RFile file; + TBuf8< 32 > header; + + TInt64 headerSize( 0 ); + TBool isProtectedWmDrm( EFalse ); + TPtr8 headerPtr( NULL, 0 ); + + // Leave if given handle is invalid + if( !aFileHandle.SubSessionHandle() ) + { + User::Leave( KErrBadHandle ); + } + + User::LeaveIfError( file.Duplicate( aFileHandle ) ); + CleanupClosePushL( file ); + + User::LeaveIfError( file.Seek( ESeekStart, pos ) ); + + // Check if the file is an ASF file + // : Check on runtime wether WM DRM is supporeted or not + + User::LeaveIfError( file.Read( 0, header, KMinContentLength ) ); + if( header.Length() < KMinContentLength ) + { + User::Leave( KErrUnderflow ); + } + + FormatGUID( header ); + + if( header == KASFHeaderObject ) + { + // It's ASF, check still whether it's WM DRM protected or not + file.Read( header,8 ); + headerSize = ConvertToInt64( header ); + if( headerSize <= 30 ) + { + User::Leave( KErrUnderflow ); + } + if ( headerSize > ( ( KMaxTInt32 / 2 ) - 1 ) ) + { + User::Leave( KErrOverflow ); + } + buffer = HBufC8::NewLC( headerSize ); + + headerPtr.Set( buffer->Des() ); + User::LeaveIfError( file.Read( headerPtr, headerSize - 24 ) ); + + r = headerPtr.Find( KWrmHeader ); + if ( KErrNotFound != r ) + { + isProtectedWmDrm = ETrue; + } + CleanupStack::PopAndDestroy( buffer ); // buffer + } + CleanupStack::PopAndDestroy(); // file + + return isProtectedWmDrm; + } + +#endif // RD_DRM_COMMON_INTERFACE_FOR_OMA_AND_WMDRM + +// ----------------------------------------------------------------------------- +// CFLDDRMImplementation::IsFileWMDRMProtectedL +// ----------------------------------------------------------------------------- +// +TBool CFLDDRMImplementation::IsFileWMDRMProtectedL( const TDesC& aFileName ) const + { + TBool res = EFalse; + RFs& fsSession( CCoeEnv::Static()->FsSession() ); + RFile hFile; + + TInt err = hFile.Open( fsSession, aFileName, + EFileRead | EFileStream | EFileShareReadersOnly ); + if( err == KErrInUse ) + { + err = hFile.Open( fsSession, aFileName, + EFileRead | EFileStream | EFileShareAny ); + } + if( err != KErrNone ) + { + User::Leave( err ); + } + CleanupClosePushL( hFile ); + +#ifdef RD_DRM_COMMON_INTERFACE_FOR_OMA_AND_WMDRM + TPtrC agent( KNullDesC ); + DRM::CDrmUtility* drmUtil( DRM::CDrmUtility::NewLC() ); + drmUtil->GetAgentL( hFile, agent ); + if( agent.Compare( DRM::KDrmWMAgentName ) == 0 ) + { + res = ETrue; + } + CleanupStack::PopAndDestroy( drmUtil ); +#else + res = IsProtectedWmDrmL( hFile ); +#endif + + CleanupStack::PopAndDestroy( &hFile ); + return res; + } + +// ----------------------------------------------------------------------------- +// +// End of Functions related to WMDRM protection check +// +// ----------------------------------------------------------------------------- + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDDRMImplementation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDDRMImplementation.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,171 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for DRM functionality. +* +*/ + + + +#ifndef CFLDDRMIMPLEMENTATION_H +#define CFLDDRMIMPLEMENTATION_H + +// INTERNAL INCLUDES +#include "MFLDFileObserver.h" + +// EXTERNAL +#include +#include // KMaxDataTypeLength +#include +#include +#include // For TDRMHelperAutomatedType +#include // For TRestriction + +// FORWARD DECLARATIONS +class DRMCommon; +class CDRMHelper; +class CFLDFileListModel; +class MProfilesLocalFeatures; + +// CLASS DECLARATION + +/** +* Implementation for DRM functionality. +* +* @lib filelist.lib +* @since 2.1 +*/ +NONSHARABLE_CLASS( CFLDDRMImplementation ) : public CBase, public MFLDFileObserver + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CFLDDRMImplementation* NewL( CFLDFileListModel* aModel ); + + /** + * Destructor. + */ + virtual ~CFLDDRMImplementation(); + + public: // Functions from base classes + + /** + * From MFLDFileObserver. + */ + TBool IsFileValidL( const TDesC& aFileName, TIntention aIntention ); + + /** + * From MFLDFileObserver. + */ + TInt32 MediaFileType( const TDesC& aFileName ) const; + + public: // New functions + + /** + * Set the automated content type + * @param aAutomatedType: type of automated content + */ + void SetAutomatedType( + CDRMHelper::TDRMHelperAutomatedType aAutomatedType ); + + + private: // New functions + + /** + * Displays an error note. + * @since 2.1 + * @param @aResourceId Resource ID for a TBUF resource containing the error text. + */ + void ShowErrorNoteL( TInt aResourceId ) const; + + /** + * Checks if an unprotected file is valid. + * @param aFileName Full path and filename. + * @param aIntention Describes what is the file used for. + * @return Returns ETrue if the file is valid for intended use. + */ + TBool IsFileValidUnprotectedL( + const TDesC& aFileName, TIntention aIntention ) const; + + /** + * Returns info whether demoplay is allowed for given filetype + * @param aDataType Tone MIME type + * @return ETrue if tone allowed to be played + */ + TBool AllowDemoPlay( const TDesC& aDataType ) const; + + /** + * Returns info whether given filetype is allowed as ringingtone + * @param aDataType Tone MIME type + * @return ETrue if tone is allowed to be selected + */ + TBool AllowSelect( const TDesC& aDataType ) const; + + /** + * Finds out the MIME type of a given file + * @param aFileName File to be checked + * @return Returns datatype of a file + */ + TDataType DataTypeL( const TDesC& aFileName ) const; + + /** + * Finds out DRM restrictions for a given file + * @param aFileName File to be checked + * @param aInfoBits(out) Determines CFM protection + * @return Returns EFalse if file is corrupted or has no rights + */ + TBool GetFileInfoL( const TDesC& aFileName, + TInt32& aInfoBits ) const; + + /** + * Checks if file is WMDRM protected. + * @param aFileName Name of the file to be checked. + * @return ETrue if file is WMDRM protected, EFalse otherwise. + */ + TBool IsFileWMDRMProtectedL( const TDesC& aFileName ) const; + + private: + + /** + * C++ default constructor. + */ + CFLDDRMImplementation( CFLDFileListModel* aModel ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + + /// Own: DRM common functions + DRMCommon* iDRMCommon; + + /// Own: DRM helper + CDRMHelper* iDRMHelper; + + /// Not owned: FileList model + CFLDFileListModel* iModel; + + /// Automated content type + CDRMHelper::TDRMHelperAutomatedType iAutomatedType; + + /// Not owned: Profiles local features + MProfilesLocalFeatures* iProfilesFeatures; + }; + +#endif // CFLDDRMIMPLEMENTATION_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDDRMImplementationCommon.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDDRMImplementationCommon.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,146 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the CFLDDRMImplementation. +* +*/ + + + +// CLASS HEADER +#include "CFLDDRMImplementation.h" + +// INTERNAL INCLUDES +#include "CFLDRingingTonePlayer.h" +#include "CFLDFileListModel.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CFLDDRMImplementation::CFLDDRMImplementation +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CFLDDRMImplementation::CFLDDRMImplementation( CFLDFileListModel* aModel ) + : iModel( aModel ), + iAutomatedType( CDRMHelper::EAutomatedTypeRingingTone ) + { + } + +// ----------------------------------------------------------------------------- +// CFLDDRMImplementation::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CFLDDRMImplementation* CFLDDRMImplementation::NewL( CFLDFileListModel* aModel ) + { + CFLDDRMImplementation* self = new( ELeave ) CFLDDRMImplementation( aModel ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CFLDDRMImplementation::ShowErrorNoteL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDDRMImplementation::ShowErrorNoteL( TInt aResourceId ) const + { + HBufC* errorText = StringLoader::LoadLC( aResourceId ); + CAknInformationNote* note = new( ELeave ) CAknInformationNote( EFalse ); + + note->ExecuteLD( *errorText ); + + // errorText + CleanupStack::PopAndDestroy( errorText ); + } + +// ----------------------------------------------------------------------------- +// CFLDDRMImplementation::IsFileValidUnprotectedL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CFLDDRMImplementation::IsFileValidUnprotectedL( + const TDesC& aFileName, TIntention aIntention ) const + { + TBuf tempDataType( DataTypeL( aFileName ).Des() ); + + if( iProfilesFeatures->IsBlockedType( tempDataType ) ) + { + if( aIntention == ESelect ) + { + ShowErrorNoteL( R_FLD_QTN_TEXT_NOT_ALLOWED ); + } + return EFalse; + } + + // Operator requirement. Check if DRM is required with tones. + if( aIntention == EPlay ) + { + if( iProfilesFeatures->IsBlockedDemoPlayType( tempDataType ) ) + { + return EFalse; + } + } + else + { + if( iProfilesFeatures->IsBlockedUnprotectedType( tempDataType ) ) + { + ShowErrorNoteL( R_FLD_QTN_PROFILES_INFO_TONE_NO_DRM ); + return EFalse; + } + } + + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CFLDDRMImplementation::DataTypeL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TDataType CFLDDRMImplementation::DataTypeL( + const TDesC& aFileName ) const + { + RApaLsSession apaLsSession; + User::LeaveIfError( apaLsSession.Connect() ); + CleanupClosePushL( apaLsSession ); + + TUid dummyUid = { 0 }; // instantiate as zero + TDataType dataType( dummyUid ); + User::LeaveIfError( + apaLsSession.AppForDocument( aFileName, dummyUid, dataType ) ); + + CleanupStack::PopAndDestroy(); // apaLsSession.Close() + return dataType; + } + +// ----------------------------------------------------------------------------- +// CFLDDRMImplementation::MediaFileType +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt32 CFLDDRMImplementation::MediaFileType( const TDesC& aFileName ) const + { + return iModel->MediaFileType( aFileName ); + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDDRMImplementationEmpty.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDDRMImplementationEmpty.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the CFLDDRMImplementation. +* +*/ + + + +// INCLUDE FILES +#include "CFLDDRMImplementation.h" + +#include +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CFLDDRMImplementation::ConstructL +// Empty implementation +// ----------------------------------------------------------------------------- +// +void CFLDDRMImplementation::ConstructL() + { + iDRMCommon = DRMCommon::NewL(); + User::LeaveIfError( iDRMCommon->Connect() ); + } + +// Destructor +CFLDDRMImplementation::~CFLDDRMImplementation() + { + if( iDRMCommon ) + { + iDRMCommon->Disconnect(); // ignore possible error + delete iDRMCommon; + } + } + +// ----------------------------------------------------------------------------- +// CFLDDRMImplementation::IsFileValidL +// Empty implementation +// ----------------------------------------------------------------------------- +// +TBool CFLDDRMImplementation::IsFileValidL( + const TDesC& aFileName, TIntention aIntention ) + { + TBool isValidUnprotected( ETrue ); + + if( aFileName.Compare( KNullDesC ) != 0 ) + { + TBool isProtected( EFalse ); + iDRMCommon->IsProtectedFile( aFileName, isProtected ); + if( !isProtected ) + { + // The file in question is not a DCF file. + // Return ETrue if file is also Ok unprotected, otherwise EFalse. + isValidUnprotected = + IsFileValidUnprotectedL( aFileName, aIntention ); + } + } + + return isValidUnprotected; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDEntryReference.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDEntryReference.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* A simple container class that is used to reference a single +* entry in the file list. +* +* +*/ + + +// CLASS HEADER +#include "CFLDEntryReference.h" + +// INTERNAL INCLUDES + +// EXTERNAL INCLUDES + +// ================= MEMBER FUNCTIONS ======================= + +// Constructor +CFLDEntryReference::CFLDEntryReference() + { + } + +// Destructor +CFLDEntryReference::~CFLDEntryReference() + { + delete iFormattedPresentation; + delete iPathAndMediaFileName; + } + +// ----------------------------------------------------------------------------- +// CFLDEntryReference::FormattedPresentation() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +HBufC& CFLDEntryReference::FormattedPresentation() const + { + return *iFormattedPresentation; + } + +// ----------------------------------------------------------------------------- +// CFLDEntryReference::PathAndMediaFileName() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +HBufC& CFLDEntryReference::PathAndMediaFileName() const + { + return *iPathAndMediaFileName; + } + +// ----------------------------------------------------------------------------- +// CFLDEntryReference::MediaType() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt32 CFLDEntryReference::MediaType() const + { + return iMediaType; + } + +// ----------------------------------------------------------------------------- +// CFLDEntryReference::SetPathAndMediaFileName() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDEntryReference::SetPathAndMediaFileName( HBufC* aPathAndMediaFileName ) // CSI: 60 # ownership is transferred + { + delete iPathAndMediaFileName; + iPathAndMediaFileName = NULL; + + iPathAndMediaFileName = aPathAndMediaFileName; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::SetAutomatedType() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDEntryReference::SetFormattedPresentation( HBufC* aFormattedPresentation ) // CSI: 60 # ownership is transferred + { + delete iFormattedPresentation; + iFormattedPresentation = NULL; + + iFormattedPresentation = aFormattedPresentation; + } + +// ----------------------------------------------------------------------------- +// CFLDEntryReference::SetMediaType() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDEntryReference::SetMediaType( TInt32 aMediaType ) + { + iMediaType = aMediaType; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDEntryReference.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDEntryReference.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* A simple container class that is used to reference a single +* entry in the file list. +* +* +*/ + + +#ifndef __CFLDENTRYREFERENCE_H +#define __CFLDENTRYREFERENCE_H + +// INTERNAL INCLUDES + +// EXTERNAL INCLUDES +#include +#include + +// CLASS DECLARATION + +/** +* A simple container class that is used to reference a single +* entry in the file list. +* +* @lib filelist.lib +* @since 2.1 +*/ +NONSHARABLE_CLASS( CFLDEntryReference ): public CBase + { + public: + + /** + * Constructor + * @param aDirectory Pointer to directory + */ + CFLDEntryReference(); + + /** + * Destructor + */ + virtual ~CFLDEntryReference(); + + public: // New functions + + /** + * Sets media type + * @param aMediaType Media type + */ + void SetMediaType( TInt32 aMediaType ); + + /** + * Sets path and filename + * @param aPathAndMediaFileName Path and filename, ownership transferred + */ + void SetPathAndMediaFileName( HBufC* aPathAndMediaFileName ); + + /** + * Sets formatted presentation + * @param aFormattedPresentation Formatted presentation, ownership + * transferred + */ + void SetFormattedPresentation( HBufC* aFormattedPresentation ); + + /** + * Gets formatted presentation + * @return Reference to formatted presentation + */ + HBufC& FormattedPresentation() const; + + /** + * Gets path and filename + * @return Reference to path and filename + */ + HBufC& PathAndMediaFileName() const; + + /** + * Gets Media type + * @return Media type + */ + TInt32 MediaType() const; + + private: // Data + + /// Own: Listbox formatted data + /// However, not created by CFLDEntryReference + HBufC* iPathAndMediaFileName; + + /// Own: Listbox formatted data + /// However, not created by CFLDEntryReference + HBufC* iFormattedPresentation; + + /// Media type + TInt32 iMediaType; + + }; + +#endif // __CFLDENTRYREFERENCE_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDFileListContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDFileListContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,514 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* A wrapper class, which is part of an example implementation of tone +* selection list. It owns the list box, the model, and the controller, +* and it is used to launch the popup list. +* If you need to use a different list box style or a different file, +* processor replace this class with your own container. +* +* +*/ + + +// CLASS HEADER +#include "CFLDFileListContainer.h" + +// INTERNAL INCLUDES +#include "CFLDPopupList.h" +#include "CFLDDRMImplementation.h" +#include "CFLDBrowserLauncher.h" +#include "CFLDSingleGraphicEntryFormatter.h" +#include "FLDListBoxTemplate.h" +#include "CFLDController.h" +#include "CFLDFileListModel.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include +#include // Profiles engine internal Central Repository keys +#include + +// CONSTANTS +namespace + { + // MIME types + _LIT( KFLDAMRMimeType, "audio/amr" ); +#ifndef __WMA + _LIT( KFLDAudioWMA, "audio/x-ms-wma" ); +#endif + + _LIT( KFLDResourceFileName, "FileList.RSC" ); + + // Default delay 1000000 = 1sec + const TInt KDefaultDelay( 1000000 ); + } + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CFLDFileListContainer* CFLDFileListContainer::NewL() + { + CFLDFileListContainer* self = CFLDFileListContainer::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CFLDFileListContainer* CFLDFileListContainer::NewLC() + { + CFLDFileListContainer* self = + new( ELeave ) CFLDFileListContainer(); + CleanupStack::PushL( self ); + self->ConstructL( R_FLD_LIST_MODEL, R_FLD_DIRECTORIES ); + return self; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CFLDFileListContainer* CFLDFileListContainer::NewL( + const TInt aResourceId ) + { + CFLDFileListContainer* self = CFLDFileListContainer::NewLC( + aResourceId, R_FLD_DIRECTORIES ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CFLDFileListContainer* CFLDFileListContainer::NewLC( + const TInt aResourceId ) + { + CFLDFileListContainer* self = + new( ELeave ) CFLDFileListContainer(); + CleanupStack::PushL( self ); + self->ConstructL( aResourceId, R_FLD_DIRECTORIES ); + return self; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CFLDFileListContainer* CFLDFileListContainer::NewL( + const TInt aResourceId, const TInt aDirectoriesResourceId ) + { + CFLDFileListContainer* self = CFLDFileListContainer::NewLC( + aResourceId, aDirectoriesResourceId ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CFLDFileListContainer* CFLDFileListContainer::NewLC( + const TInt aResourceId, const TInt aDirectoriesResourceId ) + { + CFLDFileListContainer* self = + new( ELeave ) CFLDFileListContainer(); + CleanupStack::PushL( self ); + self->ConstructL( aResourceId, aDirectoriesResourceId ); + return self; + } + +// Destructor +EXPORT_C CFLDFileListContainer::~CFLDFileListContainer() + { + iResourceLoader.Close(); + + delete iDRMImplementation; + delete iModel; + delete iController; + FeatureManager::UnInitializeLib(); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::CFLDFileListContainer +// C++ constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CFLDFileListContainer::CFLDFileListContainer() + : iResourceLoader( *( CCoeEnv::Static() ) ) + { + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CFLDFileListContainer::ConstructL( + const TInt aResourceId, const TInt aDirectoriesResourceId ) + { + // Open Filelist default resource + TFileName* fn = new (ELeave) TFileName + ( TParsePtrC( PathInfo::RomRootPath() ).Drive() ); + CleanupStack::PushL( fn ); + + fn->Append( KDC_RESOURCE_FILES_DIR ); + fn->Append( KFLDResourceFileName ); + iResourceLoader.OpenL( *fn ); + CleanupStack::PopAndDestroy( fn ); + + iModel = CFLDFileListModel::NewL( aResourceId, aDirectoriesResourceId ); + CFLDSingleGraphicEntryFormatter* entryFormatter = + new ( ELeave ) CFLDSingleGraphicEntryFormatter(); + iModel->SetEntryFormatter( entryFormatter ); + + // Add 'download tones' item to model + FeatureManager::InitializeLibL(); + if( FeatureManager::FeatureSupported( KFeatureIdSeamlessLinks ) ) + { + // Load 'download tones' text and format it + HBufC* text = StringLoader::LoadLC( + R_FLD_QTN_PROFILES_DOWNLOAD_TONES ); + _LIT( KIconIndexAndTab, "1\t" ); + HBufC* newText = + text->ReAllocL( text->Length() + KIconIndexAndTab().Length() ); + CleanupStack::Pop( text ); + CleanupStack::PushL( newText ); + TPtr des( newText->Des() ); + des.Insert( 0, KIconIndexAndTab ); + // Insert formatted 'download tones' text to model + iModel->InsertNullItemL( des, KNullDesC ); + CleanupStack::PopAndDestroy( newText ); + } + + iDRMImplementation = CFLDDRMImplementation::NewL( iModel ); + + TBool showErrorMsgs( ETrue ); + iController = CFLDController::NewL( showErrorMsgs, KDefaultDelay ); + iController->SetFileObserver( iDRMImplementation ); + + // Following implementation enables disabling recordable ringing tones. + TInt recEnable( 0 ); + CRepository* cenrep = CRepository::NewL( KCRUidProfileEngine ); + CleanupStack::PushL( cenrep ); + User::LeaveIfError( cenrep->Get( KProEngRecordedRingingTones, recEnable ) ); + CleanupStack::PopAndDestroy( cenrep ); + + if( !recEnable ) + { + // Recorded tones as ringing tones should be disabled. + // Exclude AMR files. + iModel->AddExclusiveMimeTypeL( KFLDAMRMimeType ); + } + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::SetAutomatedType() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::SetAutomatedType( + CDRMHelper::TDRMHelperAutomatedType aAutomatedType ) + { + iDRMImplementation->SetAutomatedType( aAutomatedType ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::LaunchL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CFLDFileListContainer::LaunchL( TDes& aFileName, const TDesC& aPopupTitle ) + { + // Update the list + iModel->RefreshEntryListL(); + + CEikFormattedCellListBox* listBox = NULL; + listBox = new( ELeave ) FLDListBoxTemplate + ( *iController, *iModel ); + CleanupStack::PushL( listBox ); + + // Create the popup list + CFLDPopupList* popup = CFLDPopupList::NewL( listBox, + R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT, + *iDRMImplementation, iController, + *iModel, AknPopupLayouts::EMenuGraphicWindow ); + // EMenuGraphicWindow for CAknSingleGraphicBtPopupMenuStyleListBox + CleanupStack::PushL( popup ); + + static_cast *>( listBox ) + ->SetListBox( popup ); + + // Video player can be fully constructed only when popup list + // is constructed + iController->CompleteConstructionL( popup->PopupListWindow() ); + + // Set popup to Model + iModel->SetPopupList( popup ); + + popup->SetTitleL( aPopupTitle ); + + listBox->ConstructL( popup, + EAknListBoxSelectionList | EAknListBoxLoopScrolling ); + + // Create the scroll indicator + listBox->CreateScrollBarFrameL( ETrue ); + listBox->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto); + + // Set the listbox to use the the file list model + listBox->Model()->SetItemTextArray( iModel ); + listBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + // Refresh the listbox due to model change + listBox->HandleItemAdditionL(); + + popup->PopulateIconArrayL(); + + // If a filename was given, set focus on it + if ( aFileName != KNullDesC ) + { + TInt index = iModel->FindFileL( aFileName ); + if ( index != KErrNotFound ) + { + listBox->SetCurrentItemIndex( index ); + } + } + + popup->ListBox()->DisableSingleClick(ETrue); + TBool result = popup->ExecuteLD(); + // Note, CAknPopupList must NOT be popped out + // before ExecuteLD (like dialogs do) but after. + CleanupStack::Pop( popup ); + + // Reset popup pointer + iModel->SetPopupList( NULL ); + + if ( result ) + { + TInt selectedIndex( listBox->CurrentItemIndex() ); + + // Check if the selected item is 'Download tones' or regular ringingtone + TFileName selectedFileName( KNullDesC ); + iModel->GetFileName( selectedFileName, selectedIndex ); + + // If there is such a model that has no 'Download tones' item but + // seamless links are supported, we have to check that selectedFileName + // is really ringingtone (it is not a null item) + if( selectedIndex == 0 && + FeatureManager::FeatureSupported( KFeatureIdSeamlessLinks ) && + selectedFileName.Length() == 0 ) + { + // User selected the first item "Download tones". Launch browser. + CFLDBrowserLauncher* launcher = CFLDBrowserLauncher::NewLC(); + launcher->LaunchBrowserL(); + CleanupStack::PopAndDestroy(); // launcher + result = EFalse; // No tone was selected + } + else + { + // Any other choice. Copy selected file name to aFileName. + iModel->GetFileName( aFileName, selectedIndex ); + } + } + + CleanupStack::PopAndDestroy(); // listBox + + return result; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::InsertNullItemL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::InsertNullItemL( + const TDesC& aItemText ) + { + iModel->InsertNullItemL( aItemText ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::InsertNullItemL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::InsertNullItemL( + const TDesC& aItemText, const TDesC& aFileName ) + { + iModel->InsertNullItemL( aItemText, aFileName ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::InsertEndNullItemL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::InsertEndNullItemL( + const TDesC& aItemText ) + { + iModel->InsertEndNullItemL( aItemText ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::InsertEndNullItemL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::InsertEndNullItemL( + const TDesC& aItemText, const TDesC& aFileName ) + { + iModel->InsertEndNullItemL( aItemText, aFileName ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::SetDelay() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::SetDelay( TTimeIntervalMicroSeconds32 aDelay ) + { + iController->SetDelay( aDelay ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::SetVolume() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::SetVolume( TInt aVolume ) + { + iController->SetVolume( aVolume ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::SetRingingType() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::SetRingingType( TInt aRingingType ) + { + iController->SetRingingType( aRingingType ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::SetVibra() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::SetVibra( TBool aVibra ) + { + iController->SetVibra( aVibra ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::Set3dEffects() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::Set3dEffects( TBool a3dEffects ) + { + iController->Set3dEffects( a3dEffects ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::AddExclusiveMimeTypeL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::AddExclusiveMimeTypeL( const TDesC& aMimeType ) + { + iModel->AddExclusiveMimeTypeL( aMimeType ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::AddExclusiveMediaTypeL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::AddExclusiveMediaTypeL( const TInt32 aMediaType ) + { + iModel->AddExclusiveMediaTypeL( aMediaType ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::SetWantedMimeTypesL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::SetWantedMimeTypesL( const MDesCArray& aMimeTypes ) + { + iModel->SetWantedMimeTypesL( aMimeTypes ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::SetWantedMediaTypesL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::SetWantedMediaTypesL( const TArray& aMediaTypes ) + { + iModel->SetWantedMediaTypesL( aMediaTypes ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::SetWantedMimeTypesL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::ResetExclusiveMimeTypes() + { + iModel->ResetExclusiveMimeTypes(); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::SetWantedMimeTypesL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::ResetExclusiveMediaTypes() + { + iModel->ResetExclusiveMediaTypes(); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListContainer::SetMaxFileSize() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void CFLDFileListContainer::SetMaxFileSize( const TInt aMaxFileSize ) + { + iModel->SetMaxFileSize( aMaxFileSize ); + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDFileListModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDFileListModel.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,1039 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This class implements a model of a file list. Features: +* - Contents of multiple folders in the same list +* - Filtering with wildcards (*?) +* - Filtering by maximum file size +* - Sorting (name / date, ascending / descending) +* - Entry presentation formatting using an abstract interface +* The class is inherited from MDesCArray, so it can be used directly +* as a model for a listbox. +* +* +*/ + + +// CLASS HEADER +#include "CFLDFileListModel.h" + +// INTERNAL INCLUDES +#include "CFLDOperationObserver.h" +#include "CFLDChangedItemObserver.h" +#include "CFLDEntryReference.h" +#include "CFLDWaitNote.h" +#include "CFLDPopupList.h" +#include "MFLDEntryFormatter.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include +#include // For TResourceReader +#include // For RConeResourceLoader +#include // CCoeEnv +#include +#include // For KDC_RESOURCE_FILES_DIR +#include // For R_FLD_WAIT_NOTE +#include // For BaflUtils +#include // For RApaLsSession +#include +#include + +// CONSTANTS +namespace + { + _LIT( KFLDROMDriveLetter, "Z:" ); + const TInt KGranularityFilters( 2 ); + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// + CFLDFileListModel* CFLDFileListModel::NewL( + const TInt aModelResourceId, const TInt aDirectoriesResourceId ) + { + // The default stuff. + CFLDFileListModel* self = + CFLDFileListModel::NewLC( aModelResourceId, aDirectoriesResourceId ); + CleanupStack::Pop( self ); // self + return self; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CFLDFileListModel* CFLDFileListModel::NewLC( + const TInt aModelResourceId, const TInt aDirectoriesResourceId ) + { + CFLDFileListModel* self = + new( ELeave ) CFLDFileListModel(); + CleanupStack::PushL( self ); + self->ConstructL( aModelResourceId, aDirectoriesResourceId ); + return self; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::CFLDFileListModel +// C++ constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CFLDFileListModel::CFLDFileListModel() + : iExclusiveMimeTypes( KGranularityFilters ), + iExclusiveMediaTypes( KGranularityFilters ), + iDirectoryPaths( KGranularityFilters ), + iRomDirectoryPaths( KGranularityFilters ), + iMaxFileSize( 0 ) + { + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CFLDFileListModel::ConstructL( + const TInt aModelResourceId, const TInt aDirectoriesResourceId ) + { + // Create CLF Operation Observer to monitor, when + // refresh operation has completed + iObserver = CFLDOperationObserver::NewL(); + + // Create Content Listing Engine and a list model + iEngine = ContentListingFactory::NewContentListingEngineLC(); + CleanupStack::Pop(); // iEngine + + // Load CLF definitions from user given resource + TResourceReader reader; + CCoeEnv::Static()->CreateResourceReaderLC( reader, aModelResourceId ); + iModel = iEngine->CreateListModelLC( *iObserver, reader ); + CleanupStack::Pop(); // iModel + CleanupStack::PopAndDestroy(); // reader + + // Load wait note from default-resource + iWaitNote = CFLDWaitNote::NewL( R_FLD_WAIT_NOTE ); + + // Load directories + CFLDFileListModel::LoadDirectoriesL( aDirectoriesResourceId ); + + // Create changed item observer to monitor, when + // tone selection files are modified or deleted + iChangedItemObserver = CFLDChangedItemObserver::NewL(iWaitNote); + iEngine->AddChangedItemObserverL( *iChangedItemObserver ); + + // Set post filter + iModel->SetPostFilter( this ); + } + +// Destructor + CFLDFileListModel::~CFLDFileListModel() + { + if( iModel ) + { + iModel->CancelRefresh(); + delete iModel; + } + + delete iEngine; + delete iObserver; + delete iChangedItemObserver; + delete iEntryFormatter; + delete iWaitNote; + + iEndNullTextRingingToneArray.ResetAndDestroy(); + iEndNullTextArray.ResetAndDestroy(); + iNullTextRingingToneArray.ResetAndDestroy(); + iNullTextArray.ResetAndDestroy(); + iEntryReferences.ResetAndDestroy(); + iExclusiveMimeTypes.Reset(); + iExclusiveMediaTypes.Reset(); + iDirectoryPaths.Reset(); + iRomDirectoryPaths.Reset(); + iRomRingingToneArray.ResetAndDestroy(); + } + + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::LoadRomDirectoriesL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDFileListModel::LoadDirectoriesL( const TInt aDirectoriesResourceId ) + { + TResourceReader reader; + CCoeEnv::Static()->CreateResourceReaderLC( reader, aDirectoriesResourceId ); + + // Read ROM directories from resource + TInt count( reader.ReadInt16() ); + while( --count >= 0 ) + { + TPtrC ptr( reader.ReadTPtrC() ); + // Ignore return value + AddRomDirectoryL( ptr ); + } + + // Read directories from resource + count = reader.ReadInt16(); + while( --count >= 0 ) + { + TPtrC ptr( reader.ReadTPtrC() ); + // Ignore return value + AddDirectoryL( ptr ); + } + + CleanupStack::PopAndDestroy(); // reader + } +// ----------------------------------------------------------------------------- +// CFLDFileListModel::AddRomDirectoryL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + TInt CFLDFileListModel::AddRomDirectoryL( const TDesC& aDirectory ) + { + TInt index( 0 ); + if( iRomDirectoryPaths.Find( aDirectory, index ) == 0 ) + { + // A duplicate was found, do not add to the array, return. + return KErrAlreadyExists; + } + + RFs& fsSession( CCoeEnv::Static()->FsSession() ); + // Check that the directory really exists + if ( !BaflUtils::FolderExists( fsSession, aDirectory ) ) + { + return KErrPathNotFound; + } + iRomDirectoryPaths.AppendL( aDirectory ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::AddDirectoryL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + TInt CFLDFileListModel::AddDirectoryL( const TDesC& aDirectory ) + { + TInt index( 0 ); + if( iDirectoryPaths.Find( aDirectory, index ) == 0 ) + { + // A duplicate was found, do not add to the array, return. + return KErrAlreadyExists; + } + + iDirectoryPaths.AppendL( aDirectory ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::SetWantedMimeTypesL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDFileListModel::SetWantedMimeTypesL( const MDesCArray& aMimeTypes ) + { + CFLDFileListModel::ResetExclusiveMimeTypes(); + CFLDFileListModel::ResetExclusiveMediaTypes(); + + iModel->SetWantedMimeTypesL( aMimeTypes ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::SetWantedMediaTypesL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDFileListModel::SetWantedMediaTypesL( + const TArray& aMediaTypes ) + { + CFLDFileListModel::ResetExclusiveMimeTypes(); + CFLDFileListModel::ResetExclusiveMediaTypes(); + + // Temporary solution + RArray array; + TInt count( aMediaTypes.Count() ); + CleanupClosePushL( array ); + for( TInt i = 0; i < count; i++ ) + { + array.AppendL( aMediaTypes[i]); + } + + iModel->SetWantedMediaTypesL( array.Array() ); + CleanupStack::PopAndDestroy( &array ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::PopulateReferenceListL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + void CFLDFileListModel::PopulateReferenceListL() + { + // Do not allow to update model from changed item observer + iChangedItemObserver->SetFileListModel( NULL ); + + // Send reference of CActiveSchedulerWait to the CLF Operation Observer + iObserver->PrepareForRefresh( iWait ); + + // CLF hogs the processor when doing its refresh. Make sure we'll + // have enough of a slice to be able to handle the End key presses. + RWsSession& wsSession = CCoeEnv::Static()->WsSession(); + wsSession.ComputeMode( RWsSession::EPriorityControlDisabled ); + + // Call refresh to get all music files from the file system to the model + iModel->RefreshL(); + + // Display a wait note if user tries to do something while refresh + // operation of the list model has not finished yet. + if( iObserver->IsRefreshOngoing() && !iWait.IsStarted() ) + { + // View the wait note + if( iWaitNote && !iWaitNote->IsRunning() ) + { + iWaitNote->OpenWaitNoteL(); + } + + // Wait for the refresh operation to complete. Operation Observer will + // stop this wait when the refresh operation has compeleted. + iWait.Start(); // CSI: 10 # the state of iWait is checked above + + // Close the wait note + if ( iWaitNote ) + { + iWaitNote->CloseWaitNoteL(); + } + } + + // Back to default behavior + wsSession.ComputeMode( RWsSession::EPriorityControlComputeOff ); + + PopulateListBoxL(); + + if( iPopupList ) + { // Model has updated; list should try to handle it + iPopupList->CancelPreview(); + TRAP_IGNORE( iPopupList->ListBox()->HandleItemAdditionL() ); + // List has updated; set focus to the first item + iPopupList->ListBox()->SetCurrentItemIndexAndDraw( 0 ); + } + + // Allow to update model from changed item observer + // (unless we're displaying ROM tones only) + if( !iRomTonesOnly ) + { + iChangedItemObserver->SetFileListModel( this ); + } + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::ScanRomDirectoriesL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDFileListModel::ScanRomDirectoriesL() + { + CDir* fileList( NULL ); + RFs& fsSession( CCoeEnv::Static()->FsSession() ); + + TInt directoryCount( iRomDirectoryPaths.Count() ); + for( TInt i= 0; iCount() ); + for ( TInt j=0; j tempBuf = item.iName; + HBufC* concateName = HBufC::NewLC( + iRomDirectoryPaths.MdcaPoint(i).Length() + tempBuf.Length() ); + TPtr des = concateName->Des(); + des.Insert(0, iRomDirectoryPaths.MdcaPoint(i) ); + des.Append( tempBuf ); + + // Only files located on ROM must be scanned + // CLF has already scanned other ( supported ) locations + if( ( des.Left( KFLDROMDriveLetter().Length() ).CompareF( + KFLDROMDriveLetter ) == 0 ) ) + { + TParsePtrC parsedName( des ); + + MCLFModifiableItem* clfModifiableItem + = ContentListingFactory::NewModifiableItemLC(); + clfModifiableItem->AddFieldL( ECLFFieldIdFileName, parsedName.NameAndExt() ); + clfModifiableItem->AddFieldL( ECLFFieldIdPath, parsedName.Path() ); + clfModifiableItem->AddFieldL( ECLFFieldIdDrive, parsedName.Drive() ); +#ifdef RD_VIDEO_AS_RINGING_TONE + if( PathInfo::PathType( parsedName.DriveAndPath() ) == PathInfo::EVideosPath ) + { + clfModifiableItem->AddFieldL( ECLFFieldIdMediaType, ECLFMediaTypeVideo); + } + else + { + clfModifiableItem->AddFieldL( ECLFFieldIdMediaType, ECLFMediaTypeSound); + } +#else + clfModifiableItem->AddFieldL( ECLFFieldIdMediaType, ECLFMediaTypeSound); +#endif + clfModifiableItem->AddFieldL( ECLFFieldIdFileNameAndPath, des ); + + // Find out MIME type + RApaLsSession apaLsSession; + User::LeaveIfError( apaLsSession.Connect() ); + CleanupClosePushL( apaLsSession ); + TUid dummyUid = { 0 }; // instantiate as zero + TDataType dataType( dummyUid ); + TInt err = apaLsSession.AppForDocument( parsedName.FullName(), dummyUid, dataType ); + CleanupStack::PopAndDestroy(); // apaLsSession.Close() + if( err == KErrNone ) + { + clfModifiableItem->AddFieldL( ECLFFieldIdMimeType, dataType.Des() ); + User::LeaveIfError( iRomRingingToneArray.Append( clfModifiableItem ) ); + CleanupStack::Pop(); // clfModifiableItem + } + else + { + CleanupStack::PopAndDestroy(); // clfModifiableItem + } + } + CleanupStack::PopAndDestroy( concateName ); + } + CleanupStack::PopAndDestroy( fileList); + } + } + + +// ----------------------------------------------------------------------------- +// CompareEntries +// For sorting entry references alphabetically by tone name. +// ----------------------------------------------------------------------------- +// +TInt CompareEntries(const CFLDEntryReference& entry1, const CFLDEntryReference& entry2 ) + { + TParsePtrC parsed1( entry1.PathAndMediaFileName() ); + TParsePtrC parsed2( entry2.PathAndMediaFileName() ); + + return parsed1.Name().CompareF( parsed2.Name() ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::ScanRomDirectoriesAndInsertL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDFileListModel::ScanRomDirectoriesAndInsertL() + { + CDir* fileList( NULL ); + RFs fsSession; + User::LeaveIfError( fsSession.Connect() ); + CleanupClosePushL( fsSession ); + + TInt directoryCount( iRomDirectoryPaths.Count() ); + for( TInt i= 0; iCount() ); + for ( TInt j=0; j tempBuf = item.iName; + HBufC* concateName = HBufC::NewLC( + iRomDirectoryPaths.MdcaPoint(i).Length() + tempBuf.Length() ); + TPtr des = concateName->Des(); + des.Insert(0, iRomDirectoryPaths.MdcaPoint(i) ); + des.Append( tempBuf ); + + // Only files located on ROM must be scanned + if( ( des.Left( KFLDROMDriveLetter().Length() ).CompareF( + KFLDROMDriveLetter ) == 0 ) ) + { + // Add file to entry-list + CFLDEntryReference* entryRef = new( ELeave ) CFLDEntryReference(); + CleanupStack::PushL( entryRef ); + HBufC* pathAndMediaFileName = des.AllocL(); + entryRef->SetPathAndMediaFileName( pathAndMediaFileName ); + + TParsePtrC parsedName( des ); + if( PathInfo::PathType( parsedName.DriveAndPath() ) == PathInfo::EVideosPath ) + { + entryRef->SetMediaType( ECLFMediaTypeVideo); + } + else + { + entryRef->SetMediaType( ECLFMediaTypeSound); + } + + iEntryFormatter->FormatL( *entryRef ); + User::LeaveIfError( iEntryReferences.Append( entryRef ) ); + CleanupStack::Pop( entryRef ); + } + CleanupStack::PopAndDestroy( concateName ); + } + CleanupStack::PopAndDestroy( fileList); + } + + TLinearOrder* sorter = + new( ELeave ) TLinearOrder ( CompareEntries ); + iEntryReferences.Sort( *sorter ); + delete sorter; + + CleanupStack::PopAndDestroy(); // fsSession + } + + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::FilterItemsL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDFileListModel::FilterItemsL( const TArray& aItemList, + RPointerArray& aFilteredItemList ) + { + + // Add all found entries into model + TInt count( aItemList.Count() ); + for( TInt i = 0 ; i < count ; ++i ) + { + MCLFItem* item = aItemList[i]; + aFilteredItemList.AppendL( item ); + } + + // Fetch tones from ROM directories + CFLDFileListModel::ScanRomDirectoriesL(); + + // Add all found entries into model + count = iRomRingingToneArray.Count(); + for( TInt i = 0 ; i < count ; ++i ) + { + MCLFItem* item = iRomRingingToneArray[i]; + aFilteredItemList.AppendL( item ); + } + + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::GetPopupList +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +CFLDPopupList* CFLDFileListModel::GetPopupList() + { + return iPopupList; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::AddExclusiveMimeTypeL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDFileListModel::AddExclusiveMimeTypeL( const TDesC& aMimeType ) + { + TInt index( 0 ); + if( iExclusiveMimeTypes.Find( aMimeType, index ) == 0 ) + + { + // A duplicate was found, do not add to the array, just return. + return; + } + iExclusiveMimeTypes.AppendL( aMimeType ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::AddExclusiveMediaTypeL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDFileListModel::AddExclusiveMediaTypeL( const TInt32 aMediaType ) + { + if( iExclusiveMediaTypes.Find( aMediaType ) != KErrNotFound ) + { + // A duplicate was found, do not add to the array, just return. + return; + } + iExclusiveMediaTypes.AppendL( aMediaType ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::ResetExclusiveMimeTypes +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDFileListModel::ResetExclusiveMimeTypes() + { + iExclusiveMimeTypes.Reset(); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::ResetExclusiveMediaTypes +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDFileListModel::ResetExclusiveMediaTypes() + { + iExclusiveMediaTypes.Reset(); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::CheckRules +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CFLDFileListModel::CheckRules( + TPtrC& aMimeType, TInt32 aMediaType, TPtrC& aPathAndFileName ) + { + + // Check exclusive MIME types + if( iExclusiveMimeTypes.Count() > 0 ) + { + TInt index( 0 ); + if( iExclusiveMimeTypes.Find( aMimeType, index ) == 0 ) + { + return EFalse; + } + } + + // Check exclusive media types + if( iExclusiveMediaTypes.Count() > 0 ) + { + if( iExclusiveMediaTypes.Find( aMediaType ) != KErrNotFound ) + { + return EFalse; + } + } + + if( ( aPathAndFileName.Left( KFLDROMDriveLetter().Length() ).CompareF( + KFLDROMDriveLetter ) == 0 ) ) + { + // ROM tones are accepted always + return ETrue; + } + + // Check defined pathes + if( iDirectoryPaths.Count() > 0 ) + { + TParsePtrC parsedName( aPathAndFileName ); + TInt index( 0 ); + if( iDirectoryPaths.Find( parsedName.DriveAndPath(), index ) != 0 ) + { + // File is not part of defined path set + return EFalse; + } + } + + // File is part of defined path set or then no directory paths are defined + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::PopulateListBoxL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDFileListModel::PopulateListBoxL() + { + // Add all items to the list box + TInt countItems( iModel->ItemCount() ); + TInt error; + + for( TInt i = 0; i < countItems; i++ ) + { + // Check name and path + TPtrC fieldValueNameAndPath; + error = iModel->Item( i ).GetField( + ECLFFieldIdFileNameAndPath, fieldValueNameAndPath ); + + if( error == KErrNone ) + { + // Check media type + TInt32 mediaTypeValue; + error = iModel->Item( i ).GetField( + ECLFFieldIdMediaType, mediaTypeValue ); + + if( error == KErrNone ) + { + // Check MIME type + TPtrC fieldValueMime; + error = iModel->Item( i ).GetField( + ECLFFieldIdMimeType, fieldValueMime ); + + if( error == KErrNone ) + { + // Check include/exclude rules + if( CFLDFileListModel::CheckRules( + fieldValueMime, mediaTypeValue, + fieldValueNameAndPath ) ) + { + // Everything seems to be ok, + // now check file-size limit + if ( iMaxFileSize ) + { + if ( CheckToneFileSizeL( + fieldValueNameAndPath, iMaxFileSize) + != KErrNone ) + { + continue; + } + } + // Finally, add file to entry-list + CFLDEntryReference* entryRef + = new( ELeave ) CFLDEntryReference(); + CleanupStack::PushL( entryRef ); + HBufC* pathAndMediaFileName + = fieldValueNameAndPath.AllocL(); + entryRef->SetPathAndMediaFileName( + pathAndMediaFileName ); + entryRef->SetMediaType( mediaTypeValue ); + iEntryFormatter->FormatL( *entryRef ); + User::LeaveIfError( + iEntryReferences.Append( entryRef ) ); + CleanupStack::Pop( entryRef ); + } + } + } + } + } + + if( countItems == 0 ) + { + // No tones from CLF -- likely out of memory. Scan for ROM tones only. + HBufC* errorText = StringLoader::LoadLC( + R_FLD_QTN_PROFILES_ERROR_NOT_ENOUGH_MEMORY ); + CAknErrorNote* note = new( ELeave ) CAknErrorNote( ETrue ); + note->ExecuteLD( *errorText ); + CleanupStack::PopAndDestroy( errorText ); + + iRomTonesOnly = ETrue; + ScanRomDirectoriesAndInsertL(); + } + + } + + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::RefreshEntryListL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + void CFLDFileListModel::RefreshEntryListL() + { + iRomTonesOnly = EFalse; + + iRomRingingToneArray.ResetAndDestroy(); + iEntryReferences.ResetAndDestroy(); + PopulateReferenceListL(); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::SetPopupList +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDFileListModel::SetPopupList( CFLDPopupList* aPopupList ) + { + iPopupList = aPopupList; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::MdcaPoint +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + TPtrC16 CFLDFileListModel::MdcaPoint( TInt aIndex ) const + { + TInt nullItemCount( iNullTextArray.Count() ); + if( aIndex < nullItemCount ) + { + // Points to a null item in the beginning of the list. + return iNullTextArray[aIndex]->Des(); + } + TInt referenceListCount( iEntryReferences.Count() ); + if( aIndex >= referenceListCount + nullItemCount ) + { + // Points to a null item in the end of the list. + return iEndNullTextArray[aIndex - referenceListCount - nullItemCount] + ->Des(); + } + + // The index points to one of the directory entries + return iEntryReferences[aIndex - nullItemCount] + ->FormattedPresentation().Des(); + + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::MdcaCount +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + TInt CFLDFileListModel::MdcaCount() const + { + return iNullTextArray.Count() + + iEntryReferences.Count() + iEndNullTextArray.Count(); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::SetEntryFormatter +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + void CFLDFileListModel::SetEntryFormatter( MFLDEntryFormatter* aFormatter ) + { + delete iEntryFormatter; + iEntryFormatter = aFormatter; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::InsertNullItemL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + void CFLDFileListModel::InsertNullItemL( const TDesC& aItemText ) + { + InsertNullItemL( aItemText, KNullDesC ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::InsertNullItemL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + void CFLDFileListModel::InsertNullItemL( + const TDesC& aItemText, const TDesC& aFileName ) + { + HBufC* text = iEntryFormatter->FormatTextLC( aItemText ); + // Takes ownership + User::LeaveIfError( iNullTextArray.Append( text ) ); + CleanupStack::Pop( text ); + + text = aFileName.AllocLC(); + // Takes ownership + User::LeaveIfError( iNullTextRingingToneArray.Append( text ) ); + CleanupStack::Pop( text ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::InsertEndNullItemL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + void CFLDFileListModel::InsertEndNullItemL( const TDesC& aItemText ) + { + InsertEndNullItemL( aItemText, KNullDesC ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::InsertEndNullItemL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + void CFLDFileListModel::InsertEndNullItemL( + const TDesC& aItemText, const TDesC& aFileName ) + { + HBufC* text = iEntryFormatter->FormatTextLC( aItemText ); + // Takes ownership + User::LeaveIfError( iEndNullTextArray.Append( text ) ); + CleanupStack::Pop( text ); + + text = aFileName.AllocLC(); + // Takes ownership + User::LeaveIfError( iEndNullTextRingingToneArray.Append( text ) ); + CleanupStack::Pop( text ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::GetFileName +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + void CFLDFileListModel::GetFileName( TDes& aFileName, const TInt aIndex ) + { + TInt nullItemCount( iNullTextRingingToneArray.Count() ); + if( aIndex < nullItemCount ) + { + // Points to a null item in the beginning of the list. + aFileName.Copy( iNullTextRingingToneArray[aIndex]->Des() ); + return; + } + TInt referenceListCount( iEntryReferences.Count() ); + if( aIndex >= referenceListCount + nullItemCount ) + { + // Points to a null item in the end of the list. + aFileName.Copy( iEndNullTextRingingToneArray[ + aIndex - referenceListCount - nullItemCount]->Des() ); + return; + } + + // The index points to one of the directory entries + CFLDEntryReference& entry = *iEntryReferences[aIndex - nullItemCount]; + aFileName.Copy( entry.PathAndMediaFileName().Des() ); + + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::FindFileL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + TInt CFLDFileListModel::FindFileL( const TDesC& aFileName ) + { + TInt ret( KErrNotFound ); + TInt count( MdcaCount() ); + TFileName fileName( KNullDesC ); + for( TInt index( 0 ); index < count; index++ ) + { + GetFileNameAtIndex( index, fileName ); + if( fileName.CompareF( aFileName ) == 0 ) + { + ret = index; + break; + } + } + return ret; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::GetFileNameAtIndex +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDFileListModel::GetFileNameAtIndex( + TInt aIndex, TDes& aFileName ) const + { + TInt nullItemCount( iNullTextRingingToneArray.Count() ); + if( aIndex < nullItemCount ) + { + // Points to a null item in the beginning of the list. + aFileName.Copy( iNullTextRingingToneArray[aIndex]->Des() ); + return; + } + TInt referenceListCount( iEntryReferences.Count() ); + if( aIndex >= referenceListCount + nullItemCount ) + { + // Points to a null item in the end of the list. + aFileName.Copy( iEndNullTextRingingToneArray[ + aIndex - referenceListCount - nullItemCount]->Des() ); + return; + } + + // The index points to one of the directory entries + CFLDEntryReference& entry = *iEntryReferences[aIndex - nullItemCount]; + aFileName.Copy( entry.PathAndMediaFileName().Des() ); + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::MediaFileType +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt32 CFLDFileListModel::MediaFileType( const TDesC& aFileName ) const + { + if( iRomTonesOnly ) + { + // Model is empty, get media type from entry reference + for(TInt i = 0; i < iEntryReferences.Count(); i++) + { + if( aFileName.CompareF( iEntryReferences[i]->PathAndMediaFileName() ) == 0 ) + { + return iEntryReferences[i]->MediaType(); + } + } + } + else + { + TInt countItems( iModel->ItemCount() ); + for( TInt i = 0; i < countItems; i++ ) + { + // Get value of requested field and add item to the list box + TPtrC fieldValue; + TInt error( iModel->Item( i ).GetField( + ECLFFieldIdFileNameAndPath, fieldValue ) ); + + if( error == KErrNone ) + { + if( aFileName.CompareF( fieldValue ) == 0 ) + { + TInt32 mediaTypeValue; + TInt error( iModel->Item( i ).GetField( + ECLFFieldIdMediaType, mediaTypeValue ) ); + + if( error == KErrNone ) + { + return mediaTypeValue; + } + } + } + } + } + return KErrNotFound; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::SetMaxFileSize +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDFileListModel::SetMaxFileSize( const TInt aMaxFileSize ) + { + iMaxFileSize = aMaxFileSize; + } + +// ----------------------------------------------------------------------------- +// CFLDFileListModel::CheckToneFileSizeL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CFLDFileListModel::CheckToneFileSizeL( + const TDesC& aFile, TInt aSizeLimit ) + { + RFs& fsSession( CCoeEnv::Static()->FsSession() ); + + // Get file size + TInt size = 0; + TInt error = KErrNone; + + TEntry entry; + if ( fsSession.Entry( aFile, entry ) == KErrNone ) + { + size = entry.iSize; + } + + // Check. NOTE: now if file size couldn't be determined, check fails. + if ( aSizeLimit && size > aSizeLimit ) + { + error = KErrTooBig; + } + + return error; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDOperationObserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDOperationObserver.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of CFLDOperationObserver. +* +*/ + + + +// CLASS HEADER +#include "CFLDOperationObserver.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CFLDOperationObserver::CFLDOperationObserver +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CFLDOperationObserver::CFLDOperationObserver() + { + } + +// ----------------------------------------------------------------------------- +// CFLDOperationObserver::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CFLDOperationObserver* CFLDOperationObserver::NewL() + { + CFLDOperationObserver* self = new (ELeave) CFLDOperationObserver; + return self; + } + +// Destructor +CFLDOperationObserver::~CFLDOperationObserver() + { + } + +// ----------------------------------------------------------------------------- +// CFLDOperationObserver::HandleOperationEventL +// Method to handle list model operation events. +// ----------------------------------------------------------------------------- +// +void CFLDOperationObserver::HandleOperationEventL( + TCLFOperationEvent aOperationEvent, + TInt /*aError*/ ) + { + // Waiting is stopped when an event for refresh completion is received + if( aOperationEvent == ECLFRefreshComplete ) + { + iRefreshOngoing = EFalse; + + if( iWait && iWait->IsStarted() ) + { + iWait->AsyncStop(); + } + } + } + +// ----------------------------------------------------------------------------- +// CFLDOperationObserver::IsRefreshOngoing +// Check if there is a refresh operation is ongoing. +// ----------------------------------------------------------------------------- +// +TBool CFLDOperationObserver::IsRefreshOngoing() + { + return iRefreshOngoing; + } + +// ----------------------------------------------------------------------------- +// CFLDOperationObserver::PrepareForRefresh +// Prepare for a refresh operation. +// ----------------------------------------------------------------------------- +// +void CFLDOperationObserver::PrepareForRefresh( CActiveSchedulerWait& aWait ) + { + // Store the wait instance + iWait = &aWait; + + // Refresh operation will be started in a moment + iRefreshOngoing = ETrue; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDOperationObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDOperationObserver.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CLF Operation Observer. +* +*/ + + + +#ifndef __CFLDOPERATIONOBSERVER_H__ +#define __CFLDOPERATIONOBSERVER_H__ + +// INTERNAL INCLUDES + +// EXTERNAL INCLUDES +#include +#include + +// CLASS DECLARATION + +/** +* CLF Operation Observer. +* CFLDOperationObserver receives operation events of Content +* Listing Framework. Operation event is generated when asynchronous refresh +* operation of List Model is finished. +*/ +NONSHARABLE_CLASS( CFLDOperationObserver ) + : public CBase, + public MCLFOperationObserver + { + public: // Constructors and destructor + + /** + * Creates and returns a new instance of this class. + * @return Pointer to the CFLDOperationObserver object + */ + static CFLDOperationObserver* NewL(); + + /** + * Destructor. + */ + virtual ~CFLDOperationObserver(); + + private: // Constructors + /** + * C++ default constructor. + */ + CFLDOperationObserver(); + + protected: // Methods derived from MCLFOperationObserver + + void HandleOperationEventL( TCLFOperationEvent aOperationEvent, + TInt aError ); + + public: // New functions + + /** + * Check if there is a refresh operation is ongoing. + * @return ETrue if refresh is not finished, + * EFalse if refresh is finished + */ + TBool IsRefreshOngoing(); + + /** + * Prepare for a refresh operation to start. + * @param aWait The wait instance to stop when refreshing is completed + */ + void PrepareForRefresh( CActiveSchedulerWait& aWait ); + + private: // Data + + /// Own: For waiting the refresh operation to complete + CActiveSchedulerWait* iWait; + + // For indicating that refresh operation is started but not finished + TBool iRefreshOngoing; + + }; + +#endif // __CFLDOperationObserver_H__ + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDPlayerBase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDPlayerBase.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,376 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CFLDPlayerBase is used to play sound files. It takes into account +* the current volume and ringing type settings. +* +* +*/ + + +// CLASS HEADER +#include "CFLDPlayerBase.h" + +// INTERNAL INCLUDES +#include "ProfileEngineInternalCRKeys.h" + +// EXTERNAL INCLUDES +#include // CAknErrorNote +#include +#include +#include +#include +#include +#include + +// CONSTANTS +namespace + { + const TInt KMinVolumeLevel( 1 ); + const TInt KMaxVolumeLevel( 10 ); + } + +// ============================ MEMBER FUNCTIONS =============================== + +// Destructor +CFLDPlayerBase::~CFLDPlayerBase() + { + CCoeEnv::Static()->RemoveForegroundObserver( *this ); + + iApaSession.Close(); + + if( iVibraNotifyHandler ) + { + iVibraNotifyHandler->StopListening(); + } + + if( iTypeNotifyHandler ) + { + iTypeNotifyHandler->StopListening(); + } + + if( iVolumeNotifyHandler ) + { + iVolumeNotifyHandler->StopListening(); + } + + delete iVibraNotifyHandler; + delete iTypeNotifyHandler; + delete iVolumeNotifyHandler; + + delete iSession; + delete iVibraSession; + + delete iErrorMessage; + iErrorMessage = NULL; + } + +// ----------------------------------------------------------------------------- +// CFLDPlayerBase::CFLDPlayerBase +// C++ constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CFLDPlayerBase::CFLDPlayerBase( TBool aShowErrorMsgs ) + : i3dEffects( ETrue ), + iShowErrorMsgs( aShowErrorMsgs ) + { + } + +// ----------------------------------------------------------------------------- +// CFLDPlayerBase::BaseConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CFLDPlayerBase::BaseConstructL() + { + CCoeEnv* coeEnv = CCoeEnv::Static(); + + coeEnv->AddForegroundObserverL( *this ); + + // Read a text string from resource file + if ( iShowErrorMsgs ) + { + iErrorMessage = StringLoader::LoadL( R_FLD_QTN_FILE_FORMAT_ERROR ); + } + + // Get initial settings from active profile + // init cenrep connection + iSession = CRepository::NewL(KCRUidProfileEngine); + iVibraSession = CRepository::NewL(KCRUidVibraCtrl); + + iVolumeNotifyHandler = CCenRepNotifyHandler::NewL(*this, + *iSession, + CCenRepNotifyHandler::EIntKey, + KProEngActiveRingingVolume); + + iTypeNotifyHandler = CCenRepNotifyHandler::NewL(*this, + *iSession, + CCenRepNotifyHandler::EIntKey, + KProEngActiveRingingType); + + iVibraNotifyHandler = CCenRepNotifyHandler::NewL(*this, + *iVibraSession, + CCenRepNotifyHandler::EIntKey, + KVibraCtrlProfileVibraEnabled); + + + User::LeaveIfError( iSession->Get( KProEngActiveRingingVolume, iRingingVolume ) ); + User::LeaveIfError( iSession->Get( KProEngActiveRingingType, iRingingType ) ); + User::LeaveIfError( iVibraSession->Get( KVibraCtrlProfileVibraEnabled, iVibra ) ); + + User::LeaveIfError( iSession->Get( KProEngDefaultRingingTone, iDefaultTone ) ); + + iVolumeNotifyHandler->StartListeningL(); + iTypeNotifyHandler->StartListeningL(); + iVibraNotifyHandler->StartListeningL(); + + User::LeaveIfError( iApaSession.Connect() ); + } + +// ----------------------------------------------------------------------------- +// CFLDPlayerBase::SetVolume() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPlayerBase::SetVolume( TInt aVolume ) + { + iRingingVolume = aVolume; + + // CCenrepNotifyHandler doesn't allow to stop only iVolumeNotifyHandler + // but we must stop all the handlers in correct order + if( iVibraNotifyHandler ) + { + iVibraNotifyHandler->StopListening(); + } + + if( iTypeNotifyHandler ) + { + iTypeNotifyHandler->StopListening(); + } + + if( iVolumeNotifyHandler ) + { + iVolumeNotifyHandler->StopListening(); + delete iVolumeNotifyHandler; + iVolumeNotifyHandler = NULL; + } + + // Start handlers again which were stopped + // No possibility to handle leave here any way + if( iTypeNotifyHandler ) + { + TRAP_IGNORE( iTypeNotifyHandler->StartListeningL() ); + } + if( iVibraNotifyHandler ) + { + TRAP_IGNORE( iVibraNotifyHandler->StartListeningL() ); + } + } + +// ----------------------------------------------------------------------------- +// CFLDPlayerBase::SetRingingType() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPlayerBase::SetRingingType( TInt aRingingType ) + { + iRingingType = aRingingType; + if( iVibraNotifyHandler ) + { + iVibraNotifyHandler->StopListening(); + } + + if( iTypeNotifyHandler ) + { + iTypeNotifyHandler->StopListening(); + delete iTypeNotifyHandler; + iTypeNotifyHandler = NULL; + } + + if( iVolumeNotifyHandler ) + { + iVolumeNotifyHandler->StopListening(); + } + + if( iVolumeNotifyHandler ) + { + TRAP_IGNORE( iVolumeNotifyHandler->StartListeningL() ); + } + + if( iVibraNotifyHandler ) + { + TRAP_IGNORE( iVibraNotifyHandler->StartListeningL() ); + } + } + +// ----------------------------------------------------------------------------- +// CFLDPlayerBase::SetVibra() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPlayerBase::SetVibra( TBool aVibra ) + { + iVibra = aVibra; + if( iVibraNotifyHandler ) + { + iVibraNotifyHandler->StopListening(); + delete iVibraNotifyHandler; + iVibraNotifyHandler = NULL; + } + + if( iTypeNotifyHandler ) + { + iTypeNotifyHandler->StopListening(); + } + + if( iVolumeNotifyHandler ) + { + iVolumeNotifyHandler->StopListening(); + } + + if( iVolumeNotifyHandler ) + { + TRAP_IGNORE( iVolumeNotifyHandler->StartListeningL() ); + } + if( iTypeNotifyHandler ) + { + TRAP_IGNORE( iTypeNotifyHandler->StartListeningL() ); + } + } + +// ----------------------------------------------------------------------------- +// CFLDPlayerBase::Set3dEffects() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPlayerBase::Set3dEffects( TBool a3dEffects ) + { + i3dEffects = a3dEffects; + } + +// ----------------------------------------------------------------------------- +// CFLDPlayerBase::BaseConvertVolume() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CFLDPlayerBase::BaseConvertVolume( TInt aVolume, TInt aMaxVolume ) + { + TInt result( aMaxVolume * aVolume / KMaxVolumeLevel ); + // if user has selected minimum volume level + // set HW volume 1 + if ( aVolume == KMinVolumeLevel && result == 0 ) + { + result = 1; + } + + return result; + } + +// ----------------------------------------------------------------------------- +// CFLDPlayerBase::DisplayErrorNoteL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPlayerBase::DisplayErrorNoteL() + { + if( iShowErrorMsgs ) + { + CAknErrorNote* note = new( ELeave ) CAknErrorNote( ETrue ); + note->ExecuteLD( *iErrorMessage ); + } + } + +// ----------------------------------------------------------------------------- +// CFLDPlayerBase::DataType() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CFLDPlayerBase::DataType( const TDesC& aFileName, TDataType& aDataType ) + { + TUid dummyUid( KNullUid ); + return iApaSession.AppForDocument( aFileName, dummyUid, aDataType ); + } + +// ----------------------------------------------------------------------------- +// CFLDPlayerBase::HandleNotifyInt() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPlayerBase::HandleNotifyInt(TUint32 aId, TInt aNewValue) + { + + if ( aId == KProEngActiveRingingVolume ) + { + iRingingVolume = aNewValue; + } + else if ( aId == KProEngActiveRingingType ) + { + iRingingType = aNewValue; + } + else if ( aId == KVibraCtrlProfileVibraEnabled ) + { + iVibra = aNewValue; + } + + } + +// ----------------------------------------------------------------------------- +// CFLDPlayerBase::HandleLosingForeground() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPlayerBase::HandleLosingForeground() + { + iFocusLost = ETrue; + Cancel(); + } + +// ----------------------------------------------------------------------------- +// CFLDPlayerBase::HandleGainingForeground() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPlayerBase::HandleGainingForeground() + { + iFocusLost = EFalse; + } + +// ----------------------------------------------------------------------------- +// CFLDPlayerBase::IsCallOngoing() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CFLDPlayerBase::IsCallOngoing() const + { + // Get call status + TBool res = EFalse; + TInt err = KErrNone; + TInt callState = EPSCTsyCallStateUninitialized; + + err = RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, callState ); + if( !err && + ( callState != EPSCTsyCallStateUninitialized && + callState != EPSCTsyCallStateNone && + callState != EPSCTsyCallStateDisconnecting ) ) + { + // There was call ongoing + res = ETrue; + } + + return res; + } + + +// End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDPlayerBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDPlayerBase.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,192 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CFLDPlayerBase is used to play sound files. It takes into account +* the current volume and ringing type settings. +* +* +*/ + + +#ifndef __CFLDPLAYERBASE_H__ +#define __CFLDPLAYERBASE_H__ + +// INTERNAL INCLUDES +#include "MFLDFileProcessor.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class C3DRingingToneInterface; + +// CONSTANTS +const TInt KFLDMinVolumeLevel( 1 ); + +// CLASS DECLARATION + +/** +* CFLDPlayerBase is used to play sound files. It takes into account the current +* volume and ringing type settings. +* +* @lib filelist.lib +* @since 2.1 +*/ +NONSHARABLE_CLASS( CFLDPlayerBase ) + : public CBase, + public MFLDFileProcessor, + public MCenRepNotifyHandlerCallback, + public MCoeForegroundObserver + { + protected: // Destructor + + /** + * Destructor + */ + virtual ~CFLDPlayerBase(); + + protected: // Constructors + + /** + * C++ constructor + * @param aShowErrorMsgs Show an error note if the file format is not supported + */ + CFLDPlayerBase( TBool aShowErrorMsgs ); + + /** + * Second phase constructor + */ + void BaseConstructL(); + + public: // From MFLDFileProcessor + + /** + * Set the volume level on which the sound is played + * If this method is not called, player uses the setting in active profile. + * @param aVolume The volume level + */ + void SetVolume( TInt aVolume ); + + /** + * Sets the ringing type + * If this method is not called, player uses the setting in active profile. + * @param aRingingType The ringing type (see enum TRingingTypes) + */ + void SetRingingType( TInt aRingingType ); + + /** + * Sets vibrating alert on or off. + * If this method is not called, player uses the setting in active profile. + * @param aVibra True: Vibra is on. False: Vibra is off. + */ + void SetVibra( TBool aVibra ); + + /** + * Sets 3d-effects on or off. + * If this method is called using parameter EFalse 3d-effects are + * always disabled even though those are set in active profile. + * Otherwise toneplayer uses the setting in active profile. + * @param a3dEffects True: 3dEffects are on. False: 3dEffects are off. + */ + void Set3dEffects( TBool a3dEffects ); + + protected: // New methods + + /** See if a call is ongoing. + * @return ETrue if a call is ongoing, EFalse otherwise. + */ + TBool IsCallOngoing() const; + + /** + * Helper method to adapt the Profiles volume to player volume. + * @param aVolume the volume value to be converted. + * @param aMaxVolume maximum volume level of the player used. + * @return the converted volume. + */ + TInt BaseConvertVolume( TInt aVolume, TInt aMaxVolume ); + + /** + * Show note "Tone format not supported" + */ + void DisplayErrorNoteL(); + + /** + * Gets the data type of the given file. + * @param aFileName path to the file which data type must be found out + * @param aDataType value return parameter to hold the data type + * @return system-wide error code + */ + TInt DataType( const TDesC& aFileName, TDataType& aDataType ); + + private: // Methods derived from MCenRepNotifyHandlerCallback + void HandleNotifyInt(TUint32 aId, TInt aNewValue); + + private: // Methods derived from MCoeForegroundObserver + + /** + * Derived from MCoeForegroundObserver. Called when application gains foreground. + */ + void HandleGainingForeground(); + + /** + * Derived from MCoeForegroundObserver. Stops playing the file if + * this application loses focus. + */ + void HandleLosingForeground(); + + protected: // Data + + /// Ringingvolume + TInt iRingingVolume; + /// Ringingtype + TInt iRingingType; + /// Vibrasetting (on/off) + TBool iVibra; + /// Own: pointer to error message + HBufC* iErrorMessage; + /// Prevent tone playing, if application has lost focus + TBool iFocusLost; + /// Default tone + TFileName iDefaultTone; + // Ringingtone Plugin (should be created/deleted by subclass) + C3DRingingToneInterface* i3dRingingTonePlugin; + /// 3DSettings (on/off) + TBool i3dEffects; + + private: // Data + + /// Own: Pointer to volumenotifyhandler + CCenRepNotifyHandler* iVolumeNotifyHandler; + /// Own: Pointer to typenotifyhandler + CCenRepNotifyHandler* iTypeNotifyHandler; + /// Own: Pointer to vibranotifyhandler + CCenRepNotifyHandler* iVibraNotifyHandler; + /// Own: Pointer to CR session + CRepository* iSession; + /// Own: Pointer to CR vibra session + CRepository* iVibraSession; + /// Show an error, if the file format is not supported + TBool iShowErrorMsgs; + // Find out tone MIME -type + RApaLsSession iApaSession; + + }; + +#endif // __CFLDPLAYERBASE_H__ + +// End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDPopupList.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDPopupList.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,637 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the CFLDPopupList. +* +*/ + + + +// CLASS HEADER +#include "CFLDPopupList.h" + +// INTERNAL INCLUDES +#include "CFLDFileListModel.h" +#include "MFLDFileObserver.h" +#include "MFLDFileListBoxObserver.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include // KAvkonBitmapFile, KAvkonVariatedBitmapsFile +#include // MBM indices for seamless link +#include +#include +#include +#include +#include +#ifdef RD_TACTILE_FEEDBACK +#include +#endif //RD_TACTILE_FEEDBACK +// CONSTANTS +namespace + { + _LIT( KFLDMassStorageBitmapFile, "z:filelist.mbm" ); + _LIT( KFLDMemoryCardUiBitmapFile, "z:aknmemorycardui.mbm" ); + + const TInt KIconGranularity( 3 ); + } + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CFLDPopupList::CFLDPopupList +// C++ constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CFLDPopupList::CFLDPopupList( + MFLDFileObserver& aFileObserver, + MFLDFileListBoxObserver* aListBoxObserver, + CFLDFileListModel& aModel ) + : CAknPopupList(), + iFileObserver( aFileObserver ), + iListBoxObserver( aListBoxObserver ), + iModel( aModel ), + iPoint(-1,-1) + { + } + + +void CFLDPopupList::ConstructL( + CEikListBox* aListBox, TInt aCbaResource, AknPopupLayouts::TAknPopupLayouts aType ) + { + // Notify foreground lost + CCoeEnv* coeEnv = CCoeEnv::Static(); + coeEnv->AddForegroundObserverL( *this ); + coeEnv->AddFocusObserverL( *this ); + + CAknPopupList::ConstructL( aListBox, aCbaResource, aType ); + } + +// ----------------------------------------------------------------------------- +// CFLDPopupList::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CFLDPopupList* CFLDPopupList::NewL( + CEikListBox* aListBox, + TInt aCbaResource, + MFLDFileObserver& aFileObserver, + MFLDFileListBoxObserver* aListBoxObserver, + CFLDFileListModel& aModel, + AknPopupLayouts::TAknPopupLayouts aType ) + { + CFLDPopupList* self = new( ELeave ) + CFLDPopupList( aFileObserver, aListBoxObserver, aModel ); + CleanupStack::PushL( self ); + self->ConstructL( aListBox, aCbaResource, aType ); + CleanupStack::Pop( self ); + return self; + } + +// Destructor + CFLDPopupList::~CFLDPopupList() + { + CCoeEnv::Static()->RemoveForegroundObserver( *this ); + CCoeEnv::Static()->RemoveFocusObserver( *this ); + } + + // ----------------------------------------------------------------------------- + // CFLDPopupList::HandlePointerEventL + // (other items were commented in a header). + // ----------------------------------------------------------------------------- + // + void CFLDPopupList::HandlePointerEventL(const TPointerEvent& aPointerEvent) + { + if ( aPointerEvent.iType == TPointerEvent::EButton1Down) + { + iPoint = aPointerEvent.iPosition; + CancelPreview(); + } + if (!Rect().Contains(iPoint)) + { +#ifdef RD_TACTILE_FEEDBACK + MTouchFeedback* feedback = MTouchFeedback::Instance(); + if (feedback) + { + feedback->InstantFeedback(this, ETouchFeedbackBasic); + } +#endif //RD_TACTILE_FEEDBACK } + AttemptExitL(EFalse); + } + CAknPopupList::HandlePointerEventL(aPointerEvent); + } +// ----------------------------------------------------------------------------- +// CFLDPopupList::AttemptExitL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPopupList::AttemptExitL( TBool aAccept ) + { + if( iExitChecksDone ) + { + CAknPopupList::AttemptExitL( aAccept ); + return; + } + + TFileName fileName( KNullDesC ); + iModel.GetFileName( fileName, iListBox->CurrentItemIndex() ); + +#ifdef RD_VIDEO_AS_RINGING_TONE + // Get current softkey state + if( iListBoxObserver ) + { + iListBoxObserver->HandleSoftKeyState( iSoftKeyState ); + } + TBool isVideo( EFalse ); + if ( iModel.MediaFileType( fileName ) == ECLFMediaTypeVideo ) + { + isVideo = ETrue; + } +#endif + + if( aAccept ) + { + // User made a selection (didn't press cancel). + +#ifdef RD_VIDEO_AS_RINGING_TONE + if( isVideo ) + { + if( iSoftKeyState == + MFLDFileListBoxObserver::EToneSelectionSoftKeyState ) + { + // Cancel listbox timer + if( iListBoxObserver ) + { + iListBoxObserver->HandleFileListBoxEventL( + MFLDFileListBoxObserver::EOtherKeyEvent, + fileName ); + } + } + else + { + // No need to cancel timer + // (it has been already cancelled) + } + } + else + { + // Cancel listbox timer + if( iListBoxObserver ) + { + iListBoxObserver->HandleFileListBoxEventL( + MFLDFileListBoxObserver::EOtherKeyEvent, + fileName ); + } + } +#else + // Cancel listbox timer + if( iListBoxObserver ) + { + iListBoxObserver->HandleFileListBoxEventL( + MFLDFileListBoxObserver::EOtherKeyEvent, + fileName ); + } +#endif + +#ifdef RD_VIDEO_AS_RINGING_TONE + if( !isVideo ) // Only perform file validity check for audio files here + { + // Ask the observer if the file is valid. + if( !iFileObserver.IsFileValidL( + fileName, MFLDFileObserver::ESelect ) ) + { + // Not ok to close the pop-up. + // Return. Don't call CAknPopupList::AttemptExitL. + return; + } + } + +#else + // Ask the observer if the file is valid. + if( !iFileObserver.IsFileValidL( + fileName, MFLDFileObserver::ESelect ) ) + { + // Not ok to close the pop-up. + // Return. Don't call CAknPopupList::AttemptExitL. + return; + } +#endif + + +#ifdef RD_VIDEO_AS_RINGING_TONE + if( iListBoxObserver ) + { + // Ask the observer if the file is video + if( isVideo ) + {// File is a video + + // Change the softkeys back to normal + iListBoxObserver->HandleFileListBoxEventL( + MFLDFileListBoxObserver::EVideoPreviewCanceled, + fileName ); + + if( iSoftKeyState + == MFLDFileListBoxObserver::EToneSelectionSoftKeyState ) + { // File is a video and we are in tone selection list + + // Ask the observer if the file is valid. + if( !iFileObserver.IsFileValidL( + fileName, MFLDFileObserver::ESelect ) ) + { + // Not ok to close the pop-up. + // Return. Don't call CAknPopupList::AttemptExitL. + return; + } + } + else if( iSoftKeyState + == MFLDFileListBoxObserver::EPreviewSoftKeyState ) + { // File is a video and it has been focused for 1s + + // Ask the observer if the file is valid. + if( !iFileObserver.IsFileValidL( + fileName, MFLDFileObserver::EPlay ) ) + { + // Not ok to close the pop-up. + // Return. Don't call CAknPopupList::AttemptExitL. + return; + } + + iListBoxObserver->HandleFileListBoxEventL( + MFLDFileListBoxObserver::EVideoPreview, + fileName ); + + // Disable scrollbar + ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( ETrue ); + + // Remove the focus from listbox + ListBox()->SetDimmed( ETrue ); + + // Not ok to close the pop-up. + // Return. Don't call CAknPopupList::AttemptExitL. + return; + } + else if( iSoftKeyState + == MFLDFileListBoxObserver::EPreviewSelectSoftKeyState ) + { // File is a video and it is in preview state + + // Ask the observer if the file is valid. + if( !iFileObserver.IsFileValidL( + fileName, MFLDFileObserver::ESelect ) ) + { + // When video screen is closed, + // listbox must be forced to be refreshed + // ( otherwise scrollbar is not redrawn) + ListBox()->SetDimmed( EFalse ); + ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse ); + DrawNow( CEikonEnv::Static()->EikAppUi()->ApplicationRect() ); + // Not ok to close the pop-up. + // Return. Don't call CAknPopupList::AttemptExitL. + return; + } + + // When video screen is closed, listbox must be refreshed + DrawDeferred(); + } + } + } + } + else // if( aAccept ) + { + // User canceled selection + if( iListBoxObserver ) + { + if( isVideo ) + { // File is a video + + // Change the softkeys back to normal + iListBoxObserver->HandleFileListBoxEventL( + MFLDFileListBoxObserver::EVideoPreviewCanceled, + fileName ); + + if( iSoftKeyState == + MFLDFileListBoxObserver::EPreviewSelectSoftKeyState ) + { // File is a video and it is in preview state + + // When video screen is closed, + // listbox must be forced to be refreshed + // ( otherwise scrollbar is not redrawn) + ListBox()->SetDimmed( EFalse ); + ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse ); + DrawNow( CEikonEnv::Static()->EikAppUi()->ApplicationRect() ); + // Not ok to close the pop-up. + // Return. Don't call CAknPopupList::AttemptExitL. + return; + } + } + } +#endif + + } + + iExitChecksDone = ETrue; + CAknPopupList::AttemptExitL( aAccept ); + } + +// ----------------------------------------------------------------------------- +// CFLDPopupList::HandleResourceChange +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPopupList::HandleResourceChange( TInt aType ) + { +#ifdef RD_VIDEO_AS_RINGING_TONE + if( aType == KEikDynamicLayoutVariantSwitch || + aType == KAknsMessageSkinChange ) + { + if( iListBoxObserver ) + { + TRAP_IGNORE( iListBoxObserver->HandleFileListBoxEventL( + MFLDFileListBoxObserver::EVideoPreviewCanceled ) ); + if( ListBox()->IsFocused() ) + { + ListBox()->SetDimmed( EFalse ); + ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse ); + } + } + } +#endif + if( aType == KAknsMessageSkinChange ) + { + TRAP_IGNORE( PopulateIconArrayL() ); + } + + CAknPopupList::HandleResourceChange( aType ); + } + +// ----------------------------------------------------------------------------- +// CFLDPopupList::GetFileListBoxObserver +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +MFLDFileListBoxObserver* CFLDPopupList::GetFileListBoxObserver() + { + return iListBoxObserver; + } + +// ----------------------------------------------------------------------------- +// CFLDPopupList::HandleListBoxEventL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPopupList::HandleListBoxEventL( CEikListBox* aListBox, + TListBoxEvent aEventType ) + { + switch( aEventType ) + { + // Special handling for touch: first click just starts preview; + // second click (double click) will select the tone. + // Fall through. + case EEventItemClicked: + { + iModel.GetFileName( iCurrentFileName, iListBox->CurrentItemIndex() ); + iListBoxObserver->HandleFileListBoxEventL( + MFLDFileListBoxObserver::EFocusChanged, iCurrentFileName ); + return; + } + + case EEventItemDoubleClicked: + AttemptExitL( ETrue ); + return; + + default: + break; + } + + CAknPopupList::HandleListBoxEventL( aListBox, aEventType ); + } + +// ----------------------------------------------------------------------------- +// CFLDPopupList::CancelPreview +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPopupList::CancelPreview() + { + if( iListBoxObserver ) + { + TRAP_IGNORE( iListBoxObserver->HandleFileListBoxEventL( + MFLDFileListBoxObserver::EOtherKeyEvent, KNullDesC ) ); + } + } + +// ----------------------------------------------------------------------------- +// CFLDPopupList::PopupListWindow:: +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +RWindow& CFLDPopupList::PopupListWindow() const + { + return Window(); + } + +// ----------------------------------------------------------------------------- +// CFLDPopupList::HandleGainingForeground +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPopupList::HandleGainingForeground() + { + TRAP_IGNORE( ListBox()->HandleItemAdditionL() ); + } +// ----------------------------------------------------------------------------- +// CFLDPopupList::HandleLosingForeground +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPopupList::HandleLosingForeground() + { + if( iListBoxObserver ) + { + iListBoxObserver->HandleSoftKeyState( iSoftKeyState ); + if( iSoftKeyState == MFLDFileListBoxObserver::EPreviewSelectSoftKeyState ) + { + TRAP_IGNORE( iListBoxObserver->HandleFileListBoxEventL( + MFLDFileListBoxObserver::EVideoPreviewCanceled, KNullDesC ) ); + DrawNow(); + } + + // Set the vertical scroll bar and listbox to not dimmed. + if ( ListBox()->IsFocused() ) + { + ListBox()->SetDimmed( EFalse ); + ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse ); + } + } + } + +// ----------------------------------------------------------------------------- +// CFLDPopupList::HandleChangeInFocus +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPopupList::HandleChangeInFocus() + { + if( ListBox()->IsFocused() ) + { + ListBox()->SetDimmed( EFalse ); + } + } +// ----------------------------------------------------------------------------- +// CFLDPopupList::HandleDestructionOfFocusedItem +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPopupList::HandleDestructionOfFocusedItem() + { + } + +// ----------------------------------------------------------------------------- +// CFLDPopupList::PopulateIconArrayL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDPopupList::PopulateIconArrayL() + { + CAknSingleGraphicBtPopupMenuStyleListBox* listBox = + static_cast( ListBox() ); + + if( !listBox ) + { + return; + } + + // Create new icon array + CArrayPtr* iconArray = new( ELeave ) CAknIconArray( KIconGranularity ); + CleanupStack::PushL( iconArray ); + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + // + // Create an empty icon in icon array position 0 + // + CGulIcon* icon = + AknsUtils::CreateGulIconL( skin, KAknsIIDQgnPropEmpty, KAvkonBitmapFile, + EMbmAvkonQgn_prop_empty, EMbmAvkonQgn_prop_empty_mask ); + CleanupStack::PushL( icon ); + iconArray->AppendL( icon ); + CleanupStack::Pop( icon ); + + // + // Create an URL icon for download tones in icon array position 1 + // + icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnPropLinkEmbdSmall, + KAvkonVariatedBitmapsFile, + EMbmVariatedbitmapsQgn_prop_link_embd_small, + EMbmVariatedbitmapsQgn_prop_link_embd_small_mask ); + CleanupStack::PushL( icon ); + iconArray->AppendL( icon ); + CleanupStack::Pop( icon ); + + // + // Create an memory card icon in icon array position 2 + // + TParse* fp = new(ELeave) TParse(); + fp->Set(KFLDMemoryCardUiBitmapFile, &KDC_APP_BITMAP_DIR, NULL); + TFileName resourceFileName( fp->FullName() ); + delete fp; + + TRgb defaultColour( KRgbBlack ); + CFbsBitmap* bmap = NULL; + CFbsBitmap* mask = NULL; + + AknsUtils::GetCachedColor( skin, defaultColour, + KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13 ); + AknsUtils::CreateColorIconLC( skin, KAknsIIDQgnPropLinkEmbdSmall, + KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13, bmap, mask, + resourceFileName, EMbmAknmemorycarduiQgn_indi_mmc_add, + EMbmAknmemorycarduiQgn_indi_mmc_add_mask, + defaultColour ); + icon = CGulIcon::NewL( bmap, mask ); + icon->SetBitmapsOwnedExternally( EFalse ); + CleanupStack::Pop( 2 ); // icon owns the bitmaps now + + CleanupStack::PushL( icon ); + iconArray->AppendL( icon ); + CleanupStack::Pop( icon ); + + // + // Create an audio file icon in icon array position 3 + // + icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnPropFmgrFileSound, + KCommonDialogsBitmapFile, + EMbmCommondialogsQgn_prop_fmgr_file_sound, + EMbmCommondialogsQgn_prop_fmgr_file_sound_mask ); + CleanupStack::PushL( icon ); + iconArray->AppendL( icon ); + CleanupStack::Pop( icon ); + + // + // Create a video file icon in icon array position 4 + // + icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnPropFmgrFileVideo, + KCommonDialogsBitmapFile, + EMbmCommondialogsQgn_prop_fmgr_file_video, + EMbmCommondialogsQgn_prop_fmgr_file_video_mask ); + CleanupStack::PushL( icon ); + iconArray->AppendL( icon ); + CleanupStack::Pop( icon ); + + // + // create mass storage icon in icon array position 5 + // + TParse* fp2 = new(ELeave) TParse(); + fp2->Set(KFLDMassStorageBitmapFile, &KDC_APP_BITMAP_DIR, NULL); + resourceFileName = fp2->FullName(); + delete fp2; + + TRgb defaultColour2( KRgbBlack ); + CFbsBitmap* bmap2 = NULL; + CFbsBitmap* mask2 = NULL; + + AknsUtils::GetCachedColor( skin, defaultColour2, + KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13 ); + AknsUtils::CreateColorIconLC( skin, KAknsIIDQgnPropLinkEmbdSmall, + KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13, bmap2, mask2, + resourceFileName, EMbmFilelistQgn_indi_fmgr_ms_add, + EMbmFilelistQgn_indi_fmgr_ms_add_mask, + defaultColour2 ); + + icon = CGulIcon::NewL( bmap2, mask2 ); + icon->SetBitmapsOwnedExternally( EFalse ); + CleanupStack::Pop( 2 ); // icon owns the bitmaps now + + CleanupStack::PushL( icon ); + iconArray->AppendL( icon ); + CleanupStack::Pop( icon ); + + + // Delete old icons + CArrayPtr* arr = listBox->ItemDrawer()->ColumnData()->IconArray(); + if( arr ) + { + arr->ResetAndDestroy(); + delete arr; + arr = NULL; + } + + listBox->ItemDrawer()->ColumnData()->SetIconArrayL( iconArray ); + CleanupStack::Pop( iconArray ); + + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDPopupList.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDPopupList.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A thin CAknPopupList extension. +* +*/ + + + +#ifndef CFLDPOPUPLIST_H +#define CFLDPOPUPLIST_H + +// INTERNAL INCLUDES +#include "MFLDFileListBoxObserver.h" // For TFileListSoftKeyState + +// EXTERNAL INCLUDES +#include +#include // For MCoeForegroundObserver + +// FORWARD DECLARATIONS +class MFLDFileObserver; +class CFLDFileListModel; + +// CLASS DECLARATION + +/** +* A thin CAknPopupList extension. +* Prevents closing the pop-up if the pop-up observer so wishes. +* +* @lib filelist.lib +* @since 2.1 +*/ +NONSHARABLE_CLASS( CFLDPopupList ) + : public CAknPopupList, public MCoeForegroundObserver, public MCoeFocusObserver + { + + + public: // New methods + + /** + * Two-phased constructor. + * @param aListbox A parameter to CAknPopupList. + * @param aCbaResource A parameter to CAknPopupList. + * @param aFileObserver File observer. + * @param aListBoxObserver Listbox observer, can be NULL. + * @param aModel Filelist Model. + * @param aType A parameter to CAknPopupList. + */ + static CFLDPopupList* NewL( + CEikListBox* aListBox, + TInt aCbaResource, + MFLDFileObserver& aFileObserver, + MFLDFileListBoxObserver* aListBoxObserver, + CFLDFileListModel& aModel, + AknPopupLayouts::TAknPopupLayouts aType = AknPopupLayouts::EMenuWindow ); + + void ConstructL(CEikListBox* aListBox, TInt aCbaResource, AknPopupLayouts::TAknPopupLayouts aType ); + + + /** + * Destructor. + */ + virtual ~CFLDPopupList(); + + /** + * Returns Popuplist RWindow handle + */ + RWindow& PopupListWindow() const; + + /** + * Populates icon array and updates ListBox + */ + void PopulateIconArrayL(); + + /** + * Cancels audio/video preview + */ + void CancelPreview(); + + /** + * Handles pointer events of popups. + */ + void HandlePointerEventL(const TPointerEvent& aPointerEvent); + + /** + * Returns FileListBoxObserver. + */ + MFLDFileListBoxObserver* GetFileListBoxObserver(); + + private: // From CAknPopupList + void AttemptExitL( TBool aAccept ); + void HandleResourceChange(TInt aType); + void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); + + private: // From MCoeForegroundObserver + void HandleGainingForeground(); + void HandleLosingForeground(); + + private: // From MCoeFocusObserver + void HandleChangeInFocus(); + void HandleDestructionOfFocusedItem(); + + private: + + /** + * C++ constructor. + * @param aFileObserver File observer. + * @param aListBoxObserver Listbox observer, can be NULL. + * @param aModel Filelist Model. + */ + CFLDPopupList( + MFLDFileObserver& aFileObserver, + MFLDFileListBoxObserver* aListBoxObserver, + CFLDFileListModel& aModel ); + + private: // New methods + + private: // Data + + /// File observer + MFLDFileObserver& iFileObserver; + + /// Ref: Listbox observer + MFLDFileListBoxObserver* iListBoxObserver; + + /// FileList Model + CFLDFileListModel& iModel; + + + /// Current softkeystate + MFLDFileListBoxObserver::TFileListSoftKeyState iSoftKeyState; + + + TFileName iCurrentFileName; + + // Have the checks in AttemptExitL been done already + TBool iExitChecksDone; + TPoint iPoint; + }; + +#endif // CFLDPOPUPLIST_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDRingingTonePlayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDRingingTonePlayer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,474 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CFLDRingingTonePlayer is used to play sound files. It takes into account +* the current volume and ringing type settings. +* +* +*/ + + +// CLASS HEADER +#include "CFLDRingingTonePlayer.h" + +// EXTERNAL INCLUDES +#include +#include +#include // C3DRingingToneInterface +#include + +// CONSTANTS +namespace + { + const TInt KAscendingVolumeInterval( 3000000 ); // 3 seconds + const TInt KToneInterval( 1000000 ); // 1 second pause between tones + + _LIT( KDataTypeNone, "" ); + _LIT( KFileListRngMimeType, "application/vnd.nokia.ringing-tone" ); + _LIT8( KFileListBeepSequence, "\x00\x11\x06\x0A\x08\x73\x0A\x40\x28\x0A\xF7\ + \x05\xFC\x40\x64\x0A\x08\x40\x32\x0A\xF7\x06\x0B" ); //sequence for playing a beep once sound + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CFLDRingingTonePlayer::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CFLDRingingTonePlayer* CFLDRingingTonePlayer::NewL( TBool aShowErrorMsgs ) + { + CFLDRingingTonePlayer* self = new( ELeave ) CFLDRingingTonePlayer( aShowErrorMsgs ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); // self + return self; + } + +// Destructor +CFLDRingingTonePlayer::~CFLDRingingTonePlayer() + { + Cancel(); // Stops possible playback + + delete iAudioPlayer; + delete iTonePlayer; + + delete i3dRingingTonePlugin; + } + +// ----------------------------------------------------------------------------- +// CFLDRingingTonePlayer::CFLDRingingTonePlayer +// C++ constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CFLDRingingTonePlayer::CFLDRingingTonePlayer( TBool aShowErrorMsgs ) + : CFLDPlayerBase( aShowErrorMsgs ), + iAudioPlayerStatus( EAudioPlayerNotCreated ), + iTonePlayerStatus( EAudioPlayerNotCreated ) + { + i3dEffects = ETrue; + i3DEffect = KErrNotFound; + i3DEcho = KErrNotFound; + } + +// ----------------------------------------------------------------------------- +// CFLDRingingTonePlayer::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CFLDRingingTonePlayer::ConstructL() + { + BaseConstructL(); + + // To allow/not allow screensaver + // Errors ignored, no actions needed if API is not available + iPropScreenSaver.Attach( KPSUidScreenSaver, KScreenSaverAllowScreenSaver ); + + } + +// ----------------------------------------------------------------------------- +// CFLDRingingTonePlayer::ProcessFileL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDRingingTonePlayer::ProcessFileL( const TDesC& aFileName, RWindow* /*aWindow*/ ) + { + if ( aFileName == KNullDesC || iFocusLost ) + { + return; + } + + Cancel(); // Stops possible playback + + TDataType dataType; + TInt error( DataType( aFileName, dataType ) ); + if( ( error != KErrNotFound ) && ( error != KErrNone ) ) + { + User::Leave( error ); + } + + // Do not allow screen saver while playing + // Errors ignored, no actions needed if API is not available + iPropScreenSaver.Set( KPSUidScreenSaver, + KScreenSaverAllowScreenSaver, EFLScreenSaverNotAllowed ); + + delete iTonePlayer; + iTonePlayer = NULL; + + delete iAudioPlayer; + iAudioPlayer = NULL; + + if ( iRingingType == ERingingTypeBeepOnce ) + { + // Active profile ringing tone is set to Beep Once + // Don't initialize a FileSequence but use DesSequence instead + iTonePlayer = CMdaAudioToneUtility::NewL( *this ); + iTonePlayer->PrepareToPlayDesSequence( KFileListBeepSequence() ); + iTonePlayerStatus = EAudioPlayerInitializing; + } + else + { + TPtrC ptr( aFileName ); + if( error ) + { + ptr.Set( iDefaultTone ); + } + if( dataType.Des().CompareF( KFileListRngMimeType ) == 0 ) + { + //Ringingtone is a RNG-file + iTonePlayer = CMdaAudioToneUtility::NewL( *this ); + iTonePlayer->PrepareToPlayFileSequence( ptr ); + iTonePlayerStatus = EAudioPlayerInitializing; + } + // If the mime type is NULL, the file can't be play. + else if ( dataType.Des().CompareF( KDataTypeNone ) == 0 ) + { + return; + } + else + { + iAudioPlayer = CDrmPlayerUtility::NewFilePlayerL( + ptr, *this, KAudioPriorityRingingTonePreview, + TMdaPriorityPreference ( + iVibra ? KAudioPrefRingFilePreviewVibra : + KAudioPrefRingFilePreview ) ); + + iAudioPlayerStatus = EAudioPlayerInitializing; + } + } + } + +// ----------------------------------------------------------------------------- +// CFLDRingingTonePlayer::Cancel() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDRingingTonePlayer::Cancel() + { + if ( iAudioPlayerStatus == EAudioPlayerPlayingWith3DEffect ) + { + i3dRingingTonePlugin->Stop(); + // plugin calls AudioPlayer->Stop() + iAudioPlayer->Close(); + delete iAudioPlayer; + iAudioPlayer = NULL; + } + + if ( iAudioPlayerStatus == EAudioPlayerPlaying ) + { + if( iAudioPlayer ) + { + iAudioPlayer->Stop(); + iAudioPlayer->Close(); + delete iAudioPlayer; + iAudioPlayer = NULL; + } + } + + iAudioPlayerStatus = EAudioPlayerReady; + + if ( iTonePlayerStatus == EAudioPlayerPlaying ) + { + if( iTonePlayer ) + { + iTonePlayer->CancelPlay(); + delete iTonePlayer; + iTonePlayer = NULL; + } + } + iTonePlayerStatus = EAudioPlayerReady; + + // Allow screen saver, unless there's a call ongoing + if( !IsCallOngoing() ) + { + // Errors ignored, no actions needed if API is not available + iPropScreenSaver.Set( KPSUidScreenSaver, + KScreenSaverAllowScreenSaver, EFLScreenSaverAllowed ); + } + +} + +// ----------------------------------------------------------------------------- +// CFLDRingingTonePlayer::DoSetRingingType() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDRingingTonePlayer::DoSetRingingType( TInt aRingingType ) + { + if( iAudioPlayerStatus == EAudioPlayerInitialized ) + { + switch( aRingingType ) + { + // Fall through + case ERingingTypeRinging: + case ERingingTypeSilent: + { + iAudioPlayer->SetRepeats( + KMdaRepeatForever, TTimeIntervalMicroSeconds( KToneInterval ) ); + break; + } + case ERingingTypeAscending: + { + iAudioPlayer->SetRepeats( + KMdaRepeatForever, TTimeIntervalMicroSeconds( KToneInterval ) ); + TInt volRamp = KAscendingVolumeInterval * iRingingVolume; + iAudioPlayer->SetVolumeRamp( TTimeIntervalMicroSeconds( volRamp ) ); + break; + } + case ERingingTypeRingOnce: + { + iAudioPlayer->SetRepeats( + 0, TTimeIntervalMicroSeconds( KToneInterval ) ); + break; + } + + default: + { + break; + } + } + } + else if( iTonePlayerStatus == EAudioPlayerInitialized ) + { + switch( aRingingType ) + { + // Fall through + case ERingingTypeRinging: + case ERingingTypeSilent: + { + iTonePlayer->SetRepeats( + KMdaRepeatForever, TTimeIntervalMicroSeconds( KToneInterval ) ); + break; + } + case ERingingTypeAscending: + { + iTonePlayer->SetRepeats( + KMdaRepeatForever, TTimeIntervalMicroSeconds( KToneInterval ) ); + TInt volRamp = KAscendingVolumeInterval * iRingingVolume; + iTonePlayer->SetVolumeRamp( TTimeIntervalMicroSeconds( volRamp ) ); + break; + } + // Fall through + case ERingingTypeRingOnce: + case ERingingTypeBeepOnce: + { + iTonePlayer->SetRepeats( + 0, TTimeIntervalMicroSeconds( KToneInterval ) ); + break; + } + default: + { + break; + } + } + } + } + +// ----------------------------------------------------------------------------- +// CFLDRingingTonePlayer::ConvertVolume() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CFLDRingingTonePlayer::ConvertVolume( TInt aVolume ) + { + TInt result( 0 ); + if ( iAudioPlayerStatus == EAudioPlayerInitialized || + iAudioPlayerStatus == EAudioPlayerPlaying ) + { + result = BaseConvertVolume( aVolume, iAudioPlayer->MaxVolume() ); + } + else if( iTonePlayerStatus == EAudioPlayerInitialized || + iTonePlayerStatus == EAudioPlayerPlaying ) + { + result = BaseConvertVolume( aVolume, iTonePlayer->MaxVolume() ); + } + //if user has selected silent ringing type, set volume off + if( iRingingType == ERingingTypeSilent ) + { + result = 0; + } + + return result; + } + +// ----------------------------------------------------------------------------- +// CFLDRingingTonePlayer::MdapcInitComplete() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDRingingTonePlayer::MdapcInitComplete( + TInt aError, const TTimeIntervalMicroSeconds& /* aDuration */ ) + { + if ( !aError && iAudioPlayerStatus == EAudioPlayerInitializing ) + { + iAudioPlayerStatus = EAudioPlayerInitialized; + DoSetRingingType( iRingingType ); + iAudioPlayer->SetVolume( ConvertVolume( iRingingVolume ) ); + iAudioPlayer->SetPriority( KAudioPriorityPreview, + TMdaPriorityPreference( iVibra ? KAudioPrefRingFilePreviewVibra : + KAudioPrefRingFilePreview ) ); + + if ( iRingingType == ERingingTypeBeepOnce ) + { + return; // beeb once not handled here + } + + if( !i3dEffects ) + { + iAudioPlayer->Play(); + iAudioPlayerStatus = EAudioPlayerPlaying; + return; + } + + if ( !i3dRingingTonePlugin ) + { + TUid emptyUid = { 0 }; + TRAPD( err, i3dRingingTonePlugin = C3DRingingToneInterface::NewL( emptyUid ) ); + if ( err != KErrNone || !i3dRingingTonePlugin ) + { + iAudioPlayer->Play(); + iAudioPlayerStatus = EAudioPlayerPlaying; + return; + } + } + if ( i3DEffect != KErrNotFound && i3DEcho != KErrNotFound ) + { + i3dRingingTonePlugin->SetAttr( E3DRTIAttr3DEffect, i3DEffect ); + i3dRingingTonePlugin->SetAttr( E3DRTIAttr3DEcho, i3DEcho ); + } + + i3dRingingTonePlugin->SetAttr( E3DRTIAttrDrmPlayerUtility, iAudioPlayer ); + TRAP_IGNORE( i3dRingingTonePlugin->PlayL() ); + iAudioPlayerStatus = EAudioPlayerPlayingWith3DEffect; + } + else + { + Cancel(); + if ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ) + { + // Don't care about leave, if the note can't be displayed. + TRAP_IGNORE( DisplayErrorNoteL() ); + } + } + } + +// ----------------------------------------------------------------------------- +// CFLDRingingTonePlayer::MdapcPlayComplete() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDRingingTonePlayer::MdapcPlayComplete( TInt aError ) + { + if ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ) + { + // Don't care about leave, if the note can't be displayed. + TRAP_IGNORE( DisplayErrorNoteL() ); + } + + Cancel(); + } + +// ----------------------------------------------------------------------------- +// CFLDRingingTonePlayer::MatoPrepareComplete() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDRingingTonePlayer::MatoPrepareComplete( TInt aError ) + { + if ( !aError && iTonePlayerStatus == EAudioPlayerInitializing ) + { + iTonePlayerStatus = EAudioPlayerInitialized; + DoSetRingingType( iRingingType ); + iTonePlayer->SetVolume( ConvertVolume( iRingingVolume ) ); + iTonePlayer->SetPriority( KAudioPriorityPreview, + TMdaPriorityPreference( iVibra ? KAudioPrefRingFilePreviewVibra : + KAudioPrefRingFilePreview ) ); + iTonePlayer->Play(); + iTonePlayerStatus = EAudioPlayerPlaying; + } + else + { + Cancel(); + if ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ) + { + // Don't care about leave, if the note can't be displayed. + TRAP_IGNORE( DisplayErrorNoteL() ); + } + } + } + +// ----------------------------------------------------------------------------- +// CFLDRingingTonePlayer::MatoPlayComplete() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDRingingTonePlayer::MatoPlayComplete( TInt aError ) + { + if ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ) + { + // Don't care about leave, if the note can't be displayed. + TRAP_IGNORE( DisplayErrorNoteL() ); + } + + Cancel(); + } + + +// ----------------------------------------------------------------------------- +// CFLDRingingTonePlayer::Set3dEffects() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDRingingTonePlayer::Set3dEffects( TBool a3dEffects ) + { + const TInt K3DEffectBase = 1000; + const TInt K3DEchoBase = 2000; + + i3dEffects = a3dEffects; + + if ( a3dEffects >= K3DEffectBase && a3dEffects < K3DEchoBase ) + { + i3DEffect = a3dEffects - K3DEffectBase; + return; + } + + if ( a3dEffects >= K3DEchoBase ) + { + i3DEcho = a3dEffects - K3DEchoBase; + return; + } + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDRingingTonePlayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDRingingTonePlayer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,193 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CFLDRingingTonePlayer is used to play sound files. It takes into account +* the current volume and ringing type settings. +* +* +*/ + + +#ifndef __CFLDRINGINGTONEPLAYER_H__ +#define __CFLDRINGINGTONEPLAYER_H__ + +// INTERNAL INCLUDES +//#include "MFLDFileProcessor.h" +#include "CFLDPlayerBase.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include + + +// FORWARD DECLARATIONS +class C3DRingingToneInterface; + +// CLASS DECLARATION + +/** +* CFLDRingingTonePlayer is used to play sound files. It takes into account the current +* volume and ringing type settings. +* +* @lib filelist.lib +* @since 2.1 +*/ +NONSHARABLE_CLASS( CFLDRingingTonePlayer ) + : public CFLDPlayerBase, + public MDrmAudioPlayerCallback, + public MMdaAudioToneObserver + { + private: // Enumerations + + enum TAudioPlayerStatus + { + EAudioPlayerNotCreated, + EAudioPlayerInitializing, + EAudioPlayerReady, + EAudioPlayerPlaying, + EAudioPlayerInitialized, + EAudioPlayerPlayingWith3DEffect + }; + + // These match with the ones in Profile Engine + enum TRingingTypes + { + ERingingTypeRinging = 0, + ERingingTypeAscending, + ERingingTypeRingOnce, + ERingingTypeBeepOnce, + ERingingTypeSilent + }; + + enum TFLAllowScreenSaver + { + EFLScreenSaverAllowed = 0, + EFLScreenSaverNotAllowed + }; + + public: // Constructors and destructors + + /** + * Two-phase static constructor + * @param aShowErrorMsgs Show an error note if the file format is not supported + * @return A pointer to a fully constructed CFLDRingingTonePlayer instance + */ + static CFLDRingingTonePlayer* NewL( TBool aShowErrorMsgs = ETrue ); + + /** + * Destructor + */ + virtual ~CFLDRingingTonePlayer(); + + private: // Constructors and destructors + + /** + * Constructor + * @param aShowErrorMsgs Show an error note if the file format is not supported + */ + CFLDRingingTonePlayer( TBool aShowErrorMsgs ); + + /** + * Second phase constructor + */ + void ConstructL(); + + public: // From MFLDFileProcessor + + /** + * Derived from MFLDFileProcessor. Starts playing the sound file + */ + void ProcessFileL( const TDesC& aFileName, RWindow* aWindow ); + + /** + * Derived from MFLDFileProcessor. Stops playing the file. + */ + void Cancel(); + + public: + /** + * Enables/disables 3D effects. + * @param a3dEffects. + * @return None. + */ + void Set3dEffects( TBool a3dEffects ); + + + + private: // New methods + + /** When audioplayer is ready, set its ringing type + * @param aRingingType The ringing type (see enum TRingingTypes) + */ + void DoSetRingingType( TInt aRingingType ); + + /** + * Converts volume from 1 to 10 to audio driver understandable value. + * @param aVolume Volume level to be converted. + * @return Returns converted volume level + */ + TInt ConvertVolume( TInt aVolume ); + + private: // Methods derived from MDrmAudioPlayerCallback + + /** + * Derived from MDrmAudioPlayerCallback + * This method is called when the audio player initialisation is ready + */ + void MdapcInitComplete( TInt aError, const TTimeIntervalMicroSeconds& aDuration ); + + /** + * Derived from MDrmAudioPlayerCallback + * This method is called when the audio player has finished playing + */ + void MdapcPlayComplete( TInt aError ); + + private: // Methods derived from MMdaAudioToneObserver + + virtual void MatoPrepareComplete( TInt aError ); + virtual void MatoPlayComplete( TInt aError ); + + private: // Data + + /// Own: Pointer to audioplayer + CDrmPlayerUtility* iAudioPlayer; + /// Audioplayer status + TAudioPlayerStatus iAudioPlayerStatus; + /// Own: Pointer to toneplayer + CMdaAudioToneUtility* iTonePlayer; + /// Toneplayer status + TAudioPlayerStatus iTonePlayerStatus; + + /** + * Pub&Sub property. + * For setting the state of the screen saver. + */ + RProperty iPropScreenSaver; + + // 3D effect + TInt i3DEffect; + // 3D effect + TInt i3DEcho; + + // plugin for playing 3D effects + C3DRingingToneInterface* i3dRingingTonePlugin; + + + }; + +#endif // __CFLDRINGINGTONEPLAYER_H__ + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDSingleGraphicEntryFormatter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDSingleGraphicEntryFormatter.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,296 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the CFLDSingleGraphicEntryFormatter. +* +* +*/ + + +// CLASS HEADER +#include "CFLDSingleGraphicEntryFormatter.h" + +// INTERNAL INCLUDES +#include "CFLDEntryReference.h" + +// EXTERNAL INCLUDES +#include // For TParsePtrC +#include // For AknTextUtils +#include + +// CONSTANTS +namespace + { + // Some helper literals + _LIT( KFLDTab, "\t" ); + _LIT( KFLDIgnoredExt, ".rng" ); + + // these icon array indexes must match with the implementation + // of the function CFLDFileListContainer.cpp/PopulateIconArrayL + _LIT( KFLDZeroAndTab, "0\t" ); + _LIT( KFLDSoundAndTab, "3\t" ); + _LIT( KFLDVideoAndTab, "4\t" ); + _LIT( KFLDMemoryCard, "2" ); + _LIT( KFLDMassStorage, "5" ); + + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CFLDSingleGraphicEntryFormatter::CFLDSingleGraphicEntryFormatter +// C++ constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CFLDSingleGraphicEntryFormatter::CFLDSingleGraphicEntryFormatter() + { + + } + +// ----------------------------------------------------------------------------- +// CFLDSingleGraphicEntryFormatter::~CFLDSingleGraphicEntryFormatter() +// ----------------------------------------------------------------------------- +// +CFLDSingleGraphicEntryFormatter::~CFLDSingleGraphicEntryFormatter() + { + delete iDriveUtil; + } + +// ----------------------------------------------------------------------------- +// CFLDSingleGraphicEntryFormatter::FormatL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDSingleGraphicEntryFormatter::FormatL( CFLDEntryReference& aEntry ) + { + if ( !iDriveUtil ) + { + iDriveUtil = CDriveUtil::NewL(); + } + + HBufC* formattedName = NULL; + HBufC& pathAndMediaFileName = aEntry.PathAndMediaFileName(); + TParsePtrC parsedName( pathAndMediaFileName.Des() ); + +#ifdef RD_VIDEO_AS_RINGING_TONE + TBool isFileVideo( EFalse ); + if ( aEntry.MediaType() == ECLFMediaTypeVideo ) + { + isFileVideo = ETrue; + } + + if( isFileVideo ) + { + formattedName = HBufC::NewL( parsedName.NameAndExt().Length() + KFLDVideoAndTab().Length() * 2 ); + } + else + { + formattedName = HBufC::NewL( parsedName.NameAndExt().Length() + KFLDSoundAndTab().Length() * 2 ); + } +#else + formattedName = HBufC::NewL( parsedName.NameAndExt().Length() + KFLDZeroAndTab().Length() * 2 ); +#endif + + aEntry.SetFormattedPresentation( formattedName ); + + // Combine all the data to the formatted data descriptor: + TPtr des = formattedName->Des(); + + // RNG files are shown without the file extension + TPtrC ext( parsedName.Ext() ); + if ( ext.CompareF( KFLDIgnoredExt ) == 0 ) + { + des.Copy( parsedName.Name() ); + } + else + { + des.Copy( parsedName.NameAndExt() ); + } + + // Make sure that the file name does not contain tab characters + AknTextUtils::ReplaceCharacters( des, KAknReplaceListControlChars, TChar(' ') ); + +#ifdef RD_VIDEO_AS_RINGING_TONE + if( isFileVideo ) + { + des.Insert( 0, KFLDVideoAndTab ); + } + else + { + des.Insert( 0, KFLDSoundAndTab ); + } + +#else + des.Insert( 0, KFLDZeroAndTab ); +#endif + des.Append( KFLDTab ); + + /* + TChar mmcDriveLetter( PathInfo::MemoryCardRootPath()[0] ); + mmcDriveLetter.UpperCase(); + + // Check if the entry is on MMC + TChar entryDriveLetter( parsedName.Drive()[ 0 ] ); + entryDriveLetter.UpperCase(); + + if ( entryDriveLetter == mmcDriveLetter ) + { + des.Append( '2' ); // MMC icon index + } + */ + + if ( iDriveUtil->IsMemoryCard( aEntry.PathAndMediaFileName() ) ) + { + des.Append( KFLDMemoryCard ); + } + else if ( iDriveUtil->IsMassStorage( aEntry.PathAndMediaFileName() ) ) + { + des.Append( KFLDMassStorage ); + } + } + +// ----------------------------------------------------------------------------- +// CFLDSingleGraphicEntryFormatter::FormatTextLC() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +HBufC* CFLDSingleGraphicEntryFormatter::FormatTextLC( const TDesC& aText ) + { + HBufC* text = NULL; + if( aText.Find( KFLDTab ) == KErrNotFound ) + { + text = HBufC::NewLC( aText.Length() + KFLDZeroAndTab().Length() ); + TPtr des( text->Des() ); + des.Copy( KFLDZeroAndTab ); + des.Append( aText ); + } + else + { + text = aText.AllocLC(); + } + return text; + } + + + + +/****************************************************************************** + * class CDriveUtil + ******************************************************************************/ + + +// ----------------------------------------------------------------------------- +// CDriveUtil::NewL +// +// ----------------------------------------------------------------------------- +// +CDriveUtil* CDriveUtil::NewL() + { + CDriveUtil* self = new (ELeave) CDriveUtil(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// +// ----------------------------------------------------------------------------- +// +CDriveUtil::~CDriveUtil() + { + iFsSession.Close(); + } + + +// ----------------------------------------------------------------------------- +// CDriveUtil::CDriveUtil +// +// ----------------------------------------------------------------------------- +// +CDriveUtil::CDriveUtil() + { + } + + +// ----------------------------------------------------------------------------- +// CDriveUtil::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CDriveUtil::ConstructL() + { + User::LeaveIfError( iFsSession.Connect() ); + } + + +// ----------------------------------------------------------------------------- +// CDriveUtil::IsMassStorage +// +// ----------------------------------------------------------------------------- +// +TBool CDriveUtil::IsMassStorage(const TDesC& aFullPath) + { + const TUint KMassStorageBits = DriveInfo::EDriveInternal | + DriveInfo::EDriveExternallyMountable; + + TDriveUnit drive(aFullPath); + TUint driveStatus(0); + + TInt err = DriveInfo::GetDriveStatus( iFsSession, drive, driveStatus ); + if ( err != KErrNone ) + { + return EFalse; + } + + if ( (driveStatus & KMassStorageBits) == KMassStorageBits ) + { + return ETrue; + } + + return EFalse; + } + + +// ----------------------------------------------------------------------------- +// CDriveUtil::IsMemoryCard +// +// ----------------------------------------------------------------------------- +// +TBool CDriveUtil::IsMemoryCard(const TDesC& aFullPath) + { + const TUint KMemoryCardBits = DriveInfo::EDriveRemovable | + DriveInfo::EDriveExternallyMountable; + + TDriveUnit drive(aFullPath); + TUint driveStatus(0); + + TInt err = DriveInfo::GetDriveStatus( iFsSession, drive, driveStatus ); + if ( err != KErrNone ) + { + return EFalse; + } + + if ( (driveStatus & KMemoryCardBits) == KMemoryCardBits ) + { + return ETrue; + } + + return EFalse; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDSingleGraphicEntryFormatter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDSingleGraphicEntryFormatter.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This class is responsible of formatting a directory entry to +* a format that is displayable in a CAknSingleGraphicBtPopupMenuStyleListBox. +* +* +*/ + + + +#ifndef CFLDSINGLEGRAPHICENTRYFORMATTER_H +#define CFLDSINGLEGRAPHICENTRYFORMATTER_H + +// INTERNAL INCLUDES +#include "MFLDEntryFormatter.h" + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CFLDEntryRefererence; + +// CLASS DECLARATION + + +/** +* CDriveUtil +* +* CDriveUtil is used for getting drive information. +*/ +NONSHARABLE_CLASS (CDriveUtil) : public CBase + { + public: + static CDriveUtil* NewL(); + virtual ~CDriveUtil(); + + private: + CDriveUtil(); + void ConstructL(); + + public: + TBool IsMemoryCard(const TDesC& aFullPath); + TBool IsMassStorage(const TDesC& aFullPath); + + private: + RFs iFsSession; + }; + + +/** +* This class is responsible of formatting a directory entry to +* a format that is displayable in a CAknSingleGraphicBtPopupMenuStyleListBox. +* +* @lib FileList.lib +* @since Series 60 2.6 +*/ +NONSHARABLE_CLASS( CFLDSingleGraphicEntryFormatter ) : + public CBase, public MFLDEntryFormatter + { + public: // // Functions from base classes + + CFLDSingleGraphicEntryFormatter(); + + /** + * Destructor. + */ + virtual ~CFLDSingleGraphicEntryFormatter(); + + + /** + * From MFLDEntryFormatter + */ + void FormatL( CFLDEntryReference& aEntry ); + + /** + * From MFLDEntryFormatter + */ + HBufC* FormatTextLC( const TDesC& aText ); + + private: + CDriveUtil* iDriveUtil; + }; + +#endif // CFLDSINGLEGRAPHICENTRYFORMATTER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDSoftKeyChanger.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDSoftKeyChanger.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,189 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CFLDSoftKeyChanger changes softkeys into video preview layout and +* video preview select layout. Allows also to restore old layout. +* +* +*/ + +// CLASS HEADER +#include "CFLDSoftKeyChanger.h" + +// EXTERNAL INCLUDES +#include // For TParsePtrC +#include +#include // For CEikButtonGroupContainer +#include // For R_FLD_SOFTKEYS_PREVIEW_CANCEL +#include // For R_AVKON_SOFTKEYS_SELECT_CANCEL +#include // For EAknSoftkeySelect + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CFLDSoftKeyChanger::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CFLDSoftKeyChanger* CFLDSoftKeyChanger::NewL() + { + CFLDSoftKeyChanger* self = CFLDSoftKeyChanger::NewLC(); + CleanupStack::Pop( self ); // self + + return self; + } + +// ----------------------------------------------------------------------------- +// CFLDSoftKeyChanger::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CFLDSoftKeyChanger* CFLDSoftKeyChanger::NewLC() + { + CFLDSoftKeyChanger* self = new( ELeave ) CFLDSoftKeyChanger(); + CleanupStack::PushL( self ); + + self->ConstructL( ); + return self; + } + +// Destructor +CFLDSoftKeyChanger::~CFLDSoftKeyChanger() + { + delete iSoftKeySelect; + delete iSoftKeyPreview; + delete iSoftKeyCancel; + delete iSoftKeyBack; + } + + +// ----------------------------------------------------------------------------- +// CFLDSoftKeyChanger::CFLDSoftKeyChanger +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CFLDSoftKeyChanger::CFLDSoftKeyChanger() + : iSoftKeyState( MFLDFileListBoxObserver::EToneSelectionSoftKeyState ) + { + } + +// ----------------------------------------------------------------------------- +// CFLDSoftKeyChanger::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CFLDSoftKeyChanger::ConstructL() + { + iSoftKeySelect = StringLoader::LoadL( R_FLD_QTN_TEXT_SOFTKEY_PREVIEW_SELECT ); + iSoftKeyPreview = StringLoader::LoadL( R_FLD_QTN_TEXT_SOFTKEY_PREVIEW ); + iSoftKeyCancel = StringLoader::LoadL( R_FLD_QTN_TEXT_SOFTKEY_CANCEL ); + iSoftKeyBack = StringLoader::LoadL( R_FLD_QTN_TEXT_SOFTKEY_BACK ); + } + +// ----------------------------------------------------------------------------- +// CFLDSoftKeyChanger::ChangeLeftSoftKeyL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDSoftKeyChanger::ChangeLeftSoftKeyL( const TDesC& aSoftKeyLabel ) const + { + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + CleanupStack::PushL( cba ); + cba->SetCommandL( EAknSoftkeySelect, aSoftKeyLabel ); + CleanupStack::Pop( cba ); + cba->DrawDeferred(); + } + +// ----------------------------------------------------------------------------- +// CFLDSoftKeyChanger::ChangeRightSoftKeyL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDSoftKeyChanger::ChangeRightSoftKeyL( const TDesC& aSoftKeyLabel ) const + { + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + CleanupStack::PushL( cba ); + cba->SetCommandL( EAknSoftkeyCancel, aSoftKeyLabel ); + CleanupStack::Pop( cba ); + cba->DrawDeferred(); + } + + +// ----------------------------------------------------------------------------- +// CFLDSoftKeyChanger::ChangeNewSoftKeysPreviewL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDSoftKeyChanger::ChangeNewSoftKeysPreviewL() + { + if (iSoftKeyState == MFLDFileListBoxObserver::EPreviewSoftKeyState ) + { + return; + } + + CFLDSoftKeyChanger::ChangeLeftSoftKeyL( iSoftKeyPreview->Des() ); + CFLDSoftKeyChanger::ChangeRightSoftKeyL( iSoftKeyCancel->Des() ); + + iSoftKeyState = MFLDFileListBoxObserver::EPreviewSoftKeyState; + } + +// ----------------------------------------------------------------------------- +// CFLDSoftKeyChanger::ChangeNewSoftKeysPreviewSelectL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDSoftKeyChanger::ChangeNewSoftKeysPreviewSelectL() + { + if (iSoftKeyState == MFLDFileListBoxObserver::EPreviewSelectSoftKeyState ) + { + return; + } + + CFLDSoftKeyChanger::ChangeLeftSoftKeyL( iSoftKeySelect->Des() ); + CFLDSoftKeyChanger::ChangeRightSoftKeyL( iSoftKeyBack->Des() ); + + iSoftKeyState = MFLDFileListBoxObserver::EPreviewSelectSoftKeyState; + } + +// ----------------------------------------------------------------------------- +// CFLDSoftKeyChanger::RestoreOldSoftKeysL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDSoftKeyChanger::RestoreOldToneSelectionSoftKeysL() + { + if (iSoftKeyState == MFLDFileListBoxObserver::EToneSelectionSoftKeyState ) + { + return; + } + + CFLDSoftKeyChanger::ChangeLeftSoftKeyL( iSoftKeySelect->Des() ); + CFLDSoftKeyChanger::ChangeRightSoftKeyL( iSoftKeyCancel->Des() ); + + iSoftKeyState = MFLDFileListBoxObserver::EToneSelectionSoftKeyState; + } + +// ----------------------------------------------------------------------------- +// CFLDSoftKeyChanger::SoftKeyState +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +MFLDFileListBoxObserver::TFileListSoftKeyState + CFLDSoftKeyChanger::SoftKeyState() const + { + return iSoftKeyState; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDSoftKeyChanger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDSoftKeyChanger.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CFLDSoftKeyChanger changes softkeys into video preview layout and +* video preview select layout. Allows also to restore old layout. +* +* +*/ + + +#ifndef __CFLDSOFTKEYCHANGER_H__ +#define __CFLDSOFTKEYCHANGER_H__ + +// INTERNAL INCLUDES +#include + +// EXTERNAL INCLUDES +#include "MFLDFileListBoxObserver.h" + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* CFLDSoftKeyChanger changes softkeys into video preview layout and +* video preview select layout. Allows also to restore old layout. +* +* @lib filelist.lib +* @since 3.1 +*/ +NONSHARABLE_CLASS( CFLDSoftKeyChanger ) : public CBase + { + + public: // Constructors and destructors + + /** + * Two-phased static constructor. + * @return A pointer to a fully constructed CFLDSoftKeyChanger instance + */ + static CFLDSoftKeyChanger* NewL(); + + /** + * Two-phased static constructor, leaves a pointer to cleanup stack + * @return A pointer to a fully constructed CFLDSoftKeyChanger instance + */ + static CFLDSoftKeyChanger* NewLC(); + + /** + * Destructor + */ + virtual ~CFLDSoftKeyChanger(); + + protected: // Constructors and destructors + + /** + * Constructor, protected + */ + CFLDSoftKeyChanger(); + + /** + * Second phase constructor + */ + void ConstructL(); + + public: // New methods + + /** + * Changes softkey layout into 'Preview' 'Cancel' + */ + void ChangeNewSoftKeysPreviewL(); + + /** + * Changes softkey layout into 'Select' 'Cancel' + * NOTE: this layout is used only when tone selection list + * is at preview state + */ + void ChangeNewSoftKeysPreviewSelectL(); + + /** + * Restores layout into original 'Select' 'Back' + */ + void RestoreOldToneSelectionSoftKeysL(); + + /** + * Returns current softkeystate + */ + MFLDFileListBoxObserver::TFileListSoftKeyState + SoftKeyState() const; + + private: // New methods + + /** + * Opens filelist internal resource file + */ + void OpenResourceL(); + + /** + * Changes softkey label from given string + * @parameter aSoftKeyLabel new label for softkey + */ + void ChangeLeftSoftKeyL( const TDesC& aSoftKeyLabel ) const; + /** + * Changes softkey label from given string + * @parameter aSoftKeyLabel new label for softkey + */ + void ChangeRightSoftKeyL( const TDesC& aSoftKeyLabel ) const; + + + private: // Data + + // Softkey state + MFLDFileListBoxObserver::TFileListSoftKeyState iSoftKeyState; + + /// Own: SoftkeyLabel + HBufC* iSoftKeySelect; + + /// Own: SoftkeyLabel + HBufC* iSoftKeyPreview; + + /// Own: SoftkeyLabel + HBufC* iSoftKeyCancel; + + /// Own: SoftkeyLabel + HBufC* iSoftKeyBack; + + }; + +#endif // __CFLDSOFTKEYCHANGER_H__ + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDVideoPlayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDVideoPlayer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,612 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Creates a video player and starts video preview +* +* +*/ + + +// CLASS HEADER +#include "CFLDVideoPlayer.h" + +// EXTERNAL INCLUDES +#include // For AknLayoutUtils +#include // For KAudioPriorityPreview +#include + +// CONSTANTS +namespace + { + const TInt KAscendingVolumeRampInterval( 3000000 ); // 3 seconds + const TInt KPhoneVideoVolumeRampStep = 1; + // Used to reset inactivity timer so that backlight stays on + const TInt KResetInactivityTimerDelay = 2000000; // 2 seconds + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CFLDVideoPlayer* CFLDVideoPlayer::NewL( TBool aShowErrorMsgs ) + { + CFLDVideoPlayer* self = new( ELeave ) CFLDVideoPlayer( aShowErrorMsgs ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); // self + return self; + } + +// Destructor +CFLDVideoPlayer::~CFLDVideoPlayer() + { + Cancel(); + + delete iBacklightTimer; + + if( iVolumeRampTimer ) + { + delete iVolumeRampTimer; + } + + if( iVideoPlayer ) + { + delete iVideoPlayer; + } + } + +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::CFLDVideoPlayer +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CFLDVideoPlayer::CFLDVideoPlayer( TBool aShowErrorMsgs ) + : CFLDPlayerBase( aShowErrorMsgs ), + iVideoPlayerStatus( EVideoPlayerNotCreated ) + { + } + +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CFLDVideoPlayer::ConstructL() + { + BaseConstructL(); + + // To allow/not allow screensaver + // Errors ignored, no actions needed if API is not available + iPropScreenSaver.Attach( KPSUidScreenSaver, KScreenSaverAllowScreenSaver ); + + // To keep backlight on while a video is being previewed + iBacklightTimer = CPeriodic::NewL( EPriorityLow ); + } + +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::ProcessFileL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDVideoPlayer::ProcessFileL( const TDesC& aFileName, RWindow* aWindow ) + { + iWindow = aWindow; + + if ( aFileName == KNullDesC || iFocusLost || !iWindow ) + { + return; + } + + Cancel(); // Stops possible playback + + // Do not allow screen saver while playing + // Errors ignored, no actions needed if API is not available + iPropScreenSaver.Set( KPSUidScreenSaver, + KScreenSaverAllowScreenSaver, EFLScreenSaverNotAllowed ); + + iBacklightTimer->Cancel(); // Just in case + // Disable backlight turn off during video preview + iBacklightTimer->Start( KResetInactivityTimerDelay, + KResetInactivityTimerDelay, + TCallBack( DoResetInactivityTimer, NULL ) ); + + // Screen and clip rectangles to window dimensions + TPoint wndPosition( iWindow->AbsPosition() ); + TSize wndSize( iWindow->Size() ); + + // iY and iHeight should be even numbers + if( wndPosition.iY % 2 ) + { + wndPosition.iY = wndPosition.iY + 1; + wndSize.iHeight = wndSize.iHeight - 1; + } + if( wndSize.iHeight % 2 ) + { + wndSize.iHeight = wndSize.iHeight - 1; + } + + TRect wndRect( wndPosition, wndSize ); + + if( iVideoPlayer ) + { + delete iVideoPlayer; + iVideoPlayer = NULL; + } + + iVideoPlayer = + CVideoPlayerUtility::NewL (*this, KAudioPriorityPreview, + TMdaPriorityPreference( iVibra ? KAudioPrefRingFilePreviewVibra : + KAudioPrefRingFilePreview ), + CCoeEnv::Static()->WsSession(), + *(CCoeEnv::Static()->ScreenDevice()), + *iWindow, + wndRect, + wndRect); + + iVideoPlayerStatus = EVideoPlayerReady; + + + TDataType dataType; + TInt error( DataType( aFileName, dataType ) ); + if( ( error != KErrNotFound ) && ( error != KErrNone ) ) + { + User::Leave( error ); + } + + TPtrC ptr( aFileName ); + if( error ) + { + ptr.Set( iDefaultTone ); + } + + iVideoPlayer->OpenFileL( ptr ); + iVideoPlayerStatus = EVideoPlayerInitializing; + } + +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::Cancel +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDVideoPlayer::Cancel() + { + iBacklightTimer->Cancel(); + + if( iVolumeRampTimer ) + { + iVolumeRampTimer->Cancel(); + } + + if( iVideoPlayer ) + { + iVideoPlayer->Stop(); + iVideoPlayer->Close(); + iVideoPlayerStatus = EVideoPlayerReady; + delete iVideoPlayer; + iVideoPlayer = NULL; + } + + // Allow screen saver, unless there's a call ongoing + if( !IsCallOngoing() ) + { + // Errors ignored, no actions needed if API is not available + iPropScreenSaver.Set( KPSUidScreenSaver, + KScreenSaverAllowScreenSaver, EFLScreenSaverAllowed ); + } + + } + +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::DoResetInactivityTimer() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CFLDVideoPlayer::DoResetInactivityTimer( TAny* /*aObject*/ ) + { + User::ResetInactivityTime(); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::DoSetRingingType() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDVideoPlayer::DoSetRingingType( TInt aRingingType ) + { + if( iVideoPlayerStatus == EVideoPlayerInitialized ) + { + switch( aRingingType ) + { + // Fall through + case ERingingTypeRinging: + case ERingingTypeSilent: + case ERingingTypeRingOnce: + { + break; + } + case ERingingTypeAscending: + { + if ( !iVolumeRampTimer ) + { + iVolumeRampTimer = CPeriodic::New( CActive::EPriorityStandard ); + } + + if ( iVolumeRampTimer && !iVolumeRampTimer->IsActive() ) + { + TCallBack cb( VolumeRampTimerCallback, this ); + iRampedVolume = KFLDMinVolumeLevel; + iVolumeRampTimer->Start( + KAscendingVolumeRampInterval, KAscendingVolumeRampInterval, cb ); + } + break; + } + + default: + { + break; + } + } + } + } + +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::DoVolumeRamp +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CFLDVideoPlayer::DoVolumeRamp() + { + if ( iRampedVolume < iRingingVolume ) + { + iRampedVolume = iRampedVolume + KPhoneVideoVolumeRampStep; + if ( iRampedVolume >= iRingingVolume ) + { + // target volume level reached + iRampedVolume = iRingingVolume; + iVolumeRampTimer->Cancel(); + } + } + + TRAP_IGNORE( iVideoPlayer->SetVolumeL( ConvertVolume( iRampedVolume ) ) ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::VolumeRampTimerCallback +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CFLDVideoPlayer::VolumeRampTimerCallback( TAny* aObj ) + { + return static_cast( aObj )->DoVolumeRamp(); + } + +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::ConvertVolume() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CFLDVideoPlayer::ConvertVolume( TInt aVolume ) + { + TInt result( 0 ); + TBool audioEnabled( EFalse ); + + TRAP_IGNORE( audioEnabled = iVideoPlayer->AudioEnabledL() ); + + if( audioEnabled ) + { + if ( iVideoPlayerStatus == EVideoPlayerInitialized || + iVideoPlayerStatus == EVideoPlayerPlaying ) + { + result = BaseConvertVolume( aVolume, iVideoPlayer->MaxVolume() ); + + //if user has selected silent ringing type + // or beeb once, set volume off + if( ( iRingingType == ERingingTypeSilent ) || + ( iRingingType == ERingingTypeBeepOnce ) ) + { + result = 0; + } + } + } + + return result; + } + +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::MvpuoOpenComplete +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDVideoPlayer::MvpuoOpenComplete(TInt aError) + { + if ( !aError && iVideoPlayerStatus == EVideoPlayerInitializing ) + { + iVideoPlayer->Prepare(); + } + else + { + Cancel(); + if ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ) + { + // Don't care about leave, if the note can't be displayed. + TRAP_IGNORE( DisplayErrorNoteL() ); + } + } + } +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::MvpuoFrameReady +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDVideoPlayer::MvpuoFrameReady(CFbsBitmap& /*aFrame*/,TInt /*aError*/) + { + + } + +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::MvpuoEvent +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDVideoPlayer::MvpuoEvent(const TMMFEvent& /*aEvent*/) + { + + } +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::MvpuoPrepareComplete +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDVideoPlayer::MvpuoPrepareComplete(TInt aError) + { + if ( !aError && iVideoPlayerStatus == EVideoPlayerInitializing ) + { + iVideoPlayerStatus = EVideoPlayerInitialized; + DoSetRingingType( iRingingType ); + + TInt startVolume( KFLDMinVolumeLevel ); + if( iRingingType != ERingingTypeAscending ) + { + startVolume = ConvertVolume( iRingingVolume ); + } + else + { + // Ascending starts from minimum volume level + startVolume = ConvertVolume( KFLDMinVolumeLevel ); + } + + TRAP_IGNORE( iVideoPlayer->SetVolumeL( startVolume ) ); + + // Unfortunately SetPriorityL uses always priority/preference + // settings which are given in videoPlayer constructor and ONLY + // after that sets SetPriorityL parameter to its member data + // which leads to a situation that we need to make SetPriorityL + // call twice to make new settings effect. + TRAP_IGNORE( iVideoPlayer->SetPriorityL( KAudioPriorityPreview, + TMdaPriorityPreference( iVibra ? KAudioPrefRingFilePreviewVibra : + KAudioPrefRingFilePreview ) ) ); + TRAP_IGNORE( iVideoPlayer->SetPriorityL( KAudioPriorityPreview, + TMdaPriorityPreference( iVibra ? KAudioPrefRingFilePreviewVibra : + KAudioPrefRingFilePreview ) ) ); + iVideoPlayer->Play(); + iVideoPlayerStatus = EVideoPlayerPlaying; + } + else + { + Cancel(); + if ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ) + { + // Don't care about leave, if the note can't be displayed. + TRAP_IGNORE( DisplayErrorNoteL() ); + } + } + } + +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::MvpuoPlayComplete +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDVideoPlayer::MvpuoPlayComplete(TInt aError) + { + if ( !aError && iVideoPlayerStatus == EVideoPlayerPlaying ) + { + if( iRingingType != ERingingTypeRingOnce ) + { + iVideoPlayer->Play(); + } + else + { + Cancel(); + iVideoPlayerStatus = EVideoPlayerReady; + } + } + else + { + Cancel(); + if ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ) + { + // Don't care about leave, if the note can't be displayed. + TRAP_IGNORE( DisplayErrorNoteL() ); + } + } + } + +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::VideoResolution +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TSize CFLDVideoPlayer::VideoFrameSize() const + { + // Original implementation taken from phone application + + TSize frameSize( 0,0 ); + + TRAPD( err, iVideoPlayer->VideoFrameSizeL( frameSize ) ); + + if ( err != KErrNone ) + { + return TSize(0,0); + } + + return frameSize; + } + +// ----------------------------------------------------------------------------- +// CFLDVideoPlayer::AdjustToWindow +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CFLDVideoPlayer::AdjustToWindow( RWindow& aDisplayWindow ) + { + // Original implementation taken from phone application + + // Get video frame dimensions + TSize frameSize( VideoFrameSize() ); + + if ( frameSize.iWidth == 0 || frameSize.iHeight == 0 ) + { + return; + } + + // Get display dimensions + TPoint displayPosition( aDisplayWindow.AbsPosition() ); + TSize displaySize( aDisplayWindow.Size() ); + TRect displayRect( displayPosition, displaySize ); + + + // To cover display by video: + // 1) Video is scaled to be >= display size + // 2) If scaled size > display, then video is cropped + // Assumption is that video can be scaled to 50,150 or 200 + // percent from its original size (can't be scaled freely). + + ///////////////////////////// + // Calculate scaling factor + ///////////////////////////// + TInt dScaleFactor(100); // use integer arithmetic + + TInt xDelta( displaySize.iWidth - frameSize.iWidth ); + TInt yDelta( displaySize.iHeight - frameSize.iHeight ); + + if ( xDelta == 0 && yDelta == 0 ) + { + // correct size, scaling not needed + } + else if ( xDelta < 0 && yDelta == 0 ) + { + // wide, but cannot downscale -> just crop + } + else if ( yDelta < 0 && xDelta == 0 ) + { + // tall, but cannot downscale -> just crop + } + else if ( xDelta > 0 && yDelta > 0 ) + { + // small, narrow and flat -> enlarge + TInt xProp( (100 * displaySize.iWidth) / frameSize.iWidth ); + TInt yProp( (100 * displaySize.iHeight) / frameSize.iHeight ); + + dScaleFactor = xProp > yProp ? xProp : yProp; + } + else if ( xDelta < 0 && yDelta < 0 ) + { + // large, wide and tall -> downscale + TInt xProp( ( 100 * displaySize.iWidth) / frameSize.iWidth ); + TInt yProp( ( 100 * displaySize.iHeight) / frameSize.iHeight ); + + dScaleFactor = xProp > yProp ? xProp : yProp; + } + else if ( xDelta > 0 && yDelta <= 0 ) + { + // narrow -> enlarge + dScaleFactor = (100 * displaySize.iWidth) / frameSize.iWidth; + } + else if ( yDelta > 0 && xDelta <= 0 ) + { + // flat -> enlarge + dScaleFactor = (100 * displaySize.iHeight) / frameSize.iHeight; + } + else + { + // do nothing + } + + // Convert to float: 0.5, 1.5, 2.0 .. + TInt scaleFactor( dScaleFactor / 100 ); + TInt remainder( dScaleFactor % 100 ); + TReal32 fScaleFactor = (TReal) scaleFactor ; + + if ( scaleFactor > 0 ) // upscale + { + if ( remainder > 50 ) + { + fScaleFactor = fScaleFactor + 1.0; + } + else if ( remainder > 0 ) + { + fScaleFactor = fScaleFactor + 0.5; + } + else // 0 + { + } + } + else // downscale + { + if ( remainder > 50 ) + { + fScaleFactor = 1.0; + } + else + { + fScaleFactor = 0.5; + } + } + + //////////////////////////////////////////////// + // Calculate scaled frame size (virtual canvas) + //////////////////////////////////////////////// + TReal32 canvasWidth = fScaleFactor * (TReal32)frameSize.iWidth; + TReal32 canvasHeight = fScaleFactor * (TReal32)frameSize.iHeight; + TSize canvasSize( (TInt)canvasWidth, (TInt)canvasHeight ); + + //////////////////////////////////////////////// + // Crop by centering displayRect to canvasRect + //////////////////////////////////////////////// + TRect canvasRect( displayPosition, canvasSize ); + TInt offsetX = (displaySize.iWidth - canvasSize.iWidth) / 2; + TInt offsetY = (displaySize.iHeight - canvasSize.iHeight) / 2; + canvasRect.Move( offsetX, offsetY ); + + //////////////////////////////////////////////// + // Update settings to player + //////////////////////////////////////////////// + TRAP_IGNORE( iVideoPlayer->SetDisplayWindowL( + CCoeEnv::Static()->WsSession(), + *CCoeEnv::Static()->ScreenDevice(), + aDisplayWindow, + canvasRect, + displayRect ) ); + + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDVideoPlayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDVideoPlayer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,187 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Creates a video player and starts video preview +* +* +*/ + + +#ifndef __CFLDVIDEOPLAYER_H__ +#define __CFLDVIDEOPLAYER_H__ + +// INTERNAL INCLUDES +#include "CFLDPlayerBase.h" + +// EXTERNAL INCLUDES +#include +#include // For MVideoPlayerUtilityObserver + +// FORWARD DECLARATIONS +class RWindow; + +// CLASS DECLARATION + +/** +* Creates a video player and starts video preview +* +* @lib filelist.lib +* @since 3.1 +*/ +NONSHARABLE_CLASS( CFLDVideoPlayer ) + : public CFLDPlayerBase, + public MVideoPlayerUtilityObserver + { + + private: // Enumerations + + // These match with the ones in Profile Engine + enum TRingingTypes + { + ERingingTypeRinging = 0, + ERingingTypeAscending, + ERingingTypeRingOnce, + ERingingTypeBeepOnce, + ERingingTypeSilent + }; + + enum TVideoPlayerStatus + { + EVideoPlayerNotCreated = 0, + EVideoPlayerInitializing, + EVideoPlayerInitialized, + EVideoPlayerReady, + EVideoPlayerPlaying + }; + + enum TFLAllowScreenSaver + { + EFLScreenSaverAllowed = 0, + EFLScreenSaverNotAllowed + }; + + public: // Constructors and destructors + + /** + * Two-phase static constructor + * @param aShowErrorMsgs Show an error note if the file format is not supported + * @return A pointer to a fully constructed CFLDVideoPlayer instance + */ + static CFLDVideoPlayer* NewL( TBool aShowErrorMsgs = ETrue ); + + /** + * Destructor + */ + virtual ~CFLDVideoPlayer(); + + private: // Constructors and destructors + + /** + * Constructor + * @param aShowErrorMsgs Show an error note if the file format is not supported + */ + CFLDVideoPlayer( TBool aShowErrorMsgs); + + /** + * Second phase constructor + */ + void ConstructL(); + + public: // From MFLDFileProcessor + + /** + * Derived from MFLDFileProcessor. Starts playing the sound file + */ + void ProcessFileL( const TDesC& aFileName, RWindow* aWindow ); + + /** + * Derived from MFLDFileProcessor. Stops playing the file. + */ + void Cancel(); + + private: // From MVidePlayerUtilityObserver + void MvpuoOpenComplete(TInt aError); + void MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError); + void MvpuoPlayComplete(TInt aError); + void MvpuoEvent(const TMMFEvent& aEvent); + void MvpuoPrepareComplete(TInt aError); + + private: // New methods + + /** When videoplayer is ready, set its ringing type + * @param aRingingType The ringing type (see enum TRingingTypes) + */ + void DoSetRingingType( TInt aRingingType ); + + /** + * Converts volume from 1 to 10 to audio driver understandable value. + * @param aVolume Volume level to be converted. + * @return Returns converted volume level + */ + TInt ConvertVolume( TInt aVolume ); + + /** + * Callback function for ascending ringing type + * @param aObj Pointer to callback instance + */ + static TInt VolumeRampTimerCallback( TAny* aObj ); + /** + * Performs volume ramping + */ + TInt DoVolumeRamp(); + /** + * Performs video scaling and cropping + * @param aDisplayWindow Reference to window handle + */ + void AdjustToWindow( RWindow& aDisplayWindow ); + /** + * Returns video frame size + * @return size of the video frame + */ + TSize VideoFrameSize() const; + + /** + * Callback function to do inactivity timer resetting. + */ + static TInt DoResetInactivityTimer( TAny* aObject ); + + private: // Data + + /// Own: video player + CVideoPlayerUtility* iVideoPlayer; + /// Own: Ascending volume timer + CPeriodic* iVolumeRampTimer; + /// Ref: handle to window + RWindow* iWindow; + /// Player state + TVideoPlayerStatus iVideoPlayerStatus; + /// Ascending volume + TInt iRampedVolume; + + /** + * Pub&Sub property. + * For setting the state of the screen saver. + */ + RProperty iPropScreenSaver; + + /** + * Timer for resetting the user inactivity timeout + */ + CPeriodic* iBacklightTimer; + + }; + +#endif // __CFLDVIDEOPLAYER_H__ + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDWaitNote.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDWaitNote.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the CFLDWaitNote. +* +*/ + + + +// CLASS HEADER +#include "CFLDWaitNote.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CFLDWaitNote::CFLDWaitNote +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CFLDWaitNote::CFLDWaitNote( const TInt aWaitNoteResourceId ) + : iWaitNoteResourceId (aWaitNoteResourceId) + { + } + +// ----------------------------------------------------------------------------- +// CFLDWaitNote::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CFLDWaitNote* CFLDWaitNote::NewL( const TInt aWaitNoteResourceId ) + { + CFLDWaitNote* self = new (ELeave) CFLDWaitNote( aWaitNoteResourceId ); + return self; + } + +// Destructor +CFLDWaitNote::~CFLDWaitNote() + { + if( iWaitDialog ) + { + // Do not delete CAknWaitDialog object: + // CAknWaitDialog::ProcessFinishedL should be used instead. + iWaitDialog->SetCallback( NULL ); + TRAP_IGNORE( iWaitDialog->ProcessFinishedL() ); + } + } + +// ----------------------------------------------------------------------------- +// CFLDWaitNote::DialogDismissedL +// Gets called when the dialog is dismissed/closed. +// ----------------------------------------------------------------------------- +// +void CFLDWaitNote::DialogDismissedL( const TInt /*aButtonId*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CFLDWaitNote::CloseWaitNoteL +// Close the wait note dialog. +// ----------------------------------------------------------------------------- +// +void CFLDWaitNote::CloseWaitNoteL() + { + // Close and delete the wait note dialog, + // if it has not been dismissed yet + if( iWaitDialog ) + { + iWaitDialog->ProcessFinishedL(); + } + } + +// ----------------------------------------------------------------------------- +// CFLDWaitNote::OpenWaitNoteL +// Open the wait note dialog. +// ----------------------------------------------------------------------------- +// +void CFLDWaitNote::OpenWaitNoteL() + { + CloseWaitNoteL(); + + // Create and view the wait note dialog + iWaitDialog = new (ELeave) CAknWaitDialog( + reinterpret_cast( &iWaitDialog ) ); + iWaitDialog->SetCallback( this ); + iWaitDialog->ExecuteLD( iWaitNoteResourceId ); // CSI: 50 # Pointer to iWaitDialog variable is given to iWaitDialog itself, so won't dare to set it NULL below + } + +// ----------------------------------------------------------------------------- +// CFLDWaitNote::IsRunning +// Gets called by the model to see if the wait note (refresh) is already running. +// ----------------------------------------------------------------------------- +// +TBool CFLDWaitNote::IsRunning() + { + if( iWaitDialog == NULL ) + { + return EFalse; + } + else + { + return ETrue; + } + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/CFLDWaitNote.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/CFLDWaitNote.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implements wait note when CLF is refreshed. +* +*/ + + + +#ifndef __CFLDWAITNOTE_H__ +#define __CFLDWAITNOTE_H__ + +// EXTERNAL INCLUDES +#include +#include +#include + +// CLASS DECLARATION + +/** +* Implements wait note when CLF is refreshed +*/ +NONSHARABLE_CLASS( CFLDWaitNote ) + : public CBase, + public MProgressDialogCallback + { + public: // Constructors and destructor + + /** + * Creates and returns a new instance of this class. + * @param aResourceId Wait note resource id + * @return Pointer to the CFLDWaitNote object + */ + static CFLDWaitNote* NewL( const TInt aWaitNoteResourceId ); + + /** + * Destructor. + */ + virtual ~CFLDWaitNote(); + + private: // Constructors + /** + * C++ default constructor. + */ + CFLDWaitNote( const TInt aWaitNoteResourceId ); + + protected: // Methods derived from MProgressDialogCallback + + void DialogDismissedL( const TInt aButtonId ); + + public: // New functions + + /** + * Close the wait note dialog. + */ + void CloseWaitNoteL(); + + /** + * Open the wait note dialog. + */ + void OpenWaitNoteL(); + + /** + * Is wait note running. + */ + TBool IsRunning(); + + private: // Data + + /// Own: Wait note dialog for indicating refresh operation + /// of the List Model (owned) + CAknWaitDialog* iWaitDialog; + + /// Wait note resource + const TInt iWaitNoteResourceId; + + }; + +#endif // __CFLDWAITNOTE_H__ + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/FLDListBoxTemplate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/FLDListBoxTemplate.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,172 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Template for a listbox class which forwards listbox events +* to an observer. +* +*/ + + +#ifndef FLDLISTBOXTEMPLATE_H +#define FLDLISTBOXTEMPLATE_H + +#include // TKeyResponse +#include // TKeyEvent, TEventCode +#include "MFLDFileListBoxObserver.h" +#include "CFLDFileListModel.h" +#include "CFLDPopupList.h" + +// CLASS DECLARATION + +/** +* Template for a listbox class which forwards listbox events to an observer. +* +* @lib filelist.lib +* @since Series 60 2.6 +*/ +template +class FLDListBoxTemplate : public T + { + public: // Constructors and destructor + + /** + * Constructor + */ + FLDListBoxTemplate( + MFLDFileListBoxObserver& aObserver, CFLDFileListModel& aModel ) + : iObserver( aObserver ), iModel( aModel ) {} + + virtual ~FLDListBoxTemplate() + { + iObserver.HandleFileListBoxEventL( + MFLDFileListBoxObserver::EListBoxClosed ); + } + + public: // New functions + + /** + * Sets populist + */ + void SetListBox( CFLDPopupList* aPopupList ) + { + iPopupList = aPopupList; + } + + public: // Functions from base classes + + /** + * Method modified to send listbox events to an observer, when + * focus changes from one list item to another + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) + { + /// Current softkeystate + MFLDFileListBoxObserver::TFileListSoftKeyState softKeyState; + iObserver.HandleSoftKeyState( softKeyState ); + + if( aType == EEventKey ) + { + // Get current item index + TInt oldIndex( T::CurrentItemIndex() ); + // Call OfferKeyEventL + TKeyResponse response( T::OfferKeyEventL( aKeyEvent, aType ) ); + // Get new item index + TInt newIndex( T::CurrentItemIndex() ); + // Get current filename + TFileName filename; + iModel.GetFileName( filename, T::CurrentItemIndex() ); + // Compare new and old index + if( oldIndex != newIndex ) + { + // Notify focus change if focus changes + iObserver.HandleFileListBoxEventL( + MFLDFileListBoxObserver::EFocusChanged, filename ); + +#ifdef RD_VIDEO_AS_RINGING_TONE + // When video is drawn over popuplist and user changes focus + // or interrupts the video by using other key + // screen must be forced to be redrawn + if( ( iPopupList ) && + ( softKeyState == MFLDFileListBoxObserver::EPreviewSelectSoftKeyState ) ) + { + // Set the vertical scroll bar and listbox to not dimmed. + if ( iPopupList ) + { + iPopupList->ListBox()->SetDimmed( EFalse ); + iPopupList->ListBox()->ScrollBarFrame()-> + VerticalScrollBar()->SetDimmed( EFalse ); + } + + iPopupList->DrawNow( CEikonEnv::Static()->EikAppUi()->ApplicationRect() ); + } +#endif + } + else + { +#ifdef RD_VIDEO_AS_RINGING_TONE + if( ( iModel.MediaFileType( filename ) == ECLFMediaTypeVideo ) && + ( aKeyEvent.iScanCode == EStdKeyDevice3 ) ) + { + // Do not notify observer + // when joystick key is pressed + // and current file is a video file + } + else + { + iObserver.HandleFileListBoxEventL( + MFLDFileListBoxObserver::EOtherKeyEvent ); + + // When video is drawn over popuplist and user changes focus + // or interrupts the video by using other key + // screen must be forced to be redrawn + if( ( iPopupList ) && + ( softKeyState == MFLDFileListBoxObserver::EPreviewSelectSoftKeyState ) ) + { + // Set the vertical scroll bar and listbox to not dimmed. + if ( iPopupList ) + { + iPopupList->ListBox()->SetDimmed( EFalse ); + iPopupList->ListBox()->ScrollBarFrame()-> + VerticalScrollBar()->SetDimmed( EFalse ); + } + + iPopupList->DrawNow( CEikonEnv::Static()->EikAppUi()->ApplicationRect() ); + } + } + +#else + iObserver.HandleFileListBoxEventL( + MFLDFileListBoxObserver::EOtherKeyEvent ); +#endif + } + return response; + } + return T::OfferKeyEventL( aKeyEvent, aType ); + } + + private: // Data + + /// Ref: The list box observer, which gets notified about list item focus changes + MFLDFileListBoxObserver& iObserver; + + /// Ref: File list model + CFLDFileListModel& iModel; + + /// Ref: File list popuplist + CFLDPopupList* iPopupList; + + }; + +#endif // FLDLISTBOXTEMPLATE_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/MFLDEntryFormatter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/MFLDEntryFormatter.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* MFLDEntryFormatter defines an abstract interface to create +* formatted presentations of directory entries +* +* +*/ + + + +#ifndef __MFLDENTRYFORMATTER_H__ +#define __MFLDENTRYFORMATTER_H__ + +// INTERNAL INCLUDES + +// EXTERNAL INCLUDES +#include + +// FORWARD DECLARATIONS +class CFLDEntryReference; + +// CLASS DEFINITION + +/** +* MFLDEntryFormatter defines an abstract interface to create +* formatted presentations of directory entries +*/ +class MFLDEntryFormatter + { + public: // Constructors and destructor + + /** + * Destructor. + */ + virtual ~MFLDEntryFormatter() {} + + public: // New functions + + /** + * Formats a single entry + * @param aEntry The entry to be formatted + */ + virtual void FormatL( CFLDEntryReference& aEntry ) = 0; + + /** + * Formats a null item text (see CFLDFileListModel::InsertNullItemL). + * Default implementation does no modifications to the given text + * (to maintain BC). + * @param aText The text to be formatted. + * @return Returns an allocated formatted HBufC. + * Ownership is returned to the caller. + * @since Series 60 2.6 + */ + virtual HBufC* FormatTextLC( const TDesC& aText ) + { return aText.AllocLC(); } + + }; + +#endif // __MFLDENTRYFORMATTER_H__ + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/MFLDFileObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/MFLDFileObserver.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Abstract interface for check media files. +* +*/ + + + +#ifndef MFLDFILEOBSERVER_H +#define MFLDFILEOBSERVER_H + +// INTERNAL INCLUDES + +// EXTERNAL INCLUDES +#include + +// CLASS DEFINITION + +/** +* Abstract interface for check media files. +* +* @lib filelist.lib +* @since 2.1 +*/ +class MFLDFileObserver + { + public: // Enumerations + + // An enumeration which tells what is the file used for. + enum TIntention + { + EPlay = 1, + ESelect = 2 + }; + + public: // New functions + + /** + * An abstract function for checking if a file is valid. + * @since 2.1 + * @param aFileName Full path and filename. + * @param aIntention Describes what is the file used for. + * @return Returns ETrue if the file is valid for intended use. + */ + virtual TBool IsFileValidL( + const TDesC& aFileName, + TIntention aIntention ) = 0; + + /** + * An abstract function for checking media type + * @since 3.1 + * @param aFileName Full path and filename. + * @return Returns media type + */ + virtual TInt32 MediaFileType( + const TDesC& aFileName ) const = 0; + + protected: + + /** + * Destructor. + */ + virtual ~MFLDFileObserver() {} + + }; + +#endif // MFLDFILEOBSERVER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/Src/MFLDFileProcessor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/Src/MFLDFileProcessor.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* MFLDFileProcessor defines an abstract interface for processing +* files (e.g. playing sound files or displaying image files). +* +* +*/ + + + +#ifndef __MFLDFILEPROCESSOR_H__ +#define __MFLDFILEPROCESSOR_H__ + +// INTERNAL INCLUDES + +// EXTERNAL INCLUDES +#include + +// CLASS DEFINITION + +// FORWARD DECLARATIONS +class RWindow; + +/** +* MFLDFileProcessor defines an abstract interface for processing +* files (e.g. playing sound files or displaying image files). +*/ +class MFLDFileProcessor + { + public: // Constructors and destructors + + /** + * Destructor. + */ + virtual ~MFLDFileProcessor() {} + + public: // New methods + + /** + * Starts processing a file (e.g. playing a sound file) + * @param aFileName The file name to be processed + */ + virtual void ProcessFileL( const TDesC& aFileName, RWindow* aWindow ) = 0; + + /** + * Cancels processing a file (e.g. stop playing a sound file) + */ + virtual void Cancel() = 0; + + /** + * Set the volume level on which the sound is played + * @param aVolume The volume level + */ + virtual void SetVolume( TInt aVolume ) = 0; + + /** + * Sets the ringing type + * @param aRingingType The ringing type (see enum TRingingTypes) + */ + virtual void SetRingingType( TInt aRingingType ) = 0; + + /** + * Sets vibrating alert on or off. + * @param aVibra True: Vibra is on. False: Vibra is off. + */ + virtual void SetVibra( TBool aVibra ) = 0; + + /** + * Sets 3d-effects on or off. + * @param a3dEffects True: 3dEffects are on. False: 3dEffects are off. + */ + virtual void Set3dEffects( TBool a3dEffects ) = 0; + + }; + +#endif // __MFLDFILEPROCESSOR_H__ + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/group/FileList.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/group/FileList.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,108 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This is project specification file for the File List. +* +*/ + + +// To get the APP_LAYER_SYSTEMINCLUDE-definition +#include +#include + +TARGET FileList.dll +TARGETTYPE DLL +UID 0x1000008d 0x101f4678 +VENDORID VID_DEFAULT + +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../Src +SOURCE CFLDFileListModel.cpp +SOURCE CFLDController.cpp +SOURCE CFLDPlayerBase.cpp +SOURCE CFLDRingingTonePlayer.cpp +SOURCE CFLDFileListContainer.cpp +SOURCE CFLDEntryReference.cpp +SOURCE CFLDPopupList.cpp +SOURCE CFLDBrowserLauncher.cpp +SOURCE CFLDCommandAbsorbingControl.cpp +SOURCE CFLDSingleGraphicEntryFormatter.cpp +SOURCE CFLDDRMImplementationCommon.cpp // Common DRM implementation + +SOURCE CFLDDRMImplementation.cpp // Full OMA DRM support +LIBRARY drmhelper.lib + +#ifdef RD_VIDEO_AS_RINGING_TONE +SOURCE CFLDVideoPlayer.cpp +SOURCE CFLDSoftKeyChanger.cpp +#endif + +SOURCE CFLDOperationObserver.cpp +SOURCE CFLDWaitNote.cpp +SOURCE CFLDChangedItemObserver.cpp + +USERINCLUDE ../Inc ../Src ../group + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE ../../inc // subsystem internal includes + +START RESOURCE ../group/FileList.rss + HEADER + TARGETPATH RESOURCE_FILES_DIR + LANGUAGE_IDS +END + +LIBRARY apgrfx.lib // RApaLsSession +LIBRARY apmime.lib // TDataType +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY efsrv.lib +LIBRARY eikcoctl.lib +LIBRARY euser.lib +LIBRARY mediaclientaudio.lib +LIBRARY commonengine.lib +LIBRARY eikcore.lib +LIBRARY AknSkins.lib +LIBRARY FeatMgr.lib +LIBRARY platformenv.lib +LIBRARY browserlauncher.lib +LIBRARY CommonUI.lib // Document Handler +LIBRARY centralrepository.lib +LIBRARY CenRepNotifHandler.lib +LIBRARY servicehandler.lib // CAiwGenericParamList +LIBRARY ws32.lib // RWindow methods +LIBRARY ecom.lib // ECom +LIBRARY ProfileEng.lib + +LIBRARY ContentListingFramework.lib + +#ifdef RD_VIDEO_AS_RINGING_TONE +LIBRARY mediaclientvideo.lib +#endif + +LIBRARY egul.lib // CGulIcon + +LIBRARY DRMCommon.lib +LIBRARY DrmRights.lib + +#ifdef RD_DRM_COMMON_INTERFACE_FOR_OMA_AND_WMDRM +LIBRARY drmutility.lib +#endif +LIBRARY touchfeedback.lib +LIBRARY caf.lib cafutils.lib // Content access framework +LIBRARY DrmAudioPlayUtility.lib + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/group/FileList.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/group/FileList.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,184 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This file contains all the resources for the FileList module. +* +*/ + + +// RESOURCE IDENTIFIER +NAME FLDR // 4 letter ID + +// INTERNAL INCLUDES +#include "FileListModel.rh" // For FILELISTDIRECTORIES +#include + +// EXTERNAL INCLUDES +#include +#include // For text_rom_root_path +#include +#include +#include // For EAknSoftkeyOptions +#include // For AVKON_NOTE +#include // For R_AVKON_SOFTKEYS_EMPTY +#include +#include + +RESOURCE RSS_SIGNATURE { } + +RESOURCE TBUF r_fld_qtn_profiles_error_not_enough_memory + { + buf = qtn_profiles_error_not_enough_memory; + } + +RESOURCE TBUF r_fld_qtn_file_format_error + { + buf = qtn_file_format_error; + } + +RESOURCE TBUF r_fld_qtn_profiles_download_tones + { + buf = qtn_profiles_download_tones; + } + +RESOURCE TBUF r_fld_qtn_drm_prev_rights_use + { + buf = qtn_drm_prev_rights_use; + } + +RESOURCE TBUF r_fld_qtn_drm_prev_rights_set + { + buf = qtn_drm_prev_rights_set; + } + +RESOURCE TBUF r_fld_qtn_profiles_info_tone_no_drm + { + buf = qtn_profiles_info_tone_no_drm; + } + +RESOURCE TBUF r_fld_qtn_drm_prof_rights_missing + { + buf = qtn_drm_prof_rights_missing; + } + +RESOURCE TBUF r_fld_qtn_text_not_allowed + { + buf = text_not_allowed; + } + +RESOURCE TBUF r_fld_qtn_profiles_info_tone_drm_protected + { + buf = qtn_profiles_info_tone_drm_protected; + } + +RESOURCE TBUF r_fld_qtn_drm_mgr_det_exp + { + buf = qtn_drm_mgr_det_exp; + } + +#ifdef RD_VIDEO_AS_RINGING_TONE +RESOURCE TBUF r_fld_qtn_text_softkey_preview + { + buf = text_softkey_preview; + } + +RESOURCE TBUF r_fld_qtn_text_softkey_preview_select + { + buf = text_softkey_select; + } + +RESOURCE TBUF r_fld_qtn_text_softkey_back + { + buf = text_softkey_back; + } + +RESOURCE TBUF r_fld_qtn_text_softkey_cancel + { + buf = text_softkey_cancel; + } +#endif + +RESOURCE DIALOG r_fld_wait_note + { + flags = EAknWaitNoteFlags; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + singular_label = qtn_gen_note_opening; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + }; + } + }; + } + +RESOURCE FILELISTDIRECTORIES r_fld_directories + { + // Scan these ROM directories + RomDirectories = + { + LBUF { txt = text_rom_root_path text_sounds_path; }, + LBUF { txt = text_rom_root_path text_digital_sounds_path; }, + LBUF { txt = text_rom_root_path text_simple_sounds_path; } +#ifdef RD_VIDEO_AS_RINGING_TONE + ,LBUF { txt = text_rom_root_path text_videos_path; } +#endif + }; + + // Scan these these phone directories + PhoneDirectories = + { + }; + } + +RESOURCE CLF_LIST_MODEL r_fld_list_model + { + mime_type_array = CLF_MIME_TYPE_ARRAY + { + mime_types = + { + }; + }; + + media_type_array = CLF_MEDIA_TYPE_ARRAY + { + media_types = + { +#ifdef RD_VIDEO_AS_RINGING_TONE + CLF_MEDIA_TYPE { media_type = ECLFMediaTypeVideo; }, +#endif + CLF_MEDIA_TYPE { media_type = ECLFMediaTypeMusic; }, + CLF_MEDIA_TYPE { media_type = ECLFMediaTypeSound; } + }; + }; + + sorting_style = CLF_SORTING_STYLE + { + ordering = ECLFOrderingAscending; + data_type = ECLFItemDataTypeDesC; + fields = + { + CLF_FIELD_ID { field_id = ECLFFieldIdFileName; } + }; + }; + } + +// End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This file provides the information required for building +* File List. +* +*/ + + +// To get the APP_LAYER_DOMAIN_EXPORT_PATH-definition +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE filelist.mif + OPTION HEADERFILE filelist.mbg + OPTION SOURCES -c8,8 qgn_indi_fmgr_ms_add +END + + +PRJ_MMPFILES + +//gnumakefile filelist_icons_aif_scalable_dc.mk + +FileList.mmp + +PRJ_EXPORTS +../rom/filelist.iby CORE_APP_LAYER_IBY_EXPORT_PATH(filelist.iby) +../rom/filelistResources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(filelistResources.iby) +../loc/FileList.loc APP_LAYER_LOC_EXPORT_PATH(filelist.loc) + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/group/filelist_icons_aif_scalable_dc.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/group/filelist_icons_aif_scalable_dc.mk Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,70 @@ +# +# Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Icons makefile for project FileList. +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z +else +ZDIR=\epoc32\data\z +endif + +# ---------------------------------------------------------------------------- +# : Configure these +# ---------------------------------------------------------------------------- + +TARGETDIR=$(ZDIR)\resource\apps +HEADERDIR=\epoc32\include +ICONTARGETFILENAME=$(TARGETDIR)\filelist.mif +HEADERFILENAME=$(HEADERDIR)\filelist.mbg + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + +LIB : do_nothing + +CLEANLIB : do_nothing + +# ---------------------------------------------------------------------------- +# : Configure these. +# +# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by +# MifConv if the mask detph is defined. +# +# NOTE 2: Usually, source paths should not be included in the bitmap +# definitions. MifConv searches for the icons in all icon directories in a +# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps. +# The directory \s60\icons is included in the search only if the feature flag +# __SCALABLE_ICONS is defined. +# ---------------------------------------------------------------------------- + +RESOURCE : + mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \ + /c8,8 qgn_indi_fmgr_ms_add.svg \ + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(HEADERFILENAME)&& \ + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/loc/FileList.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/loc/FileList.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This is a localisation file for FileList module. +* A .loc file is the one and only place where the logical strings +* to be localised are defined. +* +* +*/ + + +//d: Error message text for non-supported file formats +//l: popup_note_window +// +#define qtn_file_format_error "Tone format not supported" + +//d: The first item in the tone selection list. +//d: Launches browser for downloading new tones. +//l: list_single_graphic_pane_t1_cp2 +// +#define qtn_profiles_download_tones "Download tones" + +//d: Softkey label for previewing video files +//l: control_pane_t1/opt7 +//w: +//r:3.1 +#define text_softkey_preview "Preview" + +//d: Error message text for non-supported file formats +//l: popup_note_window +//w: +//r:3.1 +#define qtn_profiles_info_tone_drm_protected "Protected file. Cannot be selected as ringing tone." + +//d: Error message indicating that because of a lack of memory, only +//d: tones on ROM will be displayed. +//l: popup_note_window +//w: +//r:5.0 +#define qtn_profiles_error_not_enough_memory "Not enough memory to display all tones. Only tones in ROM memory are displayed." + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/rom/filelist.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/rom/filelist.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: IBY files for FileList +* +*/ + +#ifndef __FILELIST_IBY__ +#define __FILELIST_IBY__ + +file=ABI_DIR\BUILD_DIR\FileList.dll SHARED_LIB_DIR\FileList.dll + +data=DATAZ_\BITMAP_DIR\filelist.mif BITMAP_DIR\filelist.mif + + +#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/rom/filelistResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/rom/filelistResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -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: IBY files for FileList resources. +* +*/ +#ifndef __FILELIST_RESOURCES_IBY__ +#define __FILELIST_RESOURCES_IBY__ + +//resourcefile for FileList (filelist.iby) +data=ZRESOURCE\FILELIST.RSC RESOURCE_FILES_DIR\FILELIST.RSC + +#endif \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/tsrc/public/basic/bwins/T_CFLDFileListu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/tsrc/public/basic/bwins/T_CFLDFileListu.def Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/tsrc/public/basic/eabi/T_CFLDFileListu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/tsrc/public/basic/eabi/T_CFLDFileListu.def Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,7 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + _ZTI16T_CFLDController @ 2 NONAME ; ## + _ZTI23T_CFLDFileListContainer @ 3 NONAME ; ## + _ZTV16T_CFLDController @ 4 NONAME ; ## + _ZTV23T_CFLDFileListContainer @ 5 NONAME ; ## + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/tsrc/public/basic/group/FLDTest.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/tsrc/public/basic/group/FLDTest.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This file contains all the resources for the FLDTest. +* ?description_line +* +*/ + + +// RESOURCE IDENTIFIER +NAME FLDT // 4 letter ID + +// INTERNAL INCLUDES +#include "FileListModel.rh" // For FILELISTDIRECTORIES + +// EXTERNAL INCLUDES +#include +#include +#include + +// CONSTANTS + +// MACROS + +// RESOURCE DEFINITIONS + +RESOURCE RSS_SIGNATURE { } + + +RESOURCE FILELISTDIRECTORIES r_fld_test_rom_model + { + RomDirectories = + { + LBUF { txt = text_rom_root_path text_sounds_path; }, + LBUF { txt = text_rom_root_path text_digital_sounds_path; }, + LBUF { txt = text_rom_root_path text_simple_sounds_path; } + }; + PhoneDirectories = + { + }; + } + +RESOURCE CLF_LIST_MODEL r_fld_test_model1 + { + mime_type_array = CLF_MIME_TYPE_ARRAY + { + mime_types = + { + }; + }; + + media_type_array = CLF_MEDIA_TYPE_ARRAY + { + media_types = + { + CLF_MEDIA_TYPE { media_type = ECLFMediaTypeMusic; }, + CLF_MEDIA_TYPE { media_type = ECLFMediaTypeSound; }, + CLF_MEDIA_TYPE { media_type = ECLFMediaTypeVideo; } + }; + }; + + sorting_style = CLF_SORTING_STYLE + { + ordering = ECLFOrderingAscending; + data_type = ECLFItemDataTypeDesC; + fields = + { + CLF_FIELD_ID { field_id = ECLFFieldIdFileName; } + }; + }; + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/tsrc/public/basic/group/T_CFLDFileList.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/tsrc/public/basic/group/T_CFLDFileList.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This is project specification file for the FileList test cases. +* +*/ + +//////////////////////////////////////////////////////////// +// T_CFLDFileList.mmp +// +// To get the APP_LAYER_SYSTEMINCLUDE-definition +#include +#include + +// DEFINES +#define KEUnitUid3 0x1000af59 +#define KEUnitTestDllUid2 0x1000af5a + +// Build target +TARGET T_CFLDFileList.dll +TARGETTYPE DLL +TARGETPATH ../../../../wins/c/DigiaEUnit/Tests +UID KEUnitTestDllUid2 KEUnitUid3 + +LANG SC + +CAPABILITY ALL -TCB + +// Source files location +SOURCEPATH . + +// Source files +SOURCEPATH ../src +SOURCE T_CFLDDllMain.cpp +SOURCE T_CFLDController.cpp +SOURCE T_CFLDFileListContainer.cpp + +// Include paths +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../../../src +USERINCLUDE ../../../../inc +SYSTEMINCLUDE /epoc32/include/Digia/EUnit +APP_LAYER_SYSTEMINCLUDE + +START RESOURCE ../group/FLDTest.rss + HEADER + TARGETPATH RESOURCE_FILES_DIR +END + +// Dependencies to system components +LIBRARY EUnit.lib +LIBRARY EUnitutil.lib +LIBRARY FileList.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY efsrv.lib +LIBRARY euser.lib +LIBRARY commonengine.lib +LIBRARY ws32.lib + +// dependencies for tested classes +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY CommonUI.lib // Document Handler +LIBRARY apmime.lib // TDataType +LIBRARY servicehandler.lib // CAiwGenericParamList +LIBRARY platformenv.lib diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/tsrc/public/basic/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/tsrc/public/basic/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This file provides the information required for building +* FileList test cases. +* +*/ + +//////////////////////////////////////////////////////////// +// bld.inf +// Part of EUnit library test + +PRJ_PLATFORMS + DEFAULT + +PRJ_TESTEXPORTS + +PRJ_TESTMMPFILES + T_CFLDFileList.mmp \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/tsrc/public/basic/inc/FLDTestConst.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/tsrc/public/basic/inc/FLDTestConst.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* Constant definitions for FileList test cases. +* +* +*/ + + +#ifndef __FLDTestConst_H__ +#define __FLDTestConst_H__ + +// INCLUDES + +// CONSTANTS +_LIT( KFLDResourceFile, "z:\\Resource\\FLDTest.rSC" ); +_LIT( KFLDTestNullItem, "Nulltext" ); +_LIT( KFLDTestNullItemRingingTone, "c:\\data\\sounds\\digital\\test.wav" ); + +#endif // __FLDTestConst_H__ + +// end of file + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/tsrc/public/basic/inc/T_CFLDController.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/tsrc/public/basic/inc/T_CFLDController.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CFLDController test class. +* +* +*/ + + +#ifndef __T_CFLDController_H__ +#define __T_CFLDController_H__ + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CFLDController; + +// CLASS DEFINITION + +/* +----------------------------------------------------------------------------- + + DESCRIPTION + + Test suite for class CEUnitTestCase. + +----------------------------------------------------------------------------- +*/ +class T_CFLDController + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + static T_CFLDController* NewLC(); + ~T_CFLDController(); + + private: // New methods + T_CFLDController(); + void ConstructL(); + + private: // Test case functions + void SetupL(); + void EmptySetupL(); + void Teardown(); + + // tests: + void TestCreateObjectL(); + + void HandleFileListBoxEventTestL(); + void SetDelayTestL(); + + void SetVolumeTestL(); + void SetRingingTypeTestL(); + void SetVibraTestL(); + void Set3dEffectsTestL(); + void SetFileObserverTestL(); + + private: // Implementation + EUNIT_DECLARE_TEST_TABLE; + + private: // Data + CFLDController* iController; // own + }; + +#endif // __T_CFLDController_H__ + +// end of file + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/tsrc/public/basic/inc/T_CFLDFileListContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/tsrc/public/basic/inc/T_CFLDFileListContainer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,107 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CFLDFileListContainer test class. +* +* +*/ + + +#ifndef __T_CFLDFileListContainer_H__ +#define __T_CFLDFileListContainer_H__ + +// INCLUDES +#include +#include +#include + +#include +#include +#include + + +class CFLDFileListContainer; + +// CLASS DEFINITION + +/* +----------------------------------------------------------------------------- + + DESCRIPTION + + Test suite for class CEUnitTestCase. + +----------------------------------------------------------------------------- +*/ +class T_CFLDFileListContainer + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + static T_CFLDFileListContainer* NewLC(); + ~T_CFLDFileListContainer(); + + private: // New methods + T_CFLDFileListContainer(); + void ConstructL(); + + private: // Test case functions + void EmptySetupL(); + void SetupL(); + void Teardown(); + + // tests: + void TestCreateObjectL(); + + void LaunchTestL(); + void InsertNullItemTestL(); + void InsertEndNullItemTestL(); + void SetDelayTestL(); + void SetVolumeTestL(); + void SetRingingTypeTestL(); + void SetVibraTestL(); + + void SetAutomatedTypeTestL(); + void Set3dEffectsTestL(); + void SetMaxFileSizeTestL(); + + void AddExclusiveMimeTypeTestL(); + void AddExclusiveMediaTypeTestL(); + void SetWantedMimeTypesTestL(); + void SetWantedMediaTypesTestL(); + void ResetExclusiveMimeTypesTestL(); + void ResetExclusiveMediaTypesTestL(); + + private: // Implementation + EUNIT_DECLARE_TEST_TABLE; + + private: // Data + RConeResourceLoader* iResourceLoader; + + CFLDFileListContainer* iContainer; + CFLDFileListContainer* iContainer1; + CFLDFileListContainer* iContainer2; + CFLDFileListContainer* iContainer3; + CFLDFileListContainer* iContainer4; + CFLDFileListContainer* iContainer5; + RWsSession iWsSession; + + CDesCArray* iMimeTypeArray; + RArray iMediaTypeArray; + + }; + +#endif // __T_CFLDFileListContainer_H__ + +// end of file + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/tsrc/public/basic/rom/FileList_ats3.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/tsrc/public/basic/rom/FileList_ats3.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* ROM image definition for FileList automated tests +* +* +*/ + +#ifndef __FILELIST_ATS3_IBY__ +#define __FILELIST_ATS3_IBY__ + +// THESE ARE INCLUDED IN PROFILESAPPLICATION_ATS3_IBY + +//file=ABI_DIR\BUILD_DIR\T_CFLDFileList.dll SHARED_LIB_DIR\T_CFLDFileList.dll +// Resource file for FileList tests +//data=ZRESOURCE\FLDTEST.RSC RESOURCE_FILES_DIR\FLDTEST.RSC + +#endif \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/tsrc/public/basic/src/T_CFLDController.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/tsrc/public/basic/src/T_CFLDController.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,210 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CFLDController test class. +* +* +*/ + + +// Include Files +#include "T_CFLDController.h" +#define private public +#define protected public +#include "CFLDController.h" +#include +#include +#include + +namespace + { + // Default delay 1000000 = 1sec + const TInt KDefaultDelay( 1000000 ); + } + +// CONSTRUCTION +// Static constructor +T_CFLDController* T_CFLDController::NewLC() + { + T_CFLDController* self = new(ELeave) T_CFLDController; + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// Destructor (virtual by CBase) +T_CFLDController::~T_CFLDController() + { + delete iController; + iController = NULL; + } + +// Second phase construct +void T_CFLDController::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + +T_CFLDController::T_CFLDController() + { + } + +//--------------------------------------------------------------- +//----------------- TEST CASE METHODS --------------------------- +//--------------------------------------------------------------- + +// METHODS + +// Setup nothing. +void T_CFLDController::EmptySetupL() + { + } + +void T_CFLDController::SetupL() + { + EmptySetupL(); + TBool showErrorMsgs( ETrue ); + + iController = CFLDController::NewL( showErrorMsgs, KDefaultDelay ); + } + +// Teardown nothing. +void T_CFLDController::Teardown() + { + delete iController; + iController = NULL; + } + +// CREATIONAL TESTS +void T_CFLDController::TestCreateObjectL() + { + TBool showErrorMsgs( ETrue ); + + CFLDController* controller = NULL; + controller = CFLDController::NewL( showErrorMsgs, KDefaultDelay ); + delete controller; + controller = NULL; + + controller = CFLDController::NewLC( showErrorMsgs, KDefaultDelay ); + if( controller ) + { + RWindow *dummy = NULL; + controller->CompleteConstructionL( *dummy ); + } + CleanupStack::Pop( controller ); + delete controller; + } + +void T_CFLDController::SetDelayTestL() + { + __UHEAP_MARK; + iController->SetDelay( 1000000 ); + __UHEAP_MARKEND; + } + +void T_CFLDController::SetVolumeTestL() + { + __UHEAP_MARK; + iController->SetVolume( 1 ); + __UHEAP_MARKEND; + } +void T_CFLDController::SetRingingTypeTestL() + { + __UHEAP_MARK; + iController->SetRingingType( 1 ); + __UHEAP_MARKEND; + } +void T_CFLDController::SetVibraTestL() + { + __UHEAP_MARK; + iController->SetVibra( EFalse ); + __UHEAP_MARKEND; + } +void T_CFLDController::Set3dEffectsTestL() + { + __UHEAP_MARK; + iController->Set3dEffects( EFalse ); + __UHEAP_MARKEND; + } +void T_CFLDController::SetFileObserverTestL() + { + __UHEAP_MARK; + iController->SetFileObserver( NULL ); + __UHEAP_MARKEND; + } +void T_CFLDController::HandleFileListBoxEventTestL() + { + __UHEAP_MARK; + iController->HandleFileListBoxEventL( MFLDFileListBoxObserver::EVideoPreviewSelected, KNullDesC ); + __UHEAP_MARKEND; + } + + +// Test case table for this test suite class +EUNIT_BEGIN_TEST_TABLE( + T_CFLDController, + "T_CFLDController test suite", + "MODULE" ) + +EUNIT_TEST( + "Create and delete", + "CFLDController", + "NewL", + "FUNCTIONALITY", + EmptySetupL, TestCreateObjectL, Teardown ) +EUNIT_TEST( + "Set delay", + "CFLDController", + "SetDelay", + "FUNCTIONALITY", + SetupL, SetDelayTestL, Teardown ) +EUNIT_TEST( + "Set volume", + "CFLDController", + "SetVolume", + "FUNCTIONALITY", + SetupL, SetVolumeTestL, Teardown ) +EUNIT_TEST( + "Set ringing type", + "CFLDController", + "SetRingingType", + "FUNCTIONALITY", + SetupL, SetRingingTypeTestL, Teardown ) +EUNIT_TEST( + "Set vibra", + "CFLDController", + "SetVibra", + "FUNCTIONALITY", + SetupL, SetVibraTestL, Teardown ) +EUNIT_TEST( + "Set 3D effects", + "CFLDController", + "Set3dEffects", + "FUNCTIONALITY", + SetupL, Set3dEffectsTestL, Teardown ) +EUNIT_TEST( + "Set file observer", + "CFLDController", + "SetFileObserver", + "FUNCTIONALITY", + SetupL, SetFileObserverTestL, Teardown ) +EUNIT_TEST( + "Handle ListBox Event", + "CFLDController", + "HandleFileListBoxEventL", + "FUNCTIONALITY", + SetupL, HandleFileListBoxEventTestL, Teardown ) +EUNIT_END_TEST_TABLE + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/tsrc/public/basic/src/T_CFLDDllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/tsrc/public/basic/src/T_CFLDDllMain.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* FileList test suite. +* +* +*/ + + +// CLASS HEADER + +// EXTERNAL INCLUDES +#include + +#include "T_CFLDController.h" +#include "T_CFLDFileListContainer.h" + +/** + * T_CFLDFileList.dll test suite factory function. + */ +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + CEUnitTestSuite* mainSuite = CEUnitTestSuite::NewLC(_L("T_FileList Module Tests")); + + // NewLC leaves the pointer to cleanupstack until AddL finishes + mainSuite->AddL( T_CFLDController::NewLC() ); + CleanupStack::Pop(); + mainSuite->AddL( T_CFLDFileListContainer::NewLC() ); + CleanupStack::Pop(); + CleanupStack::Pop( mainSuite ); + return mainSuite; + } + +// END OF FILE diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/FileList/tsrc/public/basic/src/T_CFLDFileListContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/FileList/tsrc/public/basic/src/T_CFLDFileListContainer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,395 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CFLDFileListContainer test class. +* +* +*/ + +// Include Files +#include "T_CFLDFileListContainer.h" +#include +#include +#include +#include +#include +#include +#include "FLDTestConst.h" + + +namespace + { + _LIT( KFLDTestMimeMP4, "audio/mp4" ); + _LIT( KFLDTestMime3GPP, "video/3gpp" ); + _LIT( KFLDTestMimeRNG, "application/vnd.nokia.ringing-tone" ); + } + + +// Classes under test include + +// LOCAL FUNCTIONS + +// CONSTRUCTION +// Static constructor +T_CFLDFileListContainer* T_CFLDFileListContainer::NewLC() + { + T_CFLDFileListContainer* self = new(ELeave) T_CFLDFileListContainer; + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// Destructor (virtual by CBase) +T_CFLDFileListContainer::~T_CFLDFileListContainer() + { + delete iContainer; + delete iContainer1; + if( iResourceLoader ) + { + iResourceLoader->Close(); + delete iResourceLoader; + } + iWsSession.Close(); + } + +// Second phase construct +void T_CFLDFileListContainer::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + +T_CFLDFileListContainer::T_CFLDFileListContainer() + { + } + +//--------------------------------------------------------------- +//----------------- TEST CASE METHODS --------------------------- +//--------------------------------------------------------------- + +// METHODS + +// Setup nothing. +void T_CFLDFileListContainer::EmptySetupL() + { + iResourceLoader = new ( ELeave ) RConeResourceLoader( *CCoeEnv::Static() ); + TFileName fileName( KFLDResourceFile ); + User::LeaveIfError( iResourceLoader->Open( fileName ) ); + } + +void T_CFLDFileListContainer::SetupL() + { + EmptySetupL(); + + iContainer = CFLDFileListContainer::NewL(); + iContainer1 = CFLDFileListContainer::NewLC(); + CleanupStack::Pop(); + iContainer2 = CFLDFileListContainer::NewL( R_FLD_TEST_MODEL1 ); + iContainer3 = CFLDFileListContainer::NewLC( R_FLD_TEST_MODEL1 ); + CleanupStack::Pop(); + iContainer4 = CFLDFileListContainer::NewL( R_FLD_TEST_MODEL1, R_FLD_TEST_ROM_MODEL ); + iContainer5 = CFLDFileListContainer::NewLC( R_FLD_TEST_MODEL1, R_FLD_TEST_ROM_MODEL ); + CleanupStack::Pop(); + + iWsSession.Connect(); + + iMimeTypeArray = new (ELeave) CDesCArrayFlat( 8 ); + } + +void T_CFLDFileListContainer::Teardown() + { + delete iContainer; + iContainer = NULL; + + delete iContainer1; + iContainer1 = NULL; + + delete iContainer2; + iContainer2 = NULL; + + delete iContainer3; + iContainer3 = NULL; + + delete iContainer4; + iContainer4 = NULL; + + delete iContainer5; + iContainer5 = NULL; + + if( iResourceLoader ) + { + iResourceLoader->Close(); + delete iResourceLoader; + iResourceLoader = NULL; + } + iWsSession.Close(); + + delete iMimeTypeArray; + iMimeTypeArray = NULL; + + iMediaTypeArray.Reset(); + iMediaTypeArray.Close(); + } + +// CREATIONAL TESTS +void T_CFLDFileListContainer::TestCreateObjectL() + { + CFLDFileListContainer* container = CFLDFileListContainer::NewL(); + EUNIT_ASSERT( container ); + delete container; + container = NULL; + + container = CFLDFileListContainer::NewLC(); + EUNIT_ASSERT( container ); + CleanupStack::PopAndDestroy(); + } + +void T_CFLDFileListContainer::LaunchTestL() + { + _LIT( KFLDTestFileName, "" ); + _LIT( KFLDTestPopupTitle, "PopupTitle" ); + TFileName fn( KFLDTestFileName ); + + iContainer->LaunchL( fn ); + iContainer->LaunchL( fn, KFLDTestPopupTitle ); + } + +void T_CFLDFileListContainer::InsertNullItemTestL() + { + iContainer->InsertNullItemL( KFLDTestNullItem ); + iContainer->InsertNullItemL( KFLDTestNullItem, KFLDTestNullItemRingingTone ); + } + +void T_CFLDFileListContainer::InsertEndNullItemTestL() + { + iContainer->InsertEndNullItemL( KFLDTestNullItem ); + iContainer->InsertEndNullItemL( KFLDTestNullItem, KFLDTestNullItemRingingTone ); + } + +void T_CFLDFileListContainer::SetDelayTestL() + { + __UHEAP_MARK; + iContainer->SetDelay( 0 ); + iContainer->SetDelay( 1000000 ); + __UHEAP_MARKEND; + } + +void T_CFLDFileListContainer::SetVolumeTestL() + { + __UHEAP_MARK; + iContainer->SetVolume( 5 ); + __UHEAP_MARKEND; + } + +void T_CFLDFileListContainer::SetRingingTypeTestL() + { + __UHEAP_MARK; + iContainer->SetRingingType( 0 ); + __UHEAP_MARKEND; + } + +void T_CFLDFileListContainer::SetVibraTestL() + { + __UHEAP_MARK; + iContainer->SetVibra( EFalse ); + iContainer->SetVibra( ETrue ); + __UHEAP_MARKEND; + } + +void T_CFLDFileListContainer::Set3dEffectsTestL() + { + __UHEAP_MARK; + iContainer->Set3dEffects( EFalse ); + __UHEAP_MARKEND; + } + +void T_CFLDFileListContainer::SetAutomatedTypeTestL() + { + __UHEAP_MARK; + iContainer->SetAutomatedType( CDRMHelper::EAutomatedTypeRingingTone ); + __UHEAP_MARKEND; + } + +void T_CFLDFileListContainer::SetMaxFileSizeTestL() + { + __UHEAP_MARK; + iContainer->SetMaxFileSize( 0 ); + __UHEAP_MARKEND; + } + +void T_CFLDFileListContainer::AddExclusiveMimeTypeTestL() + { + iContainer->AddExclusiveMimeTypeL( KFLDTestMimeRNG ); + iContainer->AddExclusiveMimeTypeL( KFLDTestMimeMP4 ); + iContainer->AddExclusiveMimeTypeL( KFLDTestMime3GPP ); + + iContainer->ResetExclusiveMimeTypes(); + } + +void T_CFLDFileListContainer::AddExclusiveMediaTypeTestL() + { + iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeSound ); + iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeMusic ); + iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeVideo ); + + iContainer->ResetExclusiveMediaTypes(); + } + +void T_CFLDFileListContainer::ResetExclusiveMimeTypesTestL() + { + iContainer->AddExclusiveMimeTypeL( KFLDTestMimeRNG ); + iContainer->ResetExclusiveMimeTypes(); + } + +void T_CFLDFileListContainer::ResetExclusiveMediaTypesTestL() + { + iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeSound ); + iContainer->ResetExclusiveMediaTypes(); + } + +void T_CFLDFileListContainer::SetWantedMimeTypesTestL() + { + iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeSound ); + iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeMusic ); + iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeVideo ); + + iMimeTypeArray->Reset(); + iMimeTypeArray->AppendL( _L("*") ); + iContainer->SetWantedMimeTypesL( *iMimeTypeArray ); + } + +void T_CFLDFileListContainer::SetWantedMediaTypesTestL() + { + iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeSound ); + iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeMusic ); + iContainer->AddExclusiveMediaTypeL( ECLFMediaTypeVideo ); + + iMediaTypeArray.AppendL( ECLFMediaTypeSound ); + iMediaTypeArray.AppendL( ECLFMediaTypeMusic ); + iContainer->SetWantedMediaTypesL( iMediaTypeArray.Array() ); + } + + + +// Test case table for this test suite class +EUNIT_BEGIN_TEST_TABLE( + T_CFLDFileListContainer, + "T_CFLDFileListContainer test suite", + "MODULE" ) + +EUNIT_TEST( + "Create and delete", + "CFLDFileListContainer", + "NewL", + "FUNCTIONALITY", + EmptySetupL, TestCreateObjectL, Teardown ) +EUNIT_TEST( + "Launch, CAknPopupList causes resource imbalance", + "CFLDFileListContainer", + "LaunchL", + "FUNCTIONALITY", + SetupL, LaunchTestL, Teardown ) +EUNIT_TEST( + "Insert null item", + "CFLDFileListContainer", + "InsertNullItemL", + "FUNCTIONALITY", + SetupL, InsertNullItemTestL, Teardown ) +EUNIT_TEST( + "Insert end null item", + "CFLDFileListContainer", + "InsertEndNullItemL", + "FUNCTIONALITY", + SetupL, InsertEndNullItemTestL, Teardown ) +EUNIT_TEST( + "Set delay", + "CFLDFileListContainer", + "SetDelay", + "FUNCTIONALITY", + SetupL, SetDelayTestL, Teardown ) +EUNIT_TEST( + "Set volume", + "CFLDFileListContainer", + "SetVolume", + "FUNCTIONALITY", + SetupL, SetVolumeTestL, Teardown ) +EUNIT_TEST( + "Set Ringing type", + "CFLDFileListContainer", + "SetRingingType", + "FUNCTIONALITY", + SetupL, SetRingingTypeTestL, Teardown ) +EUNIT_TEST( + "Set Vibra", + "CFLDFileListContainer", + "SetVibra", + "FUNCTIONALITY", + SetupL, SetVibraTestL, Teardown ) +EUNIT_TEST( + "Set automated type", + "CFLDFileListContainer", + "SetAutomatedType", + "FUNCTIONALITY", + SetupL, SetAutomatedTypeTestL, Teardown ) +EUNIT_TEST( + "Set 3d effects", + "CFLDFileListContainer", + "Set3dEffects", + "FUNCTIONALITY", + SetupL, Set3dEffectsTestL, Teardown ) +EUNIT_TEST( + "Set max file size", + "CFLDFileListContainer", + "SetMaxFileSize", + "FUNCTIONALITY", + SetupL, SetMaxFileSizeTestL, Teardown ) +EUNIT_TEST( + "Add exclusive MIME type", + "CFLDFileListContainer", + "AddExclusiveMimeType", + "FUNCTIONALITY", + SetupL, AddExclusiveMimeTypeTestL, Teardown ) +EUNIT_TEST( + "Add exclusive media type", + "CFLDFileListContainer", + "AddExclusiveMediaType", + "FUNCTIONALITY", + SetupL, AddExclusiveMediaTypeTestL, Teardown ) +EUNIT_TEST( + "Set wanted MIME types", + "CFLDFileListContainer", + "SetWantedMimeTypes", + "FUNCTIONALITY", + SetupL, SetWantedMimeTypesTestL, Teardown ) +EUNIT_TEST( + "Set wanted media types", + "CFLDFileListContainer", + "SetWantedMediaTypes", + "FUNCTIONALITY", + SetupL, SetWantedMediaTypesTestL, Teardown ) +EUNIT_TEST( + "Reset exclusive MIME types", + "CFLDFileListContainer", + "ResetExclusiveMimeTypes", + "FUNCTIONALITY", + SetupL, ResetExclusiveMimeTypesTestL, Teardown ) +EUNIT_TEST( + "Reset exclusive media types", + "CFLDFileListContainer", + "ResetExclusiveMediaTypes", + "FUNCTIONALITY", + SetupL, ResetExclusiveMediaTypesTestL, Teardown ) + +EUNIT_END_TEST_TABLE + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Inc/mediafiledialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Inc/mediafiledialog.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,506 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file of mediafiledialog. UI control of mediafilelist +* +*/ + + + + +#ifndef MEDIALFILEDIALOG_H +#define MEDIALFILEDIALOG_H + + +// INCLUDES +#include "mediafiledialogutils.h" +#include "mediafilepreview.h" +#include "mediafilehandler.h" +#include "mediafiledialogstate.h" +#include "mediafilewaitnote.h" + + +#include +#include +#include +#include // CAknInfoPopupNoteController +#include +#include +#include +#include + + +// CONSTANTS + +// CLASS DECLARATION +class CMFDialogTest; +class CMFProtectionHandler; +class CAknInputBlock; +class CVideoPreviewDialog; + + + +/** +* CMFListHandlerObserver +* +* CMFListHandler uses CMFListHandlerObserver to get listbox item texts. +*/ +NONSHARABLE_CLASS (CMFListHandlerObserver) + { + public: + virtual TPtrC ConstructListboxItem( TInt aListIndex ) = 0; + virtual TInt ListboxItemCount() = 0; + }; + + +/** +* CMFListHandler +* +* This class is used as listbox model's item array. Listbox uses it to draw +* list items. CMFListHandler gets list item texts from CMediaFileHandler +* (metadata query result). This way there is no need to copy all list items +* into listbox model. +*/ +NONSHARABLE_CLASS (CMFListHandler) : public MDesCArray + { + public: + static CMFListHandler* NewL(); + ~CMFListHandler(); + private: + void ConstructL(void); + CMFListHandler(); + + public: // from MDesCArray + TInt MdcaCount() const; + TPtrC16 MdcaPoint(TInt aIndex) const; + + public: + void SetObserver( CMFListHandlerObserver* aObserver ); + static void Panic( TInt aReason ); + + private: + CMFListHandlerObserver* iObserver; // does not own + }; + + + + + + +/** +* CMediaFileDialog +* +* CMediaFileDialog provides UI for selecting/previewing media files. +*/ +NONSHARABLE_CLASS (CMediaFileDialog) : public CAknDialog, + public MEikListBoxObserver, + public MCoeForegroundObserver, + public CMFListHandlerObserver, + public MMediaFileHandlerObserver, + public MMFActiveCallerObserver, + public MPreviewHandlerObserver, + public MMediaFileWaitNoteObserver, + public MAdaptiveSearchTextObserver, // not used + public MPenUiActivationHandler + + { + +#ifdef _DEBUG + friend class CMFDialogTest; +#endif + + enum TListOperationType + { + EAttrSelect, + EAttrOpen, + EAttrClicked, + EAttrDoubleClicked + }; + + enum TDelayedOperationType + { + EAttrPreview, + EAttrSearch, + EAttrChangeCba + }; + + + public:// Constructors and destructor + + /** + * Two-phased constructor. + */ + static CMediaFileDialog* NewL(); + + /** + * Destructor. + */ + virtual ~CMediaFileDialog(); + + private: + + /** + * C++ default constructor. + */ + CMediaFileDialog(); + + /** + * By default Symbian OS constructor is private. + */ + void ConstructL(); + + public: + TBool ShowDialogL( TDes* aFileName, TInt* aNullItem, + TInt* aInfo, TDes* aDesInfo ); + + void SetAttrL( TInt aAttr, TInt aValue ); + void SetAttrL( TInt aAttr, const TDesC& aValue ); + void SetAttrL( TInt aAttr, TAny* aValue ); + void SetNullItemL( const TDesC& aText, const TDesC& aMediaFile, + TInt aMediaFileType, TInt aIconId ); + + private: + /** + * From MEikListBoxObserver, called by framework. + * @param aListBox. + * @param aEventType. + * @return None + */ + void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ); + + /** + * From the base class. + * Called by framework before the dialog is shown. + * @param None + * @return None + */ + void PreLayoutDynInitL(); + + /** + * From the base class. + * Called by framework before exiting the dialog. + * @param aButtonId Button id. + * @return ETrue to exit\ EFalse to not to exit. + */ + TBool OkToExitL( TInt aButtonId ); + + /** + * From the base class. + * Called by framework for key event handling. + * @param aKeyEvent. + * @param aType. + * @return Return code. + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + + /** + * From the base class. + * Called by framework when dialog is activated. + * @param None. + * @return None. + */ + void ActivateL(); + + /** + * From the base class. + * Called by framework before menu is shown. + * @param aResourceId Menu resource id. + * @param aMenuPane Pointer to the menu. + * @return None. + */ + void DynInitMenuPaneL( TInt aResourceID, CEikMenuPane* aMenuPane ); + + /** + * From the base class. + * Handles menu events. + * @param aCommandId Command id. + * @return None. + */ + void ProcessCommandL( TInt aCommandId ); + + /** + * From base class. + * Called when UI layout changes. + * @param aType. + * @return None. + */ + void HandleResourceChange( TInt aType ); + + /** SetSizeAndPosition + * From CAknDialog. + * Sets dialog's size to whole main pane. + * @param aSize ignored + */ + void SetSizeAndPosition( const TSize &aSize ); + + SEikControlInfo CreateCustomControlL( TInt aControlType ); + + virtual CCoeControl* ComponentControl( TInt aIndex ) const; + virtual TInt CountComponentControls() const; + + + private: + TBool DoHandleOKL( TInt aAttr ); + TBool HandleOKL( TInt aAttr ); + TBool DoHandleBackL(); + TBool HandleBackL(); + void SearchL(); + void DoSearchL(); + static TInt StartRomScaning( TAny* aInstance ); + void StartRomScan(); + + private: + void ResetDialogL( TInt aError); + void QueryL( TInt aFolderId, TBool aDatabaseChanged = EFalse ); + void GetSelectedItemFileName( TInt aListboxIndex, TDes& aFileName ); + TInt CurrentItemListIndex(); + void SetIconsL(); + CAknSearchField* FindBox() const; + void ResetFindBoxL(); + void FindBoxCursorMoveL( TInt aType ); + void ShowContextMenuL( TInt aResource ); + void PreviewL( TInt aMediaType ); + void PreviewVideoL( const TDesC& aFileName ); + void PreviewNullItemL( TInt aFolderId ); + void StartPreviewWithDelay(); + void CancelPreview(); + void StartSearchWithDelay(); + TBool IsVideoFile( TInt aCurrentIndex ); + TBool IsValidVideoFileL( TInt aCurrentIndex, TInt aIntention ); + TInt MediaTypeIcon( TInt aListboxIndex ); + TInt StorageTypeIcon( TInt aListboxIndex ); + void GetListItemText( TInt aListboxIndex, TDes& aText ); + + private: + void CheckListboxIndex(); + void HandleMediaFileChanged(); + + private: + void UpdateListBoxL( TBool aRestFindBox = ETrue ); + void DoUpdateListBoxL( TBool aRestFindBox ); + void UpdateCbaL( TInt aAttr ); + TInt MapAttribute( TInt aFolderId ); + + void ShowErrorNoteL( TInt aError ); + void ShowPreviewErrorNoteL( TInt aError, TInt aMediaType ); + void DeleteMenuItem( CEikMenuPane* aMenuPane, TInt aCommandId ); + CGulIcon* IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, + TInt aFileMaskIndex); + CGulIcon* IconL(TAknsItemID aId, const TDesC& aFileName, TInt aFileIndex, + TInt aFileMaskIndex, TAknsQsnIconColorsIndex colorIndex); + static TInt CloseDialog( TAny *aObj ); + void CloseDialogWithDelayL(); + + private: + void ShowWaitNoteL( TBool aDatabaseChanged ); + void ShowPopupNoteL( const TDesC& aText ); + void ShowDetailsPopupL(); + void GetPopupText( CMediaFileData* aData, TDes& aText ); + TBool MatchFound( const TDesC& aAttribute, const TDesC& aText ); + + /** + * Filters the invalid files from media file handler. + * @return None. + */ + void FilterInvalidFiles(); + + private: + static void Panic( TInt aReason ); + + private: // from CMFListHandlerObserver + TPtrC ConstructListboxItem( TInt aListboxIndex ); + TInt ListboxItemCount(); + + private: // from MPreviewHandlerObserver + void HandlePreviewEventL( TInt aEvent, TInt aError ); + + private: // from MMediaFileHandlerObserver + void HandleMFEventL( TInt aEvent, TInt aError ); + + private: // from MMFActiveCallerObserver + void HandleActiveCallL( TInt aCallId ); + + private: //from MCoeControlObserver + void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); + + private: // from MCoeForegroundObserver + void HandleGainingForeground(); + void HandleLosingForeground(); + + private: // from MAdaptiveSearchTextObserver + void AdaptiveSearchTextChanged( CAknSearchField* aSearchField ); + + private: // from MPenUiActivationHandler + void OnPeninputUiDeactivated(); + void OnPeninputUiActivated(); + + private: // MMediaFileWaitNoteObserver + void HandleWaitNoteL( TInt aButtonId ); + +#ifdef _DEBUG + private: // test code + CMFDialogTest* iTest; +#endif + + private: + // listbox + CAknSingleGraphicStyleListBox* iListBox; + + // for title and icon handling + CStatusPaneHandler* iStatusPaneHandler; + + // long buffer for string handling + TBuf iBuf; + + // long buffer for string handling + TBuf iPopupText; + + // long buffers for listbox items + TBuf iListboxItemText1; + TBuf iListboxItemText2; + + // text from search field + TBuf iSearchText; + + // long buffers for icon file names + TFileName iIconFileName; + + // list box model item array + CMFListHandler* iMFListHandler; + + // dialog state + CMediaFileDialogState* iState; + + // metadata engine wrapper + CMediaFileHandler* iMediaFileHandler; + + // search box + CAknSearchField* iFindCtrl; + + // for generating active object calls + CMFActiveCaller* iCaller; + CMFActiveCaller* iSearchCaller; + + // for previewing video files + CMFVideoPreviewHandler* iVideoPreviewHandler; + + // for previewing audio files + CMFAudioPreviewHandler* iAudioPreviewHandler; + + // popup note + CAknInfoPopupNoteController* iPopupNote; + + // cancel note in case database query takes more than 2 seconds + CMediaFileWaitNote* iWaitNote; + + // needed for finding out whether search field is in pen input mode + RPeninputServer iPeninputServer; + + // for file protection information (drm etc) + CMFProtectionHandler* iProtectionHandler; + + // for closing dialog + CIdle* iIdle; + + TBool ifilevalid; + // is dialog in foreground (visible) + TBool iForeGround; + + // dll resource file id + TInt iResourceFileId; + + // is metadata databse open + TBool iDatabaseOpen; + + // is pen input active + TBool iPeninputActive; + + // dialog attribute values + HBufC* iNullItemFileNameOne; + HBufC* iNullItemFileNameTwo; + TInt iNullItemFileTypeOne; + TInt iNullItemFileTypeTwo; + TBuf iDialogTitle; + + CAknInputBlock* iInputBlock; + + // dialog output parameters + + // selected media file + TDes* iFileName; + // selected null item + TInt*iNullItem; + // extra parameter for later use + TInt* iInfo; + // extra parameter for later use + TDes* iDesInfo; + //is double clicked the item of the listbox + TBool iIsDoubleClicked; + TBool iFileisvalid; + // Video preview dialogue, model dialog + CVideoPreviewDialog* iVideoPreviewDlg; + }; + + + +/** +* CFindControl +* +* Search field functionality (CFindControl) is copied from +* AknSelectionLis (s60/mw/classicui/uifw/AvKon/src/AknSelectionList.cpp). +* Example code can also be found in +* s60/app/imppapplications/wvuing/wvuiave/AppSrc/CCAContactSelectionDialog.cpp +*/ +NONSHARABLE_CLASS (CFindControl) : public CCoeControl + { +public: + CAknSearchField *iFind; + ~CFindControl() { delete iFind; } + void Draw(const TRect &) const + { + // this removes flicker from CEikDialog's Draw(). + } + void SizeChanged() + { + TRect mainPane; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane ); + + TAknLayoutRect listRect; + + listRect.LayoutRect( mainPane, AknLayout::list_gen_pane(0) ); + + TRect r( listRect.Rect() ); + iPosition = TPoint( r.iTl ); + iSize.SetSize( r.Width(), r.Height() ); + } + + TSize MinimumSize() + { + if ( iFind ) + { + if ( iFind->Size() != TSize( 0, 0 ) ) + { + return iFind->Size(); + } + } + + return iSize; + } + }; + + + + +#endif // MEDIALFILEDIALOG_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Inc/mediafiledialogstate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Inc/mediafiledialogstate.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,280 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file of mediafiledialogstate. +* Class used to deal with the items of the Main view +* +*/ + + + +#ifndef MEDIAFILEDIALOGSTATE_H +#define MEDIAFILEDIALOGSTATE_H + +// INCLUDES +#include "mediafiledialogutils.h" + +#include + + +// CONSTANTS + + +enum TMediaFileListFolder + { + EEFolderRoot = 0, + EEFolderDownload, + EEFolderTones, + EEFolderMusic, + EEFolderVideos, + EEFolderRecordings, + EEFolderSearch, + EEFolderAllMusic, + EEFolderArtistRoot, + EEFolderArtist, + EEFolderArtistUnknown, // 10 + EEFolderArtistAll, + EEFolderArtistAlbum, + EEFolderArtistAlbumUnknown, + EEFolderAlbumRoot, + EEFolderAlbum, + EEFolderAlbumUnknown, + EEFolderGenreRoot, + EEFolderGenre, + EEFolderGenreUnknown, + EEFolderComposerRoot, // 20 + EEFolderComposer, + EEFolderComposerUnknown, + EEFolderNullItemOne, + EEFolderNullItemTwo, + EEFolderRecent, + EEFolderNone, + EEFolderPersistent, + EEFolderUnknown, + EEFolderSearchMusic + }; + + +enum TMediaFileListIcons + { + EEIconMusic = 0, + EEIconTone = 1, + EEIconVideo = 2, + EEIconRecording = 3, + EEIconArtist = 4, + EEIconAlbum = 5, + EEIconGenre = 6, + EEIconComposer = 7, + EEIconFolder = 8, + EEIconUnknown = 9, + EEIconFolderDownload = 10, + EEIconNullItemOff = 11, + EEIconMemoryCard = 12, + EEIconMassStorage = 13, + EEIconEmpty = 14 + }; + +enum TMediaFileListQueryDirection + { + EEQueryUp, + EEQueryDown, + EEQueryUpdate + }; + + + +// CLASS DECLARATION + +NONSHARABLE_CLASS (TMFListItem) + { + public: + // position in listbox + TInt iListIndex; + + // one of TMediaFileListFolder + TInt iFolderId; + + // one of TMediaFileListFolder + TInt iParentFolderId; + + // non-persistent child items from metadata (folders or file names) + TInt iChildFolderId; + + // is list item a persistent folder + TBool iPersistent; + + // is list item hidden + TBool iHidden; + + // icon that is shown in listbox + TInt iIconId; + + // icon that is shown in listbox + TInt iChildIconId; + + // count of unknown items in this folder + TInt iUnknownCount; + + // text that is shown in listox + TBuf iText; + + // text that is shown in navi pane + TBuf iTitle; + + + public: + TMFListItem(); + }; + +/** +* TMFCurrentItemInfo +* +* Used for maintaining the open item info in a list box +* folder and current list item position. +*/ + +NONSHARABLE_CLASS (TMFCurrentItemInfo) + { + public: + // has media file database changed + TBool iIndexCheckNeeded; + + // current item listbox index + TInt iItemIndex; + + // currently selected media file id + TInt iMediaFileId; + + // currently selected persistent folder id + TInt iFolderId; + + // currently selected non-persistent folder id + TBuf iFolderText; + + public: + void Reset(); + }; + + + + +/** +* CMediaFileDialogState +* +* Used for maintaining MediaFileDialog state eg currently open +* folder and current list item position. +*/ +NONSHARABLE_CLASS (CMediaFileDialogState) : public CBase + { + public: + static CMediaFileDialogState* NewL(); + virtual ~CMediaFileDialogState(); + + private: + CMediaFileDialogState(); + void ConstructL(); + + public: + void Init(); + void AddPermanentItemsL(); + + TInt NextFolderUp(); + TInt NextFolderDown( TInt aListIndex ); + void SetQueryInfo( TInt aQueryId, const TDesC& aQueryText, + TInt aQueryListPosition, TInt aQueryDirection ); + void SetStateAfterQuery(); + + public: + void SetCurrentFolder( TInt aFolderId ); + TInt CurrentFolder(); + + TBool FindBoxNeeded(); + TBool QueryNeeded(); + TBool QueryNeeded( TInt aFolderId ); + TInt QueryFolder(); + + void SetText( TInt aFolderId, const TDesC& aText ); + void GetText( TInt aFolderId, TDes& aText ); + void SetTitle( TInt aFolderId, const TDesC& aText ); + void GetTitle( TInt aFolderId, TDes& aText ); + void GetSearchTitleL( TDes& aText, TInt aCount ); + void GetSearchTitle( TDes& aText, TInt aCount ); + + void SetUnknownFolderPosition( TInt aQueryCount ); + void SetListIndex( TInt aFolderId, TInt aListIndex ); + TInt ListIndex( TInt aFolderId ); + void EnableNullItemL( TInt aFolderId, const TDesC& aText, TInt aIconId ); + + + private: + TInt IndexFromId( TInt aFolderId ); + TInt FolderIndex( TInt aListIndex ); + + public: + TInt PersistentFolderCount( TInt aFolderId ); + TInt PersistentFolderCount(); + TInt LeadingPersistentFolderCount(); + TInt CurrentItemIndex(); + void SetCurrentItemIndex( TInt aIndex ); + TInt FolderId( TInt aListIndex ); + void GetFolderInfo( TInt aListIndex, TInt& aId, TDes& aText, + TBool& aPersistent, TInt& aIconId ); + + public: + TMFCurrentItemInfo& CurrentItemInfo(); + TInt QueryDirection(); + TInt PreviousFolderId(); + TBool IsPersistent( TInt aFolderId ); + + public: + void ResetUnknownCount(); + void SetUnknownCount( TInt aFolderId, TInt aCount ); + TInt UnknownCount( TInt aFolderId ); + void HideUnknownFolders(); + void HideUnknownFolder( TInt aFolderId, TInt aUnknownCount ); + void HideRootFolder( TInt aFolderId, TBool aHidden, + const TDesC& aText, TInt aIconId ); + + public: + void PrintCurrentFolder(); + + public: + static void GetFolderTypeText(TDes& aText, TInt aType); + + private: + static void Panic( TInt aReason ); + + private: + RArray iList; + TInt iCurrentFolderId; + TInt iCurrentFolderIndex; + TInt iListPosition; + + // temporary query info - iList is updated after successful query + TInt iQueryFolderId; + TInt iQueryDirection; + TBuf iQueryText; + + // previous folder id + TInt iPreviousFolderId; + + // current item info, needed for setting focus to current item + // when media file database changes + TMFCurrentItemInfo iCurrentItemInfo; + }; + + + +#endif // MEDIAFILEDIALOGSTATE_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Inc/mediafiledialogutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Inc/mediafiledialogutils.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,425 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Basic functionality of MediaFileList. +* +*/ + + + + +#ifndef MEDIALFILEDIALOGUTILS_H +#define MEDIALFILEDIALOGUTILS_H + + +// INCLUDES + +#include +#include // RReadStream RWriteStream +#include // RFs + +#include // CEikStatusPane +#include // CAknNavigationControlContainer +#include // CEikImage + +#include // MDownloadedContentHandler + + +// CONSTANTS + +const TInt KBufSize64 = 64; +const TInt KBufSize128 = 128; +const TInt KBufSize256 = 256; +const TInt KBufSize512 = 512; + + +// FORWARD DECLARATIONS + +class CAknAppUi; +class CRepository; + +class CDocumentHandler; +class CBrowserLauncher; + + + +/** +* TMFDialogUtil +* +* TMFDialogUtil is utility class for media file dialog. +*/ +NONSHARABLE_CLASS (TMFDialogUtil) + { + public: + + enum TMFDialogPrivateAttribute + { + EAttrFileName = 100, + EAttrDrawingWindow + }; + + + public: + static void ShowInformationQueryL( const TDesC& aText ); + static void ShowInformationQueryL( TInt aResource ); + static void ShowInformationNoteL( const TDesC& aText ); + static void ShowInformationNoteL( TInt aResource ); + + static void ShowErrorNoteL( const TDesC& aText ); + static void ShowErrorNoteL( TInt aResource ); + static void ShowErrorNoteL( const TDesC& aText, TInt aError ); + static TBool ShowNumberQueryL( TInt& aNumber, const TDesC& aTitle ); + + static TBool ShowListQueryL( const TDesC& aTitle, CDesCArray* aList, + TInt* aSelectedIndex ); + + + static TInt AddResFileL(); + static void StrCopy( TDes& aTarget, const TDesC& aSource ); + static void Panic( TInt aReason ); + static void SetIconFileNameL( const TDesC& aName, TDes& aFullName ); + static CEikImage* CreateImageLC( TAknsItemID aId, const TDesC& aFileName, + TInt aFileBitmapId, TInt aFileMaskId ); + static TBool IsEmpty( const TDesC& aText ); + + }; + + +/** +* MMFActiveCallerObserver +* +* MMFActiveCallerObserver is for observing CMFActiveCaller. +*/ +NONSHARABLE_CLASS (MMFActiveCallerObserver) + { + public: + virtual void HandleActiveCallL( TInt aCallId ) = 0; + }; + + + + +/** +* CMFActiveCaller +* +* CMFActiveCaller is used for generating a call from active scheduler. +* Typical use is to start some operation after a short delay. +*/ +NONSHARABLE_CLASS (CMFActiveCaller) : public CActive + { + public: + static CMFActiveCaller* NewL( MMFActiveCallerObserver* aObserver ); + virtual ~CMFActiveCaller(); + + private: + CMFActiveCaller( MMFActiveCallerObserver* aObserver ); + void ConstructL(); + + public: + void Start( TInt aCallId, TInt aMilliseconds ); + void Stop(); + void Request(); + + private: + void RunL(); + void DoCancel(); + + private: + // call that is passed to observer + TInt iCallId; + + // timer + RTimer iTimer; + + // observer that gets called + MMFActiveCallerObserver* iObserver; + }; + + + +/** +* CNaviPaneHandler +* +* This class is used for changing navipane title. +*/ +NONSHARABLE_CLASS (CNaviPaneHandler) : public CBase + { + public: + /** + * Destructor. + */ + virtual ~CNaviPaneHandler(); + + /** + * C++ default constructor. + */ + CNaviPaneHandler(CEikStatusPane* aStatusPane); + + public: + + /** + * Sets navi pane title. + * @param aTitle. + * @return None. + */ + void SetNaviPaneTitleL(const TDesC& aTitle); + + /** + * Store navi pane. + * @param None. + * @return None. + */ + void StoreNavipaneL(); + + private: + // status pane + CEikStatusPane* iStatusPane; + + // navi Pane + CAknNavigationControlContainer* iNaviPane; + + // navi decorator + CAknNavigationDecorator* iNaviDecorator; + + // has Navidecorator been pushed into navi pane + TBool iNavidecoratorPushed; + + // has navi pane been pushed into navigation pane's object stack + TBool iNavipanePushed; + }; + + + +/** +* CStatusPaneHandler +* +* This class is used for changing dialog title and image. +*/ +NONSHARABLE_CLASS (CStatusPaneHandler) : public CBase + { + public: + /** + * Two-phased constructor. + */ + static CStatusPaneHandler* NewL( CAknAppUi* aAppUi ); + + /** + * Destructor. + */ + virtual ~CStatusPaneHandler(); + + private: + /** + * By default Symbian OS constructor is private. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CStatusPaneHandler( CAknAppUi* aAppUi ); + + public: + /** + * Stores original title so it can be restored when dialog closes. + * @param None. + * @return None. + */ + void StoreOriginalTitleL(); + + /** + * Restores original title. + * @param None. + * @return None. + */ + void RestoreOriginalTitleL(); + + /** + * Sets dialog title. + * @param aText. + * @return None. + */ + void SetTitleL( const TDesC& aText ); + + /** + * Sets dialog title. + * @param aResourceId. + * @return None. + */ + void SetTitleL( TInt aResourceId ); + + public: + /** + * Sets dialog title. + * @param aAppUi. + * @param aText. + * @return Return code. + */ + static TBool SetTitleL( CAknAppUi* aAppUi, const TDesC& aText ); + + /** + * Gets dialog title. + * @param aAppUi. + * @param aText. + * @return Return code. + */ + static TBool GetTitleL( CAknAppUi* aAppUi, TDes& aText ); + + /** + * Sets navi pane title. + * @param aTitle. + * @return None. + */ + void SetNaviPaneTitleL( const TDesC& aTitle ); + + /** + * Sets navi pane title. + * @param aTitle. + * @return None. + */ + void SetNaviPaneTitle( const TDesC& aTitle ); + + /** + * Sets navi pane title. + * @param aTitle. + * @return None. + */ + void SetNaviPaneTitleL( TInt aResource ); + + /** + * Store navi pane. + * @param None. + * @return None. + */ + void StoreNavipaneL(); + + private: + // access to app ui + CAknAppUi* iAppUi; + + // original status pane title + TBuf iOriginalTitle; + + // is original status pane title stored + TBool iOriginalTitleStored; + + // original context pane image + CEikImage* iOriginalImage; + + CNaviPaneHandler* iNaviPaneHandler; + }; + + + + +/** +* CDriveUtil +* +* CDriveUtil is used for getting drive information. +*/ +NONSHARABLE_CLASS (CDriveUtil) : public CBase + { + public: + static CDriveUtil* NewL(); + virtual ~CDriveUtil(); + + private: + CDriveUtil(); + void ConstructL(); + + public: + TBool IsMemoryCard( const TDesC& aFullPath ); + TBool IsMassStorage( const TDesC& aFullPath ); + TBool IsRom( const TDesC& aFullPath ); + + private: + RFs iFsSession; + }; + + +/** +* CMimeTypeList +* +* CMimeTypeList is used for storing mime types that +* are excluded from media file list. +*/ +NONSHARABLE_CLASS (CMimeTypeList) : public CBase + { + public: + static CMimeTypeList* NewL(); + virtual ~CMimeTypeList(); + + private: + CMimeTypeList(); + void ConstructL(); + + public: + void ResetL(); + TInt Count(); + const TDesC& MimeType( TInt aIndex ); + void AddMimeTypeL( const TDesC& aText ); + TBool FindMimeTypeL( const TDesC& aText ); + + + public: + static TInt Compare( const TFileName& aFirst, const TFileName& aSecond ); + + private: + RArray iList; + }; + + +/** +* CWebBrowserLauncher +* +* CWebBrowserLauncher is used for launching web browser. +*/ +NONSHARABLE_CLASS(CWebBrowserLauncher) : public CBase, + public MDownloadedContentHandler + { + public: + static CWebBrowserLauncher* NewLC(); + virtual ~CWebBrowserLauncher(); + + private: + CWebBrowserLauncher(); + void ConstructL(); + + public: + void LaunchBrowserL(); + + public: + TBool HandleContentL( const TDesC& aFileName, + const CAiwGenericParamList& aParamList, + TBool& aContinue ); + + TAny* DownloadedContentHandlerReserved1( TAny* aAnyParam ); + + + private: + // Browser Launcher + CBrowserLauncher* iBrowserLauncher; + + // Document Handler for saving downloaded tones. + CDocumentHandler* iDocumentHandler; + }; + + + + + +#endif // MEDIALFILEDIALOGUTILS_H + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Inc/mediafilehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Inc/mediafilehandler.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,580 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used to interact with the MDE. +* +*/ + + + +#ifndef MEDIAFILEHANDLER_H +#define MEDIAFILEHANDLER_H + + +// INCLUDES + +#include "mediafiledialogutils.h" + + +#include +#include +#include +#include +#include +#include +#include +#include + + +// FORWARD DECLARATIONS +class CSearchList; +class CRomFileList; +class CArtistQuery; + +// CONSTANTS + +_LIT( KMimeTypeAMR, "audio/amr" ); +_LIT( KMimeTypeWAV, "audio/wav" ); +_LIT( KMimeMp3, "mp3" ); +_LIT( KDriveZ, "z:\\" ); +_LIT( KSpace, " " ); + + +/** +* CMediaFileData +* +* Used for storing metadata information for one media file. +*/ +NONSHARABLE_CLASS (CMediaFileData) : public CBase + { + public: + static CMediaFileData* NewL(); + virtual ~CMediaFileData(); + + private: + CMediaFileData(); + void ConstructL(); + + public: + const TDesC& Attr( TInt aAttr ); + void GetAttr( TInt aAttr, TDes& aValue ); + void SetAttrL( TInt aAttr, const TDesC& aValue ); + + public: + TInt iMediaFileType; + + private: + HBufC* iFullName; + HBufC* iName; + HBufC* iArtist; + HBufC* iAlbum; + HBufC* iGenre; + HBufC* iComposer; + }; + + +/** +* MMediaFileHandlerObserver +* +* For observing CMediaFileHandler events. +*/ +NONSHARABLE_CLASS (MMediaFileHandlerObserver) + { + public: + enum TMediaFileHandlerEvent + { + EInitComplete, + EQueryComplete, + EQueryCanceled, + EUnknownQueryComplete, + EMediaFileChanged, + EScanRomComplete, + EError + }; + + enum TScanRomState + { + ENoneRomScan, + ERomScanInProgress, + ERomScanComplete, + ERomScanError + }; + + public: + virtual void HandleMFEventL( TInt aEvent, TInt aError ) = 0; + }; + + + +/** +* CMediaFileHandler +* +* Used for making media file queries. For example get all songs for +* one artist. Uses metadata engine. +*/ +NONSHARABLE_CLASS (CMediaFileHandler) : public CBase, + public MMdESessionObserver, + public MMdEQueryObserver, + public MMdEObjectObserver, + public MMdEObjectPresentObserver, + public MMFActiveCallerObserver + { + public: + enum TMediaType + { + EMediaTypeTone = 0, + EMediaTypeVideo, + EMediaTypeRecording, + EMediaTypeMusic + }; + + enum TStorageType + { + EPhoneMemory = 0, + ERomStorage, + EMassStorage, + EMemoryCard + }; + + enum TQueryAttribute + { + EAttrMediaType = 20, // integer + EAttrFileSize, // integer + EAttrStorageType, // integer + EAttrMediaFileId, // integer + EAttrFileName, // string + EAttrFullName, // string + EAttrSongName, // string + EAttrArtist, // string + EAttrAlbum, // string + EAttrGenre, // string + EAttrComposer // string + }; + + enum TQueryType + { + EQueryNone = 0, + EQueryAudio, + EQueryMusic, + EQueryVideo, + EQueryRecording, + EQueryTone, + ESearchAudio, + ESearchVideo, + ESearchMusic, + ESearchTones, + EQueryEmpty, + EQueryUnknown, + + EQueryArtist, + EQueryArtistAlbum, + EQueryArtistAll, + EQueryArtistUnknown, + EQueryArtistEmpty, + }; + + public: + static CMediaFileHandler* NewL(); + virtual ~CMediaFileHandler(); + + private: + CMediaFileHandler(); + void ConstructL(); + + public: + void SetAttrL( TInt aAttr, TInt aValue ); + void SetAttrL( TInt aAttr, const TDesC& aValue ); + void SetAttrL( TInt aAttr, TAny* aValue ); + + public: + void QueryMusicL( TInt aAttr ); + void QueryMusicL( TInt aAttr, const TDesC& aFindText ); + void QueryMusicUnknownL( TInt aAttr ); + void QueryMusicUnknownCountL( TInt aAttr ); + void QueryAttributeValuesL( TInt aAttr ); + void QueryArtistL( TInt aAttr, const TDesC& aArtist, + const TDesC& aAlbum, TBool aRefresh = EFalse ); + void QueryArtistEmptyL(); + void QueryEmptyL(); + void QueryRomEmptyL( TInt aQueryType ); + + void QueryVideosL( TInt aAttr ); + void QueryRecordingsL( TInt aAttr ); + void QueryTonesL( TInt aAttr ); + void QueryDefaultTonesL( TInt /*aAttr*/ ); + + void SearchL( const TDesC& aSearchText ); + void SearchAudioL( const TDesC& aSearchText ); + + void StartRomScaning( TInt aQueryType ); + + public: + TInt UnknownArtistCount(); + TInt UnknownArtistCountL(); + TInt ResultCount(); + TBool QueryReady(); + TInt Attribute( TInt aIndex, TInt aAttr, TInt aQueryId ); + void GetAttributeL( TInt aIndex, TInt aAttr, TDes& aValue, TInt aQueryId ); + void GetAttribute( TInt aIndex, TInt aAttr, TDes& aValue, TInt aQueryId ); + CMediaFileData* ReadMediaFileDataL( TInt aId ); + void CancelQuery(); + + /** + * Remove an item from list of search reuslt + * @param aIndex Search list's index. + * @return None. + */ + void Remove( TInt aIndex ); + + public: + TInt ItemIndex( const TDesC& aItemText, TInt aIndex ); + TInt ItemIndex( TInt aItemId, TInt aIndex ); + + private: + + void SearchVideoL( const TDesC& aSearchText ); + void SearchMusicL( const TDesC& aSearchText ); + void SearchTonesL( const TDesC& aSearchText ); + static TInt SearchTones( TAny *aObj ); + static TInt SearchVideo( TAny *aObj ); + + + public: + void SetObserver( MMediaFileHandlerObserver* aObserver ); + void SetQueryId( TInt aId ); + void EnableObserverCall( TBool aEnable ); + + + public: + CMediaFileData* RomMediaFileDataL( TInt aId ,TInt aMediaType ); + + private: + CMdEPropertyDef& PropertyDefL( TInt aAttr ); + void StrCopy( TDes& aTarget, const TDesC& aSource ); + void CheckAttrL( TInt aAttr ); + void CallObserverWithDelay(); + void CallObserver( TInt aEvent, TInt aError ); + void AddObjectObserverL(); + + public: + static CMdEPropertyDef& PropertyDefL( CMdESession* aSession, TInt aAttr ); + + private: + void ExcludeRecordingsL( CMdELogicCondition& aCondition ); + void ExcludeRomFilesL( CMdELogicCondition& aCondition ); + void ExcludeMimeTypesL( CMdELogicCondition& aCondition, TInt aAttr ); + void IncludeMusicPropertiesL( CMdELogicCondition& aCondition ); + void ExcludeMusicPropertiesL( CMdELogicCondition& aCondition ); + void IncludeMusicSearchConditionL( CMdELogicCondition& aCondition, + const TDesC& aSearchText ); + void IncludeToneSearchConditionL( CMdELogicCondition& aCondition, + const TDesC& aSearchText ); + void IncludeVideoSearchConditionL( CMdELogicCondition& aCondition, + const TDesC& aSearchText ); + + + + private: + void LeaveIfSessionClosedL(); + void Panic( TInt aReason ); + TInt MediaType( TInt aQueryType ); + + + private: // from MMdESessionObserver + void HandleSessionOpened(CMdESession& aSession, TInt aError); + void HandleSessionError(CMdESession& aSession, TInt aError); + + + private: // from MMdEQueryObserver (mdequery.h) + void HandleQueryNewResults( CMdEQuery& aQuery, TInt aFirstNewItemIndex, + TInt aNewItemCount ); + void HandleQueryCompleted( CMdEQuery& aQuery, TInt aError ); + void HandleQueryCompletedL( CMdEQuery& aQuery, TInt aError ); + + private: // from MMdEObjectObserver + void HandleObjectNotification( CMdESession& aSession, + TObserverNotificationType aType, + const RArray& aObjectIdArray); + + private: // from MMdEObjectPresentObserver + void HandleObjectPresentNotification( CMdESession& aSession, + TBool aPresent, const RArray& aObjectIdArray); + + private: // from MMFActiveCallerObserver + void HandleActiveCallL( TInt aCallId ); + + private: + + // media file event observer + MMediaFileHandlerObserver* iObserver; + + // session to metadata engine + CMdESession* iSession; + + // metadata query + CMdEObjectQuery* iQuery; + + // used for optimizing artist queries + CArtistQuery* iArtistQuery; + + // search result list - ui shows items from this list + CSearchList* iSearchList; + + // metadata search text + TBuf iSearchText; + + // for generating active object calls + CMFActiveCaller* iQueryCaller; + // for generating active object calls + CMFActiveCaller* iObjectNotificationCaller; + + // for finding out file drive type + CDriveUtil* iDriveUtil; + + // mime types that are exluded from queries + CMimeTypeList* iExcludedMimeTypes; + + // for starting video query after short delay + CIdle* iIdle; + + // used to prevent observer call when query is canceled fro ui + TBool iObserverCallEnabled; + + // query id from UI, not used in this class + TInt iQueryId; + + // max audio file file size + TInt iMaxFileSize; + + // is metadata session open + TBool iSessionOpen; + + // query type + TInt iQueryType; + + // query error + TInt iQueryError; + + // query event + TInt iQueryEvent; + + TBool iVideoSearchDisabled; + + TInt iMediaFileCounter; + //for scan data from rom + CRomFileList* iRomFileList; + //Record the rom scan state. + TInt iRomScanState; + //Tone query in progress + TBool iQueryinProgress; + + }; + + + + +/** +* CSearchListItem +* +* Data for one media file item CSearchList. +*/ +NONSHARABLE_CLASS (CSearchListItem) : public CBase + { + public: + static CSearchListItem* NewLC(); + static CSearchListItem* NewL(); + virtual ~CSearchListItem(); + + private: + CSearchListItem(); + void ConstructL(); + + public: + void SetTitleL( const TDesC& aText, TBool aFullName ); + const TDesC& Title() const; + + public: + TInt iId; + TInt iMediaType; + TInt iStorageType; + private: + HBufC* iTitle; + }; + + +/** +* CRomFileList +* +* Used for reading media files from rom. +*/ +NONSHARABLE_CLASS (CRomFileList) : public CBase + { + public: + static CRomFileList* NewL(); + virtual ~CRomFileList(); + + private: + CRomFileList(); + void ConstructL(); + public: + void ReadDirectoryL( const TDesC& aDirectory, RArray& aList ); + void ReadDirectoryL( const TDesC& aDirectory, + RPointerArray& aList ); + + void ReadRomFilesL(); + void ReadRomVediosL(); + const TDesC& Item( TInt aIndex , TInt aType ); + TInt RomFileItem( CSearchListItem* aItem, TInt aIndex); + TInt RomVedioItem( CSearchListItem* aItem, TInt aIndex); + TInt Count( TInt aType ); + void Reset(); + + public: +// //Used to return the rom file attribute in rom; +// TInt RomFileAttribute(TInt aIndex, TInt aAttr); + //Used to return the title of rom item + TInt GetRomFileName(TInt aIndex, TInt aType, TDes& aValue); +private: + CSearchListItem* SearchListItemFromRomL(const TDesC& aFileName, + TInt aIndex); + //Used to get the title of rom item + void RomItemTitle(TInt aIndex, TDes& aTitle ); + +private: + TFileName iFileName; + RArray iList; + RArray iVedioList; + RPointerArray iRomToneList; + RPointerArray iRomVideoList; + + }; + +/** +* CSearchList +* +* List for storing search result for one (most recent) metadata query. +*/ +NONSHARABLE_CLASS (CSearchList) : public CBase + { + public: + static CSearchList* NewL(); + virtual ~CSearchList(); + + private: + CSearchList(); + void ConstructL(); + + public: + void SetSession( CMdESession* aSession ); + void SetRomFileList( CRomFileList* aRomFileList ); + void TakeResultL( CMdEObjectQuery* aQuery, TInt aMediaType ); + void TakeArtistResultL( CArtistQuery* aArtistQuery ); + void TakeDistinctResultL( CMdEObjectQuery* aQuery, TInt aMediaType ); + void SearchInToneL( CRomFileList* aQuery, const TDesC& aSearchText ); + void VideoSearchInRomL( CRomFileList* aQuery, const TDesC& aSearchText ); + + void AddAlbumItemL( const TDesC& aAlbum ); + void AddItemL( CMdEObject& aObject, TInt aMediaType ); + void AddRomItemL( CRomFileList* aRomList, TInt aMediaType ); + void AddArtistItemL( CMdEObject& aObject, TInt aQueryType, const TDesC& aAlbum ); + + void Reset(); + void Sort(); + TInt Count(); + void GetAttributeL( TInt aIndex, TInt aAttr, TDes& aValue ); + TInt Attribute( TInt aIndex, TInt aAttr ); + void SetSearchId( TInt aId ); + TInt SearchId(); + + /** + * Remove an item from the list of search results. + * @param aIndex List's index. + * @return None. + */ + void Remove( TInt aIndex ); + + public: + TInt ItemIndex( TInt aId ); + TInt ItemIndex( const TDesC& aText ); + TInt ItemIndex( const TDesC& aText, TInt aIndex ); + TInt ItemIndex( TInt aId, TInt aIndex ); + + private: + static TInt Compare( const CSearchListItem& aFirst, + const CSearchListItem& aSecond ); + void Panic( TInt aReason ); + const TDesC& TextL( CMdEObject& aObject, TInt aId ); + + private: + CMdESession* iSession; // does not own + + CRomFileList* iRomFileList; //does not own + + // list of search results + RPointerArray iList; + + // for finding out drive type (eg memory card) + CDriveUtil* iDriveUtil; + + // search id - not used in this class + TInt iSearchId; + }; + + + + + +/** +* CArtistQuery +* +* CArtistQuery is for storing all metadata for one artist. +* Once CArtistQuery is initialized it can be used to get artist +* subqueries without making more metadata queries. +*/ +NONSHARABLE_CLASS (CArtistQuery) : public CBase + { + public: + static CArtistQuery* NewL(); + virtual ~CArtistQuery(); + + private: + CArtistQuery(); + void ConstructL(); + + public: + void ResetL(); + + void SetArtistL( const TDesC& aText ); + void SetAlbumL( const TDesC& aText ); + void SetQueryType( TInt aType ); + void SetQuery( CMdEObjectQuery* aQuery ); + + const TDesC& Artist(); + const TDesC& Album(); + TInt QueryType(); + CMdEObjectQuery* Query(); + TInt UnknownCount(); + + private: + CMdEObjectQuery* iQuery; + TInt iQueryType; + + HBufC* iArtist; + HBufC* iAlbum; + }; + + + +#endif // MEDIAFILEHANDLER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Inc/mediafilelist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Inc/mediafilelist.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,187 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface of MediaFileList. Provide some API for +* the user to use mediafilelist +* +*/ + + + + +#ifndef MEDIALFILELIST_H +#define MEDIALFILELIST_H + +// INCLUDES +#include +#include + + +// FORWARD DECLARATIONS +class CMediaFileDialog; + + + +// CLASS DECLARATION + +/** +* Public API for displaying media file list. List is used for +* selecting/previewing audio and video files. +* +* @lib mediafilelist.lib +* @since Series60_5.1 +* +*/ +class CMediaFileList : public CBase + { + public: + enum TMediaFileListAttribute + { + // max media file size + EAttrFileSize = 0, + // ringing volume (TProfileRingingVolume from Profile.hrh) + EAttrVolume, + // ringing type, (TProfileRingingType from Profile.hrh) + EAttrRingingType, + // vibra on/off (Boolean) + EAttrVibra, + // 3D effect (TProfile3DToneEffect from ProfileInternal.hrh) + EAttr3DEffect, + // 3D echo (TProfile3DToneEcho from ProfileInternal.hrh) + EAttr3DEcho, + // excluded mime type text + EAttrExcludeMimeType, + // for file protection checking + EAttrAutomatedType, + // media file dialog title + EAttrTitle, + // excluded folder (see enum TFolderType) + EAttrExcludeFolder + }; + + enum TMediaFileType + { + EMediaFileTypeAudio = 0, + EMediaFileTypeVideo + }; + + enum TNullItemIcon + { + ENullItemIconNone = 0, + ENullItemIconDefaultTone, + ENullItemIconOff + }; + + enum TFolderType + { + EFolderDownload = 0, + EFolderVideos + }; + + public: + /** + * Two-phased constructor. + */ + IMPORT_C static CMediaFileList* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CMediaFileList(); + + private: + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CMediaFileList(); + + public: + + /** + * Shows Media file list. + * @since Series60_5.1 + * @param aFileName Selected media file name full path. + * @param aNullItem Selected null item index. Possible values: + * KErrNotFound - item is not null item or Download item + * 0 - Download item + * 1 - first null item + * 2 - second null item + * + * @param aInfo Extra information, set to NULL if not used. + * @param aDesInfo Extra information, set to KNullDesC if not used. + * @return ETrue if user selected media file, EFalse otherwise. + */ + IMPORT_C TBool ShowMediaFileListL( TDes* aFileName, TInt* aNullItem, + TInt* aInfo, TDes* aDesInfo ); + + /** + * Set Media file list attribute. See enum TMediaFileListAttribute for + * list of supported attributes. + * @since Series60_5.1 + * @param aAttr Attribute id. + * @param aValue Attribute value. + * @return None. + */ + IMPORT_C void SetAttrL( TInt aAttr, TInt aValue ); + + /** + * Set Media file list attribute. See enum TMediaFileListAttribute for + * list of supported attributes. + * @since Series60_5.1 + * @param aAttr Attribute id. + * @param aValue Attribute value. + * @return None. + */ + IMPORT_C void SetAttrL( TInt aAttr, const TDesC& aValue ); + + /** + * Set Media file list attribute. Currently not in use. + * @since Series60_5.1 + * @param aAttr Attribute id. + * @param aValue Attribute value. + * @return None. + */ + IMPORT_C void SetAttrL( TInt aAttr, TAny* aValue ); + + /** + * Set Media file list null item. Null items are custom list items + * that appear at the end of the media file list main view. + * @since Series60_5.1 + * @param aText Null item text. + * @param aMediaFile File that is played when null items gets focused. + * Use KNullDesC if not used. + * @param aMediaFileType Media file type. See enum TMediaFileType for + supported media types. + * @param aIconId Null item icon id. See enum TNullItemIcon for + supported icons. + * @return None. + */ + IMPORT_C void SetNullItemL( const TDesC& aText, const TDesC& aMediaFile, + TInt aMediaFileType, TInt aIconId ); + + + + private: + CMediaFileDialog* iDialog; + }; + + + +#endif // MEDIALFILELIST_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Inc/mediafilelistdebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Inc/mediafilelistdebug.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Tools for making logs +* +*/ + + + +#ifdef _DEBUG + +#include +#include +#include +#include + +_LIT(KLogFileName,"mfl.txt"); +_LIT(KLogDirFullName,"c:\\logs\\"); +_LIT(KLogDir,"mfl"); + +// Declare the FPrint function +inline void FPrint(const TRefByValue aFmt, ...) + { + VA_LIST list; + VA_START(list,aFmt); + RFileLogger::WriteFormat(KLogDir, KLogFileName, EFileLoggingModeAppend, aFmt, list); + } + +// =========================================================================== +#ifdef __WINS__ // File logging for WINS +// =========================================================================== +#define FLOG(arg...) { FPrint(arg); } +//#define FLOG(a) { RDebug::Print(a); } +#define FTRACE(a) { a; } +// =========================================================================== +#else // RDebug logging for target HW +// =========================================================================== +//#define FLOG(arg...) { RDebug::Print(arg); } +#define FLOG(arg...) { FPrint(arg); } +#define FTRACE(a) { a; } +#endif //__WINS__ + +// =========================================================================== +#else // // No loggings --> Reduced binary size +// =========================================================================== +#define FLOG(arg...) +#define FTRACE(a) + +#endif // _DEBUG + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Inc/mediafilepreview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Inc/mediafilepreview.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,353 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for preview audio and video +* +*/ + + + +#ifndef MEDIAFILEPREVIEW_H +#define MEDIAFILEPREVIEW_H + +#include "mediafiledialogutils.h" + +// INCLUDES + +#include +#include +#include +#include +#include +#include // for RApaLsSession +#include + + + +// CONSTANTS + + +// FORWARD DECLARATIONS +class C3DRingingToneInterface; +class RWindow; + + + + +/** +* MPreviewHandlerObserver +* +* For observing media file preview events. +* +*/ +NONSHARABLE_CLASS (MPreviewHandlerObserver) + { + public: + enum TPreviewHandler + { + EVideoPreviewComplete, + EAudioPreviewComplete, + EPreviewError + }; + + public: + virtual void HandlePreviewEventL( TInt aEvent, TInt aError ) = 0; + }; + + + + +/** +* CMFPreviewHandlerBase +* +* Base class for CMFAudioPreviewHandler and CMFVideoPreviewHandler. +*/ +NONSHARABLE_CLASS (CMFPreviewHandlerBase) : public CBase + { + public: + enum TPlayerStatus + { + EPlayerNotCreated, + EPlayerInitializing, + EPlayerReady, + EPlayerPlaying, + EPlayerInitialized, + EPlayerPlayingWith3DEffect + }; + + // these must match with the ones in Profile Engine + enum TRingingTypes + { + ERingingTypeRinging = 0, + ERingingTypeAscending, + ERingingTypeRingOnce, + ERingingTypeBeepOnce, + ERingingTypeSilent + }; + + enum TFLAllowScreenSaver + { + EFLScreenSaverAllowed = 0, + EFLScreenSaverNotAllowed + }; + + protected:// Constructors and destructor + + /** + * Destructor. + */ + virtual ~CMFPreviewHandlerBase(); + + protected: + + /** + * C++ default constructor. + */ + CMFPreviewHandlerBase(); + + /** + * By default Symbian OS constructor is private. + */ + void ConstructL(); + + public: + void SetAttrL( TInt aAttr, TInt aValue ); + void SetAttrL( TInt aAttr, const TDesC& aValue ); + void SetAttrL( TInt aAttr, TAny* aValue ); + TInt Attr( TInt aAttr ); + void SetObserver( MPreviewHandlerObserver* aObserver ); + virtual void PlayL() = 0; + virtual void Stop() = 0; + virtual TBool IsPlaying() = 0; + + protected: + TInt ConvertVolume( TInt aVolume ); + void ReadActiveProfileL(); + TInt GetDataType( const TDesC& aFileName, TDataType& aDataType ); + void ReadDefaultToneL(); + void Panic( TInt aReason ); + void EnableScreenSaver( TBool aEnable ); + + void DisableBackLight(); + + static TInt DoResetInactivityTimer( TAny* aObject ); + protected: + TInt RingingVolume(); + TInt RingingType(); + TInt Vibra(); + TInt Echo3D(); + TInt Effect3D(); + + protected: + static TInt ConvertVolume( TInt aVolume, TInt aMaxVolume ); + static TBool IsCallOngoing(); + + protected: + TInt iRingingVolume; + TInt iRingingType; + TInt iVibra; + TInt i3DEffect; + TInt i3DEcho; + TInt iMediaType; + TInt iFileSize; + HBufC* iFullName; + + TBool iActiveProfileRead; + TInt iActiveProfileRingingVolume; + TInt iActiveProfileRingingType; + TInt iActiveProfileVibra; + TInt iActiveProfile3DEffect; + TInt iActiveProfile3DEcho; + + + MPreviewHandlerObserver* iObserver; + + TInt iPlayerStatus; + + // handle to window + RWindow* iWindow; // does not own + + // for getting file MIME types + RApaLsSession iApaSession; + + // for setting screensaver on/off + RProperty iProperty; + + // default ringing tone + TFileName iDefaultTone; + + // file server session + //RFs iFsSession; + + /** + * Timer for resetting the user inactivity timeout + */ + CPeriodic* iBacklightTimer; + }; + + + +/** +* CMFVideoPreviewHandler +* +* For previewing video files. +*/ +NONSHARABLE_CLASS (CMFVideoPreviewHandler) : public CMFPreviewHandlerBase, + public MVideoPlayerUtilityObserver + { + + public:// Constructors and destructor + + /** + * Two-phased constructor. + */ + static CMFVideoPreviewHandler* NewL(); + + /** + * Destructor. + */ + virtual ~CMFVideoPreviewHandler(); + + private: + + /** + * C++ default constructor. + */ + CMFVideoPreviewHandler(); + + /** + * By default Symbian OS constructor is private. + */ + void ConstructL(); + + public: + void PlayL(); + void Stop(); + TBool IsPlaying(); + void SetDisplayWindowL(); + + + private: + TInt VolumeRamp(); + void SetRingingType( TInt aRingingType ); + TInt ConvertVolume( TInt aVolume ); + void Cancel(); + void GetRectData( TRect aRect, TDes& aText ); + + + + private: + static TInt VolumeRampTimerCallback( TAny* aObj ); + + private: // from MVidePlayerUtilityObserver + void MvpuoOpenComplete( TInt aError ); + void MvpuoFrameReady( CFbsBitmap& aFrame, TInt aError ); + void MvpuoPlayComplete( TInt aError ); + void MvpuoEvent( const TMMFEvent& aEvent ); + void MvpuoPrepareComplete( TInt aError ); + + + private: + + // video player + CVideoPlayerUtility* iVideoPlayer; + + // ascending volume timer + CPeriodic* iVolumeRampTimer; + + // Ascending volume + TInt iRampedVolume; + }; + + + +/** +* CMFAudioPreviewHandler +* +* For previewing audio files (tones, music and recordings). +* +*/ +NONSHARABLE_CLASS (CMFAudioPreviewHandler) : public CMFPreviewHandlerBase, + public MDrmAudioPlayerCallback, + public MMdaAudioToneObserver + + { + public:// Constructors and destructor + + /** + * Two-phased constructor. + */ + static CMFAudioPreviewHandler* NewL(); + + /** + * Destructor. + */ + virtual ~CMFAudioPreviewHandler(); + + private: + + /** + * C++ default constructor. + */ + CMFAudioPreviewHandler(); + + /** + * By default Symbian OS constructor is private. + */ + void ConstructL(); + + public: + void PlayL(); + void Stop(); + TBool IsPlaying(); + + private: + void Cancel(); + void SetAudioRingingType( TInt aRingingType ); + void SetToneRingingType( TInt aRingingType ); + TInt ConvertVolume( TInt aVolume ); + + + private: // from MMdaAudioToneObserver + virtual void MatoPrepareComplete( TInt aError ); + virtual void MatoPlayComplete( TInt aError ); + + private: // from MDrmAudioPlayerCallback + void MdapcInitComplete( TInt aError, const TTimeIntervalMicroSeconds& aDuration ); + void MdapcPlayComplete( TInt aError ); + + private: + // audio player + CDrmPlayerUtility* iAudioPlayer; + + /// Audioplayer status + TPlayerStatus iAudioPlayerStatus; + + /// toneplayer + CMdaAudioToneUtility* iTonePlayer; + + /// Toneplayer status + TPlayerStatus iTonePlayerStatus; + + // plugin for playing 3D effects + C3DRingingToneInterface* i3dRingingTonePlugin; + + }; + + + + + +#endif // MEDIAFILEPREVIEW_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Inc/mediafileprotection.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Inc/mediafileprotection.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,209 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class used to check the protection of the +* media files. +* +*/ + + + +#ifndef MEDIAFILEPROTECTION_H +#define MEDIAFILEPROTECTION_H + +#include "mediafiledialogutils.h" +#include "mediafilevariation.h" + +// INCLUDES + +#include +#include +#include // RApaLsSession + + +// CONSTANTS + + +// FORWARD DECLARATIONS + + + +/** +* CMFProtectionHandler +* +* For gettting media file protection information (eg drm protection). +* If media is protected and does not have necessary rights it cannot +* be used eg as ringing tone. +* +*/ +NONSHARABLE_CLASS (CMFProtectionHandler) : public CBase + { + public: + // enumeration which tells what is the file used for. + enum TIntention + { + EPlay, + ESelect + }; + + public:// Constructors and destructor + + /** + * Two-phased constructor. + */ + static CMFProtectionHandler* NewL(); + + /** + * Destructor. + */ + virtual ~CMFProtectionHandler(); + + private: + + /** + * C++ default constructor. + */ + CMFProtectionHandler(); + + /** + * By default Symbian OS constructor is private. + */ + void ConstructL(); + + public: // Functions from base classes + + /** + * Checks if an unprotected file is valid. + * @param aFileName Full path and filename. + * @param aIntention Describes what the file is used for. + * @return ETrue if the file is valid for intended use. + */ + TBool IsFileValidL( const TDesC& aFileName, TIntention aIntention ); + TBool IsFileValid( const TDesC& aFileName, TIntention aIntention ); + TBool IsVideoValidL( const TDesC& aFileName, TIntention aIntention ); + TBool IsVideoValid( const TDesC& aFileName, TIntention aIntention ); + + /** + * Check if the DRM protect file is expired or have no rights to use. + * @param aFileName Full path and filename. + * @return ETrue if the file is DRM expired or have rights to use. + */ + TBool IsFlieDRMExpired( const TDesC& aFileName ); + + void SetAttrL( TInt aAttr, TInt aValue ); + void SetAttrL( TInt aAttr, const TDesC& aValue ); + + + private: + /** + * Return media file type + */ + //TInt32 MediaFileType( const TDesC& aFileName ); + + /** + * Set the automated content type + * @param aAutomatedType: type of automated content + */ + void SetAutomatedType( + CDRMHelper::TDRMHelperAutomatedType aAutomatedType ); + + private: + + /** + * Displays an error note. + * @param @aResourceId Resource ID + */ + void ShowErrorNoteL( TInt aResourceId ); + + /** + * Checks if an unprotected file is valid. + * @param aFileName Full path and filename. + * @param aIntention Describes what the file is used for. + * @return ETrue if the file is valid for intended use. + */ + TBool IsFileValidUnprotectedL( + const TDesC& aFileName, TIntention aIntention ); + + /** + * Returns info whether demoplay is allowed for given filetype + * @param aDataType Tone MIME type + * @return ETrue if tone allowed to be played + */ + //TBool AllowDemoPlay( const TDesC& aDataType ); + + /** + * Returns info whether given filetype is allowed as ringingtone + * @param aDataType Tone MIME type + * @return ETrue if tone is allowed to be selected + */ + //TBool AllowSelect( const TDesC& aDataType ) const; + + /** + * Finds out the MIME type of a given file + * @param aFileName File to be checked + * @return Returns datatype of a file + */ + TDataType DataTypeL( const TDesC& aFileName ); + + /** + * Finds out DRM restrictions for a given file + * @param aFileName File to be checked + * @param aInfoBits(out) Determines CFM protection + * @return Returns EFalse if file is corrupted or has no rights + */ + TBool GetFileInfoL( const TDesC& aFileName, TInt32& aInfoBits ); + + /** + * Checks if file is WMDRM protected. + * @param aFileName Name of the file to be checked. + * @return ETrue if file is WMDRM protected, EFalse otherwise. + */ + TBool IsFileWMDRMProtectedL( const TDesC& aFileName ); + + TBool CheckFileSize( const TDesC& aFile, const TDesC& aMimeType ); + + + private: + // DRM common functions + DRMCommon* iDRMCommon; + + // DRM helper + CDRMHelper* iDRMHelper; + + // for finding out drive type (eg memory card) + CDriveUtil* iDriveUtil; + + // for media file list variation + CMediaFileDialogVariation* iVariation; + + // Automated content type + CDRMHelper::TDRMHelperAutomatedType iAutomatedType; + + // max file size + TInt iMaxFileSize; + + // excluded mime types + CMimeTypeList* iExcludedMimeTypes; + + RApaLsSession iApaLsSession; + RFs iFsSession; + + }; + + + + + +#endif // MEDIAFILEPROTECTION_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Inc/mediafiletest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Inc/mediafiletest.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,275 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class create for testing. +* +*/ + + +#ifndef MEDIAFILETEST_H_ +#define MEDIAFILETEST_H_ + + +// INCLUDES +#include "mediafiledialogutils.h" + +#include +#include +#include // Math::FRand +#include // CAknInfoPopupNoteController + +// for metadata engine +#include + + + +#ifdef _DEBUG + +// CLASS DECLARATION +class CMFVideoPreviewHandler; +class CMediaFileDialog; +class CMdeTest; + + +/** +* CRandomNum +* +* CRandomNum is used for generating random numbers. +*/ +NONSHARABLE_CLASS (CRandomNum) : public CBase + { + public: + static CRandomNum* NewLC(); + static CRandomNum* NewL(); + ~CRandomNum(); + private: + CRandomNum(); + + public: + TInt Random(TInt aMax); + TInt Random( TInt aMin, TInt aMax ); + TBool Match(TInt aPercentage); + + private: + TInt64 iSeed; + }; + + + +/** +* CMFDialogTest +*/ +NONSHARABLE_CLASS (CMFDialogTest) : public CBase, + public MMFActiveCallerObserver + { + enum TNextStep + { + ENextFolder = 0, + ENextListItem = 1, + EMovePosition = 2 + }; + + public:// Constructors and destructor + + static CMFDialogTest* NewL( CMediaFileDialog* aDialog ); + virtual ~CMFDialogTest(); + + private: + + CMFDialogTest( CMediaFileDialog* aDialog ); + void ConstructL(); + + public: + + TBool TestL( TInt aAttr ); + void Test1L( TInt aAttr ); + void Test2L( TInt aAttr ); + void PrintTimeL( const TDesC& aText ); + void SetTime(); + + private: + void NextListItemL(); + void MovePositionL(); + void NextFolderL(); + + private: + void SimulateKeyEventL( TInt aEvent ); + void SimulateOpenEventL(); + void SimulateBackEventL(); + void SimulateSearchEventL(); + + private: // from MMFActiveCallerObserver + void HandleActiveCallL( TInt aCallId ); + + private: + void SetScreenSaverPeriod( TInt aPeriod ); + void SetScreenSaverPeriodL( TInt aPeriod ); + TInt ScreenSaverPeriodL(); + private: + static TInt64 TimeAfter( TTime aBefore ); + static TTime TimeBefore(); + private: + void ShowPopupNoteL( const TDesC& aText ); + + + public: + TTime iTime; + TInt iTestCounter; + TInt iBottomVisited; + TInt* iDestroyedPtr; + private: + CMediaFileDialog* iDlg; + CRandomNum* iRandomNum; + CMFActiveCaller* iTestCaller; + TInt iNewIndex; + TInt iScreenSaverPeriod; + + // popup note + CAknInfoPopupNoteController* iPopupNote; + + }; + + + + +/** +* CMediaFileDialog3 +* +*/ +/* +NONSHARABLE_CLASS (CMediaFileDialog3) : public CAknDialog + { + + public:// Constructors and destructor + static CMediaFileDialog3* NewL(); + virtual ~CMediaFileDialog3(); + + public: + static TBool ShowDialogL(); + private: + + CMediaFileDialog3(); + + void ConstructL(); + + private: + void PreLayoutDynInitL(); + TBool OkToExitL( TInt aButtonId ); + void ProcessCommandL(TInt aCommandId); + + private: + CMFVideoPreviewHandler* iVideoPreviewHandler; + }; + +*/ + + +/** +* TMediaFileHistoryItem +* +*/ +NONSHARABLE_CLASS (TMediaFileHistoryItem) + { + public: + void SetId( TInt64 aId ); + TInt64 Id(); + void SetTime( TTime aTime ); + TTime Time(); + void InternalizeL( RReadStream& aStream ); + void ExternalizeL( RWriteStream& aStream ); + + + public: + // media file id + TInt64 iId; + + // time stamp + TTime iTime; + + // media file name and path + TFileName iFullName; + + // does item exist + TBool iPresent; + }; + + + +/** +* CMediaFileHistory +* +* CMediaFileHistory is used for storing list of mediafile ids +* (and time stapms). These ids refer to most recently selected +* ringing tones. Notice that each media file list client has its +* own most recent list (in its private folder). +* +*/ +NONSHARABLE_CLASS (CMediaFileHistory) : public CBase + { + static const TInt KMaxHistoryItemCount = 3; + + public: + static CMediaFileHistory* NewL(); + virtual ~CMediaFileHistory(); + + private: + CMediaFileHistory(); + void ConstructL(); + + public: // public api + void AddItemL( TInt64 aId ); + TInt Count(); + void Sort(); + void Clean(); + void SetPresent( TBool aPresent, TInt aIndex ); + void SetFileNameL( const TDesC& aFullName, TInt aIndex ); + const TDesC& FileName( TInt aIndex ); + TInt64 Id( TInt aIndex ); + + private: + void WriteHistoryL(); + void ReadHistoryL(); + TInt ItemIndex( TInt aId ); + void AddItemL( TMediaFileHistoryItem aItem ); + TMediaFileHistoryItem& Item( TInt index ); + + TBool RemoveOldItem(); + void Reset(); + + private: + void InternalizeL( RReadStream& aStream ); + void ExternalizeL( RWriteStream& aStream ); + + + private: + static TInt CompareItems( const TMediaFileHistoryItem& aFirst, + const TMediaFileHistoryItem& aSecond ); + + private: + static void GetTimeText( TDes& aText, TTime aTime ); + + private: + // list of query items + RArray iList; + + // file server session + RFs iFsSession; + + // history file path + TFileName iPath; + }; + + +#endif // #ifdef _DEBUG + +#endif /*MEDIAFILETEST_H_*/ diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Inc/mediafilevariation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Inc/mediafilevariation.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Variation functionality class +* +*/ + + + +#ifndef MEDIAFILEVARIATION_H +#define MEDIAFILEVARIATION_H + + +// INCLUDES +#include + + +// CONSTANTS + +//FORWARD DECLARATIONS +class CRepository; + + +/** +* CMediaFileDialogVariation +* +* CMediaFileDialogVariation is used to varitate media file dialog. +* Main purpose is to prevent selecting certain mime types. These +* 'blocked' mime types are stored in central repository. +* Notice: This code is a copy from CProfilesLocalFeatures. +*/ +NONSHARABLE_CLASS(CMediaFileDialogVariation) : public CBase + { + public: // Constructors and destructor + static CMediaFileDialogVariation* NewL(); + ~CMediaFileDialogVariation(); + + private: + void ConstructL(); + CMediaFileDialogVariation( TInt aFeatureBitMask ); + + public: + TBool IsFeatureSupported( TInt aLocalFeatureId ); + TBool IsBlockedType( const TDesC& aMimeType ); + TBool IsBlockedUnprotectedType( const TDesC& aMimeType ); + TBool IsBlockedProtectedType( const TDesC& aMimeType ); + TBool IsBlockedDemoPlayType( const TDesC& aMimeType ); + TBool IsExcludedType( const TDesC& aMimeType ); + + private: + + void ReadListKeyL( CRepository& aCenRep, TUint32 aKey, + RBuf& aValue ); + TBool ContainsMimeType( const TDesC& aList, const TDesC& aMimeType ); + + + private: + + // the key containing boolean type features + TInt iFeatureBitMask; + + // contains space separated list of blocked MIME-types + RBuf iBlockedTones; + + // contains space separated list of blocked unprotected MIME-types + RBuf iBlockedUnprotectedTones; + + // contains space separated list of blocked protected MIME-types + RBuf iBlockedProtectedTones; + + // contains space separated list of blocked demo-play MIME-types + RBuf iBlockedDemoPlayTones; + + // contains space separated list of excluded MIME-types + RBuf iExcludedTones; + + // helper buffer for mime-type matching + RBuf iMimeBuf; + }; + + + +#endif // MEDIAFILEVARIATION_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Inc/mediafilevideopreviewdialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Inc/mediafilevideopreviewdialog.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Dialog create for video preview +* +*/ + + + + +#ifndef VIDEOPREVIEWDIALOG_H_ +#define VIDEOPREVIEWDIALOG_H_ + + +// INCLUDES +#include + +#include "mediafilepreview.h" + +// CLASS DECLARATION + + +/** +* CVideoPreviewDialog +* +*/ +NONSHARABLE_CLASS (CVideoPreviewDialog) : public CAknDialog, + public MPreviewHandlerObserver, + public MCoeForegroundObserver + { + public:// Constructors and destructor + static CVideoPreviewDialog* NewL( TAny* aVideoHandler ); + virtual ~CVideoPreviewDialog(); + + public: + TBool ShowDialogLD( TInt* aError ); + void SetAttrL( TInt aAttr, TInt aValue ); + void SetAttrL( TInt aAttr, const TDesC& aValue ); + void SetAttrL( TInt aAttr, TAny* aValue ); + // Close the dialogue to cancel the preview + void CloseDialogL(); + + + private: + CVideoPreviewDialog( TAny* aVideoHandler ); + void ConstructL(); + + private: + void PreLayoutDynInitL(); + void PostLayoutDynInitL(); + TBool OkToExitL( TInt aButtonId ); + void ProcessCommandL(TInt aCommandId); + void HandleResourceChange(TInt aType); + + private: + void CloseDialogWithDelayL(); + static TInt CloseDialog( TAny *aObj ); + + private: // from MPreviewHandlerObserver + void HandlePreviewEventL( TInt aEvent, TInt aError ); + + private: + void HandleGainingForeground(); + void HandleLosingForeground(); + + + private: + CMFVideoPreviewHandler* iVideoHandler; + TBool iVideoHandlerCreated; + + // for closing dialog + CIdle* iIdle; + + TInt* iError; + + }; + + +#endif /*VIDEOPREVIEWDIALOG_H_*/ diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Inc/mediafilewaitnote.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Inc/mediafilewaitnote.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,206 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Waiting note for query +* +*/ + + + +#ifndef MEDIAFILEWAITNOTE_H +#define MEDIAFILEWAITNOTE_H + + +// INCLUDES +#include "mediafiledialogutils.h" + +#include +#include +#include +#include + + +// CLASS DECLARATIONS + + +/** +* MMediaFileWaitNoteObserver +* +* Observer interface function for observing wait note. +*/ +NONSHARABLE_CLASS (MMediaFileWaitNoteObserver) + { + public: + /** + * Callback method + * Get's called when a dialog is dismissed. + */ + virtual void HandleWaitNoteL( TInt aButtonId ) = 0; + }; + + + + +/** +* MMediaFileWaitNote +* +* MMediaFileWaitNote shows progress dialog. +*/ +NONSHARABLE_CLASS (CMediaFileWaitNote) : public CBase, + public MProgressDialogCallback + { + + public:// Constructors and destructor + + /** + * Two-phased constructor. + */ + static CMediaFileWaitNote* NewL( MMediaFileWaitNoteObserver* aObserver ); + + /** + * Destructor. + */ + virtual ~CMediaFileWaitNote(); + + private: + + /** + * C++ default constructor. + */ + CMediaFileWaitNote( MMediaFileWaitNoteObserver* aObserver ); + + /** + * By default Symbian OS constructor is private. + */ + void ConstructL(); + + /** + * From MProgressDialogCallback. + * Called by the framework when dialog is dismissed. + * @param aButtonId + * @return None + */ + void DialogDismissedL( TInt aButtonId ); + + public: + + /** + * Launches progress dialog. + * @return None. + */ + void LaunchL( const TDesC& aLabel ); + + + /** + * Closes progress dialog. + * @param None + * @return None + */ + void CancelProgressDialogL(); + + /** + * Set dialog label text. + * @param aText. + * @return None. + */ + void SetTextL( const TDesC& aText ); + + /** + * Set image data. + * @param aId. + * @param aFileName. + * @param aFileBitmapId. + * @param aFileMaskId. + * @return None. + */ + void SetImageL( TAknsItemID aId, const TDesC& aImageFile, + TInt aBitmapId, TInt aBitmapMaskId ); + + /** + * Set progress bar state. + * @param aValue. + * @return None + */ + void SetProgress( TInt aValue ); + + /** + * Set progress bar state. + * @param aFinalValue. + * @return None + */ + void SetFinalProgress( TInt aFinalValue ); + + /** + * Gets CAknNoteControl from CAknProgressDialog. + * @param None + * @return CAknNoteControl. + */ + CAknNoteControl* NoteControl(); + + /** + * Cancels animation. + * @param None. + * @return None. + */ + void CancelAnimation(); + + /** + * Starts animation. + * @param None + * @return None. + */ + void StartAnimationL(); + + /** + * Hides cancel button. + * @param None + * @return None. + */ + void HideButtonL(); + + + private: + + // progress dialog + CAknProgressDialog* iProgressDialog; + + // progress dialog info + CEikProgressInfo* iProgressInfo; + + // last label text + TBuf iLastText; + + // animation state + TBool iAnimation; + + // dialog observer + MMediaFileWaitNoteObserver* iObserver; + + TFileName iImageFile; + TAknsItemID iImageId; + TInt iBitmapId; + TInt iBitmapMaskId; + + // is observer call needed + TBool iObserverCallNeeded; + + // has dialog's DialogDismissedL called (ie has it been closed) + TBool iDialogDismissed; + }; + + + + +#endif // MEDIAFILEWAITNOTE_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Src/mediafiledialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Src/mediafiledialog.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,3332 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class of Mediafiledialog. UI control of mediafilelist +* +*/ + + + + +// INCLUDE FILES + +#include "mediafiledialog.h" +#include "mediafiledialogutils.h" +#include "mediafilelist.h" +#include "mediafilehandler.h" +#include "mediafilelistdebug.h" +#include "mediafileprotection.h" +#include "mediafilevideopreviewdialog.h" +#include "mediafiletest.h" // test code + +#include // for CColumnListBoxData +#include // MCoeControlObserver +#include // AknTextUtils AknFind +#include // for GulArray +#include +#include +#include +#include // CAknInputBlock +#include +// search field +#include // AknSelectionList.cpp +#include // CAknSearchField +#include // CEikCaptionedControl + +#include // KAvkonBitmapFile, KAvkonVariatedBitmapsFile +#include // icon constants +#include // memory card icon +#include + +#include +#include +#include +#include // KDC_APP_RESOURCE_DIR +#include // For MTouchFeedback + + + + + +/****************************************************************************** + * class CMediaFileDialog + ******************************************************************************/ + + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::NewL +// +// ----------------------------------------------------------------------------- +CMediaFileDialog* CMediaFileDialog::NewL() + { + FLOG( _L("CMediaFileDialog::NewL START") ); + + CMediaFileDialog* self = new (ELeave) CMediaFileDialog(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + FLOG( _L("CMediaFileDialog::NewL END") ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::CMediaFileDialog +// +// ----------------------------------------------------------------------------- +// +CMediaFileDialog::CMediaFileDialog() + { + FLOG( _L("CMediaFileDialog::CMediaFileDialog START") ); + + iResourceFileId = KErrNotFound; + iForeGround = ETrue; + iDatabaseOpen = EFalse; + iPeninputActive = EFalse; + + iNullItemFileTypeOne = KErrNotFound; + iNullItemFileTypeTwo = KErrNotFound; + iDialogTitle = KNullDesC; + iIsDoubleClicked = EFalse; + + FLOG( _L("CMediaFileDialog::CMediaFileDialog END") ); + } + + +// ---------------------------------------------------------------------------- +// Destructor +// +// ---------------------------------------------------------------------------- +// +CMediaFileDialog::~CMediaFileDialog() + { + FLOG( _L("CMediaFileDialog::~CMediaFileDialog START") ); + + if ( iResourceFileId != KErrNotFound ) + { + CEikonEnv::Static()->DeleteResourceFile( iResourceFileId ); + } + + delete iStatusPaneHandler; + delete iMFListHandler; + delete iMediaFileHandler; + delete iState; + + delete iFindCtrl; + delete iCaller; + delete iSearchCaller; + + delete iAudioPreviewHandler; + delete iVideoPreviewHandler; + + delete iNullItemFileNameOne; + delete iNullItemFileNameTwo; + + if ( iAvkonAppUi ) + { + iAvkonAppUi->RemoveFromStack(this); + } + + CCoeEnv::Static()->RemoveForegroundObserver( *this ); + + if ( iPopupNote ) + { + iPopupNote->HideInfoPopupNote(); + delete iPopupNote; + } + + delete iWaitNote; + if ( AknLayoutUtils::PenEnabled() ) + { + iPeninputServer.RemovePenUiActivationHandler(); + iPeninputServer.Close(); + } + + delete iIdle; + + delete iProtectionHandler; + + delete iInputBlock; + +#ifdef _DEBUG + delete iTest; // test code +#endif + + FLOG( _L("CMediaFileDialog::~CMediaFileDialog END") ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::ConstructL() + { + FLOG( _L("CMediaFileDialog::ConstructL START") ); + + iResourceFileId = TMFDialogUtil::AddResFileL(); + + CCoeEnv* coeEnv = CCoeEnv::Static(); + coeEnv->AddForegroundObserverL( *this ); + + CAknDialog::ConstructL( R_MEDIA_FILE_DIALOG_MENU ); + + if ( iMenuBar ) + { + iMenuBar->SetContextMenuTitleResourceId( + R_MEDIA_FILE_DIALOG_CONTEXT_MENU ); + } + + // get previous title so it can be restored + iStatusPaneHandler = CStatusPaneHandler::NewL( iAvkonAppUi ); + iStatusPaneHandler->StoreOriginalTitleL(); + + iMediaFileHandler = CMediaFileHandler::NewL(); + iMediaFileHandler->SetObserver( this ); + + iState = CMediaFileDialogState::NewL(); + +#ifndef RD_VIDEO_AS_RINGING_TONE + iState->HideRootFolder( EEFolderVideos, ETrue, + KNullDesC, KErrNotFound ); + + iMediaFileHandler->SetAttrL( CMediaFileList::EAttrExcludeFolder, CMediaFileList::EFolderVideos ); +#endif + + iMFListHandler = CMFListHandler::NewL(); + iMFListHandler->SetObserver( this ); + + iCaller = CMFActiveCaller::NewL( this ); + iSearchCaller = CMFActiveCaller::NewL( this ); + + iAudioPreviewHandler = CMFAudioPreviewHandler::NewL(); + iVideoPreviewHandler = CMFVideoPreviewHandler::NewL(); + + iAudioPreviewHandler->SetObserver( this ); + + iPopupNote = CAknInfoPopupNoteController::NewL(); + + iWaitNote = CMediaFileWaitNote::NewL( this ); + + if ( AknLayoutUtils::PenEnabled() ) + { + User::LeaveIfError( iPeninputServer.Connect() ); + iPeninputServer.AddPenUiActivationHandler( this, EPluginInputModeAll ); + } + + iProtectionHandler = CMFProtectionHandler::NewL(); + +#ifdef _DEBUG + iTest = CMFDialogTest::NewL( this ); // test code +#endif + + FLOG( _L("CMediaFileDialog::ConstructL END") ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::ShowDialogL +// +// ----------------------------------------------------------------------------- +TBool CMediaFileDialog::ShowDialogL( TDes* aFileName, TInt* aNullItem, + TInt* aInfo, TDes* aDesInfo ) + { + __ASSERT_ALWAYS( aFileName, Panic( KErrGeneral ) ); + __ASSERT_ALWAYS( aNullItem, Panic( KErrGeneral ) ); + + iFileName = aFileName; + + iNullItem = aNullItem; + *iNullItem = KErrNotFound; + + iInfo = aInfo; + iDesInfo = aDesInfo; + + TBool ret = ExecuteLD( R_MEDIA_FILE_DIALOG ); + + return ret; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::SetAttrL +// +// ----------------------------------------------------------------------------- +void CMediaFileDialog::SetAttrL( TInt aAttr, TInt aValue ) + { + iAudioPreviewHandler->SetAttrL( aAttr, aValue ); + iVideoPreviewHandler->SetAttrL( aAttr, aValue ); + iMediaFileHandler->SetAttrL( aAttr, aValue ); + iProtectionHandler->SetAttrL( aAttr, aValue ); + + if ( aAttr == CMediaFileList::EAttrExcludeFolder ) + { + if ( aValue == CMediaFileList::EFolderDownload ) + { + iState->HideRootFolder( EEFolderDownload, ETrue, + KNullDesC, KErrNotFound ); + } + if ( aValue == CMediaFileList::EFolderVideos ) + { + iState->HideRootFolder( EEFolderVideos, ETrue, + KNullDesC, KErrNotFound ); + } + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::SetAttrL +// +// ----------------------------------------------------------------------------- +void CMediaFileDialog::SetAttrL( TInt aAttr, const TDesC& aValue ) + { + iAudioPreviewHandler->SetAttrL( aAttr, aValue ); + iVideoPreviewHandler->SetAttrL( aAttr, aValue ); + iMediaFileHandler->SetAttrL( aAttr, aValue ); + iProtectionHandler->SetAttrL( aAttr, aValue ); + + if ( aAttr == CMediaFileList::EAttrTitle ) + { + TMFDialogUtil::StrCopy( iDialogTitle, aValue ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::SetAttrL +// +// ----------------------------------------------------------------------------- +void CMediaFileDialog::SetAttrL( TInt aAttr, TAny* aValue ) + { + iAudioPreviewHandler->SetAttrL( aAttr, aValue ); + iVideoPreviewHandler->SetAttrL( aAttr, aValue ); + iMediaFileHandler->SetAttrL( aAttr, aValue ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::SetNullItemL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::SetNullItemL( const TDesC& aText, + const TDesC& aMediaFile, + TInt aMediaFileType, TInt aIconId ) + { + TInt iconId = EEIconEmpty; + if ( aIconId == CMediaFileList::ENullItemIconDefaultTone ) + { + iconId = EEIconTone; + } + else if ( aIconId == CMediaFileList::ENullItemIconOff ) + { + iconId = EEIconNullItemOff; + } + + TInt mediaType = CMediaFileList::EMediaFileTypeAudio; + if ( aMediaFileType == CMediaFileList::EMediaFileTypeVideo ) + { + mediaType = CMediaFileList::EMediaFileTypeVideo; + } + + + if ( !iNullItemFileNameOne ) + { + iNullItemFileNameOne = aMediaFile.AllocL(); + iNullItemFileTypeOne = mediaType; + + iState->EnableNullItemL( EEFolderNullItemOne, aText, iconId ); + } + else if ( !iNullItemFileNameTwo ) + { + iNullItemFileNameTwo = aMediaFile.AllocL(); + iNullItemFileTypeTwo = mediaType; + + iState->EnableNullItemL( EEFolderNullItemTwo, aText, iconId ); + } + else + { + User::Leave( KErrNotSupported ); // two null items supported + } + } + + + +//------------------------------------------------------------------------------ +// CMediaFileDialog::ActivateL +// +// Called by system when dialog is activated. +//------------------------------------------------------------------------------ +// +void CMediaFileDialog::ActivateL() + { + CAknDialog::ActivateL(); + + // this cannot be in ConstructL which is executed before dialog is launched + iAvkonAppUi->AddToStackL( this ); + AknFind::HandleFixedFindSizeChanged( this, iListBox, FindBox() ); + DrawNow(); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::PreLayoutDynInitL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::PreLayoutDynInitL() + { + const TInt KFindBoxLength = 20; + + iListBox = (CAknSingleGraphicStyleListBox*) (ControlOrNull(1)); + iListBox->DisableSingleClick(ETrue); + __ASSERT_ALWAYS( iListBox, TMFDialogUtil::Panic( KErrGeneral ) ); + + iListBox->Model()->SetItemTextArray( iMFListHandler ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + iListBox->SetListBoxObserver( this ); + iListBox->CreateScrollBarFrameL( ETrue ); + iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto ); + + iListBox->SetContainerWindowL( *this ); + + SetIconsL(); + + iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue ); + + + iState->Init(); + + if ( iDialogTitle.Length() > 0 ) + { + iStatusPaneHandler->SetTitleL( iDialogTitle ); + } + else + { + iStatusPaneHandler->SetTitleL( R_QTN_MEDIA_FILE_DIALOG_TITLE ); + } + iStatusPaneHandler->SetNaviPaneTitleL( KNullDesC ); + + + // + // create find box. NOTE: findbox functionality is quite complex and + // is implemented by copy pasting code from other apps. + // + + CFindControl* control = ( CFindControl* )ControlOrNull( EFindControl ); + if ( control ) + { + CAknSearchField::TSearchFieldStyle flags = CAknSearchField::EFixed; + control->iFind = CAknSearchField::NewL( + *control, flags, 0, KFindBoxLength ); + //control->iFind = searchField; + control->SetContainerWindowL( *this ); + CEikEdwin& edwin = control->iFind->Editor(); + control->iFind->AddAdaptiveSearchTextObserverL( this ); + } + + if ( FindBox() ) + { + CAknFilteredTextListBoxModel* model = + STATIC_CAST( CAknFilteredTextListBoxModel*, iListBox->Model() ); + + FindBox()->MakeVisible( EFalse ); + } + + + UpdateListBoxL(); + + DrawDeferred(); + } + + +//------------------------------------------------------------------------------ +// CMediaFileDialog::ProcessCommandL +// +// Handle commands from menu. NOTE: Current implemntation does not use menu. +// Menu handling code is here for (possible) future use. +//------------------------------------------------------------------------------ +// +void CMediaFileDialog::ProcessCommandL( TInt aCommandId ) + { + HideMenu(); + + switch (aCommandId) + { + case EAknCmdHelp: + { + break; + } + + case EAknSoftkeySelect: + { + TBool ret = HandleOKL( EAttrSelect ); + if ( ret ) + { + TryExitL( EEikCmdExit ); + } + break; + } + + case EAknSoftkeyView: + { + PreviewL( CMediaFileList::EMediaFileTypeVideo ); + break; + } + case EAknCmdOpen: + { + HandleOKL( EAttrOpen ); + break; + } + + case EAknCmdExit: + case EEikCmdExit: + { + // close dialog and exit calling application + iAvkonAppUi->ProcessCommandL( EAknCmdExit ); + break; + } + + default: + break; + } + } + + +//------------------------------------------------------------------------------ +// CMediaFileDialog::OkToExitL +// +// Hanlde commands from cba. +//------------------------------------------------------------------------------ +// +TBool CMediaFileDialog::OkToExitL(TInt aButtonId) + { + if ( aButtonId == EEikBidCancel ) + { + return ETrue; // close dialog + } + + if ( aButtonId == EEikBidOk ) + { + TBool ret = HandleOKL( EAttrSelect ); + return ret; + } + + if ( aButtonId == EAknSoftkeyBack ) + { + if ( !HandleBackL() ) + { +#ifdef _DEBUG + // start test code + TInt currentIndex = CurrentItemListIndex(); + if ( iState->FolderId( currentIndex ) == EEFolderRecordings ) + { + if ( !iTest->TestL( 0 ) ) + { + return ETrue; // test canceled + } + return EFalse; // test accepted + } + // end test code +#endif + + return ETrue; // Back pressed in top level folder + } + + return EFalse; // leave dialog open + } + + if ( aButtonId == EAknSoftkeyContextOptions ) + { + ShowContextMenuL( R_MEDIA_FILE_DIALOG_CONTEXT_MENU ); + return EFalse; + } + + if ( aButtonId == EAknSoftkeyOpen ) + { + TBool ret = HandleOKL( EAttrOpen ); + return ret; + } + + if ( aButtonId == EAknSoftkeySelect ) + { + TBool ret = HandleOKL( EAttrSelect ); + return ret; + } + + if ( aButtonId == EAknSoftkeyView ) + { + PreviewL( CMediaFileList::EMediaFileTypeVideo ); + return EFalse; + } + + if ( aButtonId == EAknSoftkeyEmpty ) + { + return EFalse; + } + + return CAknDialog::OkToExitL( aButtonId ); + } + + +// ---------------------------------------------------------------------------- +// CMediaFileDialog::OfferKeyEventL +// +// ---------------------------------------------------------------------------- +// +TKeyResponse CMediaFileDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent, + TEventCode aType) + { + + iIsDoubleClicked = EFalse; + // must pass escape event to dialog - findbox and listbox "eat" escape events + TKeyResponse res = EKeyWasNotConsumed; + if ( aType == EEventKey && aKeyEvent.iCode == EKeyEscape ) + { + res = CAknDialog::OfferKeyEventL( aKeyEvent, aType ); + } + if ( res == EKeyWasConsumed ) + { + return res; + } + + + TBool backSpace = EFalse; + + if (aType == EEventKey) + { + switch (aKeyEvent.iCode) + { + case EKeyEnter: + { + break; + } + case EKeyUpArrow: + case EKeyDownArrow: + { + TInt itemCount = iListBox->Model()->NumberOfItems(); + if ( itemCount == 1 ) + { + PreviewL( CMediaFileList::EMediaFileTypeAudio ); + } + break; + } + + case EKeyLeftArrow: + { + if (FindBox() && FindBox()->IsVisible() + && FindBox()->TextLength() != 0) + { + FindBoxCursorMoveL( 0 ); + res = EKeyWasConsumed; + } + else + { + HandleBackL(); + return EKeyWasConsumed; + } + break; + } + + case EKeyRightArrow: + { + if (FindBox() && FindBox()->IsVisible() + && FindBox()->TextLength() != 0) + { + FindBoxCursorMoveL( 1 ); + res = EKeyWasConsumed; + } + else + { + HandleOKL( EAttrOpen ); + return EKeyWasConsumed; + } + break; + } + + case EKeyBackspace: + { + backSpace = ETrue; + break; + } + + default: + { + break; + } + } + + if ( FindBox() && FindBox()->IsVisible() ) + { + res = FindBox()->OfferKeyEventL( aKeyEvent, aType ); + + if ( backSpace && FindBox()->TextLength() == 0 && + ( iState->CurrentFolder() == EEFolderSearch || + iState->CurrentFolder() == EEFolderSearchMusic ) && !iPeninputActive ) + { + // user cleared search field - go back to main view + HandleBackL(); + return EKeyWasConsumed; + } + } + } + + + if ( res == EKeyWasNotConsumed ) + { + res = CAknDialog::OfferKeyEventL( aKeyEvent, aType); + } + return res; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::FindBoxCursorMoveL( TInt aType ) +// +// NOTE: This function is used to move the cursor of the find box. +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::FindBoxCursorMoveL( TInt aType ) + { + if ( FindBox() && FindBox()->IsVisible() ) + { + TInt pos = FindBox()->Editor().CursorPos(); + TInt textLength = FindBox()->Editor().TextLength(); + if ( aType == 0 )//left + { + pos = pos - 1; + if ( pos < 0 ) + { + pos = textLength; + } + } + else if ( aType == 1 ) + { + pos = pos + 1; + if ( pos > textLength ) + { + pos = 0; + } + } + else + { + pos = textLength; + } + FindBox()->Editor().SetCursorPosL( pos ,EFalse ); + } + } +// ----------------------------------------------------------------------------- +// CMediaFileDialog::SetSizeAndPosition (from CAknDialog) +// +// NOTE: This code is copy paste from elsewhere. +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::SetSizeAndPosition( const TSize& /*aSize*/ ) + { + TRect mainPane; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane ); + + SetRect( mainPane ); + + if ( FindBox() && FindBox()->IsVisible() ) + { + AknFind::HandleFixedFindSizeChanged( this, iListBox, FindBox() ); + } + + Line( ESelectionListControl)->SetRect( iListBox->Rect() ); + if ( FindBox() ) + { + Line( EFindControl )->SetRect( iListBox->Rect() ); + } + } + + +// ---------------------------------------------------------------------------- +// CMediaFileDialog::HandleResourceChange +// +// ---------------------------------------------------------------------------- +// +void CMediaFileDialog::HandleResourceChange(TInt aType) + { + if ( aType == KEikDynamicLayoutVariantSwitch ) + { + // handle change in layout orientation + CAknDialog::HandleResourceChange( aType ); + if ( FindBox() && FindBox()->IsVisible() ) + { + AknFind::HandleFixedFindSizeChanged( this, iListBox, FindBox() ); + } + return; + } + + if (aType == KAknsMessageSkinChange) + { + TRAP_IGNORE( SetIconsL() ); + } + + CCoeControl::HandleResourceChange( aType ); + } + + +//------------------------------------------------------------------------------ +// CMediaFileDialog::DynInitMenuPaneL +// +// Called by system before menu is shown. NOTE: Menu currently not used. +//------------------------------------------------------------------------------ +// +void CMediaFileDialog::DynInitMenuPaneL(TInt aResourceID, CEikMenuPane* aMenuPane ) + { + TInt menu1 = R_MEDIA_FILE_DIALOG_MENU_PANE; + TInt menu2 = R_MEDIA_FILE_DIALOG_CONTEXT_MENU_PANE; + + if ( aResourceID != menu1 && aResourceID != menu2 ) + { + return; // not one of our menus + } + + TInt itemCount = iListBox->Model()->NumberOfItems(); + TInt currentIndex = iListBox->CurrentItemIndex(); + TInt folderId = iState->FolderId( currentIndex ); + TInt currentFolderId = iState->CurrentFolder(); + + + // context menu only used in video folder + if ( aResourceID == R_MEDIA_FILE_DIALOG_CONTEXT_MENU_PANE ) + { + if ( itemCount == 0 ) + { + // folder is empty + DeleteMenuItem( aMenuPane, EAknSoftkeySelect ); + DeleteMenuItem( aMenuPane, EAknSoftkeyView ); + } + return; + } + + + if ( itemCount == 0 ) + { + // list has no items + DeleteMenuItem( aMenuPane, EAknCmdOpen ); + DeleteMenuItem( aMenuPane, EAknSoftkeySelect ); + DeleteMenuItem( aMenuPane, EAknSoftkeyView ); + return; + } + + if ( folderId == EEFolderDownload || folderId == EEFolderNullItemOne || + folderId == EEFolderNullItemTwo ) + { + // selected item is null item + DeleteMenuItem( aMenuPane, EAknCmdOpen ); + DeleteMenuItem( aMenuPane, EAknSoftkeyView ); + } + else if ( folderId != KErrNotFound ) + { + // selected item is folder + DeleteMenuItem( aMenuPane, EAknSoftkeySelect ); + DeleteMenuItem( aMenuPane, EAknSoftkeyView ); + } + else + { + // selected item is file + if ( iState->CurrentFolder() == EEFolderVideos ) + { + DeleteMenuItem( aMenuPane, EAknCmdOpen ); + } + else if ( iState->CurrentFolder() == EEFolderSearch ) + { + DeleteMenuItem( aMenuPane, EAknCmdOpen ); + + if ( !IsVideoFile( currentIndex ) ) + { + DeleteMenuItem( aMenuPane, EAknSoftkeyView ); + } + } + else + { + DeleteMenuItem( aMenuPane, EAknCmdOpen ); + DeleteMenuItem( aMenuPane, EAknSoftkeyView ); + } + } + } + + +// --------------------------------------------------------------------------- +// CMediaFileDialog::CountComponentControls +// +// Gets the number of controls contained in a compound control. +// --------------------------------------------------------------------------- +// +TInt CMediaFileDialog::CountComponentControls() const + { + TInt newitems = 0; + if ( FindBox() ) + { + newitems++; + } + return CAknDialog::CountComponentControls() + newitems; + } + + +// --------------------------------------------------------------------------- +// CMediaFileDialog::CountComponentControls +// +// --------------------------------------------------------------------------- +// +CCoeControl* CMediaFileDialog::ComponentControl( TInt aIndex ) const + { + if ( aIndex == CAknDialog::CountComponentControls() ) + { + return FindBox(); + } + return CAknDialog::ComponentControl( aIndex ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::FindBox +// +// ----------------------------------------------------------------------------- +// +CAknSearchField* CMediaFileDialog::FindBox() const + { + CFindControl* control = ( CFindControl* )ControlOrNull( EFindControl ); + if ( control ) + { + return control->iFind; + } + else + { + return NULL; + } + } + +// --------------------------------------------------------------------------- +// CMediaFileDialog::ResetFindBoxL +// +// --------------------------------------------------------------------------- +// +void CMediaFileDialog::ResetFindBoxL() + { + if ( !FindBox() ) + { + return; + } + + CAknFilteredTextListBoxModel* model = + STATIC_CAST( CAknFilteredTextListBoxModel*, iListBox->Model() ); + CAknListBoxFilterItems* filter = model->Filter(); + TInt currentFolder = iState->CurrentFolder(); + + // reset find box + if ( filter ) + { + filter->ResetFilteringL(); + filter->SetObserver( NULL ); + model->RemoveFilter(); + + // CreateFilterL sets CAknSearchField to observe filter + // (CAknListBoxFilterItems) but RemoveFilter does not remove observer + FindBox()->SetObserver( NULL ); + } + + if (FindBox()->TextLength() > 0 && (currentFolder != EEFolderSearch + && currentFolder != EEFolderSearchMusic)) + { + FindBox()->SetSearchTextL( KNullDesC ); + } + + + // show/hide find box + if ( iState->FindBoxNeeded() ) + { + if ( currentFolder != EEFolderSearch && + currentFolder != EEFolderSearchMusic && + currentFolder != EEFolderRoot && + currentFolder != EEFolderMusic ) + { + // normal find only finds matches from listbox item texts + model->CreateFilterL( iListBox, FindBox() ); + filter = model->Filter(); + filter->ResetFilteringL(); + filter->SetObserver( this ); // MCoeControlObserver + } + else + { + // search and root folders have custom find that makes + // database search + FindBox()->SetObserver( this ); // MCoeControlObserver + } +// if ( currentFolder == EEFolderSearch || +// currentFolder == EEFolderSearchMusic ) +// { +// FindBox()->SetSearchTextL( iSearchText ); +// } + + FindBox()->MakeVisible( ETrue ); + } + else + { + FindBox()->MakeVisible( EFalse ); + } + + TSize size; + SetSizeAndPosition( size ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::CreateCustomControlL (from CAknDialog) +// +// Create find control. +// ----------------------------------------------------------------------------- +// +SEikControlInfo CMediaFileDialog::CreateCustomControlL( TInt aControlType ) + { + if ( aControlType != EAknCtSelectionListPopupFind && + aControlType != EAknCtSelectionListFixedFind ) + { + SEikControlInfo info; + info.iControl = NULL; + info.iFlags = 0; + info.iTrailerTextId = 0; + return info; + } + + CCoeControl* findControl = NULL; + findControl = new (ELeave) CFindControl; + + SEikControlInfo info; + info.iControl = findControl; + info.iFlags = 0; + info.iTrailerTextId = 0; + return info; + } + + +// ---------------------------------------------------------------------------- +// CMediaFileDialog::SetIconsL +// +// ---------------------------------------------------------------------------- +// +void CMediaFileDialog::SetIconsL() + { + _LIT( KBitmapFile, "mediafilelist.mbm" ); + + + if ( !iListBox ) + { + return; + } + + TMFDialogUtil::SetIconFileNameL( KBitmapFile, iIconFileName ); + + CArrayPtr* icons = new (ELeave) CAknIconArray(1); + CleanupStack::PushL( icons ); + + + // + // NOTE: append order must match TMediaFileListIcons + // + + // music item icon + icons->AppendL( IconL( KAknsIIDQgnIndiAiNtMusic, iIconFileName, + EMbmMediafilelistQgn_indi_ai_nt_music, + EMbmMediafilelistQgn_indi_ai_nt_music_mask ) ); + + // tone item icon, default tone icon + icons->AppendL( IconL( KAknsIIDQgnPropMupAudio, iIconFileName, + EMbmMediafilelistQgn_prop_mup_audio, + EMbmMediafilelistQgn_prop_mup_audio_mask ) ); + + // video item icon + icons->AppendL( IconL( KAknsIIDQgnPropFmgrFileVideo, iIconFileName, + EMbmMediafilelistQgn_prop_fmgr_file_video, + EMbmMediafilelistQgn_prop_fmgr_file_video_mask ) ); + + // recording item icon + icons->AppendL( IconL( KAknsIIDQgnPropFmgrFileVoicerec, iIconFileName, + EMbmMediafilelistQgn_prop_fmgr_file_voicerec, + EMbmMediafilelistQgn_prop_fmgr_file_voicerec_mask ) ); + + // artist icon + icons->AppendL( IconL( KAknsIIDQgnPropMupArtist, iIconFileName, + EMbmMediafilelistQgn_prop_mup_artist, + EMbmMediafilelistQgn_prop_mup_artist_mask ) ); + + // album icon + icons->AppendL( IconL( KAknsIIDQgnPropMupAlbum, iIconFileName, + EMbmMediafilelistQgn_prop_mup_album, + EMbmMediafilelistQgn_prop_mup_album_mask ) ); + + // genre icon + icons->AppendL( IconL( KAknsIIDQgnPropMupGenre, iIconFileName, + EMbmMediafilelistQgn_prop_mup_genre, + EMbmMediafilelistQgn_prop_mup_genre_mask ) ); + + // composer icon + icons->AppendL( IconL( KAknsIIDQgnPropMupComposer, iIconFileName, + EMbmMediafilelistQgn_prop_mup_composer, + EMbmMediafilelistQgn_prop_mup_composer_mask ) ); + + // folder icon (tones, music, videos, recordings, all music, artist, + // album, genre, composer, artist all) + icons->AppendL( IconL( KAknsIIDQgnPropFolderSmall, iIconFileName, + EMbmMediafilelistQgn_prop_folder_small, + EMbmMediafilelistQgn_prop_folder_small_mask ) ); + + // unknown folder icon + icons->AppendL( IconL( KAknsIIDQgnPropMceUnknownRead, iIconFileName, + EMbmMediafilelistQgn_prop_mce_unknown_read, + EMbmMediafilelistQgn_prop_mce_unknown_read ) ); + + // download item icon (null item) + icons->AppendL( IconL( KAknsIIDQgnPropLinkEmbdSmall, iIconFileName, + EMbmMediafilelistQgn_prop_link_embd_small, + EMbmMediafilelistQgn_prop_link_embd_small_mask ) ); + + // off item icon (null item) + icons->AppendL( IconL( KAknsIIDQgnPropSmlSyncOff, iIconFileName, + EMbmMediafilelistQgn_prop_sml_sync_off, + EMbmMediafilelistQgn_prop_sml_sync_off_mask ) ); + + // memory card icon + icons->AppendL( IconL( KAknsIIDQgnIndiMmcAdd, iIconFileName, + EMbmMediafilelistQgn_indi_mmc_add, + EMbmMediafilelistQgn_indi_mmc_add_mask, EAknsCIQsnIconColorsCG13 ) ); + + // mass storage icon + icons->AppendL( IconL( KAknsIIDQgnPropLinkEmbdSmall, iIconFileName, + EMbmMediafilelistQgn_indi_fmgr_ms_add, + EMbmMediafilelistQgn_indi_fmgr_ms_add_mask,EAknsCIQsnIconColorsCG13 ) ); + + // empty icon + icons->AppendL( IconL( KAknsIIDQgnPropEmpty, KAvkonBitmapFile, + EMbmAvkonQgn_prop_empty, + EMbmAvkonQgn_prop_empty_mask ) ); + + // delete old icons + CArrayPtr* arr = iListBox->ItemDrawer()->ColumnData()->IconArray(); + if ( arr ) + { + arr->ResetAndDestroy(); + delete arr; + arr = NULL; + } + + iListBox->ItemDrawer()->ColumnData()->SetIconArray( icons ); + CleanupStack::Pop( icons ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::IconL +// +// ----------------------------------------------------------------------------- +// +CGulIcon* CMediaFileDialog::IconL(TAknsItemID aId, const TDesC& aFileName, + TInt aFileIndex, TInt aFileMaskIndex) + { + CGulIcon* icon = AknsUtils::CreateGulIconL(AknsUtils::SkinInstance(), aId, + aFileName, aFileIndex, aFileMaskIndex); + return icon; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::IconL +// For MMC icon and Mass Storage icon +// ----------------------------------------------------------------------------- +// +CGulIcon* CMediaFileDialog::IconL(TAknsItemID aId, const TDesC& aFileName, + TInt aFileIndex, TInt aFileMaskIndex, TAknsQsnIconColorsIndex colorIndex) + { + TRgb defaultColour(KRgbBlack); + CFbsBitmap* bmap = NULL; + CFbsBitmap* mask = NULL; + + AknsUtils::GetCachedColor(AknsUtils::SkinInstance(), defaultColour, KAknsIIDQsnIconColors, + colorIndex); + AknsUtils::CreateColorIconLC(AknsUtils::SkinInstance(), KAknsIIDQgnIndiMmcAdd, + KAknsIIDQsnIconColors, colorIndex, bmap, mask, + aFileName, aFileIndex, aFileMaskIndex, defaultColour); + + CGulIcon* icon = CGulIcon::NewL(bmap, mask); + icon->SetBitmapsOwnedExternally(EFalse); + CleanupStack::Pop(2); + return icon; + } + + +// ---------------------------------------------------------------------------- +// CMediaFileDialog::ShowContextMenuL +// +// ---------------------------------------------------------------------------- +// +void CMediaFileDialog::ShowContextMenuL( TInt /*aResource*/ ) + { + // Switch to Context specific options menu, + if ( iMenuBar ) + { + TRAP_IGNORE( iMenuBar->TryDisplayContextMenuBarL() ); + } + } + + +//------------------------------------------------------------------------------ +// CMediaFileDialog::HandleBackL +// +//------------------------------------------------------------------------------ +// +TBool CMediaFileDialog::HandleBackL() + { + TInt err = KErrNone; + TBool ret = ETrue; + + TRAP( err, ret = DoHandleBackL() ); + + if ( err != KErrNone ) + { + FLOG( _L("### CMediaFileDialog::HandleBackL (%d) ###"), err ); + + ResetDialogL( err ); + return ETrue; + } + + return ret; + } + + +//------------------------------------------------------------------------------ +// CMediaFileDialog::DoHandleBackL +// +//------------------------------------------------------------------------------ +// +TBool CMediaFileDialog::DoHandleBackL() + { + if ( iState->CurrentFolder() == EEFolderRoot ) + { + // return EFalse only when called from root folder + return EFalse; + } + + if ( !iMediaFileHandler->QueryReady() ) + { + FLOG( _L("### CMediaFileDialog::DoHandleBackL: query in progress ###") ); + return ETrue; // query in progress + } + + TInt folderId = iState->NextFolderUp(); + TInt currentIndex = CurrentItemListIndex(); + + iState->SetQueryInfo( folderId, KNullDesC, currentIndex, EEQueryUp ); + QueryL( folderId ); + + return ETrue; + } + + +//------------------------------------------------------------------------------ +// CMediaFileDialog::HandleOKL +// +//------------------------------------------------------------------------------ +// +TBool CMediaFileDialog::HandleOKL( TInt aAttr ) + { + TInt err = KErrNone; + TBool ret = EFalse; + + TRAP( err, ret = DoHandleOKL( aAttr ) ); + + if ( err != KErrNone ) + { + FLOG( _L("### CMediaFileDialog::HandleOKL (%d) ###"), err ); + + ResetDialogL( err ); + return EFalse; + } + + return ret; + } + + +//------------------------------------------------------------------------------ +// CMediaFileDialog::DoHandleOKL +// +// Selects file or opens folder. If file is selected (ie dialog can +// be closed) return value is ETrue. +//------------------------------------------------------------------------------ +// +TBool CMediaFileDialog::DoHandleOKL( TInt aAttr ) + { + if ( !iMediaFileHandler->QueryReady() ) + { + FLOG( _L("### CMediaFileDialog::DoHandleOKL: query in progress ###") ); + return EFalse; // query in progress + } + + TInt currentIndex = CurrentItemListIndex(); + if ( currentIndex == KErrNotFound ) + { + return EFalse; // empty folder + } + + TBool isPersistent = EFalse; + TInt iconId = EEIconEmpty; + TInt folderId = KErrNotFound; + iState->GetFolderInfo( currentIndex, folderId, iBuf, + isPersistent, iconId ); + + if ( folderId == EEFolderDownload || folderId == EEFolderNullItemOne || + folderId == EEFolderNullItemTwo || folderId == KErrNotFound ) + { + if ( aAttr == EAttrOpen ) + { + return EFalse; // these can only be selected, not opened + } + } + + + if ( folderId == EEFolderDownload ) + { + *iNullItem = 0; + // user selected 'Download' item - launch browser + CWebBrowserLauncher* launcher = CWebBrowserLauncher::NewLC(); + launcher->LaunchBrowserL(); + CleanupStack::PopAndDestroy( launcher ); + return EFalse; + } + + if ( folderId == EEFolderNullItemOne ) + { + if ( iNullItemFileNameOne ) + { + TMFDialogUtil::StrCopy( *iFileName, *iNullItemFileNameOne ); + } + *iNullItem = 1; + return ETrue; + } + + if ( folderId == EEFolderNullItemTwo ) + { + if ( iNullItemFileNameTwo ) + { + TMFDialogUtil::StrCopy( *iFileName, *iNullItemFileNameTwo ); + } + *iNullItem = 2; + return ETrue; + } + + if ( folderId == KErrNotFound ) + { + // user has selected some media file + GetSelectedItemFileName( currentIndex, iBuf ); + + // protection check not done when item is double checked + // if ( aAttr != EAttrDoubleClicked ) + if (!ifilevalid) + { + iFileisvalid = iProtectionHandler->IsFileValid( iBuf, + CMFProtectionHandler::ESelect ); + ifilevalid=ETrue; + } + + if ( !iFileisvalid) + { + ifilevalid=EFalse; + } + if ( iFileisvalid ) + { + TMFDialogUtil::StrCopy( *iFileName, iBuf ); + } + + return iFileisvalid; // ret is ETrue is selected file's drm is OK + } + + + if ( folderId != KErrNotFound && aAttr != EAttrSelect ) + { + // Request vibra feedback when open the folder. + MTouchFeedback* feedback = MTouchFeedback::Instance(); + if ( feedback ) + { + TTouchLogicalFeedback logicalType = ETouchFeedbackList; + TTouchFeedbackType type = ETouchFeedbackVibra; + feedback->InstantFeedback( this, logicalType, type, TPointerEvent() ); + } + + iBuf = KNullDesC; + // selected list item is folder + if ( !isPersistent ) + { + // read non-persistent folder text from database + GetListItemText( currentIndex, iBuf ); + } + + iState->SetQueryInfo( folderId, iBuf, currentIndex, EEQueryDown ); + QueryL( folderId ); + } + + return EFalse; + } + + +//------------------------------------------------------------------------------ +// CMediaFileDialog::SearchL +// +//------------------------------------------------------------------------------ +// +void CMediaFileDialog::SearchL() + { + TInt err = KErrNone; + + TRAP( err, DoSearchL() ); + + if ( err != KErrNone ) + { + ResetDialogL( err ); + } + } + + +//------------------------------------------------------------------------------ +// CMediaFileDialog::DoSearchL +// +//------------------------------------------------------------------------------ +// +void CMediaFileDialog::DoSearchL() + { + if ( !FindBox() ) + { + return; + } + + if ( iPeninputActive) + { + return; + } + if ( !iMediaFileHandler->QueryReady() ) + { + FLOG( _L("### CMediaFileDialog::DoSearchL: query in progress ###") ); + return; // query in progress + } + + TInt currentFolder = iState->CurrentFolder(); + + if ( FindBox()->TextLength() == 0 ) + { + return; + } + FindBox()->GetSearchText( iSearchText ); + + _LIT(KSpecialChar, "%"); + _LIT(KReplaceChar, "\\%" ); + TBuf<10> buf; + buf.Copy( KSpecialChar ); + TInt position = iSearchText.FindF( buf ); + if ( position != KErrNotFound ) + { + buf.Copy( KReplaceChar ); + iSearchText.Replace( position,1,buf ); + } + + + if ( currentFolder == EEFolderRoot || currentFolder == EEFolderSearch ) + { + TInt currentIndex = iListBox->CurrentItemIndex(); + iState->SetQueryInfo( EEFolderSearch, KNullDesC, currentIndex, EEQueryDown ); + + QueryL( EEFolderSearch ); + } + else if ( currentFolder == EEFolderMusic || currentFolder == EEFolderSearchMusic ) + { + TInt currentIndex = iListBox->CurrentItemIndex(); + iState->SetQueryInfo( EEFolderSearchMusic, KNullDesC, currentIndex, EEQueryDown ); + + QueryL( EEFolderSearchMusic ); + } + } + + +//------------------------------------------------------------------------------ +// CMediaFileDialog::ResetDialogL +// +//------------------------------------------------------------------------------ +// +void CMediaFileDialog::ResetDialogL( TInt aError) + { + iMediaFileHandler->EnableObserverCall( EFalse ); + iMediaFileHandler->CancelQuery(); + iMediaFileHandler->EnableObserverCall( ETrue ); + + iState->Init(); + UpdateListBoxL(); + + if ( aError != KErrNone ) + { + ShowErrorNoteL( aError ); + } + } + + +//------------------------------------------------------------------------------ +// CMediaFileDialog::QueryL +// +//------------------------------------------------------------------------------ +// +void CMediaFileDialog::QueryL( TInt aFolderId, TBool aDatabaseChanged ) + { + if ( !iMediaFileHandler->QueryReady() || !iDatabaseOpen ) + { + FLOG( _L("### CMediaFileDialog::QueryL: query in progress ###") ); + return; + } + + iMediaFileHandler->EnableObserverCall( ETrue ); + + TInt folderId = aFolderId; + + iMediaFileHandler->SetQueryId( folderId ); + + if ( folderId == EEFolderAllMusic ) + { + iMediaFileHandler->QueryMusicL( 0 ); + } + + else if ( folderId == EEFolderVideos ) + { + iMediaFileHandler->QueryVideosL( 0 ); + } + + else if ( folderId == EEFolderArtistRoot || + folderId == EEFolderAlbumRoot || + folderId == EEFolderGenreRoot || + folderId == EEFolderComposerRoot ) + { + if ( iState->UnknownCount( folderId ) == KErrNotFound ) + { + TInt attr = MapAttribute( folderId ); + iMediaFileHandler->QueryMusicUnknownCountL( attr ); + } + else + { + TInt attr = MapAttribute( folderId ); + iMediaFileHandler->QueryAttributeValuesL( attr ); + } + } + + else if ( folderId == EEFolderAlbum || folderId == EEFolderGenre || + folderId == EEFolderComposer ) + { + TInt attr = MapAttribute( folderId ); + iState->GetText( folderId, iBuf ); + iMediaFileHandler->QueryMusicL( attr, iBuf ); + } + + else if ( folderId == EEFolderArtistUnknown || folderId == EEFolderAlbumUnknown || + folderId == EEFolderGenreUnknown ||folderId == EEFolderComposerUnknown ) + { + TInt attr = MapAttribute( folderId ); + iMediaFileHandler->QueryMusicUnknownL( attr ); + } + + else if ( folderId == EEFolderArtist ) + { + iState->GetText( EEFolderArtist, iBuf ); + iMediaFileHandler->QueryArtistL( CMediaFileHandler::EQueryArtist, + iBuf, KNullDesC, aDatabaseChanged ); + } + + else if ( folderId == EEFolderArtistAll ) + { + iState->GetText( EEFolderArtist, iBuf ); + iMediaFileHandler->QueryArtistL( CMediaFileHandler::EQueryArtistAll, + iBuf, KNullDesC, aDatabaseChanged ); + } + + else if ( folderId == EEFolderArtistAlbum ) + { + TBuf buf; + iState->GetText( EEFolderArtistAlbum, buf ); + iState->GetText( EEFolderArtist, iBuf ); + iMediaFileHandler->QueryArtistL( CMediaFileHandler::EQueryArtistAlbum, + iBuf, buf, aDatabaseChanged ); + } + + else if ( folderId == EEFolderArtistAlbumUnknown ) + { + iState->GetText( EEFolderArtist, iBuf ); + iMediaFileHandler->QueryArtistL( CMediaFileHandler::EQueryArtistUnknown, + iBuf, KNullDesC, aDatabaseChanged ); + } + + else if ( folderId == EEFolderTones ) + { + //iMediaFileHandler->QueryTonesL( 0 ); + iMediaFileHandler->QueryDefaultTonesL( 0 ); + ShowWaitNoteL( EFalse ); + } + + else if ( folderId == EEFolderRecordings ) + { + iMediaFileHandler->QueryRecordingsL( 0 ); + } + + else if ( folderId == EEFolderSearch ) + { + if ( iSearchText.Length() > 0 ) + { + iMediaFileHandler->SearchL( iSearchText ); + } + else + { + iMediaFileHandler->QueryEmptyL(); + } + } + else if ( folderId == EEFolderSearchMusic ) + { + if ( iSearchText.Length() > 0 ) + { + iMediaFileHandler->SearchAudioL( iSearchText ); + } + else + { + iMediaFileHandler->QueryEmptyL(); + } + } + else + { + // make empty query + iMediaFileHandler->QueryEmptyL(); + } + + if ( !iMediaFileHandler->QueryReady() + && aFolderId != EEFolderRoot && aFolderId != EEFolderMusic ) + { + // query is running - show wait note with delay. wait note is + // removed in HandleMFEventL + ShowWaitNoteL( aDatabaseChanged ); + } + +#ifdef _DEBUG + iTest->SetTime(); +#endif + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::MapAttribute +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileDialog::MapAttribute( TInt aFolderId ) + { + TInt attr = KErrNotFound; + + switch ( aFolderId ) + { + case EEFolderArtistRoot: + case EEFolderArtist: + case EEFolderArtistUnknown: + { + attr = CMediaFileHandler::EAttrArtist; + break; + } + case EEFolderAlbumRoot: + case EEFolderAlbum: + case EEFolderAlbumUnknown: + { + attr = CMediaFileHandler::EAttrAlbum; + break; + } + case EEFolderGenreRoot: + case EEFolderGenre: + case EEFolderGenreUnknown: + { + attr = CMediaFileHandler::EAttrGenre; + break; + } + case EEFolderComposerRoot: + case EEFolderComposer: + case EEFolderComposerUnknown: + { + attr = CMediaFileHandler::EAttrComposer; + break; + } + default: + { + break; + } + } + + return attr; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::ShowDetailsPopupL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::ShowDetailsPopupL() + { + if ( !iMediaFileHandler->QueryReady() ) + { + return; // query in progress + } + + TInt currentIndex = CurrentItemListIndex(); + TInt folderId = iState->CurrentFolder(); + + if ( folderId != EEFolderSearch && folderId != EEFolderSearchMusic ) + { + return; + } + if ( currentIndex < 0 ) + { + return; + } + + TInt id = iMediaFileHandler->Attribute( currentIndex, + CMediaFileHandler::EAttrMediaFileId, + iState->CurrentFolder() ); + if ( id == KErrNotFound ) + { + return; + } + + TInt mediaType = iMediaFileHandler->Attribute( currentIndex, + CMediaFileHandler::EAttrMediaType, + iState->CurrentFolder() ); + + TInt storageType = iMediaFileHandler->Attribute( currentIndex, + CMediaFileHandler::EAttrStorageType, + iState->CurrentFolder() ); + + CMediaFileData* data = NULL; + + if ( storageType == CMediaFileHandler::ERomStorage ) + { + if ( mediaType == CMediaFileHandler::EMediaTypeTone ) + { + data = iMediaFileHandler->RomMediaFileDataL( id , CMediaFileHandler::EMediaTypeTone ); + } + if ( mediaType == CMediaFileHandler::EMediaTypeVideo ) + { + data = iMediaFileHandler->RomMediaFileDataL( id , CMediaFileHandler::EMediaTypeVideo ); + } + } + else + { + data = iMediaFileHandler->ReadMediaFileDataL( id ); + } + + CleanupStack::PushL( data ); + if ( data ) + { + GetPopupText( data, iPopupText ); + } + + CleanupStack::PopAndDestroy( data ); + + if ( iPopupText.Length() > 0 ) + { + ShowPopupNoteL( iPopupText ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::GetPopupText +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::GetPopupText( CMediaFileData* aData, TDes& aText ) + { + TBuf searchText; + TBuf attributeName; + + aText = KNullDesC; + + if ( FindBox()->TextLength() >= KBufSize64 ) + { + return; + } + FindBox()->GetSearchText( searchText ); + + aData->GetAttr( CMediaFileHandler::EAttrSongName, aText ); + if ( MatchFound( aText, searchText ) ) + { + aText = KNullDesC; + return; + } + + aData->GetAttr( CMediaFileHandler::EAttrArtist, aText ); + if ( MatchFound( aText, searchText ) ) + { + StringLoader::Load( attributeName, R_QTN_PREVIEW_POPUP_ARTIST ); + aText.Insert( 0, attributeName ); + return; + } + + aData->GetAttr( CMediaFileHandler::EAttrAlbum, aText ); + if ( MatchFound( aText, searchText ) ) + { + StringLoader::Load( attributeName, R_QTN_PREVIEW_POPUP_ALBUM ); + aText.Insert( 0, attributeName ); + return; + } + + aData->GetAttr( CMediaFileHandler::EAttrGenre, aText ); + if ( MatchFound( aText, searchText ) ) + { + StringLoader::Load( attributeName, R_QTN_PREVIEW_POPUP_GENRE ); + aText.Insert( 0, attributeName ); + return; + } + + aData->GetAttr( CMediaFileHandler::EAttrComposer, aText ); + if ( MatchFound( aText, searchText ) ) + { + StringLoader::Load( attributeName, R_QTN_PREVIEW_POPUP_COMPOSER ); + aText.Insert( 0, attributeName ); + return; + } + + aText = KNullDesC; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::MatchFound +// +// ----------------------------------------------------------------------------- +// +TBool CMediaFileDialog::MatchFound( const TDesC& aAttribute, + const TDesC& aText ) + { + _LIT( KSpace, " " ); + + if ( aText.Length() >= KBufSize64 ) + { + return EFalse; // too long search text + } + + if ( aAttribute.FindC( aText ) == 0 ) + { + // match found from the beginning of the first word + return ETrue; + } + + TBuf buf; + buf = aText; + buf.Insert( 0, KSpace ); + + if ( aAttribute.FindC( buf ) != KErrNotFound ) + { + // match found from the beginning of the word + return ETrue; + } + + return EFalse; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::PreviewL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::PreviewL( TInt aMediaType ) + { + //FLOG( _L("CMediaFileDialog::PreviewL START") ); + + if ( !iMediaFileHandler->QueryReady() ) + { + FLOG( _L("### CMediaFileDialog::PreviewL: query in progress ###") ); + return; // query in progress + } + + if ( !iForeGround ) + { + return; // dialog is not visible + } + + TInt currentIndex = CurrentItemListIndex(); + if ( currentIndex == KErrNotFound ) + { + return; // list is empty + } + + TInt folderId = iState->FolderId( currentIndex ); + if ( folderId == EEFolderNullItemOne || folderId == EEFolderNullItemTwo ) + { + PreviewNullItemL( folderId ); + return; + } + + if ( folderId != KErrNotFound ) + { + return; // focused list item is folder + } + + + if ( iState->CurrentFolder() == EEFolderVideos && + aMediaType != CMediaFileList::EMediaFileTypeVideo ) + { + return; + } + + GetSelectedItemFileName( currentIndex, iBuf ); + if ( iBuf.Length() == 0 ) + { + return; + } + + + if ( iState->CurrentFolder() == EEFolderSearch ) + { + if ( IsVideoFile( currentIndex ) ) + { + return; // search folder may contain videos - no automatic preview + } + } + + if ( !iProtectionHandler->IsFileValid( iBuf, CMFProtectionHandler::EPlay ) ) + { + return; + } + + if ( aMediaType == CMediaFileList::EMediaFileTypeVideo ) + { + PreviewVideoL( iBuf ); + return; + } + + iAudioPreviewHandler->SetAttrL( TMFDialogUtil::EAttrFileName, iBuf ); + iAudioPreviewHandler->PlayL(); + + //FLOG( _L("CMediaFileDialog::PreviewL END") ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::PreviewVideoL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::PreviewVideoL( const TDesC& aFileName ) + { + if ( !iProtectionHandler->IsVideoValid( aFileName, CMFProtectionHandler::EPlay ) ) + { + return; + } + + // in case "Beep once" one audio beep is played before showing video + TInt type = iAudioPreviewHandler->Attr( CMediaFileList::EAttrRingingType ); + if ( type == CMFPreviewHandlerBase::ERingingTypeBeepOnce ) + { + iAudioPreviewHandler->SetAttrL( TMFDialogUtil::EAttrFileName, aFileName ); + iAudioPreviewHandler->PlayL(); + } + + iVideoPreviewHandler->SetAttrL( TMFDialogUtil::EAttrFileName, aFileName ); + TInt err = KErrNone; + if ( iVideoPreviewDlg && iVideoPreviewHandler->IsPlaying() ) + { + iVideoPreviewDlg->CloseDialogL(); + iVideoPreviewDlg = NULL; + } + iVideoPreviewDlg = CVideoPreviewDialog::NewL( iVideoPreviewHandler ); + TBool ret = iVideoPreviewDlg->ShowDialogLD( &err ); + + if ( err != KErrNone ) + { + FLOG( _L("### CVideoPreviewDialog::ShowDialogLD (%d) ###"), err ); + } + + ShowPreviewErrorNoteL( err, CMediaFileHandler::EMediaTypeVideo ); + + if ( ret ) + { + CloseDialogWithDelayL(); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::PreviewLNullItemL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::PreviewNullItemL( TInt aFolderId ) + { + HBufC* fileName = NULL; + TInt fileType = KErrNotFound; + + if ( aFolderId == EEFolderNullItemOne ) + { + fileType = iNullItemFileTypeOne; + fileName = iNullItemFileNameOne; + } + if ( aFolderId == EEFolderNullItemTwo ) + { + fileType = iNullItemFileTypeTwo; + fileName = iNullItemFileNameTwo; + } + + if ( fileType != CMediaFileList::EMediaFileTypeAudio && + fileType != CMediaFileList::EMediaFileTypeVideo ) + { + return; + } + if ( !fileName ) + { + return; + } + + if ( fileType == CMediaFileList::EMediaFileTypeAudio ) + { + iAudioPreviewHandler->SetAttrL( TMFDialogUtil::EAttrFileName, *fileName ); + iAudioPreviewHandler->PlayL(); + } + if ( fileType == CMediaFileList::EMediaFileTypeVideo ) + { + // null item file type cannot be video + } + } + + +//------------------------------------------------------------------------------ +// CMediaFileDialog::CancelPreview +// +//------------------------------------------------------------------------------ +// +void CMediaFileDialog::CancelPreview() + { + iAudioPreviewHandler->Stop(); + iCaller->Cancel(); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::StartPreviewWithDelay +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::StartPreviewWithDelay() + { + const TInt KOneSecond = 1000; + + iAudioPreviewHandler->Stop(); + + // automatic preview starts after delay. see HandleActiveCallL. + iCaller->Start( EAttrPreview, KOneSecond ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::StartSearchWithDelay +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::StartSearchWithDelay() + { + if ( iPeninputActive ) + { + // search does not start automatically in pen input mode + return; + } + + const TInt KOneSecond = 1000; + + // search starts after delay. see HandleActiveCallL. + iSearchCaller->Start( EAttrSearch, KOneSecond ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::StartRomScan() +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::StartRomScan() + { + delete iIdle; + iIdle = NULL; + iIdle = CIdle::NewL( CActive::EPriorityIdle ); + + if ( iIdle ) + { + iIdle->Start( TCallBack( StartRomScaning, iMediaFileHandler ) ); + } + } + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::StartRomScaning() +// +// ----------------------------------------------------------------------------- +// + +TInt CMediaFileDialog::StartRomScaning( TAny* aInstance ) + { + CMediaFileHandler* handler = static_cast ( aInstance ); + handler->StartRomScaning( CMediaFileHandler::EQueryTone ); + return 0; + } + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::IsVideoFile +// +// ----------------------------------------------------------------------------- +// +TBool CMediaFileDialog::IsVideoFile( TInt aCurrentIndex ) + { + if ( aCurrentIndex < 0 ) + { + return EFalse; + } + + TInt current = iState->CurrentFolder(); + + if ( current == EEFolderVideos ) + { + return ETrue; + } + + if ( current != EEFolderSearch ) + { + return EFalse; + } + + TInt mediaType = iMediaFileHandler->Attribute( aCurrentIndex, + CMediaFileHandler::EAttrMediaType, + current ); + + if ( mediaType == CMediaFileHandler::EMediaTypeVideo ) + { + return ETrue; + } + + return EFalse; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::IsValidVideoFileL +// +// ----------------------------------------------------------------------------- +// +TBool CMediaFileDialog::IsValidVideoFileL( TInt aCurrentIndex, TInt aIntention ) + { + TBuf buf; + + if ( !IsVideoFile( aCurrentIndex ) ) + { + return EFalse; + } + + CMFProtectionHandler::TIntention intention; + if ( aIntention == CMFProtectionHandler::EPlay ) + { + intention = CMFProtectionHandler::EPlay; + } + else + { + intention = CMFProtectionHandler::ESelect; + } + GetSelectedItemFileName( aCurrentIndex, buf ); + + if ( iProtectionHandler->IsVideoValid( buf, intention ) ) + { + return ETrue; + } + return EFalse; + } + + + +// ---------------------------------------------------------------------------- +// CMediaFileDialog::UpdateListBoxL +// +// Update listbox contents (currently open folder items). +// ---------------------------------------------------------------------------- +// +void CMediaFileDialog::UpdateListBoxL( TBool aRestFindBox ) + { + // prevent flickering during listbox update. ResetFindBoxL seems + // to draw listbox many times + iListBox->MakeVisible( EFalse ); + + TRAP_IGNORE( DoUpdateListBoxL( aRestFindBox ) ); + + iListBox->MakeVisible( ETrue ); + } + +// ---------------------------------------------------------------------------- +// CMediaFileDialog::FilterInvalidFiles +// +// Filters the invalid files from media file handler +// invalid files = rights expired DRM Protected files and no right files +// ---------------------------------------------------------------------------- +// +void CMediaFileDialog::FilterInvalidFiles() + { + TInt count = iMediaFileHandler->ResultCount(); + + for ( TInt idx = 0; idx < count; ) + { + // check the validity + GetSelectedItemFileName( idx, iBuf ); + if ( iProtectionHandler->IsFlieDRMExpired( iBuf ) ) + { + // remove the item from handler in case of invalid file + iMediaFileHandler->Remove( idx ); + + // if an item was removed from handler, the idx will not + // be changed and the count will be decreased one. after + // recalculate the count, the next item will be checked in next loop. + count = iMediaFileHandler->ResultCount(); + } + else + { + // just increase the idx in case of valid file + idx++; + } + } + } + +// ---------------------------------------------------------------------------- +// CMediaFileDialog::DoUpdateListBoxL +// +// Update listbox contents (currently open folder items). +// ---------------------------------------------------------------------------- +// +void CMediaFileDialog::DoUpdateListBoxL( TBool aRestFindBox ) + { + // filter the invalid files to avoid showing in the list box + FilterInvalidFiles(); + iState->SetUnknownFolderPosition( iMediaFileHandler->ResultCount() ); + + // check current item index in case media file database has changed + CheckListboxIndex(); + if ( aRestFindBox ) + { + ResetFindBoxL(); + iListBox->HandleItemAdditionL(); + } + + TInt index = iState->CurrentItemIndex(); + if ( index >= 0 && index < iListBox->Model()->NumberOfItems() ) + { + iListBox->SetCurrentItemIndex( index ); + } + else + { + iListBox->SetCurrentItemIndex( 0 ); + } + + TBuf buf; + if ( iState->CurrentFolder() == EEFolderSearch || + iState->CurrentFolder() == EEFolderSearchMusic ) + { + TInt count = iListBox->Model()->NumberOfItems(); + iState->GetSearchTitle( buf, count ); + } + else + { + iState->GetTitle( iState->CurrentFolder(), buf ); +//#ifdef _DEBUG + TInt folder = iState->CurrentFolder(); + if ( iState->FindBoxNeeded() && folder != EEFolderMusic && + folder != EEFolderRoot ) + { + TBuf buf2( buf ); + TInt count = iListBox->Model()->NumberOfItems(); + buf.Format( _L("%S (%d)"), &buf2, count ); + } +//#endif + } + + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( buf ); + iStatusPaneHandler->SetNaviPaneTitle( buf ); + + UpdateCbaL( 0 ); + + DrawNow(); + + if ( iState->QueryDirection() != EEQueryUpdate ) + { + CancelPreview(); + } + + ShowDetailsPopupL(); // for search view info popup + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::UpdateCbaL +// +// Update cba. NOTE: Commented code (menu cba) is for (possible) future use. +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::UpdateCbaL( TInt /*aAttr*/ ) + { + TInt itemCount = iListBox->Model()->NumberOfItems(); + TInt currentIndex = CurrentItemListIndex(); + TInt folderId = iState->FolderId( currentIndex ); + TInt currentFolderId = iState->CurrentFolder(); + + + CEikButtonGroupContainer& cba = ButtonGroupContainer(); // from eikbtgpc.h + + + // Videos folder + if ( currentFolderId == EEFolderVideos ) + { + if ( itemCount == 0 ) + { + cba.SetCommandSetL( R_AVKON_SOFTKEYS_BACK ); + //cba.SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_BACK ); + } + else + { + if ( IsValidVideoFileL( currentIndex, CMFProtectionHandler::EPlay ) ) + { + cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_PREVIEW_SELECT_BACK ); + } + else + { + cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_SELECT_SELECT_BACK ); + } + + //cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_OPTIONS_CONTEXT_BACK ); + } + return; + } + + + // Search folder + if ( currentFolderId == EEFolderSearch || + currentFolderId == EEFolderSearchMusic ) + { + if ( itemCount == 0 ) + { + cba.SetCommandSetL( R_AVKON_SOFTKEYS_BACK ); + // cba.SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_BACK ); + } + else + { + if ( IsValidVideoFileL( currentIndex, CMFProtectionHandler::EPlay ) ) + { + cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_PREVIEW_SELECT_BACK ); + } + else + { + cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_SELECT_SELECT_BACK ); + } + //cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_OPTIONS_SELECT_BACK ); + } + return; + } + + + // Root folder + if ( currentFolderId == EEFolderRoot ) + { + if ( folderId == EEFolderDownload || folderId == EEFolderNullItemOne || + folderId == EEFolderNullItemTwo ) + { + //cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_OPTIONS_SELECT_BACK ); + cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_SELECT_SELECT_BACK ); + } + else + { + //cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_OPTIONS_OPEN_BACK ); + cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_OPEN_OPEN_BACK ); + } + return; + } + + + // other folders + if ( itemCount == 0 ) + { + // folder is empty + cba.SetCommandSetL( R_AVKON_SOFTKEYS_BACK ); + //cba.SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_BACK ); + } + else if ( folderId != KErrNotFound ) + { + // list items are folders + cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_OPEN_OPEN_BACK ); + //cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_OPTIONS_OPEN_BACK ); + } + else + { + // list items are files + cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_SELECT_SELECT_BACK ); + //cba.SetCommandSetL( R_MEDIA_FILE_DIALOG_CBA_OPTIONS_SELECT_BACK ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::Panic +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::Panic( TInt aReason ) + { + _LIT( KPanicCategory, "CMediaFileDialog" ); + + User::Panic( KPanicCategory, aReason ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::ShowErrorNoteL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::ShowErrorNoteL( TInt aError ) + { + TInt err = aError; + + if ( err == KErrNone ) + { + return; + } + + iBuf = KNullDesC; + CTextResolver* tr = CTextResolver::NewLC(); + iBuf = tr->ResolveErrorString( err, CTextResolver::ECtxNoCtxNoSeparator ); + CleanupStack::PopAndDestroy( tr ); + + if ( iBuf.Length() > 0 ) + { + TMFDialogUtil::ShowErrorNoteL( iBuf ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::ShowPreviewErrorNoteL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::ShowPreviewErrorNoteL( TInt aError, TInt aMediaType ) + { + TInt err = KErrNone; + + if ( aError == KErrNoMemory || aError == KErrDiskFull ) + { + CTextResolver* tr = CTextResolver::NewLC(); + iBuf = tr->ResolveErrorString( aError, CTextResolver::ECtxNoCtxNoSeparator ); + CleanupStack::PopAndDestroy( tr ); + err = aError; + } + else if ( aError == KErrNotSupported || aError == KErrCorrupt ||aError == KErrMMPartialPlayback) + { + if ( aMediaType == CMediaFileHandler::EMediaTypeVideo ) + { + StringLoader::Load( iBuf, R_QTN_INFO_CLIP_FORMAT_ERROR ); + } + else + { + StringLoader::Load( iBuf, R_QTN_INFO_FILE_FORMAT_ERROR ); + } + err = aError; + } + + if ( err == KErrNone ) + { + return; + } + +#ifdef _DEBUG + TMFDialogUtil::ShowErrorNoteL( iBuf, aError ); +#else + TMFDialogUtil::ShowErrorNoteL( iBuf ); +#endif + + } + + +//------------------------------------------------------------------------------ +// CMediaFileDialog::ShowWaitNoteL +// +//------------------------------------------------------------------------------ +// +void CMediaFileDialog::ShowWaitNoteL( TBool aDatabaseChanged ) + { + TBuf buf; + + if ( aDatabaseChanged ) + { + StringLoader::Load( buf, R_QTN_WAIT_NOTE_UPDATE ); + //buf = _L("Refreshing"); + } + else if ( iState->QueryFolder() == EEFolderSearch || + iState->QueryFolder() == EEFolderSearchMusic ) + { + StringLoader::Load( buf, R_QTN_WAIT_NOTE_SEARCH ); + } + else + { + StringLoader::Load( buf, R_QTN_WAIT_NOTE_OPEN ); + } + + iWaitNote->LaunchL( buf ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::DeleteMenuItem +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::DeleteMenuItem( CEikMenuPane* aMenuPane, TInt aCommandId ) + { + TInt pos = KErrNotFound; + if ( aMenuPane->MenuItemExists( aCommandId, pos ) ) + { + aMenuPane->DeleteMenuItem( aCommandId ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::ShowPopupNote +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::ShowPopupNoteL( const TDesC& aText ) + { + const TInt KPopupDisplayTime = 3*1000; + const TInt KPopupDelayTime = 500; + + iPopupNote->SetTextL( aText ); + iPopupNote->SetTimeDelayBeforeShow( KPopupDelayTime ); + iPopupNote->SetTimePopupInView( KPopupDisplayTime ); + iPopupNote->ShowInfoPopupNote(); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::CurrentItemListIndex +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileDialog::CurrentItemListIndex() + { + TInt itemCount = iListBox->Model()->NumberOfItems(); + TInt currentIndex = iListBox->CurrentItemIndex(); + + if ( itemCount == 0 || currentIndex < 0 ) + { + return KErrNotFound; // list or find box is empty + } + + // convert from findbox index into original list index + if ( FindBox() && FindBox()->IsVisible() ) + { + TInt tempIndex = currentIndex; + CAknFilteredTextListBoxModel* model = + STATIC_CAST(CAknFilteredTextListBoxModel*, iListBox->Model()); + + if ( model->Filter() ) + { + currentIndex = model->Filter()->FilteredItemIndex( tempIndex ); + } + } + + return currentIndex; + } + + +//------------------------------------------------------------------------------ +// CMediaFileDialog::GetSelectedItemFileName +// +//------------------------------------------------------------------------------ +// +void CMediaFileDialog::GetSelectedItemFileName( TInt aListboxIndex, TDes& aFileName ) + { + aFileName = KNullDesC; + + __ASSERT_DEBUG( iState->QueryNeeded(), Panic( KErrGeneral ) ); + + TInt id = iState->CurrentFolder(); + + // read selected list item text from metadata + TInt extraIndexes = iState->LeadingPersistentFolderCount(); + TInt queryIndex = aListboxIndex - extraIndexes; + + iMediaFileHandler->GetAttribute( queryIndex, CMediaFileHandler::EAttrFullName, + aFileName, id ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::ConstructListboxItem +// +// ----------------------------------------------------------------------------- +// +TPtrC CMediaFileDialog::ConstructListboxItem( TInt aListboxIndex ) + { + _LIT( KFormat2, "%d\t%S\t%d" ); + + TBool isPersistent = EFalse; + TInt mediaTypeIcon = EEIconEmpty; + TInt storageTypeIcon = EEIconEmpty; + TInt folderId = KErrNotFound; + iState->GetFolderInfo( aListboxIndex, folderId, iListboxItemText1, + isPersistent, mediaTypeIcon ); + if ( folderId != KErrNotFound ) + { + if ( !isPersistent ) + { + GetListItemText( aListboxIndex, iListboxItemText1 ); + } + } + else + { + GetListItemText( aListboxIndex, iListboxItemText1 ); + mediaTypeIcon = MediaTypeIcon( aListboxIndex ); + storageTypeIcon = StorageTypeIcon( aListboxIndex ); + } + + iListboxItemText2.Format( KFormat2, mediaTypeIcon, &iListboxItemText1, storageTypeIcon ); + return iListboxItemText2; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::MediaTypeIcon +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileDialog::MediaTypeIcon( TInt aListboxIndex ) + { + if ( aListboxIndex < 0 ) + { + return EEIconEmpty; + } + + TInt mediaType = iMediaFileHandler->Attribute( aListboxIndex, + CMediaFileHandler::EAttrMediaType, + iState->CurrentFolder() ); + + TInt iconId = EEIconMusic; + if ( mediaType == CMediaFileHandler::EMediaTypeTone ) + { + iconId = EEIconTone; + } + else if ( mediaType == CMediaFileHandler::EMediaTypeVideo ) + { + iconId = EEIconVideo; + } + else if ( mediaType == CMediaFileHandler::EMediaTypeRecording ) + { + iconId = EEIconRecording; + } + + return iconId; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::StorageTypeIcon +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileDialog::StorageTypeIcon( TInt aListboxIndex ) + { + if ( aListboxIndex < 0 ) + { + return EEIconEmpty; + } + + TInt storageType = iMediaFileHandler->Attribute( aListboxIndex, + CMediaFileHandler::EAttrStorageType, + iState->CurrentFolder() ); + TInt iconId = EEIconEmpty; + if ( storageType == CMediaFileHandler::EMassStorage ) + { + iconId = EEIconMassStorage; + } + + if ( storageType == CMediaFileHandler::EMemoryCard ) + { + iconId = EEIconMemoryCard; + } + + return iconId; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::GetListItemText +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::GetListItemText( TInt aListboxIndex, TDes& aText ) + { + __ASSERT_DEBUG( iState->QueryNeeded(), Panic( KErrGeneral ) ); + + TInt id = iState->CurrentFolder(); + + // read selected list item text from metadata + TInt extraIndexes = iState->LeadingPersistentFolderCount(); + TInt queryIndex = aListboxIndex - extraIndexes; + + iMediaFileHandler->GetAttribute( queryIndex, + CMediaFileHandler::EAttrSongName, aText, id ); + } + + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::ListboxItemCount (from CMFListHandlerObserver) +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileDialog::ListboxItemCount() + { + TInt count1 = iState->PersistentFolderCount(); + TInt count2 = 0; + + if ( iState->QueryNeeded() ) + { + count2 = iMediaFileHandler->ResultCount(); + } + return count1 + count2; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::HandleMFEventL (from MMediaFileHandlerObserver) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::HandleMFEventL( TInt aEvent, TInt aError ) + { + // + // handle cancel button + // + if ( aEvent == MMediaFileHandlerObserver::EQueryCanceled ) + { + iWaitNote->CancelProgressDialogL(); + iSearchText = KNullDesC; + UpdateListBoxL(); + return; + } + + // + // handle error + // + if ( aError != KErrNone ) + { + iWaitNote->CancelProgressDialogL(); + ResetDialogL( aError ); + + FLOG( _L("### CMediaFileDialog::HandleMFEventL (%d) ###"), aError ); + return; + } + + + if ( aEvent != MMediaFileHandlerObserver::EUnknownQueryComplete ) + { + // unknown query is always followed by another query + iWaitNote->CancelProgressDialogL(); + } + + + if ( aEvent == MMediaFileHandlerObserver::EUnknownQueryComplete ) + { + TInt count = iMediaFileHandler->ResultCount(); + TInt folderId = iState->QueryFolder(); + iState->SetUnknownCount( folderId, count ); + + TInt err = KErrNone; + TRAP( err, QueryL( folderId ) ); + if ( err != KErrNone ) + { + iWaitNote->CancelProgressDialogL(); + User::Leave( err ); + } + } + + if ( aEvent == MMediaFileHandlerObserver::EQueryComplete ) + { + // query was successful - update dialog state + iState->SetStateAfterQuery(); + + TInt count = iMediaFileHandler->ResultCount(); + + if ( iState->CurrentFolder() == EEFolderArtist ) + { + TInt count = iMediaFileHandler->UnknownArtistCount(); + iState->SetUnknownCount( EEFolderArtist, count ); + } + iState->HideUnknownFolders(); + UpdateListBoxL(); + +#ifdef _DEBUG + iTest->PrintTimeL( _L("query took") ); // test code +#endif + } + + if ( aEvent == MMediaFileHandlerObserver::EMediaFileChanged ) + { + HandleMediaFileChanged(); + } + + if ( aEvent == MMediaFileHandlerObserver::EScanRomComplete ) + { + iWaitNote->CancelProgressDialogL(); + } + + if ( aEvent == MMediaFileHandlerObserver::EInitComplete ) + { + iDatabaseOpen = ETrue; + + StartRomScan(); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::HandleMediaFileChanged +// +// Handle situation where file system changes and media files are added / +// removed. This function makes a query to update current folder and +// stores name or id of the currently selected item. Current item info +// is needed to restore current item after query. +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::HandleMediaFileChanged() + { + // query is ongoing - ignore this file change event + if ( !iMediaFileHandler->QueryReady() ) + { + FLOG( _L("### CMediaFileDialog::HandleMediaFileChanged: query in progress ###") ); + return; + } + + iState->ResetUnknownCount(); + TMFCurrentItemInfo& info = iState->CurrentItemInfo(); + info.Reset(); + info.iIndexCheckNeeded = ETrue; // set to false when dialog is opened + + TInt currentFolder = iState->CurrentFolder(); + TInt currentIndex = CurrentItemListIndex(); + + TBool isPersistent = EFalse; + TInt iconId = EEIconEmpty; + TInt id = KErrNotFound; + TBuf buf; + iState->GetFolderInfo( currentIndex, id, buf, + isPersistent, iconId ); + if ( id == KErrNotFound ) + { + // get media file id + info.iMediaFileId = iMediaFileHandler->Attribute( currentIndex, + CMediaFileHandler::EAttrMediaFileId, currentFolder ); + } + else if ( !isPersistent ) + { + // get non-persistent folder name (eg some album name) + GetListItemText( currentIndex, info.iFolderText ); + } + else + { + // get persistent folder id (eg "Unknown" folder) + info.iFolderId = id; + } + + info.iItemIndex = currentIndex; + + iState->SetQueryInfo( 0, KNullDesC, 0, EEQueryUpdate ); + + TBool databaseChanged = ETrue; + QueryL( currentFolder, databaseChanged ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::CheckListboxIndex +// +// Check that current item selection is correct. Function is used in case +// file system has changed (media files added / removed. +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::CheckListboxIndex() + { + TMFCurrentItemInfo& info = iState->CurrentItemInfo(); + if ( !info.iIndexCheckNeeded ) + { + return; + } + + TInt direction = iState->QueryDirection(); + TInt newListIndex = KErrNotFound; + + if ( direction == EEQueryUp ) + { + FLOG( _L("query up") ); + TInt prevId = iState->PreviousFolderId(); + TInt listIndex = iState->ListIndex( prevId ); + if ( !iState->IsPersistent( prevId ) ) + { + iState->GetText( prevId, info.iFolderText ); + TInt num = iState->LeadingPersistentFolderCount(); + newListIndex = iMediaFileHandler->ItemIndex( + info.iFolderText, listIndex ); + iState->SetCurrentItemIndex( newListIndex + num ); + } + else + { + iState->SetCurrentItemIndex( listIndex ); + } + } + + if ( direction == EEQueryUpdate ) + { + if ( info.iMediaFileId != KErrNotFound ) + { + newListIndex = iMediaFileHandler->ItemIndex( + info.iMediaFileId, info.iItemIndex ); + } + else if ( info.iFolderText.Length() > 0 ) + { + newListIndex = iMediaFileHandler->ItemIndex( + info.iFolderText, info.iItemIndex ); + TInt num = iState->LeadingPersistentFolderCount(); + newListIndex = newListIndex + num; + } + else if ( info.iFolderId != KErrNotFound ) + { + newListIndex = iState->ListIndex( info.iFolderId ); + } + + iState->SetCurrentItemIndex( newListIndex ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::HandlePreviewEventL (from MPreviewHandlerObserver) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::HandlePreviewEventL( TInt aEvent, TInt aError ) + { + if ( aEvent == MPreviewHandlerObserver::EAudioPreviewComplete ) + { + ShowPreviewErrorNoteL( aError, CMediaFileHandler::EMediaTypeMusic ); + } + + if ( aEvent == MPreviewHandlerObserver::EVideoPreviewComplete ) + { + ShowPreviewErrorNoteL( aError, CMediaFileHandler::EMediaTypeVideo ); + } + + if ( aEvent == MPreviewHandlerObserver::EPreviewError ) + { + FLOG( _L("### CMediaFileDialog::HandlePreviewEventL (%d) ###"), aError ); + + ShowPreviewErrorNoteL( aError, CMediaFileHandler::EMediaTypeMusic ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::HandleLosingForeground (from MCoeForegroundObserver) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::HandleLosingForeground() + { + iForeGround = EFalse; + //Record the current item info + if ( iState && iListBox) + { + iState->SetCurrentItemIndex( CurrentItemListIndex() ); + } + + CancelPreview(); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::HandleGainingForeground (from MCoeForegroundObserver) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::HandleGainingForeground() + { + iForeGround = ETrue; + if ( iListBox ) + { + UpdateListBoxL( EFalse ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::HandleControlEventL (from MCoeControlObserver) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::HandleControlEventL( CCoeControl* aControl, + TCoeEvent aEventType ) + { + TInt currentFolderId = iState->CurrentFolder(); + + if ( aEventType == EEventStateChanged ) + { + CancelPreview(); + if ( aControl == iListBox ) + { + if ( currentFolderId == EEFolderRoot || + currentFolderId == EEFolderSearch || + currentFolderId == EEFolderVideos ) + { + UpdateCbaL( 0 ); // only these folders need dynamic cba update + } + StartPreviewWithDelay(); + ShowDetailsPopupL(); // show search details in Search view + + // forward listbox state change events to this control's + // observers + ReportEventL( MCoeControlObserver::EEventStateChanged ); + } + + if ( FindBox() && aControl == FindBox() ) + { + User::InfoPrint(_L("find box event arrived")); + + // this event is received when user enters or deletes + // chars in find box. Backspace key in empty find box does not + // generate this event. + + if ( currentFolderId == EEFolderSearch || + currentFolderId == EEFolderRoot || + currentFolderId == EEFolderMusic || + currentFolderId == EEFolderSearchMusic ) + { + StartSearchWithDelay(); + return; + } + + // StartPreviewWithDelay(); + + UpdateCbaL( 0 ); + +//#ifdef _DEBUG + TBuf buf; + iState->GetTitle( iState->CurrentFolder(), buf ); + TBuf buf2( buf ); + TInt count = iListBox->Model()->NumberOfItems(); + buf.Format( _L("%S (%d)"), &buf2, count ); + iStatusPaneHandler->SetNaviPaneTitle( buf ); +//#endif + + // Forward listbox state change events to this control's + // observers + ReportEventL( MCoeControlObserver::EEventStateChanged ); + } + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::HandleWaitNoteL (from MMediaFileWaitNoteObserver) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::HandleWaitNoteL( TInt /*aButtonId*/ ) + { + iMediaFileHandler->CancelQuery(); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::AdaptiveSearchTextChanged (from MAdaptiveSearchTextObserver) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::AdaptiveSearchTextChanged( CAknSearchField* /*aSearchField*/ ) + { + // not used + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::OnPeninputUiDeactivated +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::OnPeninputUiDeactivated() + { + iPeninputActive = EFalse; + + if ( FindBox()->TextLength() == 0 && + ( iState->CurrentFolder() == EEFolderSearch || + iState->CurrentFolder() == EEFolderSearchMusic ) ) + { + HandleBackL(); + } + else + { + // search starts immediately after user closes pen input + TRAP_IGNORE( StartSearchWithDelay() ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::OnPeninputUiActivated +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::OnPeninputUiActivated() + { + iPeninputActive = ETrue; + CancelPreview(); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::HandleListBoxEventL (from MEikListBoxObserver) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::HandleListBoxEventL( CEikListBox* /*aListBox*/, + TListBoxEvent aEventType ) + { + TInt current = iState->CurrentFolder(); + if ( aEventType == EEventPenDownOnItem) + { + iListBox->View()->ItemDrawer()->SetFlags( CListItemDrawer::EPressedDownState ); + return; + } + + if ( aEventType == EEventItemClicked ) + { + iIsDoubleClicked = EFalse; + if ( current != KErrNotFound ) + { + HandleOKL( EAttrOpen ); // open folder item + } + return; + } + + if ( aEventType == EEventItemDoubleClicked || aEventType == EEventEnterKeyPressed ) + { + iIsDoubleClicked = ETrue; + TBool closeDialog = HandleOKL( EAttrDoubleClicked ); + + if ( closeDialog ) + { + // close after short delay (dialog cannot be closed from this function) + CloseDialogWithDelayL(); + } + } + if ( aEventType == EEventItemDraggingActioned ) + { + UpdateCbaL( KErrNone ); + DrawNow(); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::CloseDialogWithDelayL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::CloseDialogWithDelayL() + { + delete iIdle; + iIdle = NULL; + iIdle = CIdle::NewL( CActive::EPriorityIdle ); + + if ( iIdle ) + { + iIdle->Start( TCallBack( CloseDialog, this ) ); + } + delete iInputBlock; + iInputBlock = NULL; + iInputBlock = CAknInputBlock::NewLC(); + CleanupStack::Pop( iInputBlock ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::CloseDialog +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileDialog::CloseDialog( TAny *aObj ) + { + CMediaFileDialog *dlg = (CMediaFileDialog*) aObj; + delete dlg->iInputBlock; + dlg->iInputBlock = NULL; + + TRAP_IGNORE( dlg->TryExitL( EAknSoftkeyOk ) ); + + return 0; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::HandleActiveCallL (from MMFActiveCallerObserver) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog::HandleActiveCallL( TInt aCallId ) + { + if ( aCallId == EAttrPreview ) + { + //double click the item of the listbox to select the tones, do not preview it. + if ( iIsDoubleClicked ) + { + iIsDoubleClicked = EFalse; + } + else + { + // start preview after delay + PreviewL( CMediaFileList::EMediaFileTypeAudio ); + } + } + + if ( aCallId == EAttrSearch ) + { + // start search after delay + SearchL(); + } + } + + + + +/****************************************************************************** + * class CMFListHandler + ******************************************************************************/ + +// ----------------------------------------------------------------------------- +// CMFListHandler::NewL +// +// ----------------------------------------------------------------------------- +// +CMFListHandler* CMFListHandler::NewL() + { + CMFListHandler* self = new (ELeave) CMFListHandler(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMFListHandler::~CMFListHandler +// +// ----------------------------------------------------------------------------- +// +CMFListHandler::~CMFListHandler() + { + } + + +// ----------------------------------------------------------------------------- +// CMFListHandler::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CMFListHandler::ConstructL( void ) + { + } + + +// ----------------------------------------------------------------------------- +// CMFListHandler::CMFListHandler +// +// ----------------------------------------------------------------------------- +// +CMFListHandler::CMFListHandler() + { + } + + +// ----------------------------------------------------------------------------- +// CMFListHandler::SetObserver +// +// ----------------------------------------------------------------------------- +// +void CMFListHandler::SetObserver( CMFListHandlerObserver* aObserver ) + { + iObserver = aObserver; + } + + +// ----------------------------------------------------------------------------- +// CMFListHandler::MdcaCount (from MDesCArray) +// +// ----------------------------------------------------------------------------- +// +TInt CMFListHandler::MdcaCount() const + { + return iObserver->ListboxItemCount(); + } + + +// ----------------------------------------------------------------------------- +// CMFListHandler::MdcaPoint (from MDesCArray) +// +// CEikListBox calls this function just before it draws list box item. +// ----------------------------------------------------------------------------- +// +TPtrC16 CMFListHandler::MdcaPoint( TInt aIndex ) const + { + return iObserver->ConstructListboxItem( aIndex ); + } + + +// ----------------------------------------------------------------------------- +// CMFListHandler::Panic +// +// ----------------------------------------------------------------------------- +// +void CMFListHandler::Panic( TInt aReason ) + { + _LIT( KPanicCategory, "CMFListHandler" ); + + User::Panic( KPanicCategory, aReason ); + } + + + + + + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Src/mediafiledialogstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Src/mediafiledialogstate.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,1501 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class used to deal with the items of the Main view +* +*/ + + + + +// INCLUDE FILES + +#include "mediafiledialogstate.h" +#include "mediafiledialogutils.h" + +#include // for .rss resource enums +#include + + + +/****************************************************************************** + * class TMFListItem + ******************************************************************************/ + + +// ------------------------------------------------------------------------------- +// TMFListItem::TMFListItem +// +// ------------------------------------------------------------------------------- +// +TMFListItem::TMFListItem() + : iListIndex(KErrNotFound), iFolderId(KErrNotFound), iParentFolderId(KErrNotFound), + iChildFolderId(KErrNotFound), iPersistent(ETrue), + iHidden(EFalse), iIconId(EEIconEmpty), iChildIconId(EEIconEmpty), + iUnknownCount(KErrNotFound) + { + } + + + +/****************************************************************************** + * class TMFCurrentItemInfo + ******************************************************************************/ + + +// ------------------------------------------------------------------------------- +// TMFCurrentItemInfo::TMFCurrentItemInfo +// +// ------------------------------------------------------------------------------- +// +void TMFCurrentItemInfo::Reset() + { + iIndexCheckNeeded = EFalse; + iItemIndex = KErrNotFound; + iMediaFileId = KErrNotFound; + iFolderId = KErrNotFound; + iFolderText = KNullDesC; + } + + +/****************************************************************************** + * class CMediaFileDialogState + ******************************************************************************/ + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogState::NewL +// +// ----------------------------------------------------------------------------- +CMediaFileDialogState* CMediaFileDialogState::NewL() + { + CMediaFileDialogState* self = new ( ELeave ) CMediaFileDialogState(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CMediaFileDialogState::CMediaFileDialogState +// +// ----------------------------------------------------------------------------- +// +CMediaFileDialogState::CMediaFileDialogState() + { + iCurrentFolderId = EEFolderRoot; + iCurrentFolderIndex = 0; + iListPosition = KErrNotFound; + + iQueryFolderId = EEFolderRoot; + iQueryDirection = EEQueryDown; + iQueryText = KNullDesC; + iPreviousFolderId = KErrNotFound; + iCurrentItemInfo.Reset(); + } + +// ----------------------------------------------------------------------------- +// CMediaFileDialogState::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialogState::ConstructL() + { + AddPermanentItemsL(); + } + +// ---------------------------------------------------------------------------- +// Destructor +// +// ---------------------------------------------------------------------------- +// +CMediaFileDialogState::~CMediaFileDialogState() + { + iList.Close(); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogState::Init +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialogState::Init() + { + // initialize non-persistent folders + TInt count = iList.Count(); + for ( TInt i=0; i buf; + GetFolderInfo( aListIndex, id, buf, persistent, icon ); + + return id; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogState::FolderIndex +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileDialogState::FolderIndex( TInt aListIndex ) + { + if ( aListIndex < 0 ) + { + return KErrNotFound; + } + + TInt folderIndex = KErrNotFound; + + TInt count = iList.Count(); + for ( TInt i=0; i +// Music +// All +// Artist +// +// +// All +// +// +// Unknown +// Unknown +// Album +// +// +// +// Unknown +// +// +// Genre +// Unknown +// Composer +// Unknown +// Videos +// +// +// Recordings +// +// +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialogState::AddPermanentItemsL() + { + TMFListItem item; + + // Root + item.iListIndex = 0; + item.iFolderId = EEFolderRoot; + item.iParentFolderId = KErrNotFound; + item.iChildFolderId = KErrNotFound; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = KErrNotFound; + item.iChildIconId = KErrNotFound; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_MEDIA_FILE_DIALOG_TITLE ); + item.iTitle = KNullDesC; + User::LeaveIfError( iList.Append( item ) ); + + // Downloads + item.iListIndex = 0; + item.iFolderId = EEFolderDownload; + item.iParentFolderId = EEFolderRoot; + item.iChildFolderId = EEFolderNone; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = EEIconFolderDownload; + item.iChildIconId = EEIconEmpty; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_FOLDER_DOWNLOAD ); + item.iTitle = KNullDesC; + User::LeaveIfError( iList.Append( item ) ); + + // Tones + item.iListIndex = 1; + item.iFolderId = EEFolderTones; + item.iParentFolderId = EEFolderRoot; + item.iChildFolderId = EEFolderNone; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = EEIconFolder; + item.iChildIconId = EEIconTone; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_FOLDER_TONES ); + StringLoader::Load( item.iTitle, R_QTN_VIEW_TONES ); + User::LeaveIfError( iList.Append( item ) ); + + // Music + item.iListIndex = 2; + item.iFolderId = EEFolderMusic; + item.iParentFolderId = EEFolderRoot; + item.iChildFolderId = KErrNotFound; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = EEIconFolder; + item.iChildIconId = KErrNotFound; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_FOLDER_MUSIC ); + StringLoader::Load( item.iTitle, R_QTN_VIEW_MUSIC ); + User::LeaveIfError( iList.Append( item ) ); + + // Videos + item.iListIndex = 3; + item.iFolderId = EEFolderVideos; + item.iParentFolderId = EEFolderRoot; + item.iChildFolderId = EEFolderNone; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = EEIconFolder; + item.iChildIconId = EEIconVideo; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_FOLDER_VIDEOS ); + StringLoader::Load( item.iTitle, R_QTN_VIEW_VIDEOS ); + User::LeaveIfError( iList.Append( item ) ); + + // Recordings + item.iListIndex = 4; + item.iFolderId = EEFolderRecordings; + item.iParentFolderId = EEFolderRoot; + item.iChildFolderId = EEFolderNone; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = EEIconFolder; + item.iChildIconId = EEIconFolder; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_FOLDER_RECORDINGS ); + StringLoader::Load( item.iTitle, R_QTN_VIEW_RECORDINGS ); + User::LeaveIfError( iList.Append( item ) ); + + // Null item one + item.iListIndex = 5; + item.iFolderId = EEFolderNullItemOne; + item.iParentFolderId = EEFolderRoot; + item.iChildFolderId = EEFolderNone; + item.iPersistent = ETrue; + item.iHidden = ETrue; // by default not visible + item.iIconId = EEIconEmpty; + item.iChildIconId = KErrNotFound; + item.iUnknownCount = KErrNotFound; + item.iText = KNullDesC; + item.iTitle = KNullDesC; + User::LeaveIfError( iList.Append( item ) ); + + // Null item two + item.iListIndex = 6; + item.iFolderId = EEFolderNullItemTwo; + item.iParentFolderId = EEFolderRoot; + item.iChildFolderId = KErrNotFound; + item.iPersistent = ETrue; + item.iHidden = ETrue; // by default not visible + item.iIconId = EEIconEmpty; + item.iChildIconId = KErrNotFound; + item.iUnknownCount = KErrNotFound; + item.iText = KNullDesC; + item.iTitle = KNullDesC; + User::LeaveIfError( iList.Append( item ) ); + + // Search + item.iListIndex = KErrNotFound; + item.iFolderId = EEFolderSearch; + item.iParentFolderId = EEFolderRoot; + item.iChildFolderId = EEFolderNone; + item.iPersistent = ETrue; + item.iHidden = ETrue; // visible only when search is used in root level + item.iIconId = EEIconEmpty; + item.iChildIconId = KErrNotFound; + item.iUnknownCount = KErrNotFound; + item.iText = KNullDesC; + item.iTitle = KNullDesC; + + //StringLoader::Load( item.iText, R_QTN_VIEW_SEARCH ); + //StringLoader::Load( item.iTitle, R_QTN_VIEW_SEARCH ); + User::LeaveIfError( iList.Append( item ) ); + + + // Music Search + item.iListIndex = KErrNotFound; + item.iFolderId = EEFolderSearchMusic; + item.iParentFolderId = EEFolderMusic; + item.iChildFolderId = EEFolderNone; + item.iPersistent = ETrue; + item.iHidden = ETrue; // visible only when search is used in root level + item.iIconId = EEIconEmpty; + item.iChildIconId = KErrNotFound; + item.iUnknownCount = KErrNotFound; + item.iText = KNullDesC; + item.iTitle = KNullDesC; + User::LeaveIfError( iList.Append( item ) ); + + // All music + item.iListIndex = 0; + item.iFolderId = EEFolderAllMusic; + item.iParentFolderId = EEFolderMusic; + item.iChildFolderId = EEFolderNone; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = EEIconFolder; + item.iChildIconId = EEIconMusic; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_FOLDER_ALL_MUSIC ); + StringLoader::Load( item.iTitle, R_QTN_FOLDER_ALL_MUSIC ); + User::LeaveIfError( iList.Append( item ) ); + + + // Artist Root + item.iListIndex = 1; + item.iFolderId = EEFolderArtistRoot; + item.iParentFolderId = EEFolderMusic; + item.iChildFolderId = EEFolderArtist; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = EEIconFolder; + item.iChildIconId = EEIconArtist; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_FOLDER_ARTIST ); + StringLoader::Load( item.iTitle, R_QTN_VIEW_ARTIST ); + User::LeaveIfError( iList.Append( item ) ); + + // Album Root + item.iListIndex = 2; + item.iFolderId = EEFolderAlbumRoot; + item.iParentFolderId = EEFolderMusic; + item.iChildFolderId = EEFolderAlbum; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = EEIconFolder; + item.iChildIconId = EEIconAlbum; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_FOLDER_ALBUM ); + StringLoader::Load( item.iTitle, R_QTN_VIEW_ALBUM ); + User::LeaveIfError( iList.Append( item ) ); + + // Genre Root + item.iListIndex = 3; + item.iFolderId = EEFolderGenreRoot; + item.iParentFolderId = EEFolderMusic; + item.iChildFolderId = EEFolderGenre; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = EEIconFolder; + item.iChildIconId = EEIconGenre; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_FOLDER_GENRE ); + StringLoader::Load( item.iTitle, R_QTN_VIEW_GENRE ); + User::LeaveIfError( iList.Append( item ) ); + + // Composer Root + item.iListIndex = 4; + item.iFolderId = EEFolderComposerRoot; + item.iParentFolderId = EEFolderMusic; + item.iChildFolderId = EEFolderComposer; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = EEIconFolder; + item.iChildIconId = EEIconComposer; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_FOLDER_COMPOSER ); + StringLoader::Load( item.iTitle, R_QTN_VIEW_COMPOSER ); + User::LeaveIfError( iList.Append( item ) ); + + // Album ( represents some album under EEFolderAlbumRoot ) + item.iListIndex = KErrNotFound; + item.iFolderId = EEFolderAlbum; + item.iParentFolderId = EEFolderAlbumRoot; + item.iChildFolderId = EEFolderNone; + item.iPersistent = EFalse; + item.iHidden = EFalse; + item.iIconId = EEIconAlbum; + item.iChildIconId = EEIconMusic; + item.iUnknownCount = KErrNotFound; + item.iText = KNullDesC; + item.iTitle = KNullDesC; + User::LeaveIfError( iList.Append( item ) ); + + // Album Unknown ( all music files without album attribute ) + item.iListIndex = KErrNotFound; + item.iFolderId = EEFolderAlbumUnknown; + item.iParentFolderId = EEFolderAlbumRoot; + item.iChildFolderId = EEFolderNone; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = EEIconUnknown; + item.iChildIconId = EEIconMusic; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_UNKNOWN_ALBUM ); + StringLoader::Load( item.iTitle, R_QTN_UNKNOWN_ALBUM ); + User::LeaveIfError( iList.Append( item ) ); + + // Genre ( represents some genre under EEFolderGenreRoot ) + item.iListIndex = KErrNotFound; + item.iFolderId = EEFolderGenre; + item.iParentFolderId = EEFolderGenreRoot; + item.iChildFolderId = EEFolderNone; + item.iPersistent = EFalse; + item.iHidden = EFalse; + item.iIconId = EEIconGenre; + item.iChildIconId = EEIconMusic; + item.iUnknownCount = KErrNotFound; + item.iText = KNullDesC; + item.iTitle = KNullDesC; + User::LeaveIfError( iList.Append( item ) ); + + // Genre Unknown ( all music files without genre attribute ) + item.iListIndex = KErrNotFound; + item.iFolderId = EEFolderGenreUnknown; + item.iParentFolderId = EEFolderGenreRoot; + item.iChildFolderId = EEFolderNone; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = EEIconUnknown; + item.iChildIconId = EEIconMusic; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_UNKNOWN_GENRE ); + StringLoader::Load( item.iTitle, R_QTN_UNKNOWN_GENRE ); + User::LeaveIfError( iList.Append( item ) ); + + // Composer ( represents some composer under EEFolderComposerRoot ) + item.iListIndex = KErrNotFound; + item.iFolderId = EEFolderComposer; + item.iParentFolderId = EEFolderComposerRoot; + item.iChildFolderId = EEFolderNone; + item.iPersistent = EFalse; + item.iHidden = EFalse; + item.iIconId = EEIconComposer; + item.iChildIconId = EEIconMusic; + item.iUnknownCount = KErrNotFound; + item.iText = KNullDesC; + item.iTitle = KNullDesC; + User::LeaveIfError( iList.Append( item ) ); + + // Composer Unknown ( all music files without composer attribute ) + item.iListIndex = KErrNotFound; + item.iFolderId = EEFolderComposerUnknown; + item.iParentFolderId = EEFolderComposerRoot; + item.iChildFolderId = EEFolderNone; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = EEIconUnknown; + item.iChildIconId = EEIconMusic; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_UNKNOWN_COMPOSER ); + StringLoader::Load( item.iTitle, R_QTN_UNKNOWN_COMPOSER ); + User::LeaveIfError( iList.Append( item ) ); + + + + // + // folders under Artist root + // + + // Artist (artist folder, folder name is artist name) + item.iListIndex = KErrNotFound; + item.iFolderId = EEFolderArtist; + item.iParentFolderId = EEFolderArtistRoot; + item.iChildFolderId = EEFolderArtistAlbum; + item.iPersistent = EFalse; + item.iHidden = EFalse; + item.iIconId = EEIconArtist; + item.iChildIconId = EEIconAlbum; + item.iUnknownCount = KErrNotFound; + item.iText = KNullDesC; + item.iTitle = KNullDesC; + User::LeaveIfError( iList.Append( item ) ); + + // Artist all (all music files for one artist) + item.iListIndex = 0; + item.iFolderId = EEFolderArtistAll; + item.iParentFolderId = EEFolderArtist; + item.iChildFolderId = EEFolderNone; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = EEIconFolder; + item.iChildIconId = EEIconMusic; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_FOLDER_ARTIST_ALL ); + StringLoader::Load( item.iTitle, R_QTN_FOLDER_ARTIST_ALL ); + User::LeaveIfError( iList.Append( item ) ); + + // Artist album (one album, folder name is album name) + item.iListIndex = KErrNotFound; + item.iFolderId = EEFolderArtistAlbum; + item.iParentFolderId = EEFolderArtist; + item.iChildFolderId = EEFolderNone; + item.iPersistent = EFalse; + item.iHidden = EFalse; + item.iIconId = EEIconAlbum; + item.iChildIconId = EEIconMusic; + item.iUnknownCount = KErrNotFound; + item.iText = KNullDesC; + item.iTitle = KNullDesC; + User::LeaveIfError( iList.Append( item ) ); + + // Artist album unknown (music files for one artist without album attribute) + item.iListIndex = KErrNotFound; + item.iFolderId = EEFolderArtistAlbumUnknown; + item.iParentFolderId = EEFolderArtist; + item.iChildFolderId = EEFolderNone; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = EEIconUnknown; + item.iChildIconId = EEIconMusic; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_UNKNOWN_ALBUM ); + StringLoader::Load( item.iTitle, R_QTN_UNKNOWN_ALBUM ); + User::LeaveIfError( iList.Append( item ) ); + + // Artist unknown (all music files without artist attribute) + item.iListIndex = KErrNotFound; + item.iFolderId = EEFolderArtistUnknown; + item.iParentFolderId = EEFolderArtistRoot; + item.iChildFolderId = EEFolderNone; + item.iPersistent = ETrue; + item.iHidden = EFalse; + item.iIconId = EEIconUnknown; + item.iChildIconId = EEIconMusic; + item.iUnknownCount = KErrNotFound; + StringLoader::Load( item.iText, R_QTN_UNKNOWN_ARTIST ); + StringLoader::Load( item.iTitle, R_QTN_UNKNOWN_ARTIST ); + User::LeaveIfError( iList.Append( item ) ); + } + + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogState::Panic +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialogState::Panic( TInt aReason ) + { + _LIT( KPanicCategory, "CMediaFileDialogState" ); + + User::Panic( KPanicCategory, aReason ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogState::PrintCurrentFolder (test code) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialogState::PrintCurrentFolder() + { + TBuf buf; + + GetFolderTypeText( buf, iCurrentFolderId ); + User::InfoPrint( buf ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogState::GetFolderTypeText (test code) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialogState::GetFolderTypeText(TDes& aText, TInt aType) + { + switch (aType) + { + case EEFolderRoot: + aText = _L("EFolderRoot"); + break; + case EEFolderTones: + aText = _L("EFolderTones"); + break; + case EEFolderMusic: + aText = _L("EFolderMusic"); + break; + case EEFolderVideos: + aText = _L("EFolderVideos"); + break; + case EEFolderRecordings: + aText = _L("EFolderRecordings"); + break; + case EEFolderSearch: + aText = _L("EEFolderSearch"); + break; + + case EEFolderRecent: + aText = _L("EFolderRecent"); + break; + + + case EEFolderArtistRoot: + aText = _L("EFolderArtistRoot"); + break; + case EEFolderArtist: + aText = _L("EFolderArtist"); + break; + case EEFolderArtistUnknown: + aText = _L("EFolderArtistUnknown"); + break; + case EEFolderArtistAll: + aText = _L("EEFolderArtistAll"); + break; + case EEFolderArtistAlbum: + aText = _L("EEFolderArtistAlbum"); + break; + case EEFolderArtistAlbumUnknown: + aText = _L("EEFolderArtistAlbumUnknown"); + break; + + + case EEFolderAllMusic: + aText = _L("EFolderAllMusic"); + break; + + case EEFolderAlbumRoot: + aText = _L("EFolderAlbumRoot"); + break; + case EEFolderAlbum: + aText = _L("EFolderAlbum"); + break; + case EEFolderAlbumUnknown: + aText = _L("EFolderAlbumUnknown"); + break; + + case EEFolderGenreRoot: + aText = _L("EFolderGenreRoot"); + break; + case EEFolderGenre: + aText = _L("EFolderGenre"); + break; + case EEFolderGenreUnknown: + aText = _L("EFolderGenreUnknown"); + break; + + case EEFolderComposerRoot: + aText = _L("EFolderComposerRoot"); + break; + case EEFolderComposer: + aText = _L("EFolderComposer"); + break; + case EEFolderComposerUnknown: + aText = _L("EFolderComposerUnknown"); + break; + + case EEFolderUnknown: + aText = _L("EFolderUnknown"); + break; + + case EEFolderNone: + aText = _L("EFolderNone"); + break; + + default: + aText = _L("### unknown ###"); + break; + } + } + + + + + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Src/mediafiledialogutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Src/mediafiledialogutils.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,1132 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Basic functionality of MediaFileList. +* +*/ + + + +// INCLUDE FILES + +#include "mediafiledialogutils.h" + + +#include // bafl.lib +#include +#include +#include + +#include // CAknNavigationDecorator +#include // CAknNaviLabel +#include // CAknTitlePane +#include +#include +#include // AknsUtils + +// for CWebBrowserLauncher +#include +#include +#include + + +#include +#include // KDC_APP_RESOURCE_DIR + + + + +/****************************************************************************** + * class TMFDialogUtil + ******************************************************************************/ + + +// ----------------------------------------------------------------------------- +// TMFDialogUtil::StrCopy +// +// ----------------------------------------------------------------------------- +// +void TMFDialogUtil::StrCopy( TDes& aTarget, const TDesC& aSource ) + { + TInt len = aTarget.MaxLength(); + if( len < aSource.Length() ) + { + aTarget.Copy( aSource.Left(len) ); + return; + } + aTarget.Copy( aSource ); + } + + +// ----------------------------------------------------------------------------- +// TMFDialogUtil::Panic +// +// ----------------------------------------------------------------------------- +// +void TMFDialogUtil::Panic( TInt aReason ) + { + _LIT( KPanicCategory, "TMFDialogUtil" ); + + User::Panic( KPanicCategory, aReason ); + } + + +//------------------------------------------------------------------------------ +// TMFDialogUtil::ShowInformationNoteL +// +//------------------------------------------------------------------------------ +// +void TMFDialogUtil::ShowInformationNoteL( TInt aResource ) + { + HBufC* hBuf = StringLoader::LoadLC( aResource ); + ShowInformationNoteL( hBuf->Des() ); + CleanupStack::PopAndDestroy( hBuf ); + } + + +//------------------------------------------------------------------------------ +// TMFDialogUtil::ShowInformationNoteL +// +//------------------------------------------------------------------------------ +// +void TMFDialogUtil::ShowInformationNoteL( const TDesC& aText ) + { + CAknInformationNote* queryDialog = new (ELeave) CAknInformationNote( ETrue ); + queryDialog->ExecuteLD( aText ); + } + + +//------------------------------------------------------------------------------ +// TMFDialogUtil::ShowInformationQueryL +// +//------------------------------------------------------------------------------ +// +void TMFDialogUtil::ShowInformationQueryL( const TDesC& aText ) + { + CAknQueryDialog* queryDialog = new (ELeave) CAknQueryDialog; + queryDialog->ExecuteLD( R_INFORMATION_QUERY, aText ); + } + + +//------------------------------------------------------------------------------ +// TMFDialogUtil::ShowInformationQueryL +// +//------------------------------------------------------------------------------ +// +void TMFDialogUtil::ShowInformationQueryL( TInt aResource ) + { + HBufC* hBuf = StringLoader::LoadLC( aResource ); + ShowInformationQueryL( hBuf->Des() ); + CleanupStack::PopAndDestroy( hBuf ); + } + +//------------------------------------------------------------------------------ +// TMFDialogUtil::ShowErrorNoteL +// +//------------------------------------------------------------------------------ +// +void TMFDialogUtil::ShowErrorNoteL( TInt aResource ) + { + HBufC* hBuf = StringLoader::LoadLC( aResource ); + ShowErrorNoteL( hBuf->Des() ); + CleanupStack::PopAndDestroy( hBuf ); + } + + +//------------------------------------------------------------------------------ +// TMFDialogUtil::ShowErrorNoteL +// +//------------------------------------------------------------------------------ +// +void TMFDialogUtil::ShowErrorNoteL( const TDesC& aText ) + { + CAknErrorNote* errorNote = new (ELeave) CAknErrorNote(ETrue); + errorNote->ExecuteLD( aText ); + } + + +//------------------------------------------------------------------------------ +// TMFDialogUtil::ShowErrorNoteL +// +//------------------------------------------------------------------------------ +// +void TMFDialogUtil::ShowErrorNoteL( const TDesC& aText, TInt aError ) + { + _LIT( KFormat, "%S (%d)" ); + + TInt len = aText.Length(); + HBufC* hBuf = HBufC::NewLC( len + KBufSize64 ); + + TPtr ptr = hBuf->Des(); + ptr.Format( KFormat, &aText, aError); + + ShowErrorNoteL( ptr ); + + CleanupStack::PopAndDestroy( hBuf ); + } + +//------------------------------------------------------------------------------ +// ShowNumberQueryL +// +//------------------------------------------------------------------------------ +// +TBool TMFDialogUtil::ShowNumberQueryL( TInt& aNumber, const TDesC& aTitle ) + { + CAknNumberQueryDialog* queryDialog = CAknNumberQueryDialog::NewL(aNumber); + + if ( aTitle.Length() > 1 ) + { + CleanupStack::PushL( queryDialog ); + queryDialog->SetPromptL( aTitle ); + CleanupStack::Pop( queryDialog ); + } + + return queryDialog->ExecuteLD( R_NUMBER_QUERY ); + } + + +// ----------------------------------------------------------------------------- +// TMFDialogUtil::ShowListQueryL +// +// ----------------------------------------------------------------------------- +TBool TMFDialogUtil::ShowListQueryL( const TDesC& aTitle, CDesCArray* aList, + TInt* aSelectedIndex ) + { + CAknListQueryDialog* query = new (ELeave) CAknListQueryDialog( aSelectedIndex ); + CleanupStack::PushL( query ); + + query->PrepareLC( R_LIST_QUERY ); + query->SetItemTextArray( aList ); + query->SetOwnershipType( ELbmDoesNotOwnItemArray ); + CAknPopupHeadingPane* headingPane = query->QueryHeading(); + headingPane->SetTextL( aTitle ); + + CleanupStack::Pop( query ); + + return query->RunLD(); + } + + +// ----------------------------------------------------------------------------- +// TMFDialogUtil::AddResFileL +// +// ----------------------------------------------------------------------------- +// +TInt TMFDialogUtil::AddResFileL() + { + _LIT( KDriveZ, "z:" ); + _LIT( KResFileName, "mediafilelist.rsc" ); + + TFileName fileName; + fileName.Append( KDriveZ ); + fileName.Append( KDC_RESOURCE_FILES_DIR ); + fileName.Append( KResFileName ); + + CEikonEnv* env = CEikonEnv::Static(); + BaflUtils::NearestLanguageFile( env->FsSession(), fileName ); + + return env->AddResourceFileL( fileName ); + } + + +// ---------------------------------------------------------------------------- +// TMFDialogUtil::SetIconFileNameL +// +// ---------------------------------------------------------------------------- +// +void TMFDialogUtil::SetIconFileNameL( const TDesC& aName, TDes& aFullName ) + { + _LIT( KDriveZ, "z:" ); + + aFullName = KNullDesC; + + aFullName.Append( KDriveZ ); + aFullName.Append( KDC_APP_RESOURCE_DIR ); + aFullName.Append( aName ); + } + + +// ----------------------------------------------------------------------------- +// TMFDialogUtil::CreateImageL +// +// ----------------------------------------------------------------------------- +// +CEikImage* TMFDialogUtil::CreateImageLC( TAknsItemID aId, const TDesC& aFileName, + TInt aFileBitmapId, TInt aFileMaskId ) + { + CFbsBitmap* bitmap1 = NULL; + CFbsBitmap* bitmap2 = NULL; + + CEikImage* image = new (ELeave) CEikImage; + CleanupStack::PushL( image ); + + AknsUtils::CreateIconLC( AknsUtils::SkinInstance(), aId, bitmap1, bitmap2, + aFileName, aFileBitmapId, aFileMaskId ); + image->SetPicture( bitmap1, bitmap2 ); + CleanupStack::Pop(2); // bitmap1 bitmap2 + + return image; + } + +// ------------------------------------------------------------------------------- +// TMFDialogUtil::IsEmpty +// +// Function returns ETrue if string only contains white space or has +// no characters. +// ------------------------------------------------------------------------------- +// +TBool TMFDialogUtil::IsEmpty( const TDesC& aText ) + { + TInt len = aText.Length(); + + for ( TInt i=0; iConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// +// ----------------------------------------------------------------------------- +// +CMFActiveCaller::~CMFActiveCaller() + { + Cancel(); + iTimer.Close(); + } + + +// ----------------------------------------------------------------------------- +// CMFActiveCaller::CMFActiveCaller +// +// ----------------------------------------------------------------------------- +// +CMFActiveCaller::CMFActiveCaller(MMFActiveCallerObserver* aObserver) : CActive(CActive::EPriorityStandard) + { + iObserver = aObserver; + } + + +// ----------------------------------------------------------------------------- +// CMFActiveCaller::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CMFActiveCaller::ConstructL() + { + User::LeaveIfError( iTimer.CreateLocal() ); + CActiveScheduler::Add( this ); + } + + +// ----------------------------------------------------------------------------- +// CMFActiveCaller::DoCancel +// +// ----------------------------------------------------------------------------- +// +void CMFActiveCaller::DoCancel() + { + iTimer.Cancel(); + } + + +// ----------------------------------------------------------------------------- +// CMFActiveCaller::RunL +// +// ----------------------------------------------------------------------------- +// +void CMFActiveCaller::RunL() + { + TRAP_IGNORE( iObserver->HandleActiveCallL( iCallId ) ); + } + + +// ----------------------------------------------------------------------------- +// CMFActiveCaller::Request +// +// This function calls this class RunL. +// ----------------------------------------------------------------------------- +// +void CMFActiveCaller::Request() + { + Cancel(); + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + } + + +// ----------------------------------------------------------------------------- +// CMFActiveCaller::Start +// +// ----------------------------------------------------------------------------- +// +void CMFActiveCaller::Start( TInt aCallId, TInt aMilliseconds ) + { + const TInt KThousand = 1000; + Cancel(); + + iCallId = aCallId; + + if ( aMilliseconds <= 0 ) + { + Request(); // no delay - complete asap + } + else + { + iTimer.After( iStatus, aMilliseconds*KThousand ); + SetActive(); + } + } + + +// ----------------------------------------------------------------------------- +// CMFActiveCaller::Stop +// +// ----------------------------------------------------------------------------- +// +void CMFActiveCaller::Stop() + { + Cancel(); + } + + + + +/******************************************************************************* + * class CNaviPaneHandler + *******************************************************************************/ + + +// ----------------------------------------------------------------------------- +// Destructor +// +// ----------------------------------------------------------------------------- +// +CNaviPaneHandler::~CNaviPaneHandler() + { + if ( iNaviDecorator ) + { + if ( iNaviPane && iNavidecoratorPushed ) + { + iNaviPane->Pop( iNaviDecorator ); + } + + delete iNaviDecorator; + } + + if ( iNaviPane && iNavipanePushed ) + { + iNaviPane->Pop(); // restore previous navi pane + } + } + + +// ----------------------------------------------------------------------------- +// CNaviPaneHandler::CNaviPaneHandler +// +// ----------------------------------------------------------------------------- +// +CNaviPaneHandler::CNaviPaneHandler( CEikStatusPane* aStatusPane ) : iStatusPane( aStatusPane ) + { + iNavidecoratorPushed = EFalse; + iNavipanePushed = EFalse; + + if ( iStatusPane ) + { + TRAP_IGNORE( iNaviPane = (CAknNavigationControlContainer*)iStatusPane->ControlL(TUid::Uid(EEikStatusPaneUidNavi)) ); + } + } + + +// ---------------------------------------------------------------------------- +// CNaviPaneHandler::SetNaviPaneTitleL +// +// ---------------------------------------------------------------------------- +// +void CNaviPaneHandler::SetNaviPaneTitleL(const TDesC& aTitle) + { + if ( !iStatusPane || !iNaviPane ) + { + return; + } + + if ( iNaviDecorator ) + { + CAknNaviLabel* naviLabel = static_cast(iNaviDecorator->DecoratedControl()); + if ( naviLabel ) + { + naviLabel->SetTextL( aTitle ); + iNaviDecorator->DrawDeferred(); + } + } + else + { + iNaviDecorator = iNaviPane->CreateNavigationLabelL( aTitle ) ; + iNaviPane->PushL( *iNaviDecorator ); // activate navi label in navi pane + iNavidecoratorPushed = ETrue; + } + } + + +// ---------------------------------------------------------------------------- +// CNaviPaneHandler::StoreNavipaneL +// +// ---------------------------------------------------------------------------- +// +void CNaviPaneHandler::StoreNavipaneL() + { + if ( !iNaviPane || !iStatusPane || iNavipanePushed ) + { + return; + } + + if ( iStatusPane->PaneCapabilities(TUid::Uid(EEikStatusPaneUidTitle)).IsPresent() ) + { + iNaviPane->PushDefaultL(); + iNavipanePushed = ETrue; + } + } + + + + +/******************************************************************************* + * class CStatusPaneHandler + *******************************************************************************/ + +// ----------------------------------------------------------------------------- +// CStatusPaneHandler::NewL +// +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CStatusPaneHandler* CStatusPaneHandler::NewL( CAknAppUi* aAppUi ) + { + CStatusPaneHandler* self = new (ELeave) CStatusPaneHandler( aAppUi ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// +// ----------------------------------------------------------------------------- +// +CStatusPaneHandler::~CStatusPaneHandler() + { + TRAP_IGNORE( RestoreOriginalTitleL() ); + + delete iNaviPaneHandler; + } + + +// ----------------------------------------------------------------------------- +// CStatusPaneHandler::ConstructL +// +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CStatusPaneHandler::ConstructL() + { + iNaviPaneHandler = new (ELeave) CNaviPaneHandler( iAppUi->StatusPane() ); + } + + +// ----------------------------------------------------------------------------- +// CStatusPaneHandler::CStatusPaneHandler +// +// ----------------------------------------------------------------------------- +// +CStatusPaneHandler::CStatusPaneHandler( CAknAppUi* aAppUi ) : iAppUi(aAppUi ) + { + __ASSERT_ALWAYS( iAppUi, TMFDialogUtil::Panic( KErrGeneral ) ); + + iOriginalTitleStored = EFalse; + iOriginalTitle = KNullDesC; + } + + +// ---------------------------------------------------------------------------- +// CStatusPaneHandler::GetTitleL +// +// ---------------------------------------------------------------------------- +// +TBool CStatusPaneHandler::GetTitleL( CAknAppUi* aAppUi, TDes& aTitle ) + { + aTitle = KNullDesC; + + CEikStatusPane* statusPane = aAppUi->StatusPane(); + if (statusPane && statusPane->PaneCapabilities( TUid::Uid( EEikStatusPaneUidTitle ) ).IsPresent() ) + { + CAknTitlePane* titlePane = static_cast + ( statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); + if ( titlePane->Text() ) + { + TMFDialogUtil::StrCopy( aTitle, *titlePane->Text() ); + return ETrue; + } + } + + return EFalse; + } + + +// ---------------------------------------------------------------------------- +// CStatusPaneHandler::SetTitleL +// +// ---------------------------------------------------------------------------- +// +TBool CStatusPaneHandler::SetTitleL( CAknAppUi* aAppUi, const TDesC& aTitle ) + { + CEikStatusPane* statusPane = aAppUi->StatusPane(); + if ( statusPane && statusPane->PaneCapabilities( TUid::Uid( EEikStatusPaneUidTitle ) ).IsPresent() ) + { + CAknTitlePane* titlePane = static_cast + ( statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); + if ( titlePane->Text() ) + { + titlePane->SetTextL( aTitle ); + return ETrue; + } + } + return EFalse; + } + + +// ---------------------------------------------------------------------------- +// CStatusPaneHandler::SetNaviPaneTitleL +// +// ---------------------------------------------------------------------------- +// +void CStatusPaneHandler::SetNaviPaneTitleL( const TDesC& aTitle ) + { + iNaviPaneHandler->SetNaviPaneTitleL( aTitle ); + } + + +// ---------------------------------------------------------------------------- +// CStatusPaneHandler::SetNaviPaneTitle +// +// ---------------------------------------------------------------------------- +// +void CStatusPaneHandler::SetNaviPaneTitle( const TDesC& aTitle ) + { + TRAP_IGNORE( iNaviPaneHandler->SetNaviPaneTitleL( aTitle ) ); + } + + +// ---------------------------------------------------------------------------- +// CStatusPaneHandler::SetNaviPaneTitleL +// +// ---------------------------------------------------------------------------- +// +void CStatusPaneHandler::SetNaviPaneTitleL( TInt aResource ) + { + HBufC* hBuf = StringLoader::LoadLC( aResource) ; + SetNaviPaneTitleL( hBuf->Des() ); + CleanupStack::PopAndDestroy( hBuf ); + } + + +// ---------------------------------------------------------------------------- +// CStatusPaneHandler::StoreNavipaneL +// +// ---------------------------------------------------------------------------- +// +void CStatusPaneHandler::StoreNavipaneL() + { + iNaviPaneHandler->StoreNavipaneL(); + } + + +// ---------------------------------------------------------------------------- +// CStatusPaneHandler::StoreOriginalTitleL +// +// ---------------------------------------------------------------------------- +// +void CStatusPaneHandler::StoreOriginalTitleL() + { + TBool ret = GetTitleL( iAppUi, iOriginalTitle ); + + if ( ret ) + { + iOriginalTitleStored = ETrue; + } + } + + +// ---------------------------------------------------------------------------- +// CStatusPaneHandler::RestoreOriginalTitleL +// +// ---------------------------------------------------------------------------- +// +void CStatusPaneHandler::RestoreOriginalTitleL() + { + if ( iOriginalTitleStored ) + { + SetTitleL( iAppUi, iOriginalTitle ); + } + } + + +// ---------------------------------------------------------------------------- +// CStatusPaneHandler::SetTitleL +// +// ---------------------------------------------------------------------------- +// +void CStatusPaneHandler::SetTitleL( const TDesC& aText ) + { + if ( iOriginalTitleStored ) + { + SetTitleL( iAppUi, aText ); + } + } + + +// ---------------------------------------------------------------------------- +// CStatusPaneHandler::SetTitleL +// +// ---------------------------------------------------------------------------- +// +void CStatusPaneHandler::SetTitleL( TInt aResourceId ) + { + HBufC* hBuf = StringLoader::LoadLC( aResourceId ); + SetTitleL( hBuf->Des() ); + CleanupStack::PopAndDestroy( hBuf ); + } + + + +/****************************************************************************** + * class CDriveUtil + ******************************************************************************/ + + +// ----------------------------------------------------------------------------- +// CDriveUtil::NewL +// +// ----------------------------------------------------------------------------- +// +CDriveUtil* CDriveUtil::NewL() + { + CDriveUtil* self = new (ELeave) CDriveUtil(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// +// ----------------------------------------------------------------------------- +// +CDriveUtil::~CDriveUtil() + { + iFsSession.Close(); + } + + +// ----------------------------------------------------------------------------- +// CDriveUtil::CDriveUtil +// +// ----------------------------------------------------------------------------- +// +CDriveUtil::CDriveUtil() + { + } + + +// ----------------------------------------------------------------------------- +// CDriveUtil::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CDriveUtil::ConstructL() + { + User::LeaveIfError( iFsSession.Connect() ); + } + + +// ----------------------------------------------------------------------------- +// CDriveUtil::IsRom +// +// ----------------------------------------------------------------------------- +// +TBool CDriveUtil::IsRom( const TDesC& aFullPath ) + { + const TUint KMassStorageBits = DriveInfo::EDriveRom; + + TDriveUnit drive( aFullPath ); + TUint driveStatus( 0 ); + + TInt err = DriveInfo::GetDriveStatus( iFsSession, drive, driveStatus ); + if ( err != KErrNone ) + { + return EFalse; + } + + if ( (driveStatus & KMassStorageBits) == KMassStorageBits ) + { + return ETrue; + } + + return EFalse; + } + + +// ----------------------------------------------------------------------------- +// CDriveUtil::IsMassStorage +// +// ----------------------------------------------------------------------------- +// +TBool CDriveUtil::IsMassStorage( const TDesC& aFullPath ) + { + const TUint KMassStorageBits = DriveInfo::EDriveInternal | + DriveInfo::EDriveExternallyMountable; + + TDriveUnit drive( aFullPath ); + TUint driveStatus( 0 ); + + TInt err = DriveInfo::GetDriveStatus( iFsSession, drive, driveStatus ); + if ( err != KErrNone ) + { + return EFalse; + } + + if ( (driveStatus & KMassStorageBits) == KMassStorageBits ) + { + return ETrue; + } + + return EFalse; + } + + +// ----------------------------------------------------------------------------- +// CDriveUtil::IsMemoryCard +// +// ----------------------------------------------------------------------------- +// +TBool CDriveUtil::IsMemoryCard( const TDesC& aFullPath ) + { + const TUint KMemoryCardBits = DriveInfo::EDriveRemovable | + DriveInfo::EDriveExternallyMountable; + + TDriveUnit drive( aFullPath ); + TUint driveStatus( 0 ); + + TInt err = DriveInfo::GetDriveStatus( iFsSession, drive, driveStatus ); + if ( err != KErrNone ) + { + return EFalse; + } + + if ( (driveStatus & KMemoryCardBits) == KMemoryCardBits ) + { + return ETrue; + } + + return EFalse; + } + + + +/****************************************************************************** + * class CMimeTypeList + ******************************************************************************/ + + + +// ----------------------------------------------------------------------------- +// CMimeTypeList::NewL +// +// ----------------------------------------------------------------------------- +// +CMimeTypeList* CMimeTypeList::NewL() + { + CMimeTypeList* object = new (ELeave) CMimeTypeList; + return object; + } + +// ----------------------------------------------------------------------------- +// CMimeTypeList::CMimeTypeList +// +// ----------------------------------------------------------------------------- +// +CMimeTypeList::CMimeTypeList() + { + } + +// ----------------------------------------------------------------------------- +// CMimeTypeList::~CMimeTypeList +// +// ----------------------------------------------------------------------------- +// +CMimeTypeList::~CMimeTypeList() + { + iList.Close(); + } + + +// ----------------------------------------------------------------------------- +// CMimeTypeList::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CMimeTypeList::ConstructL() + { + } + + + +// ----------------------------------------------------------------------------- +// CMimeTypeList::ResetL +// +// ----------------------------------------------------------------------------- +// +void CMimeTypeList::ResetL() + { + iList.Reset(); + } + + +// ----------------------------------------------------------------------------- +// CMimeTypeList::Count +// +// ----------------------------------------------------------------------------- +// +TInt CMimeTypeList::Count() + { + return iList.Count(); + } + + +// ----------------------------------------------------------------------------- +// CMimeTypeList::Compare +// +// ----------------------------------------------------------------------------- +// +TInt CMimeTypeList::Compare(const TFileName& aFirst, const TFileName& aSecond) + { + return aFirst.Compare( aSecond ); + } + + +// ----------------------------------------------------------------------------- +// CMimeTypeList::AddMimeTypeL +// +// ----------------------------------------------------------------------------- +// +void CMimeTypeList::AddMimeTypeL( const TDesC& aText ) + { + if ( aText.Length() > KMaxFileName || aText.Length() == 0 ) + { + User::Leave( KErrArgument ); + } + + TLinearOrder sortFunction( Compare ); + + TInt err = iList.InsertInOrder( aText, sortFunction ); + + if ( err != KErrNone && err != KErrAlreadyExists ) + { + User::Leave( err ); + } + } + + +// ----------------------------------------------------------------------------- +// CMimeTypeList::FindMimeTypeL +// +// ----------------------------------------------------------------------------- +// +TBool CMimeTypeList::FindMimeTypeL( const TDesC& aText ) + { + TInt count = Count(); + + for ( TInt i=0; i= 0 && aIndex < count, TMFDialogUtil::Panic( KErrGeneral ) ); + + return iList[aIndex]; + } + + + + +/****************************************************************************** + * class CWebBrowserLauncher + ******************************************************************************/ + + +// ----------------------------------------------------------------------------- +// CWebBrowserLauncher::CWebBrowserLauncher +// +// ----------------------------------------------------------------------------- +// +CWebBrowserLauncher::CWebBrowserLauncher() + { + } + +// ----------------------------------------------------------------------------- +// CWebBrowserLauncher::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CWebBrowserLauncher::ConstructL() + { + iBrowserLauncher = CBrowserLauncher::NewL(); + iDocumentHandler = CDocumentHandler::NewL( CEikonEnv::Static()->Process() ); + } + +// ----------------------------------------------------------------------------- +// CWebBrowserLauncher::NewLC +// +// ----------------------------------------------------------------------------- +// +CWebBrowserLauncher* CWebBrowserLauncher::NewLC() + { + CWebBrowserLauncher* self = new( ELeave ) CWebBrowserLauncher(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// CWebBrowserLauncher::~CWebBrowserLauncher +// +// ----------------------------------------------------------------------------- +// +CWebBrowserLauncher::~CWebBrowserLauncher() + { + delete iDocumentHandler; + delete iBrowserLauncher; + } + + +// ----------------------------------------------------------------------------- +// CWebBrowserLauncher::HandleContentL +// +// ----------------------------------------------------------------------------- +// +TBool CWebBrowserLauncher::HandleContentL( const TDesC& aFileName, + const CAiwGenericParamList& aParamList, + TBool& aContinue ) + { + TBool isSaved = EFalse; + + if ( aParamList.Count() > 0 ) + { + TInt index = 0; + aParamList.FindFirst( index, EGenericParamFileSaved ); + + if( index != KErrNotFound ) + { + isSaved = ( aParamList[ index ].Value().AsTInt32() ); + } + } + + // Tone is NOT yet saved by a browser, save it by using DocHandler + if( !isSaved ) + { + //Let documenthandler to find out the datatype + TDataType nullType; + iDocumentHandler->CopyL( aFileName, KNullDesC, nullType, NULL ); + } + + aContinue = ETrue; + + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// CWebBrowserLauncher::HandleContentL +// +// ----------------------------------------------------------------------------- +// +TAny* CWebBrowserLauncher::DownloadedContentHandlerReserved1( TAny* /*aAnyParam*/ ) + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// CWebBrowserLauncher::LaunchBrowserL +// +// ----------------------------------------------------------------------------- +// +void CWebBrowserLauncher::LaunchBrowserL() + { + iBrowserLauncher->LaunchBrowserSyncEmbeddedL( KFavouritesAudioContextId ); + } + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Src/mediafilehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Src/mediafilehandler.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,3740 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Used to interact with the MDE. +* +*/ + + + + +#include "mediafilehandler.h" +#include "mediafilelistdebug.h" +#include "mediafiledialogstate.h" +#include "mediafilelist.h" + +#include +#include + + + + +/****************************************************************************** + * class CMediaFileData + ******************************************************************************/ + + + +// ----------------------------------------------------------------------------- +// CMediaFileData::NewL +// +// ----------------------------------------------------------------------------- +// +CMediaFileData* CMediaFileData::NewL() + { + CMediaFileData* self = new (ELeave) CMediaFileData(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// +// ----------------------------------------------------------------------------- +// +CMediaFileData::~CMediaFileData() + { + delete iFullName; + delete iName; + delete iArtist; + delete iAlbum; + delete iGenre; + delete iComposer; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileData::CMediaFileData +// +// ----------------------------------------------------------------------------- +// +CMediaFileData::CMediaFileData() + { + iMediaFileType = KErrNotFound; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileData::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileData::ConstructL() + { + iFullName = HBufC::NewL( 0 ); + iName = HBufC::NewL( 0 ); + iArtist = HBufC::NewL( 0 ); + iAlbum = HBufC::NewL( 0 ); + iGenre = HBufC::NewL( 0 ); + iComposer = HBufC::NewL( 0 ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileData::Attr +// +// ----------------------------------------------------------------------------- +// +const TDesC& CMediaFileData::Attr( TInt aAttr ) + { + if ( aAttr == CMediaFileHandler::EAttrFullName ) + { + return *iFullName; + } + if ( aAttr == CMediaFileHandler::EAttrSongName ) + { + return *iName; + } + if ( aAttr == CMediaFileHandler::EAttrArtist ) + { + return *iArtist; + } + if ( aAttr == CMediaFileHandler::EAttrAlbum ) + { + return *iAlbum; + } + if ( aAttr == CMediaFileHandler::EAttrGenre ) + { + return *iGenre; + } + if ( aAttr == CMediaFileHandler::EAttrComposer ) + { + return *iComposer; + } + + return KNullDesC; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileData::SetAttrL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileData::SetAttrL( TInt aAttr, const TDesC& aValue ) + { + if ( aAttr == CMediaFileHandler::EAttrFullName ) + { + delete iFullName; + iFullName = NULL; + iFullName = aValue.AllocL(); + } + if ( aAttr == CMediaFileHandler::EAttrSongName ) + { + delete iName; + iName = NULL; + iName = aValue.AllocL(); + + } + if ( aAttr == CMediaFileHandler::EAttrArtist ) + { + delete iArtist; + iArtist = NULL; + iArtist = aValue.AllocL(); + } + if ( aAttr == CMediaFileHandler::EAttrAlbum ) + { + delete iAlbum; + iAlbum = NULL; + iAlbum = aValue.AllocL(); + } + if ( aAttr == CMediaFileHandler::EAttrGenre ) + { + delete iGenre; + iGenre = NULL; + iGenre = aValue.AllocL(); + } + if ( aAttr == CMediaFileHandler::EAttrComposer ) + { + delete iComposer; + iComposer = NULL; + iComposer = aValue.AllocL(); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileData::GetAttr +// +// ----------------------------------------------------------------------------- +// +void CMediaFileData::GetAttr( TInt aAttr, TDes& aValue ) + { + if ( aAttr == CMediaFileHandler::EAttrFullName ) + { + TMFDialogUtil::StrCopy( aValue, iFullName->Des() ); + } + else if ( aAttr == CMediaFileHandler::EAttrSongName ) + { + TMFDialogUtil::StrCopy( aValue, iName->Des() ); + } + else if ( aAttr == CMediaFileHandler::EAttrArtist ) + { + TMFDialogUtil::StrCopy( aValue, iArtist->Des() ); + } + else if ( aAttr == CMediaFileHandler::EAttrAlbum ) + { + TMFDialogUtil::StrCopy( aValue, iAlbum->Des() ); + } + else if ( aAttr == CMediaFileHandler::EAttrGenre ) + { + TMFDialogUtil::StrCopy( aValue, iGenre->Des() ); + } + else if ( aAttr == CMediaFileHandler::EAttrComposer ) + { + TMFDialogUtil::StrCopy( aValue, iComposer->Des() ); + } + else + { + aValue = KNullDesC; + } + } + + +/****************************************************************************** + * class CMediaFileHandler + ******************************************************************************/ + + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::NewL +// +// ----------------------------------------------------------------------------- +// +CMediaFileHandler* CMediaFileHandler::NewL() + { + CMediaFileHandler* self = new (ELeave) CMediaFileHandler(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// +// ----------------------------------------------------------------------------- +// +CMediaFileHandler::~CMediaFileHandler() + { + delete iSearchList; + + delete iQueryCaller; + delete iObjectNotificationCaller; + + delete iDriveUtil; + delete iExcludedMimeTypes; + delete iIdle; + + delete iQuery; + delete iArtistQuery; + delete iSession; + + delete iRomFileList; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::CMediaFileHandler +// +// ----------------------------------------------------------------------------- +// +CMediaFileHandler::CMediaFileHandler() + { + iSessionOpen = EFalse; + iObserverCallEnabled = ETrue; + + iMaxFileSize = KErrNotFound; + iQueryId = KErrNotFound; + iQueryType = KErrNotFound; + iQueryError = KErrNone; + iQueryEvent = KErrNotFound; + iVideoSearchDisabled = EFalse; + + iMediaFileCounter = 0; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::ConstructL() + { + iSession = CMdESession::NewL( *this ); + iSearchList = CSearchList::NewL(); + + iQueryCaller = CMFActiveCaller::NewL( this ); + iObjectNotificationCaller = CMFActiveCaller::NewL( this ); + + iDriveUtil = CDriveUtil::NewL(); + iArtistQuery = CArtistQuery::NewL(); + iExcludedMimeTypes = CMimeTypeList::NewL(); + + iRomFileList = CRomFileList::NewL(); + iQueryinProgress = EFalse; + iRomScanState = MMediaFileHandlerObserver::ENoneRomScan; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::SetAttr +// +// ----------------------------------------------------------------------------- +void CMediaFileHandler::SetAttrL( TInt aAttr, TInt aValue ) + { + switch ( aAttr ) + { + case CMediaFileList::EAttrFileSize: + { + iMaxFileSize = aValue; + break; + } + case CMediaFileList::EAttrExcludeFolder: + { + if ( aValue == CMediaFileList::EFolderVideos ) + { + iVideoSearchDisabled = ETrue; + } + break; + } + default: + { + break; + } + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::SetAttrL +// +// ----------------------------------------------------------------------------- +void CMediaFileHandler::SetAttrL( TInt aAttr, const TDesC& aValue ) + { + if ( aAttr == CMediaFileList::EAttrExcludeMimeType ) + { + iExcludedMimeTypes->AddMimeTypeL( aValue ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::SetAttr +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::SetAttrL( TInt /*aAttr*/, TAny* /*aValue*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::HandleSessionOpened (from MMdESessionObserver) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::HandleSessionOpened( CMdESession& /*aSession*/, TInt aError ) + { + if ( aError != KErrNone ) + { + delete iSession; + iSession = NULL; + iSessionOpen = EFalse; + } + else + { + iSessionOpen = ETrue; + + TRAP_IGNORE( AddObjectObserverL() ); + } + + CallObserver( MMediaFileHandlerObserver::EInitComplete, aError ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::AddObjectObserverL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::AddObjectObserverL() + { + if ( iSessionOpen ) + { + TUint32 notificationType = ENotifyAdd | ENotifyModify | ENotifyRemove; + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + iSession->AddObjectObserverL( *this, NULL, notificationType, &defNS ); + + iSession->AddObjectPresentObserverL( *this ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::HandleSessionError (from MMdESessionObserver) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::HandleSessionError( CMdESession& /*aSession*/, TInt aError ) + { + if ( aError == KErrNone ) + { + return; + } + + delete iSession; + iSession = NULL; + iSessionOpen = EFalse; + + CallObserver( MMediaFileHandlerObserver::EError, aError ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::HandleQueryNewResults (from MMdEQueryObserver) +// +// This observer function is called during query. Calling frequency is defined +// in second parameter of CMdEQuery::FindL. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::HandleQueryNewResults( CMdEQuery& /*aQuery*/, + TInt /*aFirstNewItemIndex*/, + TInt /*aNewItemCount*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::HandleObjectNotification (MMdEObjectObserver) +// +// Called when metadata database changes. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::HandleObjectNotification( CMdESession& /*aSession*/, + TObserverNotificationType aType, + const RArray& aObjectIdArray ) + { + const TInt KObserverCallStep = 100; + + if ( aType == ENotifyAdd || aType == ENotifyModify || aType == ENotifyRemove ) + { + if ( iObserver ) + { + TInt count = aObjectIdArray.Count(); + FLOG( _L("CMediaFileHandler::HandleObjectNotification: count is %d"), count ); + + iMediaFileCounter = iMediaFileCounter + count; + if ( iMediaFileCounter >= KObserverCallStep ) + { + iMediaFileCounter = 0; + TRAP_IGNORE( iObserver->HandleMFEventL( + MMediaFileHandlerObserver::EMediaFileChanged, KErrNone ) ); + } + else + { + // delayed call to avoid many consecutive observer calls + CallObserverWithDelay(); + } + } + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::HandleObjectPresentNotification (MMdEObjectPresentObserver) +// +// Called when previously used memory card is inserted and hidden +// metadata files are made present again. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::HandleObjectPresentNotification( CMdESession& /*aSession*/, + TBool /*aPresent*/, const RArray& aObjectIdArray ) + { + if ( iObserver ) + { + TInt count = aObjectIdArray.Count(); + FLOG( _L("CMediaFileHandler::HandleObjectPresentNotification: count is %d"), count ); + + // delayed call to avoid many consecutive observer calls + CallObserverWithDelay(); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::HandleQueryCompleted (MMdEQueryObserver) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::HandleQueryCompleted( CMdEQuery& aQuery, TInt aError ) + { + + TInt err = KErrNone; + TRAP( err, HandleQueryCompletedL( aQuery, aError ) ); + + if ( err == KErrCancel ) + { + CallObserver( MMediaFileHandlerObserver::EQueryCanceled, KErrNone ); + } + else if ( err != KErrNone ) + { + iSearchList->Reset(); + TRAP_IGNORE( iArtistQuery->ResetL() ); + + CallObserver( MMediaFileHandlerObserver::EError, err ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::HandleQueryCompletedL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::HandleQueryCompletedL( CMdEQuery& /*aQuery*/, TInt aError ) + { + TInt err = aError; + + if ( !iQuery && ( iRomScanState != MMediaFileHandlerObserver::ERomScanComplete + && (iQueryType == EQueryTone || iQueryType == ESearchTones )) ) + { + err = KErrGeneral; + } + if ( err == KErrCancel ) + { + if ( iQueryType == ESearchAudio || iQueryType == ESearchMusic || + iQueryType == ESearchTones || iQueryType == ESearchVideo ) + { + iSearchList->Reset(); + } + User::Leave( err ); + } + if ( err != KErrNone ) + { + User::Leave( err ); + } + + + iSearchList->SetSession( iSession ); + + TQueryResultMode resultMode = EQueryResultModeItem; + if ( iQuery ) + { + resultMode = iQuery->ResultMode(); + } + + + if ( resultMode == EQueryResultModeDistinctValues ) + { + iSearchList->Reset(); + iSearchList->TakeDistinctResultL( iQuery, KErrNotFound ); + iSearchList->SetSearchId( iQueryId ); + iSearchList->Sort(); + + CallObserver( MMediaFileHandlerObserver::EQueryComplete, KErrNone ); + } + else if ( resultMode == EQueryResultModeCount ) + { + // EQueryResultModeCount currently not used + CallObserver( MMediaFileHandlerObserver::EUnknownQueryComplete, KErrNone ); + } + else if ( resultMode == EQueryResultModeItem ) + { + if ( iQueryType == ESearchAudio ) + { + // ESearchAudio currently not used + iSearchList->Reset(); + iSearchList->TakeResultL( iQuery, EMediaTypeMusic ); + iSearchList->Sort(); + iSearchList->SetSearchId( iQueryId ); + + CallObserver( MMediaFileHandlerObserver::EQueryComplete, KErrNone ); + + /* + // ESearchAudio currently not used + iSearchList->Reset(); + iSearchList->TakeResultL( iQuery, EMediaTypeMusic ); + + delete iIdle; + iIdle = NULL; + iIdle = CIdle::NewL( CActive::EPriorityIdle ); + if ( iIdle ) + { + iIdle->Start( TCallBack( SearchVideo, this ) ); + } + */ + } + else if ( iQueryType == ESearchMusic ) + { + // search is done in 3 steps (music, tones and videos) + iSearchList->Reset(); + iSearchList->TakeResultL( iQuery, EMediaTypeMusic ); + + // call SearchTonesL after short delay (iQuery cannot + // be deleted in this function) + delete iIdle; + iIdle = NULL; + iIdle = CIdle::NewL( CActive::EPriorityIdle ); + if ( iIdle ) + { + iIdle->Start( TCallBack( SearchTones, this ) ); + } + else + { + User::Leave( KErrNoMemory ); + } + } + else if ( iQueryType == ESearchTones ) + { + iSearchList->SearchInToneL( iRomFileList, iSearchText ); + iQueryinProgress = EFalse; + // call SearchVideosL after short delay (iQuery cannot + // be deleted in this function) + delete iIdle; + iIdle = NULL; + iIdle = CIdle::NewL( CActive::EPriorityIdle ); + if ( iIdle ) + { + iIdle->Start( TCallBack( SearchVideo, this ) ); + } + else + { + User::Leave( KErrNoMemory ); + } + } + else if ( iQueryType == ESearchVideo ) + { + iSearchList->TakeResultL( iQuery, EMediaTypeVideo ); + iSearchList->VideoSearchInRomL( iRomFileList, iSearchText ); + iSearchList->Sort(); + iSearchList->SetSearchId( iQueryId ); + + CallObserver( MMediaFileHandlerObserver::EQueryComplete, KErrNone ); + } + + else if ( iQueryType == EQueryArtist ) + { + // store CMdEObjectQuery to avoid multiple queries for one artist + iArtistQuery->SetQuery( iQuery ); + iQuery = NULL; + + iSearchList->Reset(); + iSearchList->TakeArtistResultL( iArtistQuery ); + iSearchList->Sort(); + iSearchList->SetSearchId( iQueryId ); + + CallObserver( MMediaFileHandlerObserver::EQueryComplete, KErrNone ); + } + else if ( iQueryType == EQueryArtistEmpty ) + { + // use previously stored CMdEObjectQuery for artist query + iSearchList->Reset(); + iSearchList->TakeArtistResultL( iArtistQuery ); + iSearchList->Sort(); + iSearchList->SetSearchId( iQueryId ); + + CallObserver( MMediaFileHandlerObserver::EQueryComplete, KErrNone ); + } + else if ( iQueryType == EQueryEmpty ) + { + iSearchList->Reset(); + iSearchList->SetSearchId( iQueryId ); + + CallObserver( MMediaFileHandlerObserver::EQueryComplete, KErrNone ); + } + else if ( iQueryType == EQueryUnknown ) + { + iSearchList->Reset(); + iSearchList->TakeResultL( iQuery, EMediaTypeMusic ); + iSearchList->SetSearchId( iQueryId ); + + CallObserver( MMediaFileHandlerObserver::EUnknownQueryComplete, KErrNone ); + } + else + { + TInt mediaType = MediaType( iQueryType ); + iSearchList->Reset(); + if ( mediaType == EMediaTypeTone ) + { + iSearchList->AddRomItemL( iRomFileList, mediaType ); + } + else + { + iSearchList->TakeResultL( iQuery, mediaType ); + if ( mediaType == EMediaTypeVideo ) + { + iSearchList->AddRomItemL( iRomFileList, mediaType ); + } + } + iQueryinProgress = EFalse; + iSearchList->SetSearchId( iQueryId ); + iSearchList->Sort(); + + CallObserver( MMediaFileHandlerObserver::EQueryComplete, KErrNone ); + } + } + else + { + CallObserver( MMediaFileHandlerObserver::EError, KErrNotSupported ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryArtistL +// +// Finds all music files for one artist. Query results are placed in +// CArtistQuery. +// CArtistQuery can then be used for artist subqueries (all albums, one album, +// all songs, unknown songs). +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::QueryArtistL( TInt aAttr, const TDesC& aArtist, + const TDesC& aAlbum, TBool aRefresh ) + { + LeaveIfSessionClosedL(); + + if ( aAttr != EQueryArtist && aAttr != EQueryArtistAlbum && + aAttr != EQueryArtistAll && aAttr != EQueryArtistUnknown ) + { + User::Leave( KErrNotSupported ); + } + + TBool updateFromDatabase = aRefresh; + if ( iArtistQuery->Artist().Compare( aArtist ) != 0 ) + { + updateFromDatabase = ETrue; + } + + if ( updateFromDatabase ) + { + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& objectDef = defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); + + // set attributes that are included in query result + CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName ); + iQuery->AddPropertyFilterL( &namePropertyDef ); + CMdEPropertyDef& albumPropertyDef = PropertyDefL( EAttrAlbum ); + iQuery->AddPropertyFilterL( &albumPropertyDef ); + + CMdELogicCondition& conditions = iQuery->Conditions(); + CMdEPropertyDef& propertyDef = PropertyDefL( EAttrArtist ); + conditions.AddPropertyConditionL( propertyDef, + ETextPropertyConditionCompareEquals, aArtist ); + + iQuery->SetResultMode( EQueryResultModeItem ); + + iArtistQuery->SetArtistL( aArtist ); + iArtistQuery->SetAlbumL( aAlbum ); + iQuery->FindL(); + iQueryType = EQueryArtist; + } + else + { + iArtistQuery->SetAlbumL( aAlbum ); + QueryArtistEmptyL(); + iQueryType = EQueryArtistEmpty; + } + + iArtistQuery->SetQueryType( aAttr ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryArtistEmptyL +// +// Makes empty query. Query results were previously placed into CArtistQuery. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::QueryArtistEmptyL() + { + LeaveIfSessionClosedL(); + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& objectDef = + defNS.GetObjectDefL( MdeConstants::Object::KBaseObject ); + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); + + iQuery->SetResultMode( EQueryResultModeItem ); + + iQuery->FindL( 1 ); + + iQueryType = EQueryArtistEmpty; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryMusicL +// +// Finds music files. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::QueryMusicL( TInt /*aAttr*/ ) + { + LeaveIfSessionClosedL(); + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& musicObjectDef = + defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, musicObjectDef, this ); + + // set attributes that are included in query result + CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName ); + iQuery->AddPropertyFilterL( &namePropertyDef ); + CMdEPropertyDef& fileTypePropertyDef = PropertyDefL( EAttrMediaType ); + iQuery->AddPropertyFilterL( &fileTypePropertyDef ); + + + CMdELogicCondition& conditions = iQuery->Conditions(); + + // include properties that identify music + IncludeMusicPropertiesL( conditions ); + + // + // example of defining sort order + // + // iQuery->AppendOrderRuleL( TMdEOrderRule( namePropertyDef, ESortAscending ) ); + + iQuery->SetResultMode( EQueryResultModeItem ); + + iQuery->FindL(); + + iQueryType = EQueryMusic; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryMusicL +// +// Finds music files with attibute that matches aFindText. Supported attributes +// are EAttrArtist, EAttrAlbum, EAttrGenre and EAttrComposer. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::QueryMusicL( TInt aAttr, const TDesC& aFindText ) + { + LeaveIfSessionClosedL(); + CheckAttrL( aAttr ); + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& objectDef = + defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); + + // set attributes that are included in query result + CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName ); + iQuery->AddPropertyFilterL( &namePropertyDef ); + + CMdELogicCondition& conditions = iQuery->Conditions(); + CMdEPropertyDef& propertyDef = PropertyDefL( aAttr ); + conditions.AddPropertyConditionL( propertyDef, + ETextPropertyConditionCompareEquals, aFindText ); + IncludeMusicPropertiesL( conditions ); + iQuery->SetResultMode( EQueryResultModeItem ); + + iQuery->FindL(); + + iQueryType = EQueryMusic; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryVideosL +// +// Finds all video files. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::QueryVideosL( TInt /*aAttr*/ ) + { + LeaveIfSessionClosedL(); + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& videoObjectDef = + defNS.GetObjectDefL( MdeConstants::Video::KVideoObject ); + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, videoObjectDef, this ); + + // set attributes that are included in query result + CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName ); + iQuery->AddPropertyFilterL( &namePropertyDef ); + + iQuery->SetResultMode( EQueryResultModeItem ); + + iQuery->FindL(); + + iQueryType = EQueryVideo; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryAttributeValuesL +// +// Finds all different values for aAttr (all artists, albums, genres, +// or composers). +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::QueryAttributeValuesL( TInt aAttr ) + { + LeaveIfSessionClosedL(); + CheckAttrL( aAttr ); + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& objectDef = + defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); + + iQuery->SetResultMode( EQueryResultModeDistinctValues ); + + CMdEPropertyDef& propertyDef = PropertyDefL( aAttr ); + + // distinct query requires exactly one property filter + // (eg. attribute that is included in query result) + CMdELogicCondition& conditions = iQuery->Conditions(); + conditions.AddPropertyConditionL( propertyDef ); + iQuery->AddPropertyFilterL( &propertyDef ); + IncludeMusicPropertiesL( conditions ); + iQuery->FindL(); + + iQueryType = EQueryMusic; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryMusicUnknownL +// +// Find music files that do not have attribute aAttr (eg find all files without +// album attribute). +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::QueryMusicUnknownL( TInt aAttr ) + { + LeaveIfSessionClosedL(); + CheckAttrL( aAttr ); + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& objectDef = + defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); + + iQuery->SetResultMode( EQueryResultModeItem ); + + CMdEPropertyDef& propertyDef = PropertyDefL( aAttr ); + CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName ); + + + CMdELogicCondition& conditions = iQuery->Conditions(); + + // include properties that identify music + IncludeMusicPropertiesL( conditions ); + + // add condition: get music that do not have aAttr attribute + CMdELogicCondition& condition = + conditions.AddLogicConditionL( ELogicConditionOperatorAnd ); + condition.AddPropertyConditionL( propertyDef ); + condition.SetNegate( ETrue ); + + // set attributes that are included in query result + iQuery->AddPropertyFilterL( &namePropertyDef ); + + iQuery->FindL(); + + iQueryType = EQueryMusic; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryMusicUnknownCountL +// +// Find whether there are music files that do not have attribute aAttr +// (eg files without album attribute) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::QueryMusicUnknownCountL( TInt aAttr ) + { + LeaveIfSessionClosedL(); + CheckAttrL( aAttr ); + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& objectDef = + defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); + + iQuery->SetResultMode( EQueryResultModeItem ); + + CMdEPropertyDef& propertyDef = PropertyDefL( aAttr ); + + CMdELogicCondition& conditions = iQuery->Conditions(); + + // include properties that identify music + IncludeMusicPropertiesL( conditions ); + + // add condition: get music that do not have aAttr attribute + CMdELogicCondition& condition = + conditions.AddLogicConditionL( ELogicConditionOperatorAnd ); + condition.AddPropertyConditionL( propertyDef ); + condition.SetNegate( ETrue ); + + + // count 0 or 1 is enough for UI + iQuery->FindL( 1 ); + iQueryType = EQueryUnknown; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryEmptyL +// +// Makes empty query. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::QueryEmptyL() + { + LeaveIfSessionClosedL(); + iQueryType = EQueryEmpty; + if ( iQuery ) + { + iQuery->SetResultMode( EQueryResultModeItem ); + HandleQueryCompleted( *iQuery , KErrNone); + } + else + { + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& objectDef = + defNS.GetObjectDefL( MdeConstants::Object::KBaseObject ); + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); + + iQuery->SetResultMode( EQueryResultModeItem ); + iQuery->FindL( 0 ); + + } + } + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryRomEmptyL( TInt aQueryType ) +// +// Makes empty query. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::QueryRomEmptyL( TInt aQueryType ) + { + LeaveIfSessionClosedL(); + if ( iQuery ) + { + iQueryType = aQueryType; + HandleQueryCompleted( *iQuery , KErrNone); + } + else + { + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& objectDef = + defNS.GetObjectDefL( MdeConstants::Object::KBaseObject ); + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); + + iQuery->SetResultMode( EQueryResultModeItem ); + iQuery->FindL( 0 ); + + iQueryType = aQueryType; + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryRecordingsL +// +// Finds all recordings. +// +// Note: File is considered a recording if file extension is "amr" or "wav" and +// file is not in rom. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::QueryRecordingsL( TInt /*aAttr*/ ) + { + LeaveIfSessionClosedL(); + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& musicObjectDef = + defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, musicObjectDef, this ); + + + // set attributes that are included in query result + CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName ); + iQuery->AddPropertyFilterL( &namePropertyDef ); + + iQuery->SetResultMode( EQueryResultModeItem ); + + CMdEPropertyDef& fileTypeDef = PropertyDefL( EAttrMediaType ); + + + CMdELogicCondition& conditions = iQuery->Conditions(); + CMdEObjectCondition& cond = conditions.AddObjectConditionL( + EObjectConditionCompareUriBeginsWith, KDriveZ ); + cond.SetNegate( ETrue ); + + + CMdELogicCondition& condition = + conditions.AddLogicConditionL( ELogicConditionOperatorOr ); + condition.AddPropertyConditionL( fileTypeDef, + ETextPropertyConditionCompareContains, KMimeTypeAMR ); + condition.AddPropertyConditionL( fileTypeDef, + ETextPropertyConditionCompareContains, KMimeTypeWAV ); + + iQuery->FindL(); + + iQueryType = EQueryRecording; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryTonesL +// +// Finds all tones. +// Note: Audio file is considered a tone if it is not music or video. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::QueryTonesL( TInt /*aAttr*/ ) + { + LeaveIfSessionClosedL(); + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& musicObjectDef = + defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, musicObjectDef, this ); + + + // set attributes that are included in query result + CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName ); + iQuery->AddPropertyFilterL( &namePropertyDef ); + + iQuery->SetResultMode( EQueryResultModeItem ); + + CMdELogicCondition& conditions = iQuery->Conditions(); + ExcludeMusicPropertiesL( conditions ); + + iQuery->FindL(); + + iQueryType = EQueryTone; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryDefaultTonesL +// +// Finds all sound files from rom (nokia default tones). +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::QueryDefaultTonesL( TInt /*aAttr*/ ) + { + + if ( iRomScanState == MMediaFileHandlerObserver::ERomScanComplete ) + { + QueryRomEmptyL( EQueryTone ); + } + else if ( iRomScanState == MMediaFileHandlerObserver::ERomScanInProgress ) + { + iQueryinProgress = ETrue; + } + else + { + //Rom scan not start or failed for some reason + iQueryinProgress = ETrue; + StartRomScaning( EQueryTone ); + } + } + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryDefaultTTonessL +// +// Finds all sound files from rom (nokia default tones). +// ----------------------------------------------------------------------------- +// +//void CMediaFileHandler::QueryDefaultTonesL( TInt /*aAttr*/ ) +// { +// LeaveIfSessionClosedL(); +// +// CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); +// CMdEObjectDef& musicObjectDef = +// defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); +// +// delete iQuery; +// iQuery = NULL; +// iQuery = iSession->NewObjectQueryL( defNS, musicObjectDef, this ); +// +// +// // set attributes that are included in query result +// CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName ); +// iQuery->AddPropertyFilterL( &namePropertyDef ); +// +// iQuery->SetResultMode( EQueryResultModeItem ); +// +// CMdELogicCondition& conditions = iQuery->Conditions(); +// CMdEObjectCondition& cond = conditions.AddObjectConditionL( +// EObjectConditionCompareUriBeginsWith, KDriveZ ); +// +// iQuery->FindL(); +// +// iQueryType = EQueryTone; +// } + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::SearchL +// +// Finds all music, tone and video files with any attibute that +// matches aFindText. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::SearchL( const TDesC& aSearchText ) + { + // + // search is done in 3 steps, SearchTonesL and SearchVideoL are + // called after SearchMusicL is done. Search results are collected + // in iSearchList. + // + + if ( aSearchText.Length() == 0 ) + { + iSearchText = KNullDesC; + QueryEmptyL(); + } + else + { + StrCopy( iSearchText, aSearchText ); + SearchMusicL( iSearchText ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::SearchAudioL +// +// Finds all audio files with attibute that matches aFindText. +// Searched attributes are name, artist, album, genre, composer. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::SearchAudioL( const TDesC& aSearchText ) + { + SearchMusicL( aSearchText ); + iQueryType = ESearchAudio; + + /* + LeaveIfSessionClosedL(); + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& objectDef = + defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); + + // set attributes that are included in query result + CMdEPropertyDef& song = PropertyDefL( EAttrSongName ); + iQuery->AddPropertyFilterL( &song ); + + CMdEPropertyDef& artist = PropertyDefL( EAttrArtist ); + iQuery->AddPropertyFilterL( &artist ); + CMdEPropertyDef& album = PropertyDefL( EAttrAlbum ); + iQuery->AddPropertyFilterL( &album ); + CMdEPropertyDef& genre = PropertyDefL( EAttrGenre ); + iQuery->AddPropertyFilterL( &genre ); + CMdEPropertyDef& composer = PropertyDefL( EAttrComposer ); + iQuery->AddPropertyFilterL( &composer ); + + CMdEPropertyDef& fileTypePropertyDef = PropertyDefL( EAttrMediaType ); + iQuery->AddPropertyFilterL( &fileTypePropertyDef ); + + + CMdELogicCondition& conditions = iQuery->Conditions(); + conditions.SetOperator( ELogicConditionOperatorAnd ); + + IncludeMusicSearchConditionL( conditions, aSearchText ); + + + + // iQuery->AppendOrderRuleL( TMdEOrderRule( song, ESortAscending ) ); + iQuery->SetResultMode( EQueryResultModeItem ); + iQuery->FindL(); + + iQueryType = ESearchAudio; + */ + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::SearchMusicL +// +// Finds all music with attibute that matches aFindText. +// Searched attributes are name, artist, album, genre, composer. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::SearchMusicL( const TDesC& aSearchText ) + { + LeaveIfSessionClosedL(); + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& objectDef = + defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); + + // set attributes that are included in query result + CMdEPropertyDef& songName = PropertyDefL( EAttrSongName ); + iQuery->AddPropertyFilterL( &songName ); + CMdEPropertyDef& fileTypePropertyDef = PropertyDefL( EAttrMediaType ); + iQuery->AddPropertyFilterL( &fileTypePropertyDef ); + + + CMdELogicCondition& conditions = iQuery->Conditions(); + conditions.SetOperator( ELogicConditionOperatorAnd ); + + //IncludeMusicPropertiesL( conditions ); + IncludeMusicSearchConditionL( conditions, aSearchText ); + + iQuery->SetResultMode( EQueryResultModeItem ); + iQuery->FindL(); + + iQueryType = ESearchMusic; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::SearchTonesL +// +// Finds all tones with attibute that matches aFindText. +// Searched attribute is file name. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::SearchTonesL( const TDesC& /*aSearchText */) + { + if ( iRomScanState == MMediaFileHandlerObserver::ERomScanComplete ) + { + QueryRomEmptyL( ESearchTones ); + } + else if ( iRomScanState == MMediaFileHandlerObserver::ERomScanInProgress ) + { + iQueryinProgress = ETrue; + } + else + { + //Rom scan not start or failed for some reason + iQueryinProgress = ETrue; + StartRomScaning( ESearchTones ); + } + } + +// +//// ----------------------------------------------------------------------------- +//// CMediaFileHandler::SearchTonesL +//// +//// Finds all tones with attibute that matches aFindText. +//// Searched attribute is file name. +//// ----------------------------------------------------------------------------- +//// +//void CMediaFileHandler::SearchTonesL( const TDesC& aSearchText ) +// { +// LeaveIfSessionClosedL(); +// +// CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); +// CMdEObjectDef& objectDef = +// defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); +// +// delete iQuery; +// iQuery = NULL; +// iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); +// +// // set attributes that are included in query result +// CMdEPropertyDef& songName = PropertyDefL( EAttrSongName ); +// iQuery->AddPropertyFilterL( &songName ); +// CMdEPropertyDef& fileTypePropertyDef = PropertyDefL( EAttrMediaType ); +// iQuery->AddPropertyFilterL( &fileTypePropertyDef ); +// +// +// CMdELogicCondition& conditions = iQuery->Conditions(); +// conditions.SetOperator( ELogicConditionOperatorAnd ); +// +// //ExcludeMusicPropertiesL( conditions ); +// CMdEObjectCondition& cond = conditions.AddObjectConditionL( +// EObjectConditionCompareUriBeginsWith, KDriveZ ); +// +// IncludeToneSearchConditionL( conditions, aSearchText ); +// +// iQuery->SetResultMode( EQueryResultModeItem ); +// iQuery->FindL(); +// +// iQueryType = ESearchTones; +// } + + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::SearchVideoL +// +// Finds all videos with attibute that matches aFindText. +// Searched attributes are name, artist, genre. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::SearchVideoL( const TDesC& aSearchText ) + { + LeaveIfSessionClosedL(); + if ( iRomScanState != MMediaFileHandlerObserver::ERomScanComplete ) + { + + StartRomScaning( ESearchVideo ); + } + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& objectDef = + defNS.GetObjectDefL( MdeConstants::Video::KVideoObject ); + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); + + // set attributes that are included in query result + CMdEPropertyDef& songName = PropertyDefL( EAttrSongName ); + iQuery->AddPropertyFilterL( &songName ); + + CMdELogicCondition& conditions = iQuery->Conditions(); + IncludeVideoSearchConditionL( conditions, aSearchText ); + + iQuery->SetResultMode( EQueryResultModeItem ); + + if ( iVideoSearchDisabled ) + { + iQuery->FindL( 0 ); + } + else + { + iQuery->FindL(); + } + + iQueryType = ESearchVideo; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::SearchVideo +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileHandler::SearchVideo( TAny *aObj ) + { + CMediaFileHandler* handler = (CMediaFileHandler*) aObj; + + TInt err = KErrNone; + TRAP( err, handler->SearchVideoL( handler->iSearchText ) ); + + if ( err != KErrNone ) + { + handler->CallObserver( MMediaFileHandlerObserver::EError, err ); + } + + return 0; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog::SearchTones +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileHandler::SearchTones( TAny *aObj ) + { + CMediaFileHandler* handler = (CMediaFileHandler*) aObj; + + TInt err = KErrNone; + TRAP( err, handler->SearchTonesL( handler->iSearchText ) ); + + if ( err != KErrNone ) + { + handler->CallObserver( MMediaFileHandlerObserver::EError, err ); + } + + return 0; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::ResultCount +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileHandler::ResultCount() + { + if ( !iSessionOpen ) + { + return 0; + } + + return iSearchList->Count(); + } + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::Remove +// Remove an item from list of search reuslt +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::Remove( TInt aIndex ) + { + if( aIndex >= ResultCount() ) + { + // Invalid index + return; + } + iSearchList->Remove( aIndex ); + } + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::UnknownArtistCount +// +// Returns 1 if artist has at least one music file without album attribute, +// 0 otherwise. +// ----------------------------------------------------------------------------- +// +TInt CMediaFileHandler::UnknownArtistCount() + { + TInt ret = 0; + + TInt err = KErrNone; + TRAP( err, ret = UnknownArtistCountL() ); + if ( err != KErrNone ) + { + ret = 0; + } + return ret; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::UnknownArtistCountL +// +// Returns 1 if artist has at least one music file without album attribute, +// 0 otherwise. +// ----------------------------------------------------------------------------- +// +TInt CMediaFileHandler::UnknownArtistCountL() + { + CMdEObjectQuery* artistQuery = iArtistQuery->Query(); + if ( !artistQuery ) + { + return 0; + } + + TInt count = artistQuery->Count(); + for ( TInt i=0; iResult( i ); + + CMdEPropertyDef& propDef = + CMediaFileHandler::PropertyDefL( iSession, CMediaFileHandler::EAttrAlbum ); + + CMdEProperty* property = NULL; + TInt ret = object.Property( propDef, property, 0 ); + if ( ret == KErrNotFound ) + { + return 1; + } + } + + return 0; + } +// ----------------------------------------------------------------------------- +// void CMediaFileHandler::StartRomScaning() +// +// Start rom scanning +// ----------------------------------------------------------------------------- +// + +void CMediaFileHandler::StartRomScaning( TInt aQueryType ) + { + + if ( iRomScanState != MMediaFileHandlerObserver::ERomScanComplete ) + { + iRomScanState = MMediaFileHandlerObserver::ERomScanInProgress; + iRomFileList->Reset(); + TRAPD( err , iRomFileList->ReadRomFilesL() ); + if ( err != KErrNone ) + { + iRomScanState = MMediaFileHandlerObserver::ERomScanError; + } + else + { + iRomScanState = MMediaFileHandlerObserver::ERomScanComplete; + } + } + + iSearchList->SetRomFileList( iRomFileList ); + + if ( iQueryinProgress ) + { + QueryRomEmptyL( aQueryType ); + } + + CallObserver( MMediaFileHandlerObserver::EScanRomComplete, KErrNone ); + } + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::CancelQuery +// +// Cancels ongoing query. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::CancelQuery() + { + if ( !iSessionOpen || !iQuery ) + { + return; + } + + if ( !iQuery->IsComplete() ) + { + iQuery->Cancel(); // this calls HandleQueryCompleted synchronously + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::LeaveIfSessionClosedL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::LeaveIfSessionClosedL() + { + if ( !iSession || !iSessionOpen ) + { + User::Leave( KErrDisconnected ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::SetObserver +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::SetObserver( MMediaFileHandlerObserver* aObserver ) + { + iObserver = aObserver; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::CheckAttrL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::CheckAttrL( TInt aAttr ) + { + if ( aAttr != EAttrArtist && aAttr != EAttrAlbum && + aAttr != EAttrGenre && aAttr != EAttrComposer ) + { + User::Leave( KErrNotSupported ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::GetAttributeL +// +// NOTE: GetAttributeL only gets full name or file name +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::GetAttributeL( TInt aIndex, TInt aAttr, + TDes& aValue, TInt aQueryId ) + { + aValue = KNullDesC; + + if ( !iSessionOpen ) + { + return; + } + + TInt id = iSearchList->SearchId(); + if ( id != aQueryId ) + { + return; // search list and UI do not match + } + + iSearchList->SetSession( iSession ); + iSearchList->GetAttributeL( aIndex, aAttr, aValue ); + } + + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::GetAttribute +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::GetAttribute( TInt aIndex, TInt aAttr, + TDes& aValue, TInt aQueryId ) + { + TRAP_IGNORE( GetAttributeL( aIndex, aAttr, aValue, aQueryId ) ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::Attribute +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileHandler::Attribute( TInt aIndex, TInt aAttr, TInt aQueryId ) + { + if ( !iSessionOpen ) + { + return KErrNotFound; + } + + TInt id = iSearchList->SearchId(); + if ( id != aQueryId ) + { + return KErrNotFound; + } + + return iSearchList->Attribute( aIndex, aAttr ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::ItemIndex +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileHandler::ItemIndex( TInt aItemId, TInt aIndex ) + { + return iSearchList->ItemIndex( aItemId, aIndex ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::ItemIndex +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileHandler::ItemIndex( const TDesC& aItemText, TInt aIndex ) + { + return iSearchList->ItemIndex( aItemText, aIndex ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::ReadMediaFileDataL +// +// ----------------------------------------------------------------------------- +// +CMediaFileData* CMediaFileHandler::ReadMediaFileDataL( TInt aId ) + { + if ( !iSessionOpen ) + { + User::Leave( KErrNotFound ); + } + + CMdEObject* object = iSession->GetFullObjectL( aId ); + CleanupStack::PushL( object ); + + CMediaFileData* data = CMediaFileData::NewL(); + CleanupStack::PushL( data ); + + data->SetAttrL( EAttrFullName, object->Uri() ); + + CMdEProperty* property = NULL; + TInt ret = object->Property( PropertyDefL( EAttrSongName ), property, 0 ); + if ( ret != KErrNotFound ) + { + data->SetAttrL( EAttrSongName, property->TextValueL() ); + } + + ret = object->Property( PropertyDefL( EAttrArtist ), property, 0 ); + if ( ret != KErrNotFound ) + { + data->SetAttrL( EAttrArtist, property->TextValueL() ); + } + + ret = object->Property( PropertyDefL( EAttrAlbum ), property, 0 ); + if ( ret != KErrNotFound ) + { + data->SetAttrL( EAttrAlbum, property->TextValueL() ); + } + + ret = object->Property( PropertyDefL( EAttrGenre ), property, 0 ); + if ( ret != KErrNotFound ) + { + data->SetAttrL( EAttrGenre, property->TextValueL() ); + } + + ret = object->Property( PropertyDefL( EAttrComposer ), property, 0 ); + if ( ret != KErrNotFound ) + { + data->SetAttrL( EAttrComposer, property->TextValueL() ); + } + + CleanupStack::Pop( data ); + CleanupStack::PopAndDestroy( object ); + + return data; + } + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::ReadMediaFileDataL +// +// ----------------------------------------------------------------------------- +// +CMediaFileData* CMediaFileHandler::RomMediaFileDataL( TInt aId ,TInt aMediaType ) + { + if (!iRomFileList) + { + User::Leave(KErrNotFound); + } + + TBuf buf; + CMediaFileData* data = CMediaFileData::NewL(); + CleanupStack::PushL(data); + + if (aMediaType == EMediaTypeTone) + { + data->SetAttrL(EAttrFullName, iRomFileList->Item(aId, 0)); + iRomFileList->GetRomFileName(aId, 0, buf); + data->SetAttrL(EAttrSongName, buf); + } + + if (aMediaType == EMediaTypeVideo) + { + data->SetAttrL(EAttrFullName, iRomFileList->Item(aId, 1)); + iRomFileList->GetRomFileName(aId, 1, buf); + data->SetAttrL(EAttrSongName, buf); + } + + CleanupStack::Pop(data); + + return data; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::PropertyDefL +// +// ----------------------------------------------------------------------------- +// +CMdEPropertyDef& CMediaFileHandler::PropertyDefL( TInt aAttr ) + { + return PropertyDefL( iSession, aAttr ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::PropertyDefL +// +// ----------------------------------------------------------------------------- +// +CMdEPropertyDef& CMediaFileHandler::PropertyDefL( CMdESession* aSession, TInt aAttr ) + { + CMdENamespaceDef& defNS = aSession->GetDefaultNamespaceDefL(); + + CMdEObjectDef& objectDef = + defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + + if ( aAttr == EAttrFileSize ) + { + return objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty ); + } + else if ( aAttr == EAttrMediaType ) + { + return objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty ); + } + else if ( aAttr == EAttrSongName || aAttr == EAttrFileName ) + { + return objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty ); + } + else if ( aAttr == EAttrArtist ) + { + return objectDef.GetPropertyDefL( MdeConstants::MediaObject::KArtistProperty ); + } + else if ( aAttr == EAttrAlbum ) + { + return objectDef.GetPropertyDefL( MdeConstants::Audio::KAlbumProperty ); + } + else if ( aAttr == EAttrGenre ) + { + return objectDef.GetPropertyDefL( MdeConstants::MediaObject::KGenreProperty ); + } + else if ( aAttr == EAttrComposer ) + { + return objectDef.GetPropertyDefL( MdeConstants::Audio::KComposerProperty ); + } + else + { + User::Leave( KErrNotSupported ); + } + + return objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryReady +// +// ----------------------------------------------------------------------------- +// +TBool CMediaFileHandler::QueryReady() + { + if ( iIdle ) + { + TBool isSearching = iIdle->IsActive(); + if ( isSearching ) + { + return EFalse; // we are between audio, tone and and video search + } + } + + TBool isWaitingObserverCall = iQueryCaller->IsActive(); + if ( isWaitingObserverCall ) + { + return EFalse; // query is ready but observer not called yet + } + + if ( iQuery ) + { + return iQuery->IsComplete(); + } + + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::ExcludeMimeTypesL +// +// Exclude mime types from query. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::ExcludeMimeTypesL( CMdELogicCondition& aCondition, + TInt /*aAttr*/ ) + { + TInt count = iExcludedMimeTypes->Count(); + + if ( count == 0 ) + { + return; + } + + CMdEPropertyDef& fileTypeDef = PropertyDefL( EAttrMediaType ); + CMdELogicCondition& condition = + aCondition.AddLogicConditionL( ELogicConditionOperatorAnd ); + + for ( TInt i=0; iMimeType( i ); + condition.AddPropertyConditionL( fileTypeDef, + ETextPropertyConditionCompareEquals, ptr ); + } + condition.SetNegate( ETrue ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::IncludeMusicPropertiesL +// +// Adds properties that are used to find out whether media file is music. +// File is considered music if: +// 1. it has metadata artist or album or genre or composer +// 2. its mime type is 'music' mime type (eg mp3) +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::IncludeMusicPropertiesL( CMdELogicCondition& aCondition ) + { + ExcludeRomFilesL( aCondition ); +// CMdEObjectCondition& cond = aCondition.AddObjectConditionL( +// EObjectConditionCompareUriBeginsWith, KDriveZ ); +// cond.SetNegate( ETrue ); + +// CMdELogicCondition& condition = +// aCondition.AddLogicConditionL( ELogicConditionOperatorAnd ); + ExcludeRecordingsL( aCondition ); +// CMdEPropertyDef& fileTypeDef = PropertyDefL( EAttrMediaType ); +// condition.AddPropertyConditionL( fileTypeDef, +// ETextPropertyConditionCompareContains, KMimeTypeAMR ); +// condition.AddPropertyConditionL( fileTypeDef, +// ETextPropertyConditionCompareContains, KMimeTypeWAV ); +// condition.SetNegate( ETrue ); + } + + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::IncludeMusicPropertiesL +// +// Adds properties that are used to find out whether media file is music. +// File is considered music if: +// 1. it has metadata artist or album or genre or composer +// 2. its mime type is 'music' mime type (eg mp3) +// ----------------------------------------------------------------------------- +// +/* +void CMediaFileHandler::IncludeMusicPropertiesL( CMdELogicCondition& aCondition ) + { + //aLogicCondition.SetOperator( ELogicConditionOperatorAnd ); + + CMdEPropertyDef& mimeTypeDef = PropertyDefL( EAttrMediaType ); + CMdEPropertyDef& artistTypeDef = PropertyDefL( EAttrArtist ); + CMdEPropertyDef& albumTypeDef = PropertyDefL( EAttrAlbum ); + CMdEPropertyDef& genreTypeDef = PropertyDefL( EAttrGenre ); + CMdEPropertyDef& composerTypeDef = PropertyDefL( EAttrComposer ); + + CMdELogicCondition& condition = + aCondition.AddLogicConditionL( ELogicConditionOperatorOr ); + + condition.AddPropertyConditionL( mimeTypeDef, + ETextPropertyConditionCompareContains, KMimeMp3 ); + condition.AddPropertyConditionL( artistTypeDef ); + condition.AddPropertyConditionL( albumTypeDef ); + condition.AddPropertyConditionL( genreTypeDef ); + condition.AddPropertyConditionL( composerTypeDef ); + } +*/ + + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::ExcludeMusicPropertiesL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::ExcludeMusicPropertiesL( CMdELogicCondition& aCondition ) + { + CMdEPropertyDef& mimeTypeDef = PropertyDefL( EAttrMediaType ); + CMdEPropertyDef& artistTypeDef = PropertyDefL( EAttrArtist ); + CMdEPropertyDef& albumTypeDef = PropertyDefL( EAttrAlbum ); + CMdEPropertyDef& genreTypeDef = PropertyDefL( EAttrGenre ); + CMdEPropertyDef& composerTypeDef = PropertyDefL( EAttrComposer ); + + CMdELogicCondition& condition = + aCondition.AddLogicConditionL( ELogicConditionOperatorAnd ); + + condition.AddPropertyConditionL( mimeTypeDef, + ETextPropertyConditionCompareContains, KMimeMp3 ); + condition.AddPropertyConditionL( artistTypeDef ); + condition.AddPropertyConditionL( albumTypeDef ); + condition.AddPropertyConditionL( genreTypeDef ); + condition.AddPropertyConditionL( composerTypeDef ); + + condition.SetNegate( ETrue ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::IncludeMusicSearchConditionL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::IncludeMusicSearchConditionL( CMdELogicCondition& aCondition, + const TDesC& aSearchText ) + + { + _LIT( KFormat, "%S%S" ); + + CMdELogicCondition& condition = + aCondition.AddLogicConditionL( ELogicConditionOperatorOr ); + + CMdEPropertyDef& songName = PropertyDefL( EAttrSongName ); + CMdEPropertyDef& artist = PropertyDefL( EAttrArtist ); + CMdEPropertyDef& album = PropertyDefL( EAttrAlbum ); + CMdEPropertyDef& genre = PropertyDefL( EAttrGenre ); + CMdEPropertyDef& composer = PropertyDefL( EAttrComposer ); + + // first find from the start of the property + condition.AddPropertyConditionL( songName, + ETextPropertyConditionCompareBeginsWith, aSearchText ); + + condition.AddPropertyConditionL( artist, + ETextPropertyConditionCompareBeginsWith, aSearchText ); + + + condition.AddPropertyConditionL( album, + ETextPropertyConditionCompareBeginsWith, aSearchText ); + + + condition.AddPropertyConditionL( genre, + ETextPropertyConditionCompareBeginsWith, aSearchText ); + + + condition.AddPropertyConditionL( composer, + ETextPropertyConditionCompareBeginsWith, aSearchText ); + + + // then find from the start of property words + TBuf buf; + if ( aSearchText.Length() < KBufSize128-1 ) + { + buf.Format( KFormat, &KSpace, &aSearchText ); + + condition.AddPropertyConditionL( songName, + ETextPropertyConditionCompareContains, buf ); + condition.AddPropertyConditionL( artist, + ETextPropertyConditionCompareContains, buf ); + condition.AddPropertyConditionL( album, + ETextPropertyConditionCompareContains, buf ); + condition.AddPropertyConditionL( genre, + ETextPropertyConditionCompareContains, buf ); + condition.AddPropertyConditionL( composer, + ETextPropertyConditionCompareContains, buf ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::IncludeVideoConditionL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::IncludeVideoSearchConditionL( + CMdELogicCondition& aCondition, const TDesC& aSearchText ) + + { + _LIT( KFormat, "%S%S" ); + + CMdELogicCondition& condition = + aCondition.AddLogicConditionL( ELogicConditionOperatorOr ); + + CMdEPropertyDef& songName = PropertyDefL( EAttrSongName ); + CMdEPropertyDef& artist = PropertyDefL( EAttrArtist ); + CMdEPropertyDef& genre = PropertyDefL( EAttrGenre ); + + // first find from the start of the property + condition.AddPropertyConditionL( songName, + ETextPropertyConditionCompareBeginsWith, aSearchText ); + condition.AddPropertyConditionL( artist, + ETextPropertyConditionCompareBeginsWith, aSearchText ); + condition.AddPropertyConditionL( genre, + ETextPropertyConditionCompareBeginsWith, aSearchText ); + + // then find from the start of property words + TBuf buf; + if ( aSearchText.Length() < KBufSize128-1 ) + { + buf.Format( KFormat, &KSpace, &aSearchText ); + + condition.AddPropertyConditionL( songName, + ETextPropertyConditionCompareContains, buf ); + condition.AddPropertyConditionL( artist, + ETextPropertyConditionCompareContains, buf ); + condition.AddPropertyConditionL( genre, + ETextPropertyConditionCompareContains, buf ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::IncludeToneSearchConditionL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::IncludeToneSearchConditionL( CMdELogicCondition& aCondition, + const TDesC& aSearchText ) + + { + _LIT( KFormat, "%S%S" ); + + CMdELogicCondition& condition = + aCondition.AddLogicConditionL( ELogicConditionOperatorOr ); + + CMdEPropertyDef& songName = PropertyDefL( EAttrSongName ); + + // first find from the start of the property + condition.AddPropertyConditionL( songName, + ETextPropertyConditionCompareBeginsWith, aSearchText ); + + // then find from the start of property words + TBuf buf; + if ( aSearchText.Length() < KBufSize128-1 ) + { + buf.Format( KFormat, &KSpace, &aSearchText ); + + condition.AddPropertyConditionL( songName, + ETextPropertyConditionCompareContains, buf ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::ExcludeRecordingsL +// +// Exclude recording mime types from query (.amr and .wav). +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::ExcludeRecordingsL( CMdELogicCondition& aCondition ) + { + CMdEPropertyDef& mimeTypeDef = PropertyDefL( EAttrMediaType ); + CMdELogicCondition& condition = + aCondition.AddLogicConditionL( ELogicConditionOperatorAnd ); + condition.AddPropertyConditionL( mimeTypeDef, + ETextPropertyConditionCompareEquals, KMimeTypeAMR ); + condition.AddPropertyConditionL( mimeTypeDef, + ETextPropertyConditionCompareEquals, KMimeTypeWAV ); + condition.SetNegate( ETrue ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::ExcludeRomFilesL +// +// Exclude music files that are in rom (default tones). +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::ExcludeRomFilesL( CMdELogicCondition& aCondition ) + { + _LIT( KDriveZ, "z:\\" ); + + CMdEObjectCondition& cond = aCondition.AddObjectConditionL( + EObjectConditionCompareUriBeginsWith, KDriveZ ); + cond.SetNegate( ETrue ); + } + + +// ------------------------------------------------------------------------------- +// CMediaFileHandler::StrCopy +// +// String copy with lenght check. +// ------------------------------------------------------------------------------- +// +void CMediaFileHandler::StrCopy( TDes& aTarget, const TDesC& aSource ) + { + TInt len = aTarget.MaxLength(); + if( len < aSource.Length() ) + { + aTarget.Copy( aSource.Left( len ) ); + return; + } + aTarget.Copy( aSource ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::EnableObserverCall +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::EnableObserverCall( TBool aEnable ) + { + iObserverCallEnabled = aEnable; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::CallObserver +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::CallObserver( TInt aEvent, TInt aError ) + { + const TInt KDelay = 100; // milliseconds + + if ( !iObserverCallEnabled ) + { + return; + } + + iQueryError = aError; + iQueryEvent = aEvent; + + iQueryCaller->Start( 0, KDelay ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::CallObserverWithDelay +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::CallObserverWithDelay() + { + const TInt KOneSecond = 1000; + + if ( !iObserverCallEnabled ) + { + return; + } + + iObjectNotificationCaller->Start( 1, 2*KOneSecond ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::HandleActiveCallL (from MMFActiveCallerObserver) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::HandleActiveCallL( TInt aCallId ) + { + if ( !iObserver ) + { + return; + } + + // inform observer that query is ready + if ( aCallId == 0 ) + { + TRAP_IGNORE( iObserver->HandleMFEventL( iQueryEvent, iQueryError ) ); + } + + // inform observer that database has changed + if ( aCallId == 1 ) + { + if ( QueryReady() ) + { + TRAP_IGNORE( iObserver->HandleMFEventL( MMediaFileHandlerObserver::EMediaFileChanged, KErrNone ) ); + } + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::SetQueryId +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::SetQueryId( TInt aId ) + { + // this id is passed to CSearchList after successful database search + iQueryId = aId; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::Panic +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::Panic( TInt aReason ) + { + _LIT( KPanicCategory, "CMediaFileHandler" ); + + User::Panic( KPanicCategory, aReason ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::MediaType +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileHandler::MediaType( TInt aQueryType ) + { + TInt mediaType = EMediaTypeMusic; + if ( aQueryType == EQueryVideo ) + { + mediaType = EMediaTypeVideo; + } + if ( aQueryType == EQueryRecording ) + { + mediaType = EMediaTypeRecording; + } + if ( aQueryType == EQueryTone ) + { + mediaType = EMediaTypeTone; + } + + return mediaType; + } + + + +/****************************************************************************** + * class CSearchListItem + ******************************************************************************/ + + +// ----------------------------------------------------------------------------- +// CSearchListItem::NewL +// +// ----------------------------------------------------------------------------- +// +CSearchListItem* CSearchListItem::NewLC() + { + CSearchListItem* self = new (ELeave) CSearchListItem(); + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + + +// ----------------------------------------------------------------------------- +// CSearchListItem::NewL +// +// ----------------------------------------------------------------------------- +// +CSearchListItem* CSearchListItem::NewL() + { + CSearchListItem* self = new (ELeave) CSearchListItem(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// +// ----------------------------------------------------------------------------- +// +CSearchListItem::~CSearchListItem() + { + delete iTitle; + } + + +// ----------------------------------------------------------------------------- +// CSearchListItem::CSearchListItem +// +// ----------------------------------------------------------------------------- +// +CSearchListItem::CSearchListItem() + { + iId = KErrNotFound; + iMediaType = KErrNotFound; + iStorageType = KErrNotFound; + iTitle = NULL; + } + + +// ----------------------------------------------------------------------------- +// CSearchListItem::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CSearchListItem::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CSearchListItem::SetTitleL +// +// ----------------------------------------------------------------------------- +// + +void CSearchListItem::SetTitleL( const TDesC& aText, TBool aFullName ) + { + delete iTitle; + iTitle = NULL; + + if ( aFullName ) + { + TParsePtrC parse( aText ); + iTitle = parse.Name().AllocL(); + } + else + { + iTitle = aText.AllocL(); + } + } + + +// ----------------------------------------------------------------------------- +// CSearchListItem::Title +// +// ----------------------------------------------------------------------------- +// + +const TDesC& CSearchListItem::Title() const + { + return *iTitle; + } + + + + +/****************************************************************************** + * class CRomFileList + ******************************************************************************/ + + + +// ----------------------------------------------------------------------------- +// Static constructor function CRomFileList::NewL +// +// ----------------------------------------------------------------------------- +// +CRomFileList* CRomFileList::NewL() + { + CRomFileList* self = new (ELeave) CRomFileList(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// +// ----------------------------------------------------------------------------- +// +CRomFileList::~CRomFileList() + { + iRomToneList.ResetAndDestroy(); + iRomVideoList.ResetAndDestroy(); + iList.Reset(); + iList.Close(); + iVedioList.Reset(); + iVedioList.Close(); + } + + +// ----------------------------------------------------------------------------- +// CRomFileList::CRomFileList +// +// ----------------------------------------------------------------------------- +// +CRomFileList::CRomFileList() + { + } + + +// ----------------------------------------------------------------------------- +// CRomFileList::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CRomFileList::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CRomFileList::RomFileItem( TInt aIndex ) +// +// ----------------------------------------------------------------------------- +// +TInt CRomFileList::RomFileItem( CSearchListItem* aItem, TInt aIndex) + { + if( aIndex >= 0 && aIndex < iRomToneList.Count() ) + { + aItem->iId = iRomToneList[aIndex]->iId; + aItem->iMediaType = iRomToneList[aIndex]->iMediaType; + aItem->iStorageType = iRomToneList[aIndex]->iStorageType; + TPtrC title = iRomToneList[aIndex]->Title(); + aItem->SetTitleL( title, EFalse ); + return KErrNone; + } + return KErrGeneral; + } + +// ----------------------------------------------------------------------------- +// CRomFileList::RomVedioItem( TInt aIndex ) +// +// ----------------------------------------------------------------------------- +// +TInt CRomFileList::RomVedioItem( CSearchListItem* aItem, TInt aIndex) + { + if( aIndex >= 0 && aIndex < iRomVideoList.Count() ) + { + aItem->iId = iRomVideoList[aIndex]->iId; + aItem->iMediaType = iRomVideoList[aIndex]->iMediaType; + aItem->iStorageType = iRomVideoList[aIndex]->iStorageType; + TPtrC title = iRomVideoList[aIndex]->Title(); + aItem->SetTitleL( title, EFalse ); + return KErrNone; + } + return KErrGeneral; + } +// ----------------------------------------------------------------------------- +// CRomFileList::Count() +// +// ----------------------------------------------------------------------------- +// + +TInt CRomFileList::Count(TInt aType ) + { + if ( aType == 0 ) + { + //Tone item count + return iRomToneList.Count(); + } + else if ( aType == 1 ) + { + // Video item count() + return iRomVideoList.Count(); + } + return KErrNotSupported; + } + +// ----------------------------------------------------------------------------- +// CRomFileList::Reset() +// +// ----------------------------------------------------------------------------- +// + +void CRomFileList::Reset() + { + iRomToneList.Reset(); + iRomVideoList.Reset(); + iList.Reset(); + iVedioList.Reset(); + } +// ----------------------------------------------------------------------------- +// CRomFileList::ReadRomFilesL() +// +// ----------------------------------------------------------------------------- +// + +void CRomFileList::ReadRomFilesL() + { + _LIT( KFormat, "%S%S" ); + + iRomToneList.ResetAndDestroy(); + iList.Reset(); + + iFileName.Format( KFormat, &PathInfo::RomRootPath(), &PathInfo::SoundsPath() ); + TRAP_IGNORE( ReadDirectoryL( iFileName, iRomToneList ) ); + TRAP_IGNORE( ReadDirectoryL( iFileName, iList ) ); + + iFileName.Format( KFormat, &PathInfo::RomRootPath(), &PathInfo::DigitalSoundsPath() ); + TRAP_IGNORE( ReadDirectoryL( iFileName, iRomToneList ) ); + TRAP_IGNORE( ReadDirectoryL( iFileName, iList ) ); + + iFileName.Format( KFormat, &PathInfo::RomRootPath(), &PathInfo::SimpleSoundsPath() ); + TRAP_IGNORE( ReadDirectoryL( iFileName, iRomToneList ) ); + TRAP_IGNORE( ReadDirectoryL( iFileName, iList ) ); + + TRAP_IGNORE( ReadRomVediosL() ); + } + + +// ----------------------------------------------------------------------------- +// CRomFileList::ReadRomFilesL() +// +// ----------------------------------------------------------------------------- +// + +void CRomFileList::ReadRomVediosL() + { + _LIT( KFormat, "%S%S" ); + + iRomVideoList.Reset(); + iVedioList.Reset(); + + iFileName.Format( KFormat, &PathInfo::RomRootPath(), &PathInfo::VideosPath() ); + TRAP_IGNORE( ReadDirectoryL( iFileName, iRomVideoList ) ); + TRAP_IGNORE( ReadDirectoryL( iFileName, iVedioList ) ); + + if ( iRomVideoList.Count() > 0 ) + { + for( TInt i(0); i < iRomVideoList.Count(); i++) + { + iRomVideoList[i]->iMediaType = CMediaFileHandler::EMediaTypeVideo; + } + } + + } + + +// ----------------------------------------------------------------------------- +// TDesC& CRomFileList::Item( TInt aIndex ) +// +// ----------------------------------------------------------------------------- +// +const TDesC& CRomFileList::Item(TInt aIndex, TInt aType) + { + TInt count = 0; + if ( aType == 0 ) + { + count = iList.Count(); + if (aIndex >= 0 && aIndex < count) + { + return iList[aIndex]; + } + } + else if ( aType == 1 ) + { + count = iVedioList.Count(); + if (aIndex >= 0 && aIndex < count) + { + return iVedioList[aIndex]; + } + } + return KNullDesC; + } + + +// ----------------------------------------------------------------------------- +// CRomFileList::ReadDirectoryL( const TDesC& aDirectory, +// RPointerArray& aList ) +// +// ----------------------------------------------------------------------------- +// + +void CRomFileList::ReadDirectoryL( const TDesC& aDirectory, + RPointerArray& aList ) + { + _LIT( KFormat, "%S%S" ); + + CDir* dir = NULL; + RFs fsSession; + User::LeaveIfError( fsSession.Connect() ); + CleanupClosePushL( fsSession ); + + if ( !BaflUtils::FolderExists( fsSession, aDirectory ) ) + { + User::Leave( KErrNotFound ); + } + + TInt err = fsSession.GetDir( aDirectory, KEntryAttNormal, ESortByName, dir ); + User::LeaveIfError( err ); + CleanupStack::PushL( dir ); + TInt index; + TInt count = dir->Count(); + TFileName filename; + for ( TInt i=0; i& aList ) +// +// ----------------------------------------------------------------------------- +// + +void CRomFileList::ReadDirectoryL( const TDesC& aDirectory, + RArray& aList ) + { + _LIT( KFormat, "%S%S" ); + + CDir* dir = NULL; + RFs fsSession; + User::LeaveIfError( fsSession.Connect() ); + CleanupClosePushL( fsSession ); + + if ( !BaflUtils::FolderExists( fsSession, aDirectory ) ) + { + User::Leave( KErrNotFound ); + } + + TInt err = fsSession.GetDir( aDirectory, KEntryAttNormal, ESortByName, dir ); + User::LeaveIfError( err ); + CleanupStack::PushL( dir ); + + TInt count = dir->Count(); + TFileName filename; + for ( TInt i=0; iiId = aIndex; + item->SetTitleL( aFileName , ETrue); + item->iStorageType = CMediaFileHandler::ERomStorage; + item->iMediaType = CMediaFileHandler::EMediaTypeTone; + + CleanupStack::Pop(); // item + + return item; + } + +// ----------------------------------------------------------------------------- +// CRomFileList::GetRomFileName +// +// ----------------------------------------------------------------------------- +// +TInt CRomFileList::GetRomFileName(TInt aIndex, TInt aType, TDes& aValue) + { + //return title of rom item; + if (aType == 0) + { + if (aIndex >= 0 && aIndex < Count(0)) + { + aValue.Copy( iRomToneList[aIndex]->Title() ); + return KErrNone; + } + return KErrGeneral; + } + else if (aType == 1) + { + if (aIndex >= 0 && aIndex < Count(1)) + { + aValue.Copy(iRomVideoList[aIndex]->Title()); + return KErrNone; + } + return KErrGeneral; + } + return KErrNotFound; + } + + +/****************************************************************************** + * class CSearchList + ******************************************************************************/ + + +// ----------------------------------------------------------------------------- +// CSearchList::NewL +// +// ----------------------------------------------------------------------------- +// +CSearchList* CSearchList::NewL() + { + CSearchList* self = new (ELeave) CSearchList(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// +// ----------------------------------------------------------------------------- +// +CSearchList::~CSearchList() + { + iList.ResetAndDestroy(); + delete iDriveUtil; + } + + +// ----------------------------------------------------------------------------- +// CSearchList::CSearchList +// +// ----------------------------------------------------------------------------- +// +CSearchList::CSearchList() + { + iSearchId = KErrNotFound; + } + + +// ----------------------------------------------------------------------------- +// CSearchList::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CSearchList::ConstructL() + { + iDriveUtil = CDriveUtil::NewL(); + } + + +// ----------------------------------------------------------------------------- +// CSearchList::SetSession +// +// ----------------------------------------------------------------------------- +// +void CSearchList::SetSession( CMdESession* aSession ) + { + iSession = aSession; + } + +// ----------------------------------------------------------------------------- +// CSearchList::SetRomFileList +// +// ----------------------------------------------------------------------------- +// +void CSearchList::SetRomFileList( CRomFileList* aRomFileList ) + { + iRomFileList = aRomFileList; + } + +// ----------------------------------------------------------------------------- +// CSearchList::SetSearchId +// +// ----------------------------------------------------------------------------- +// +void CSearchList::SetSearchId( TInt aSearchId ) + { + iSearchId = aSearchId; + } + + +// ----------------------------------------------------------------------------- +// CSearchList::SearchId +// +// ----------------------------------------------------------------------------- +// +TInt CSearchList::SearchId() + { + return iSearchId; + } + +// ----------------------------------------------------------------------------- +// CSearchList::Remove +// Remove an item from the list of search results +// ----------------------------------------------------------------------------- +// +void CSearchList::Remove( TInt aIndex ) + { + iList.Remove( aIndex ); + } + +// ----------------------------------------------------------------------------- +// CSearchList::TakeResultL +// +// ----------------------------------------------------------------------------- +// +void CSearchList::TakeResultL( CMdEObjectQuery* aQuery, TInt aMediaType ) + { + if ( !aQuery ) + { + return; + } + CMdEObjectQuery* query = static_cast (aQuery); + TInt count = query->Count(); + + for (TInt i = 0; i < count; i++) + { + CMdEObject* object = (CMdEObject*) query->TakeOwnershipOfResult(i); + CleanupStack::PushL(object); + AddItemL(*object, aMediaType); + CleanupStack::PopAndDestroy(object); + } + } + +// ----------------------------------------------------------------------------- +// CSearchList::SearchInToneL +// +// ----------------------------------------------------------------------------- +// +void CSearchList::SearchInToneL( CRomFileList* aQuery, const TDesC& aSearchText ) + { + if ( !aQuery ) + { + return; + } + TInt error = KErrNone; + TInt count = aQuery->Count( 0 ); + for( int i = 0; i< count; i++ ) + { + CSearchListItem* item = CSearchListItem::NewL(); + error = aQuery->RomFileItem( item, i ); + if ( error == KErrNone ) + { + TPtrC title = item->Title(); + TInt rt = title.FindF( aSearchText ); + if ( rt != KErrNotFound ) + { + iList.AppendL( item ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// CSearchList::VideoSearchInRomL +// +// ----------------------------------------------------------------------------- +// +void CSearchList::VideoSearchInRomL( CRomFileList* aQuery, const TDesC& aSearchText ) + { + if ( !aQuery ) + { + return; + } + TInt error = KErrNone; + TInt count = aQuery->Count( 1 ); + for( int i = 0; i< count; i++ ) + { + CSearchListItem* item = CSearchListItem::NewL(); + error = aQuery->RomVedioItem( item, i ); + if ( error == KErrNone ) + { + TPtrC title = item->Title(); + TInt rt = title.FindF( aSearchText ); + if ( rt != KErrNotFound ) + { + iList.AppendL( item ); + } + } + } + } +// ----------------------------------------------------------------------------- +// CSearchList::TakeArtistResultL +// +// ----------------------------------------------------------------------------- +// +void CSearchList::TakeArtistResultL( CArtistQuery* aArtistQuery ) + { + if ( !aArtistQuery ) + { + return; + } + + CMdEObjectQuery* query = aArtistQuery->Query(); + if ( !query ) + { + return; + } + TInt queryType = aArtistQuery->QueryType(); + + + TInt count = query->Count(); + for ( TInt i=0; iResult( i ); + AddArtistItemL( object, queryType, aArtistQuery->Album() ); + } + } + + +// ----------------------------------------------------------------------------- +// CSearchList::TakeDistinctResultL +// +// ----------------------------------------------------------------------------- +// +void CSearchList::TakeDistinctResultL( CMdEObjectQuery* aQuery, + TInt /*aMediaType*/ ) + { + if ( !aQuery ) + { + return; + } + + TInt count = aQuery->Count(); + + for ( TInt i=0; iResultDistinctValue( i ); + + CSearchListItem* item = CSearchListItem::NewLC(); + + item->SetTitleL( ptr, EFalse ); + item->iMediaType = KErrNotFound; + item->iStorageType = KErrNotFound; + + iList.AppendL( item ); + + CleanupStack::Pop( item ); + } + } + + +// ----------------------------------------------------------------------------- +// CSearchList::AddItemL +// +// ----------------------------------------------------------------------------- +// +void CSearchList::AddItemL( CMdEObject& aObject, TInt aMediaType ) + { + CSearchListItem* item = CSearchListItem::NewLC(); + + TPtrC songName = TextL( aObject, CMediaFileHandler::EAttrSongName ); + + if ( songName.Length() > 0 ) + { + item->SetTitleL( songName, EFalse ); + } + else + { + item->SetTitleL( aObject.Uri(), ETrue ); + } + + + item->iId = aObject.Id(); + item->iMediaType = aMediaType; + + TInt storageType = CMediaFileHandler::EPhoneMemory; + if ( iDriveUtil->IsMemoryCard( aObject.Uri() ) ) + { + storageType = CMediaFileHandler::EMemoryCard; + } + else if ( iDriveUtil->IsMassStorage( aObject.Uri() ) ) + { + storageType = CMediaFileHandler::EMassStorage; + } + item->iStorageType = storageType; + + iList.AppendL( item ); + + CleanupStack::Pop( item ); + } + +// ----------------------------------------------------------------------------- +// CSearchList::AddRomItemL +// +// ----------------------------------------------------------------------------- +// +void CSearchList::AddRomItemL( CRomFileList* aRomList, TInt aMediaType ) + { + if ( !aRomList ) + { + return; + } + + TInt count =0; + TInt error = KErrNone; + if ( aMediaType == CMediaFileHandler::EMediaTypeTone ) + { + count = aRomList->Count( 0 ); + for ( TInt i=0; i< count; i++ ) + { + CSearchListItem* item = CSearchListItem::NewL(); + error = aRomList->RomFileItem( item, i ); + if ( error == KErrNone ) + { + iList.AppendL( item ); + } + } + } + else if ( aMediaType == CMediaFileHandler::EMediaTypeVideo ) + { + count = aRomList->Count( 1 ); + for (TInt i = 0; i < count; i++) + { + CSearchListItem* item = CSearchListItem::NewL(); + error = aRomList->RomVedioItem(item, i); + if (error == KErrNone) + { + iList.AppendL(item); + } + } + } + + } + +// ----------------------------------------------------------------------------- +// CSearchList::AddAlbumItemL +// +// ----------------------------------------------------------------------------- +// +void CSearchList::AddAlbumItemL( const TDesC& aAlbum ) + { + TLinearOrder sortFunction( CSearchList::Compare ); + + CSearchListItem* item = CSearchListItem::NewLC(); + + item->SetTitleL( aAlbum, EFalse ); + + CleanupStack::Pop( item ); + + item->iMediaType = KErrNotFound; + item->iStorageType = KErrNotFound; + item->iId = KErrNotFound; + + TInt err = iList.InsertInOrder( item, sortFunction ); + if ( err != KErrNone ) + { + delete item; + } + if ( err != KErrNone && err != KErrAlreadyExists ) + { + User::Leave( err ); + } + } + + +// ----------------------------------------------------------------------------- +// CSearchList::AddArtistItemL +// +// ----------------------------------------------------------------------------- +// +void CSearchList::AddArtistItemL( CMdEObject& aObject, + TInt aQueryType, const TDesC& aAlbum ) + { + // all songs for one artist + if ( aQueryType == CMediaFileHandler::EQueryArtistAll ) + { + AddItemL( aObject, CMediaFileHandler::EMediaTypeMusic ); + return; + } + + TPtrC album = TextL( aObject, CMediaFileHandler::EAttrAlbum ); + + // unknown songs (no album metadata) for one artist + if ( aQueryType == CMediaFileHandler::EQueryArtistUnknown ) + { + if ( album.Length() == 0 ) + { + AddItemL( aObject, CMediaFileHandler::EMediaTypeMusic ); + } + } + + // all albums for one artist + if ( aQueryType == CMediaFileHandler::EQueryArtist ) + { + if ( album.Length() > 0 ) + { + AddAlbumItemL( album ); + } + } + + // songs in one album + if ( aQueryType == CMediaFileHandler::EQueryArtistAlbum ) + { + if ( album.Length() > 0 ) + { + if ( album.Compare( aAlbum ) == 0 ) + { + AddItemL( aObject, CMediaFileHandler::EMediaTypeMusic ); + } + } + } + } + + +// ----------------------------------------------------------------------------- +// CSearchList::Sort +// +// ----------------------------------------------------------------------------- +// +void CSearchList::Sort() + { + iList.Sort( TLinearOrder(CSearchList::Compare) ); + } + + +// ----------------------------------------------------------------------------- +// CSearchList::Reset +// +// ----------------------------------------------------------------------------- +// +void CSearchList::Reset() + { + iSearchId = KErrNotFound; + iList.ResetAndDestroy(); + } + + +// ----------------------------------------------------------------------------- +// CSearchList::Count +// +// ----------------------------------------------------------------------------- +// +TInt CSearchList::Count() + { + return iList.Count(); + } + + +// ----------------------------------------------------------------------------- +// CSearchList::GetAttributeL +// +// ----------------------------------------------------------------------------- +// +void CSearchList::GetAttributeL( TInt aIndex, TInt aAttr, TDes& aValue ) + { + aValue = KNullDesC; + + if ( !iSession ) + { + return; + } + + if ( aIndex == KErrNotFound ) + { + return; + } + + TInt count = iList.Count(); + if ( aIndex < 0 || aIndex >= count ) + { + return; + } + + if ( aAttr == CMediaFileHandler::EAttrFullName ) + { + CSearchListItem* item = iList[aIndex]; + if ( item->iStorageType == CMediaFileHandler::ERomStorage ) + { + if ( item->iMediaType == CMediaFileHandler::EMediaTypeTone ) + { + TPtrC name = iRomFileList->Item( item->iId , 0 ); + TMFDialogUtil::StrCopy( aValue, name ); + } + + if ( item->iMediaType == CMediaFileHandler::EMediaTypeVideo ) + { + TPtrC name = iRomFileList->Item( item->iId , 1 ); + TMFDialogUtil::StrCopy( aValue, name ); + } + } + else + { + CMdEObject* object = iSession->GetFullObjectL( item->iId ); + CleanupStack::PushL( object ); + TMFDialogUtil::StrCopy( aValue, object->Uri() ); + CleanupStack::PopAndDestroy( object ); + } + } + + else if ( aAttr == CMediaFileHandler::EAttrSongName || + aAttr == CMediaFileHandler::EAttrFileName ) + { + CSearchListItem* item = iList[aIndex]; + TMFDialogUtil::StrCopy( aValue, item->Title() ); + if ( aValue.Length() == 0 ) + { + if ( item->iStorageType == CMediaFileHandler::ERomStorage ) + { + if ( item->iMediaType == CMediaFileHandler::EMediaTypeTone ) + { + TPtrC name = iRomFileList->Item( aIndex,0 ); + TMFDialogUtil::StrCopy( aValue, name ); + } + + if ( item->iMediaType == CMediaFileHandler::EMediaTypeVideo ) + { + TPtrC name = iRomFileList->Item( aIndex,1 ); + TMFDialogUtil::StrCopy( aValue, name ); + } + } + else + { + CMdEObject* object = iSession->GetFullObjectL( item->iId ); + CleanupStack::PushL( object ); + TParsePtrC parse( object->Uri() ); + TMFDialogUtil::StrCopy( aValue, parse.Name() ); + CleanupStack::PopAndDestroy( object ); + } + } + } + } + + +// ----------------------------------------------------------------------------- +// CSearchList::Attribute +// +// ----------------------------------------------------------------------------- +// +TInt CSearchList::Attribute( TInt aIndex, TInt aAttr ) + { + if ( aIndex == KErrNotFound ) + { + return KErrNotFound; + } + + TInt count = iList.Count(); + if ( aIndex < 0 || aIndex >= count ) + { + return KErrNotFound; + } + + + TInt ret = KErrNotFound; + if ( aAttr == CMediaFileHandler::EAttrMediaType ) + { + CSearchListItem* item = iList[aIndex]; + ret = item->iMediaType; + } + + else if ( aAttr == CMediaFileHandler::EAttrStorageType ) + { + CSearchListItem* item = iList[aIndex]; + ret = item->iStorageType; + } + else if ( aAttr == CMediaFileHandler::EAttrMediaFileId ) + { + CSearchListItem* item = iList[aIndex]; + ret = item->iId; + } + + return ret; + } + + +// ----------------------------------------------------------------------------- +// CSearchList::Compare +// +// ----------------------------------------------------------------------------- +// +TInt CSearchList::Compare( const CSearchListItem& aFirst, + const CSearchListItem& aSecond ) + { + TPtrC first = aFirst.Title(); + TPtrC second = aSecond.Title(); + + return first.Compare( second ); + } + + +// ----------------------------------------------------------------------------- +// CSearchList::Panic +// +// ----------------------------------------------------------------------------- +// +void CSearchList::Panic( TInt aReason ) + { + TMFDialogUtil::Panic( aReason ); + } + + +// ----------------------------------------------------------------------------- +// CSearchList::TextL +// +// ----------------------------------------------------------------------------- +// +const TDesC& CSearchList::TextL( CMdEObject& aObject, TInt aId ) + { + CMdEPropertyDef& propDef = + CMediaFileHandler::PropertyDefL( iSession, aId ); + + CMdEProperty* property = NULL; + TInt err = aObject.Property( propDef, property, 0 ); + + if ( err != KErrNotFound && property ) + { + return property->TextValueL(); + } + + return KNullDesC; + } + + + +// ----------------------------------------------------------------------------- +// CSearchList::ItemIndex +// +// ----------------------------------------------------------------------------- +// +TInt CSearchList::ItemIndex( TInt aId ) + { + TInt count = iList.Count(); + + for ( TInt i=0; iiId == aId ) + { + return i; + } + } + + return KErrNotFound; + } + + +// ----------------------------------------------------------------------------- +// CSearchList::ItemIndex +// +// ----------------------------------------------------------------------------- +// +TInt CSearchList::ItemIndex( const TDesC& aText ) + { + TInt count = iList.Count(); + + for ( TInt i=0; iTitle() ) == 0 ) + { + return i; + } + } + + + + return KErrNotFound; + } + + +// ----------------------------------------------------------------------------- +// CSearchList::ItemIndex +// +// ----------------------------------------------------------------------------- +// +TInt CSearchList::ItemIndex( TInt aId, TInt aIndex ) + { + TInt count = iList.Count(); + if ( aIndex >= 0 && aIndex < count ) + { + CSearchListItem* item = iList[aIndex]; + if ( item->iId == aId ) + { + return aIndex; + } + } + + return ItemIndex( aId ); + } + + +// ----------------------------------------------------------------------------- +// CSearchList::ItemIndex +// +// ----------------------------------------------------------------------------- +// +TInt CSearchList::ItemIndex( const TDesC& aText, TInt aIndex ) + { + TInt count = iList.Count(); + if ( aIndex >= 0 && aIndex < count ) + { + CSearchListItem* item = iList[aIndex]; + if ( aText.CompareF( item->Title() ) == 0 ) + { + return aIndex; + } + } + + return ItemIndex( aText ); + } + + +/****************************************************************************** + * class CArtistQuery + ******************************************************************************/ + + + +// ----------------------------------------------------------------------------- +// CArtistQuery::NewL +// +// ----------------------------------------------------------------------------- +// +CArtistQuery* CArtistQuery::NewL() + { + CArtistQuery* self = new (ELeave) CArtistQuery(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// +// ----------------------------------------------------------------------------- +// +CArtistQuery::~CArtistQuery() + { + delete iArtist; + delete iAlbum; + delete iQuery; + } + + +// ----------------------------------------------------------------------------- +// CArtistQuery::CArtistQuery +// +// ----------------------------------------------------------------------------- +// +CArtistQuery::CArtistQuery() + { + iQueryType = KErrNotFound; + } + + +// ----------------------------------------------------------------------------- +// CArtistQuery::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CArtistQuery::ConstructL() + { + iArtist = HBufC::NewL( 0 ); + iAlbum = HBufC::NewL( 0 ); + } + +// ----------------------------------------------------------------------------- +// CArtistQuery::SetQueryType +// +// ----------------------------------------------------------------------------- +// +void CArtistQuery::SetQueryType( TInt aType ) + { + iQueryType = aType; + } + + +// ----------------------------------------------------------------------------- +// CArtistQuery::QueryType +// +// ----------------------------------------------------------------------------- +// +TInt CArtistQuery::QueryType() + { + return iQueryType; + } + + +// ----------------------------------------------------------------------------- +// CArtistQuery::SetQuery +// +// ----------------------------------------------------------------------------- +// +void CArtistQuery::SetQuery( CMdEObjectQuery* aQuery ) + { + delete iQuery; + iQuery = NULL; + iQuery = aQuery; + } + + +// ----------------------------------------------------------------------------- +// CArtistQuery::Query +// +// ----------------------------------------------------------------------------- +// +CMdEObjectQuery* CArtistQuery::Query() + { + return iQuery; + } + + +// ----------------------------------------------------------------------------- +// CArtistQuery::Artist +// +// ----------------------------------------------------------------------------- +// +const TDesC& CArtistQuery::Artist() + { + return *iArtist; + } + + +// ----------------------------------------------------------------------------- +// CArtistQuery::Album +// +// ----------------------------------------------------------------------------- +// +const TDesC& CArtistQuery::Album() + { + return *iAlbum; + } + + +// ----------------------------------------------------------------------------- +// CArtistQuery::SetAlbumL +// +// ----------------------------------------------------------------------------- +// +void CArtistQuery::SetAlbumL( const TDesC& aText ) + { + delete iAlbum; + iAlbum = NULL; + iAlbum = aText.AllocL(); + } + +// ----------------------------------------------------------------------------- +// CArtistQuery::SetArtistL +// +// ----------------------------------------------------------------------------- +// +void CArtistQuery::SetArtistL( const TDesC& aText ) + { + delete iArtist; + iArtist = NULL; + iArtist = aText.AllocL(); + } + + +// ----------------------------------------------------------------------------- +// CArtistQuery::ResetL +// +// ----------------------------------------------------------------------------- +// +void CArtistQuery::ResetL() + { + iQueryType = KErrNotFound; + + delete iArtist; + iArtist = NULL; + + delete iAlbum; + iAlbum = NULL; + + delete iQuery; + iQuery = NULL; + + iArtist = HBufC::NewL( 0 ); + iAlbum = HBufC::NewL( 0 ); + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Src/mediafilelist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Src/mediafilelist.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,170 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface of MediaFileList. Provide some API for +* the user to use mediafilelist +* +*/ + + + + +// INCLUDE FILES + +#include "mediafilelist.h" +#include "mediafiledialog.h" + + + +// ----------------------------------------------------------------------------- +// CMediaFileList::NewL +// +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CMediaFileList* CMediaFileList::NewL() + { + CMediaFileList* self = new (ELeave) CMediaFileList(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMediaFileList::~CMediaFileList() + { + delete iDialog; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileList::ConstructL +// +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CMediaFileList::ConstructL() + { + iDialog = CMediaFileDialog::NewL(); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileList::CMediaFileList +// +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CMediaFileList::CMediaFileList() + { + } + + +// ----------------------------------------------------------------------------- +// CMediaFileList::ShowCMediaFileListL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CMediaFileList::ShowMediaFileListL( TDes* aFileName, + TInt* aNullItem, + TInt* aInfo, + TDes* aDesInfo ) + { + TInt err = KErrNone; + TInt ret = EFalse; + TRAP( err, ret = iDialog->ShowDialogL( aFileName, aNullItem, aInfo, aDesInfo ) ); + + iDialog = NULL; + + User::LeaveIfError( err ); + + if ( !ret ) + { + return EFalse; + } + + if ( aFileName->Length() == 0 ) + { + return EFalse; + } + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileList::SetAttrL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMediaFileList::SetAttrL( TInt aAttr, TInt aValue ) + { + if ( iDialog ) + { + iDialog->SetAttrL( aAttr, aValue ); + } + } + +// ----------------------------------------------------------------------------- +// CMediaFileList::SetAttrL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMediaFileList::SetAttrL( TInt aAttr, const TDesC& aValue ) + { + if ( iDialog ) + { + iDialog->SetAttrL( aAttr, aValue ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileList::SetAttrL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMediaFileList::SetAttrL( TInt aAttr, TAny* aValue ) + { + if ( iDialog ) + { + iDialog->SetAttrL( aAttr, aValue ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileList::SetNullItemL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMediaFileList::SetNullItemL( const TDesC& aText, + const TDesC& aMediaFile, + TInt aMediaFileType, TInt aIconId ) + { + if ( iDialog ) + { + iDialog->SetNullItemL( aText, aMediaFile, aMediaFileType, aIconId ); + } + } + + + +// End of file diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Src/mediafilelist.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Src/mediafilelist.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,725 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This file contains all the resources for the MediaFileList module. +* +*/ + + + + +// RESOURCE IDENTIFIER +NAME MFLI // 4 letter ID + +// INCLUDES + +#include +#include +#include + +// common avkon strings +#include +#include +#include +#include +#include + + +// RESOURCE DEFINITIONS + +RESOURCE RSS_SIGNATURE { } + + +RESOURCE TBUF r_qtn_media_file_dialog_title + { + buf = qtn_tsl_title; + } +RESOURCE TBUF r_qtn_info_file_format_error + { + buf = qtn_tsl_file_format_error; + } +RESOURCE TBUF r_qtn_info_clip_format_error + { + buf = qtn_mp_note_invalid_clip; + } +RESOURCE TBUF r_qtn_info_file_size_error + { + buf = qtn_profiles_tone_maxsize_error; + } +RESOURCE TBUF r_qtn_info_drm_protected + { + buf = qtn_profiles_info_tone_drm_protected; + } +RESOURCE TBUF r_qtn_info_no_drm + { + // from avkon.loc + buf = qtn_profiles_info_tone_no_drm; + } +RESOURCE TBUF r_qtn_info_drm_prev_rights_use + { + // from drmcommon.loc + buf = qtn_drm_prev_rights_use; + } +RESOURCE TBUF r_qtn_info_drm_prev_rights_set + { + // from drmcommon.loc + buf = qtn_drm_prev_rights_set; + } +RESOURCE TBUF r_qtn_info_text_not_allowed + { + // from avkon.loc + buf = text_not_allowed; + } + + +RESOURCE TBUF r_qtn_wait_note_open + { + buf = qtn_tsl_wait_note_opening; + } +RESOURCE TBUF r_qtn_wait_note_search + { + buf = qtn_tsl_wait_note_searching; + } +RESOURCE TBUF r_qtn_wait_note_update + { + buf = qtn_tsl_wait_note_updating; + } + + +RESOURCE TBUF r_qtn_folder_download + { + buf = qtn_tsl_download_tones; + } +RESOURCE TBUF r_qtn_folder_tones + { + buf = qtn_tsl_tones_folder; + } +RESOURCE TBUF r_qtn_folder_music + { + buf = qtn_tsl_music_folder; + } +RESOURCE TBUF r_qtn_folder_videos + { + buf = qtn_tsl_videos_folder; + } +RESOURCE TBUF r_qtn_folder_recordings + { + buf = qtn_tsl_recordings_folder; + } +RESOURCE TBUF r_qtn_folder_default_tone + { + buf = qtn_tsl_according_to_profile; + } +RESOURCE TBUF r_qtn_folder_off + { + buf = qtn_tsl_off; + } +RESOURCE TBUF r_qtn_folder_all_music + { + buf = qtn_tsl_all_music_folder; + } +RESOURCE TBUF r_qtn_folder_artist + { + buf = qtn_tsl_artists_folder; + } +RESOURCE TBUF r_qtn_folder_album + { + buf = qtn_tsl_albums_folder; + } +RESOURCE TBUF r_qtn_folder_genre + { + buf = qtn_tsl_genres_folder; + } +RESOURCE TBUF r_qtn_folder_composer + { + buf = qtn_tsl_composers_folder; + } +RESOURCE TBUF r_qtn_folder_artist_all + { + buf = qtn_tsl_all; + } + +RESOURCE TBUF r_qtn_unknown_artist + { + buf = qtn_tsl_unknown_artist; + } +RESOURCE TBUF r_qtn_unknown_album + { + buf = qtn_tsl_unknown_album; + } +RESOURCE TBUF r_qtn_unknown_genre + { + buf = qtn_tsl_unknown_genre; + } +RESOURCE TBUF r_qtn_unknown_composer + { + buf = qtn_tsl_unknown_composer; + } + +RESOURCE TBUF r_qtn_preview_popup_artist + { + buf = qtn_tsl_preview_popup_artist; + } +RESOURCE TBUF r_qtn_preview_popup_album + { + buf = qtn_tsl_preview_popup_album; + } +RESOURCE TBUF r_qtn_preview_popup_genre + { + buf = qtn_tsl_preview_popup_genre; + } +RESOURCE TBUF r_qtn_preview_popup_composer + { + buf = qtn_tsl_preview_popup_composer; + } + + +RESOURCE TBUF r_qtn_view_tones + { + buf = qtn_tsl_tones_view; + } +RESOURCE TBUF r_qtn_view_music + { + buf = qtn_tsl_music_view; + } +RESOURCE TBUF r_qtn_view_videos + { + buf = qtn_tsl_videos_view; + } +RESOURCE TBUF r_qtn_view_recordings + { + buf = qtn_tsl_recordings_view; + } +RESOURCE TBUF r_qtn_view_search + { + buf = qtn_tsl_find_results; + } +RESOURCE TBUF r_qtn_view_artist + { + buf = qtn_tsl_artists_view; + } +RESOURCE TBUF r_qtn_view_album + { + buf = qtn_tsl_albums_view; + } +RESOURCE TBUF r_qtn_view_genre + { + buf = qtn_tsl_genres_view; + } +RESOURCE TBUF r_qtn_view_composer + { + buf = qtn_tsl_composers_view; + } + + +//------------------------------------------------------------------------------ +// number query resource +//------------------------------------------------------------------------------ +// +RESOURCE DIALOG r_number_query + { + flags = EAknGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL; + items= + { + DLG_LINE + { + type=EAknCtQuery; + id=EGeneralQuery; + + control = AVKON_DATA_QUERY + { + layout = ENumberLayout; + control = AVKON_INTEGER_EDWIN + { + min=0; + max=999999; + }; + }; + } + }; + } + + +//------------------------------------------------------------------------------ +// information query resource +//------------------------------------------------------------------------------ +// +RESOURCE DIALOG r_information_query + { + flags=EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK; + items= + { + DLG_LINE + { + type=EAknCtQuery; + id=EGeneralQuery; + control= AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + animation = R_QGN_NOTE_INFO_ANIM; + }; + } + }; + } + + +// ----------------------------------------------------------------------------- +// list query resource. +// ----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_list_query + { + flags=EEikDialogFlagWait | EGeneralQueryFlags; + + buttons=R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT; + + items= + { + AVKON_LIST_QUERY_DLG_LINE + { + control = AVKON_LIST_QUERY_CONTROL + { + listtype = EAknCtSinglePopupMenuListBox; + heading = qtn_profile_dialog_title; + + listbox = AVKON_LIST_QUERY_LIST + { + // items added dynamically + }; + }; + } + }; + } + + +// ----------------------------------------------------------------------------- +// video preview dialog resource +// ----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_video_preview_dialog + { + flags=EEikDialogFlagWait | EEikDialogFlagFillAppClientRect | EEikDialogFlagNotifyEsc; + buttons = r_video_preview_dialog_cba; + + items= + { + }; + } + + +RESOURCE CBA r_video_preview_dialog_cba + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeySelect; + txt = text_softkey_select; + }, + CBA_BUTTON + { + id = EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = EAknSoftkeySelect; + txt = qtn_msk_select; + } + }; + } + + +RESOURCE MENU_BAR r_video_preview_dialog_menu + { + titles= + { + MENU_TITLE + { + menu_pane=r_video_preview_dialog_menu_pane; + } + }; + } + +RESOURCE MENU_PANE r_video_preview_dialog_menu_pane + { + items= + { + MENU_ITEM { command=EAknSoftkeySelect; txt=text_softkey_select; }, + MENU_ITEM { command=EAknCmdHelp; txt=qtn_options_help; }, + MENU_ITEM { command=EAknCmdExit; txt=qtn_options_exit; } + }; + } + + +// ----------------------------------------------------------------------------- +// media file dialog resource. +// ----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_media_file_dialog + { + flags=EEikDialogFlagWait | EEikDialogFlagFillAppClientRect | EEikDialogFlagNotifyEsc | EEikDialogFlagNoBackup; + //buttons = r_media_file_dialog_cba_select_select_back; + buttons = R_AVKON_SOFTKEYS_SELECT_BACK__SELECT; + items= + { + DLG_LINE + { + type=EAknCtSingleGraphicListBox; + itemflags=EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys; + id=1; + control=LISTBOX + { + flags = EAknListBoxSelectionList; + }; + }, + DLG_LINE + { + itemflags = EEikDlgItemNonFocusing; + id = EFindControl; + type = EAknCtSelectionListFixedFind; + //type = EAknCtSelectionListPopupFind; + } + }; + } + +RESOURCE MENU_BAR r_media_file_dialog_menu + { + titles= + { + MENU_TITLE + { + menu_pane=r_media_file_dialog_menu_pane; + } + }; + } + +RESOURCE MENU_PANE r_media_file_dialog_menu_pane + { + items= + { + MENU_ITEM { command=EAknCmdOpen; txt=qtn_options_open; }, + MENU_ITEM { command=EAknSoftkeySelect; txt=text_softkey_select; }, + MENU_ITEM { command=EAknSoftkeyView; txt=Preview; }, + MENU_ITEM { command=EAknCmdHelp; txt=qtn_options_help; }, + MENU_ITEM { command=EAknCmdExit; txt=qtn_options_exit; } + }; + } + + +RESOURCE MENU_BAR r_media_file_dialog_context_menu + { + titles= + { + MENU_TITLE + { + menu_pane=r_media_file_dialog_context_menu_pane; + } + }; + } + +RESOURCE MENU_PANE r_media_file_dialog_context_menu_pane + { + items = + { + MENU_ITEM { command=EAknSoftkeySelect; txt=text_softkey_select; }, + MENU_ITEM { command=EAknSoftkeyView; txt=Preview; } + }; + } + + +//------------------------------------------------------------------------------ +// Softkey resource +//------------------------------------------------------------------------------ +// +RESOURCE CBA r_media_file_dialog_cba_open_open_back + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyOpen; + txt = text_softkey_open; + }, + CBA_BUTTON + { + id = EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = EAknSoftkeyOpen; + txt = qtn_msk_open; + } + }; + } + + +//------------------------------------------------------------------------------ +// Softkey resource +// +// Needed because R_AVKON_SOFTKEYS_SELECT_BACK__SELECT gives wrong +// button id when Back is pressed (EEikBidCancel). +//------------------------------------------------------------------------------ +// +RESOURCE CBA r_media_file_dialog_cba_select_select_back + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeySelect; + txt = text_softkey_select; + }, + CBA_BUTTON + { + id = EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = EAknSoftkeySelect; + txt = qtn_msk_select; + } + }; + } + + +//------------------------------------------------------------------------------ +// Softkey resource +//------------------------------------------------------------------------------ +// +RESOURCE CBA r_media_file_dialog_cba_preview_select_back + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyView; + txt = text_softkey_preview; + }, + CBA_BUTTON + { + id = EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = EAknSoftkeySelect; + txt = text_softkey_select; + } + }; + } + + +//------------------------------------------------------------------------------ +// Softkey resource +//------------------------------------------------------------------------------ +// +/* +RESOURCE CBA r_media_file_dialog_cba_preview_preview_back + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyView; + txt = text_softkey_preview; + }, + CBA_BUTTON + { + id = EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = EAknSoftkeyView; + txt = text_softkey_preview; + } + }; + } +*/ +//------------------------------------------------------------------------------ +// Softkey resource +//------------------------------------------------------------------------------ +// +/* +RESOURCE CBA r_media_file_dialog_cba_options_select_back + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id = EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = EAknSoftkeySelect; + txt = qtn_msk_select; + } + }; + } +*/ + +//------------------------------------------------------------------------------ +// Softkey resource +//------------------------------------------------------------------------------ +// +/* +RESOURCE CBA r_media_file_dialog_cba_options_open_back + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id = EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = EAknSoftkeyOpen; + txt = qtn_msk_open; + } + }; + } +*/ + +//------------------------------------------------------------------------------ +// Softkey resource +//------------------------------------------------------------------------------ +// +/* +RESOURCE CBA r_media_file_dialog_cba_options_search_back + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id = EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = EAknSoftkeySearch; + txt = text_softkey_search; + } + }; + } +*/ + +//------------------------------------------------------------------------------ +// Softkey resource +//------------------------------------------------------------------------------ +// +/* +RESOURCE CBA r_media_file_dialog_cba_options_context_back + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id = EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = EAknSoftkeyContextOptions; + txt = text_softkey_option; + } + }; + } +*/ + + +//------------------------------------------------------------------------------ +// Softkey resource +//------------------------------------------------------------------------------ +// +/* +RESOURCE CBA r_media_file_dialog_cba_empty_empty_back + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyEmpty; + txt = text_softkey_empty; + }, + CBA_BUTTON + { + id = EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = EAknSoftkeyEmpty; + txt = text_softkey_empty; + } + }; + } +*/ + +//------------------------------------------------------------------------------ +// wait note resource +//------------------------------------------------------------------------------ +// +RESOURCE DIALOG r_media_file_wait_note + { + flags=EAknProgressNoteFlags | EEikDialogFlagNotifyEsc; + buttons=R_AVKON_SOFTKEYS_CANCEL; + items= + { + DLG_LINE + { + type=EAknCtNote; + id=EGeneralNote; + control=AVKON_NOTE + { + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + layout=EProgressLayout; + + imagefile = AVKON_BITMAP_FILE; + imageid = EMbmAvkonQgn_note_progress; + imagemask = EMbmAvkonQgn_note_progress_mask; + + singular_label = qtn_gen_note_opening; + }; + } + }; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Src/mediafilepreview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Src/mediafilepreview.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,1539 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for preview audio and video +* +*/ + + + + +// INCLUDE FILES + +#include "mediafilepreview.h" +#include "mediafiledialogutils.h" +#include "mediafilelist.h" +#include "mediafilelistdebug.h" + +#include // KPSUidScreenSaver +#include // KAudioPriorityPreview +#include // C3DRingingToneInterface + +#include // for phone call states + +// for reading active profile settings +#include +#include +#include +#include "TProfileToneSettings.h" +#include +#include +#include +#include // KProEngDefaultRingingTone + + +/****************************************************************************** + * class CMFPreviewHandlerBase + ******************************************************************************/ + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::CMFPreviewHandlerBase +// +// ----------------------------------------------------------------------------- +// +CMFPreviewHandlerBase::CMFPreviewHandlerBase() + { + iMediaType = KErrNotFound; + iRingingVolume = KErrNotFound; + iRingingType = KErrNotFound; + iVibra = KErrNotFound; + i3DEffect = KErrNotFound; + i3DEcho = KErrNotFound; + iFileSize = KErrNotFound; + + iFullName = NULL; + + iActiveProfileRead = EFalse; + iPlayerStatus = EPlayerNotCreated; + + iObserver = NULL; + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::CMFPreviewHandlerBase +// +// ----------------------------------------------------------------------------- +// +void CMFPreviewHandlerBase::ConstructL() + { + // To allow/not allow screensaver + // Errors ignored, no actions needed if API is not available + iProperty.Attach( KPSUidScreenSaver, KScreenSaverAllowScreenSaver ); + + User::LeaveIfError( iApaSession.Connect() ); + + TRAP_IGNORE( ReadDefaultToneL() ); + // To keep backlight on while a video is being previewed + iBacklightTimer = CPeriodic::NewL( EPriorityLow ); + } + + +// ---------------------------------------------------------------------------- +// Destructor +// +// ---------------------------------------------------------------------------- +// +CMFPreviewHandlerBase::~CMFPreviewHandlerBase() + { + delete iFullName; + iProperty.Close(); + + iApaSession.Close(); + + if ( iBacklightTimer ) + { + delete iBacklightTimer; + iBacklightTimer = NULL; + } + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::SetAttr +// +// ----------------------------------------------------------------------------- +void CMFPreviewHandlerBase::SetAttrL( TInt aAttr, TInt aValue ) + { + switch ( aAttr ) + { + case CMediaFileList::EAttrVolume: + { + iRingingVolume = aValue; + break; + } + case CMediaFileList::EAttrRingingType: + { + iRingingType = aValue; + break; + } + case CMediaFileList::EAttrVibra: + { + iVibra = aValue; + break; + } + case CMediaFileList::EAttr3DEffect: + { + i3DEffect = aValue; + break; + } + case CMediaFileList::EAttr3DEcho: + { + i3DEcho = aValue; + break; + } + case CMediaFileList::EAttrFileSize: + { + iFileSize = aValue; + break; + } + default: + { + break; + } + } + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::Attr +// +// ----------------------------------------------------------------------------- +TInt CMFPreviewHandlerBase::Attr( TInt aAttr ) + { + TInt ret = KErrNotFound; + + switch ( aAttr ) + { + case CMediaFileList::EAttrVolume: + { + ret = iRingingVolume; + break; + } + case CMediaFileList::EAttrRingingType: + { + ret = iRingingType; + break; + } + case CMediaFileList::EAttrVibra: + { + ret = iVibra; + break; + } + case CMediaFileList::EAttr3DEffect: + { + ret = i3DEffect; + break; + } + case CMediaFileList::EAttr3DEcho: + { + ret = i3DEcho; + break; + } + case CMediaFileList::EAttrFileSize: + { + ret = iFileSize; + break; + } + default: + { + break; + } + } + + return ret; + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::SetAttrL +// +// ----------------------------------------------------------------------------- +void CMFPreviewHandlerBase::SetAttrL( TInt aAttr, const TDesC& aValue ) + { + if ( aAttr == TMFDialogUtil::EAttrFileName ) + { + delete iFullName; + iFullName = NULL; + iFullName = aValue.AllocL(); + } + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::SetAttr +// +// ----------------------------------------------------------------------------- +// +void CMFPreviewHandlerBase::SetAttrL( TInt aAttr, TAny* aValue ) + { + if ( aAttr == TMFDialogUtil::EAttrDrawingWindow ) + { + iWindow = static_cast( aValue ); + } + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::SetObserver +// +// ----------------------------------------------------------------------------- +// +void CMFPreviewHandlerBase::SetObserver( MPreviewHandlerObserver* aObserver ) + { + iObserver = aObserver; + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::IsCallOngoing +// +// ----------------------------------------------------------------------------- +// +TBool CMFPreviewHandlerBase::IsCallOngoing() + { + TInt err = KErrNone; + TInt callState = EPSCTsyCallStateUninitialized; + + err = RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, callState ); + if ( err == KErrNone ) + { + if( callState != EPSCTsyCallStateUninitialized && + callState != EPSCTsyCallStateNone && + callState != EPSCTsyCallStateDisconnecting ) + { + // There was call ongoing + return ETrue; + } + } + + return EFalse; + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::RingingVolume +// +// ----------------------------------------------------------------------------- +// +TInt CMFPreviewHandlerBase::RingingVolume() + { + const TInt KDefaultVolumeLevel = 7; // see profile.hrh for volume levels + + if ( iRingingVolume != KErrNotFound ) + { + return iRingingVolume; + } + + if ( iActiveProfileRead ) + { + return iActiveProfileRingingVolume; + } + + return KDefaultVolumeLevel; + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::RingingType +// +// ----------------------------------------------------------------------------- +// +TInt CMFPreviewHandlerBase::RingingType() + { + if ( iRingingType != KErrNotFound ) + { + return iRingingType; + } + + if ( iActiveProfileRead ) + { + return iActiveProfileRingingType; + } + + return ERingingTypeRinging; + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::Vibra +// +// ----------------------------------------------------------------------------- +// +TInt CMFPreviewHandlerBase::Vibra() + { + if ( iVibra != KErrNotFound ) + { + return iVibra; + } + + if ( iActiveProfileRead ) + { + return iActiveProfileVibra; + } + + return 0; // in case of error vibra is off + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::Echo3D +// +// ----------------------------------------------------------------------------- +// +TInt CMFPreviewHandlerBase::Echo3D() + { + if ( i3DEcho != KErrNotFound ) + { + return i3DEcho; + } + + if ( iActiveProfileRead ) + { + return iActiveProfile3DEcho; + } + + return EProfile3DEchoOff; // from ProfileInternal.hrh + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::Effect3D +// +// ----------------------------------------------------------------------------- +// +TInt CMFPreviewHandlerBase::Effect3D() + { + if ( i3DEffect != KErrNotFound ) + { + return i3DEffect; + } + + if ( iActiveProfileRead ) + { + return iActiveProfile3DEffect; + } + + return EProfile3DEffectOff; + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::ConvertVolume +// +// ----------------------------------------------------------------------------- +// +TInt CMFPreviewHandlerBase::ConvertVolume( TInt aVolume, TInt aMaxVolume ) + { + const TInt KMinVolumeLevel = 1; + const TInt KMaxVolumeLevel = 10; + + TInt result = aMaxVolume * aVolume / KMaxVolumeLevel; + + // if user has selected minimum volume level set HW volume 1 + if ( aVolume == KMinVolumeLevel && result == 0 ) + { + result = 1; + } + + return result; + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::ReadActiveProfileL +// ----------------------------------------------------------------------------- +// +void CMFPreviewHandlerBase::ReadActiveProfileL() + { + iActiveProfileRead = EFalse; + + MProfileEngine* profileEngine = CreateProfileEngineL(); + CleanupReleasePushL( *profileEngine ); + + MProfile* activeProfile = profileEngine->ActiveProfileL(); + CleanupReleasePushL( *activeProfile ); + + const MProfileTones& profileTones = activeProfile->ProfileTones(); + + const TProfileToneSettings& toneSettings = profileTones.ToneSettings(); + iActiveProfileVibra = toneSettings.iVibratingAlert; + iActiveProfileRingingVolume = toneSettings.iRingingVolume; + iActiveProfileRingingType = toneSettings.iRingingType; + + const MProfileExtraSettings& extra = activeProfile->ProfileExtraSettings(); + const MProfile3DToneSettings& threeD = extra.Profile3DToneSettings(); + + iActiveProfile3DEffect = threeD.Effect(); + iActiveProfile3DEcho = threeD.Echo(); + + CleanupStack::PopAndDestroy( activeProfile ); + CleanupStack::PopAndDestroy( profileEngine ); + + iActiveProfileRead = ETrue; + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::ReadDefaultToneL +// ----------------------------------------------------------------------------- +// +void CMFPreviewHandlerBase::ReadDefaultToneL() + { + CRepository* cenrep = CRepository::NewLC( KCRUidProfileEngine ); + + User::LeaveIfError( cenrep->Get( KProEngDefaultRingingTone, iDefaultTone ) ); + CleanupStack::PopAndDestroy( cenrep ); + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::EnableScreenSaver +// +// ----------------------------------------------------------------------------- +// +void CMFPreviewHandlerBase::EnableScreenSaver( TBool aEnable ) + { + if ( aEnable ) + { + // allow screen saver, unless there's a call ongoing + if( !IsCallOngoing() ) + { + // ignore error, no actions needed if API is not available + iProperty.Set( KPSUidScreenSaver, KScreenSaverAllowScreenSaver, + EFLScreenSaverAllowed ); + } + } + else + { + iProperty.Set( KPSUidScreenSaver, + KScreenSaverAllowScreenSaver, EFLScreenSaverNotAllowed ); + } + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::GetDataType +// +// ----------------------------------------------------------------------------- +// +TInt CMFPreviewHandlerBase::GetDataType( const TDesC& aFileName, TDataType& aDataType ) + { + TUid dummyUid( KNullUid ); + return iApaSession.AppForDocument( aFileName, dummyUid, aDataType ); + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::Panic +// +// ----------------------------------------------------------------------------- +// +void CMFPreviewHandlerBase::Panic( TInt aReason ) + { + _LIT( KPanicCategory, "CMFPreviewHandlerBase" ); + + User::Panic( KPanicCategory, aReason ); + } + + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::DoResetInactivityTimer() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMFPreviewHandlerBase::DoResetInactivityTimer( TAny* /*aObject*/ ) + { + User::ResetInactivityTime(); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMFPreviewHandlerBase::DisableBackLight() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CMFPreviewHandlerBase::DisableBackLight() + { + const TInt KResetInactivityTimerDelay = 2000000; + iBacklightTimer->Cancel(); // Just in case + // Disable backlight turn off during video preview + iBacklightTimer->Start( KResetInactivityTimerDelay, + KResetInactivityTimerDelay, + TCallBack( DoResetInactivityTimer, NULL ) ); + + } + + +/****************************************************************************** + * class CMFVideoPreviewHandler + ******************************************************************************/ + + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::NewL +// +// ----------------------------------------------------------------------------- +CMFVideoPreviewHandler* CMFVideoPreviewHandler::NewL() + { + CMFVideoPreviewHandler* self = new (ELeave) CMFVideoPreviewHandler(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::CMFVideoPreviewHandler +// +// ----------------------------------------------------------------------------- +// +CMFVideoPreviewHandler::CMFVideoPreviewHandler() + { + iPlayerStatus = EPlayerNotCreated; + } + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CMFVideoPreviewHandler::ConstructL() + { + CMFPreviewHandlerBase::ConstructL(); + } + + +// ---------------------------------------------------------------------------- +// Destructor +// +// ---------------------------------------------------------------------------- +// +CMFVideoPreviewHandler::~CMFVideoPreviewHandler() + { + Cancel(); + + if( iVolumeRampTimer ) + { + delete iVolumeRampTimer; + } + + if( iVideoPlayer ) + { + delete iVideoPlayer; + } + } + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::IsPlaying +// +// ----------------------------------------------------------------------------- +TBool CMFVideoPreviewHandler::IsPlaying() + { + if ( iPlayerStatus == EPlayerNotCreated ) + { + return EFalse; + } + + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::SetDisplayWindowL +// +// ----------------------------------------------------------------------------- +void CMFVideoPreviewHandler::SetDisplayWindowL() + { + if ( !iVideoPlayer ) + { + return; + } + + if ( !iWindow ) + { + return; // no screen for showing video + } + + // Screen and clip rectangles to window dimensions + TPoint wndPosition( iWindow->AbsPosition() ); + TSize wndSize( iWindow->Size() ); + + TRect wndRect( wndPosition, wndSize ); + + iVideoPlayer->SetDisplayWindowL( CCoeEnv::Static()->WsSession(), + *(CCoeEnv::Static()->ScreenDevice()), + *iWindow, + wndRect, + wndRect ); + } + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::PlayL +// +// ----------------------------------------------------------------------------- +void CMFVideoPreviewHandler::PlayL() + { + Cancel(); // stop previous playing + + if ( !iFullName || iFullName->Des().Length() == 0 ) + { + User::Leave( KErrNotFound ); + } + + if ( !iWindow ) + { + return; // no screen for showing video + } + + TRAP_IGNORE( ReadActiveProfileL() ); + + // Screen and clip rectangles to window dimensions + TPoint wndPosition( iWindow->AbsPosition() ); + TSize wndSize( iWindow->Size() ); + + // iY and iHeight should be even numbers + if( wndPosition.iY % 2 ) + { + wndPosition.iY = wndPosition.iY + 1; + wndSize.iHeight = wndSize.iHeight - 1; + } + if( wndSize.iHeight % 2 ) + { + wndSize.iHeight = wndSize.iHeight - 1; + } + + TRect wndRect( wndPosition, wndSize ); + + + // check video file + TDataType dataType; + TInt err = GetDataType( iFullName->Des(), dataType ); + if ( err != KErrNone ) + { + User::Leave( err ); + } + + TInt vibra = Vibra(); + TMdaPriorityPreference pref = (TMdaPriorityPreference) KAudioPrefRingFilePreview; + if ( vibra ) + { + pref = (TMdaPriorityPreference) KAudioPrefRingFilePreviewVibra; + } + + delete iVideoPlayer; + iVideoPlayer = NULL; + + iVideoPlayer = CVideoPlayerUtility::NewL ( *this, KAudioPriorityPreview, pref, + CCoeEnv::Static()->WsSession(), + *(CCoeEnv::Static()->ScreenDevice()), + *iWindow, + wndRect, + wndRect ); + + iVideoPlayer->OpenFileL( iFullName->Des() ); + + iPlayerStatus = EPlayerInitializing; + + EnableScreenSaver( EFalse ); // do not allow screen saver while playing + DisableBackLight(); + +#ifdef _DEBUG + User::InfoPrint( iFullName->Des() ); + FLOG( _L("CMFVideoPreviewHandler::PlayL '%S'"), &iFullName->Des() ); +#endif + + } + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::Stop +// +// ----------------------------------------------------------------------------- +void CMFVideoPreviewHandler::Stop() + { + Cancel(); + } + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::Cancel +// +// ----------------------------------------------------------------------------- +// +void CMFVideoPreviewHandler::Cancel() + { + TBool isPlaying = EFalse; + + if( iVolumeRampTimer ) + { + iVolumeRampTimer->Cancel(); + } + + if( iVideoPlayer ) + { + isPlaying = ETrue; + + if ( iPlayerStatus == EPlayerPlaying ) + { + iVideoPlayer->Stop(); + } + iVideoPlayer->Close(); + + delete iVideoPlayer; + iVideoPlayer = NULL; + } + + if ( isPlaying ) + { + User::InfoPrint( _L("cancel video") ); + + EnableScreenSaver( ETrue ); + iBacklightTimer->Cancel(); + } + + iPlayerStatus = EPlayerNotCreated; + } + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::SetRingingType +// +// ----------------------------------------------------------------------------- +// +void CMFVideoPreviewHandler::SetRingingType( TInt aRingingType ) + { + const TInt KMinVolumeLevel = 1; + const TInt KAscendingVolumeRampInterval = 3000000; // 3 seconds + + if ( aRingingType == ERingingTypeAscending ) + { + if ( !iVolumeRampTimer ) + { + iVolumeRampTimer = CPeriodic::New( CActive::EPriorityStandard ); + } + + if ( iVolumeRampTimer && !iVolumeRampTimer->IsActive() ) + { + TCallBack cb( VolumeRampTimerCallback, this ); + iRampedVolume = KMinVolumeLevel; + iVolumeRampTimer->Start( KAscendingVolumeRampInterval, + KAscendingVolumeRampInterval, cb ); + } + } + } + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::ConvertVolume +// +// ----------------------------------------------------------------------------- +// +TInt CMFVideoPreviewHandler::ConvertVolume( TInt aVolume ) + { + if ( !iVideoPlayer ) + { + return 0; + } + + TInt result = 0; + TBool audioEnabled = EFalse; + + TRAP_IGNORE( audioEnabled = iVideoPlayer->AudioEnabledL() ); + + if ( audioEnabled ) + { + result = CMFPreviewHandlerBase::ConvertVolume( aVolume, iVideoPlayer->MaxVolume() ); + + // if user has selected silent ringing type or beeb once, set volume off + TInt ringingType = RingingType(); + if ( ringingType == ERingingTypeSilent || ringingType == ERingingTypeBeepOnce ) + { + result = 0; + } + } + + return result; + } + + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::VolumeRampTimerCallback +// +// ----------------------------------------------------------------------------- +// +TInt CMFVideoPreviewHandler::VolumeRampTimerCallback( TAny* aObj ) + { + return static_cast( aObj )->VolumeRamp(); + } + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::VolumeRamp +// +// ----------------------------------------------------------------------------- +// +TInt CMFVideoPreviewHandler::VolumeRamp() + { + const TInt KPhoneVideoVolumeRampStep = 1; + + TInt ringingVolume = RingingVolume(); + if ( iRampedVolume < ringingVolume ) + { + iRampedVolume = iRampedVolume + KPhoneVideoVolumeRampStep; + if ( iRampedVolume >= ringingVolume ) + { + // target volume level reached + iRampedVolume = ringingVolume; + iVolumeRampTimer->Cancel(); + } + } + + TRAP_IGNORE( iVideoPlayer->SetVolumeL( ConvertVolume( iRampedVolume ) ) ); + + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::MvpuoOpenComplete (from MVidePlayerUtilityObserver) +// +// ----------------------------------------------------------------------------- +// +void CMFVideoPreviewHandler::MvpuoOpenComplete( TInt aError ) + { + __ASSERT_DEBUG( iPlayerStatus == EPlayerInitializing, Panic( KErrGeneral ) ); + + if ( aError ) + { + Cancel(); + + if ( iObserver ) + { + TInt event = MPreviewHandlerObserver::EPreviewError; + TRAP_IGNORE( iObserver->HandlePreviewEventL( event, aError ) ); + } + } + else + { + iVideoPlayer->Prepare(); + } + } + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::MvpuoPrepareComplete (from MVidePlayerUtilityObserver) +// +// ----------------------------------------------------------------------------- +// +void CMFVideoPreviewHandler::MvpuoPrepareComplete( TInt aError ) + { + const TInt KMinVolumeLevel = 1; + + __ASSERT_DEBUG( iPlayerStatus == EPlayerInitializing, Panic( KErrGeneral ) ); + + if ( aError != KErrNone ) + { + Cancel(); + + if ( iObserver ) + { + TInt event = MPreviewHandlerObserver::EPreviewError; + TRAP_IGNORE( iObserver->HandlePreviewEventL( event, aError ) ); + } + return; + } + + iPlayerStatus = EPlayerInitialized; + + TInt ringingType = RingingType(); + TInt ringingVolume = RingingVolume(); + TInt vibra = Vibra(); + + + SetRingingType( ringingType ); + + TInt startVolume = KMinVolumeLevel; + if ( ringingType != ERingingTypeAscending ) + { + startVolume = ConvertVolume( ringingVolume ); + } + else + { + // Ascending starts from minimum volume level + startVolume = ConvertVolume( KMinVolumeLevel ); + } + TRAP_IGNORE( iVideoPlayer->SetVolumeL( startVolume ) ); + + TMdaPriorityPreference pref = (TMdaPriorityPreference) KAudioPrefRingFilePreview; + if ( vibra ) + { + pref = (TMdaPriorityPreference) KAudioPrefRingFilePreviewVibra; + } + + // Unfortunately SetPriorityL uses always priority/preference + // settings which are given in videoPlayer constructor and ONLY + // after that sets SetPriorityL parameter to its member data + // which leads to a situation that we need to make SetPriorityL + // call twice to make new settings effect. + TRAP_IGNORE( iVideoPlayer->SetPriorityL( KAudioPriorityPreview, pref ) ); + TRAP_IGNORE( iVideoPlayer->SetPriorityL( KAudioPriorityPreview, pref ) ); + + iVideoPlayer->Play(); + iPlayerStatus = EPlayerPlaying; + } + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::MvpuoPlayComplete (from MVidePlayerUtilityObserver) +// +// ----------------------------------------------------------------------------- +// +void CMFVideoPreviewHandler::MvpuoPlayComplete( TInt aError ) + { + __ASSERT_DEBUG( iPlayerStatus == EPlayerPlaying, Panic( KErrGeneral ) ); + + if ( aError != KErrNone ) + { + Cancel(); + + if ( iObserver ) + { + TInt event = MPreviewHandlerObserver::EVideoPreviewComplete; + TRAP_IGNORE( iObserver->HandlePreviewEventL( event, aError ) ); + } + return; + } + + TInt ringingType = RingingType(); + if( ringingType != ERingingTypeRingOnce ) + { + iVideoPlayer->Play(); + } + else + { + Cancel(); + if ( iObserver ) + { + TInt event = MPreviewHandlerObserver::EVideoPreviewComplete; + TRAP_IGNORE( iObserver->HandlePreviewEventL( event, aError ) ); + } + } + } + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::MvpuoFrameReady (from MVidePlayerUtilityObserver) +// +// ----------------------------------------------------------------------------- +// +void CMFVideoPreviewHandler::MvpuoFrameReady( CFbsBitmap& /*aFrame*/,TInt /*aError*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::MvpuoEvent (from MVidePlayerUtilityObserver) +// +// ----------------------------------------------------------------------------- +// +void CMFVideoPreviewHandler::MvpuoEvent( const TMMFEvent& /*aEvent*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// CMFVideoPreviewHandler::GetRectData +// +// ----------------------------------------------------------------------------- +void CMFVideoPreviewHandler::GetRectData( TRect aRect, TDes& aText ) + { + _LIT( KFormat, "top left (%d,%d) bottom right (%d,%d)" ); + + TPoint p1 = aRect.iTl; + TPoint p2 = aRect.iBr; + + aText.Format( KFormat, p1.iX, p1.iY, p2.iX, p2.iY ); + } + + + + +/****************************************************************************** + * class CMFAudioPreviewHandler + ******************************************************************************/ + + + +// ----------------------------------------------------------------------------- +// CMFAudioPreviewHandler::NewL +// +// ----------------------------------------------------------------------------- +CMFAudioPreviewHandler* CMFAudioPreviewHandler::NewL() + { + CMFAudioPreviewHandler* self = new (ELeave) CMFAudioPreviewHandler(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + + +// ----------------------------------------------------------------------------- +// CMFAudioPreviewHandler::CMFAudioPreviewHandler +// +// ----------------------------------------------------------------------------- +// +CMFAudioPreviewHandler::CMFAudioPreviewHandler() + { + iAudioPlayerStatus = EPlayerNotCreated; + iTonePlayerStatus = EPlayerNotCreated; + } + + +// ----------------------------------------------------------------------------- +// CMFAudioPreviewHandler::CMFAudioPreviewHandler +// +// ----------------------------------------------------------------------------- +// +void CMFAudioPreviewHandler::ConstructL() + { + CMFPreviewHandlerBase::ConstructL(); + } + + +// ---------------------------------------------------------------------------- +// Destructor +// +// ---------------------------------------------------------------------------- +// +CMFAudioPreviewHandler::~CMFAudioPreviewHandler() + { + Cancel(); + + delete iAudioPlayer; + delete iTonePlayer; + delete i3dRingingTonePlugin; + } + + +// ----------------------------------------------------------------------------- +// CMFAudioPreviewHandler::IsPlaying +// +// ----------------------------------------------------------------------------- +TBool CMFAudioPreviewHandler::IsPlaying() + { + if ( iAudioPlayerStatus != EPlayerNotCreated ) + { + return ETrue; + } + + if ( iTonePlayerStatus != EPlayerNotCreated ) + { + return ETrue; + } + + return EFalse; + } + + +// ----------------------------------------------------------------------------- +// CMFAudioPreviewHandler::PlayL +// +// ----------------------------------------------------------------------------- +void CMFAudioPreviewHandler::PlayL() + { + //sequence for playing a beep once sound + _LIT8( KFileListBeepSequence, "\x00\x11\x06\x0A\x08\x73\x0A\x40\x28\x0A\xF7\ + \x05\xFC\x40\x64\x0A\x08\x40\x32\x0A\xF7\x06\x0B" ); + + // rng mime type + _LIT( KFileListRngMimeType, "application/vnd.nokia.ringing-tone" ); + + Cancel(); // stop previous play + + if ( !iFullName || iFullName->Des().Length() == 0 ) + { + User::Leave( KErrNotFound ); + } + + TRAP_IGNORE( ReadActiveProfileL() ); + + TPtrC fileName( iFullName->Des() ); + TDataType dataType; + TInt err = GetDataType( fileName, dataType ); + if ( err == KErrNotFound ) + { + fileName.Set( iDefaultTone ); + if ( fileName.Length() == 0 ) + { + User::Leave( KErrNotFound ); + } + } + else if ( err != KErrNone ) + { + User::Leave( err ); + } + + TBool mimeTypeRng = EFalse; + + if ( err == KErrNone ) + { + if( dataType.Des().CompareF( KFileListRngMimeType ) == 0 ) + { + mimeTypeRng = ETrue; + } + } + + TInt ringingType = RingingType(); + if ( ringingType == ERingingTypeBeepOnce ) + { + // Active profile ringing tone is set to Beep Once + // Don't initialize a FileSequence but use DesSequence instead + iTonePlayer = CMdaAudioToneUtility::NewL( *this ); + iTonePlayer->PrepareToPlayDesSequence( KFileListBeepSequence() ); + iTonePlayerStatus = EPlayerInitializing; + } + else + { + if( mimeTypeRng ) + { + //Ringingtone is a RNG-file + iTonePlayer = CMdaAudioToneUtility::NewL( *this ); + iTonePlayer->PrepareToPlayFileSequence( fileName ); + iTonePlayerStatus = EPlayerInitializing; + } + else + { + delete iAudioPlayer; + iAudioPlayer = NULL; + + iAudioPlayer = CDrmPlayerUtility::NewFilePlayerL( + fileName, *this, KAudioPriorityRingingTonePreview, + ( TMdaPriorityPreference )KAudioPrefRingFilePreview ); + + iAudioPlayerStatus = EPlayerInitializing; + } + } + + EnableScreenSaver( EFalse ); + DisableBackLight(); + +#ifdef _DEBUG + User::InfoPrint( iFullName->Des() ); + FLOG( _L("CMFAudioPreviewHandler::PlayL '%S'"), &iFullName->Des() ); +#endif + + } + + +// ----------------------------------------------------------------------------- +// CMFAudioPreviewHandler::Stop +// +// ----------------------------------------------------------------------------- +void CMFAudioPreviewHandler::Stop() + { + Cancel(); + } + + +// ----------------------------------------------------------------------------- +// CMFAudioPreviewHandler::ConvertVolume +// +// ----------------------------------------------------------------------------- +// +TInt CMFAudioPreviewHandler::ConvertVolume( TInt aVolume ) + { + TInt result = 0; + if ( iAudioPlayer ) + { + result = CMFPreviewHandlerBase::ConvertVolume( aVolume, iAudioPlayer->MaxVolume() ); + } + else if ( iTonePlayer ) + { + result = CMFPreviewHandlerBase::ConvertVolume( aVolume, iTonePlayer->MaxVolume() ); + } + + //if user has selected silent ringing type, set volume off + TInt ringingType = RingingType(); + if( ringingType == ERingingTypeSilent ) + { + result = 0; + } + + return result; + } + + +// ----------------------------------------------------------------------------- +// CMFAudioPreviewHandler::SetToneRingingType +// +// ----------------------------------------------------------------------------- +// +void CMFAudioPreviewHandler::SetToneRingingType( TInt aRingingType ) + { + const TInt KToneInterval = 1000000; // 1 second pause between tones + const TInt KAscendingVolumeInterval = 3000000; // 3 seconds + + if ( !iTonePlayer ) + { + return; + } + + __ASSERT_DEBUG( iTonePlayerStatus == EPlayerInitialized, Panic( KErrGeneral ) ); + + + TInt ringingVolume = RingingVolume(); + + switch( aRingingType ) + { + case ERingingTypeRinging: + case ERingingTypeSilent: + { + iTonePlayer->SetRepeats( KMdaAudioToneRepeatForever, + TTimeIntervalMicroSeconds( KToneInterval ) ); + break; + } + case ERingingTypeAscending: + { + iTonePlayer->SetRepeats( KMdaAudioToneRepeatForever, + TTimeIntervalMicroSeconds( KToneInterval ) ); + + TInt volRamp = KAscendingVolumeInterval * ringingVolume; + iTonePlayer->SetVolumeRamp( TTimeIntervalMicroSeconds( volRamp ) ); + break; + } + case ERingingTypeRingOnce: + case ERingingTypeBeepOnce: + { + iTonePlayer->SetRepeats( 0, TTimeIntervalMicroSeconds( KToneInterval ) ); + break; + } + default: + { + break; + } + } + } + + +// ----------------------------------------------------------------------------- +// CMFAudioPreviewHandler::SetAudioRingingType +// +// ----------------------------------------------------------------------------- +// +void CMFAudioPreviewHandler::SetAudioRingingType( TInt aRingingType ) + { + const TInt KToneInterval = 1000000; // 1 second pause between tones + const TInt KAscendingVolumeInterval = 3000000; // 3 seconds + + if ( !iAudioPlayer ) + { + return; + } + + __ASSERT_DEBUG( iAudioPlayerStatus == EPlayerInitialized, Panic( KErrGeneral ) ); + + + TInt ringingVolume = RingingVolume(); + + switch( aRingingType ) + { + case ERingingTypeRinging: + case ERingingTypeSilent: + { + iAudioPlayer->SetRepeats( KMdaAudioToneRepeatForever, + TTimeIntervalMicroSeconds( KToneInterval ) ); + break; + } + case ERingingTypeAscending: + { + iAudioPlayer->SetRepeats( KMdaAudioToneRepeatForever, + TTimeIntervalMicroSeconds( KToneInterval ) ); + TInt volRamp = KAscendingVolumeInterval * ringingVolume; + iAudioPlayer->SetVolumeRamp( TTimeIntervalMicroSeconds( volRamp ) ); + break; + } + case ERingingTypeRingOnce: + { + iAudioPlayer->SetRepeats( 0, TTimeIntervalMicroSeconds( KToneInterval ) ); + break; + } + + default: + { + break; + } + } + } + + +// ----------------------------------------------------------------------------- +// CMFAudioPreviewHandler::Cancel +// +// ----------------------------------------------------------------------------- +// +void CMFAudioPreviewHandler::Cancel() + { + TBool isPlaying = EFalse; + + if ( iAudioPlayer ) + { + isPlaying = ETrue; + if ( iAudioPlayerStatus == EPlayerPlayingWith3DEffect ) + { + i3dRingingTonePlugin->Stop(); + // plugin calls AudioPlayer->Stop() + iAudioPlayer->Close(); + } + if ( iAudioPlayerStatus == EPlayerPlaying ) + { + iAudioPlayer->Stop(); + iAudioPlayer->Close(); + } + + delete iAudioPlayer; + iAudioPlayer = NULL; + iAudioPlayerStatus = EPlayerNotCreated; + } + + if ( iTonePlayer ) + { + isPlaying = ETrue; + if ( iTonePlayerStatus == EPlayerPlaying ) + { + iTonePlayer->CancelPlay(); + } + + delete iTonePlayer; + iTonePlayer = NULL; + iTonePlayerStatus = EPlayerNotCreated; + } + + + if ( isPlaying ) + { + //User::InfoPrint(_L("cancel")); + EnableScreenSaver( ETrue ); + iBacklightTimer->Cancel(); + } + } + + +// ----------------------------------------------------------------------------- +// CMFAudioPreviewHandler::MatoPlayComplete (from MMdaAudioToneObserver) +// +// ----------------------------------------------------------------------------- +// +void CMFAudioPreviewHandler::MatoPlayComplete( TInt aError ) + { + if ( iObserver ) + { + TInt event = MPreviewHandlerObserver::EAudioPreviewComplete; + TRAP_IGNORE( iObserver->HandlePreviewEventL( event, aError ) ); + } + + Cancel(); + } + + +// ----------------------------------------------------------------------------- +// CMFAudioPreviewHandler::MatoPrepareComplete (from MMdaAudioToneObserver) +// +// ----------------------------------------------------------------------------- +// +void CMFAudioPreviewHandler::MatoPrepareComplete( TInt aError ) + { + __ASSERT_DEBUG( iTonePlayerStatus == EPlayerInitializing, Panic( KErrGeneral ) ); + + if ( aError != KErrNone ) + { + Cancel(); + + if ( iObserver ) + { + TInt event = MPreviewHandlerObserver::EPreviewError; + TRAP_IGNORE( iObserver->HandlePreviewEventL( event, aError ) ); + } + + return; + } + + TInt ringingVolume = RingingVolume(); + TInt ringingType = RingingType(); + TInt vibra = Vibra(); + + iTonePlayerStatus = EPlayerInitialized; + SetToneRingingType( ringingType ); + iTonePlayer->SetVolume( ConvertVolume( ringingVolume ) ); + + TMdaPriorityPreference pref = (TMdaPriorityPreference) KAudioPrefRingFilePreview; + if ( vibra ) + { + pref = (TMdaPriorityPreference) KAudioPrefRingFilePreviewVibra; + } + iTonePlayer->SetPriority( KAudioPriorityPreview, pref ); + + iTonePlayer->Play(); + iTonePlayerStatus = EPlayerPlaying; + } + + +// ----------------------------------------------------------------------------- +// CMFAudioPreviewHandler::MdapcInitComplete (from MDrmAudioPlayerCallback) +// +// ----------------------------------------------------------------------------- +// +void CMFAudioPreviewHandler::MdapcInitComplete( TInt aError, + const TTimeIntervalMicroSeconds& /* aDuration */ ) + { + __ASSERT_DEBUG( iAudioPlayer, Panic( KErrGeneral ) ); + + if ( aError != KErrNone ) + { + Cancel(); + + if ( iObserver ) + { + TInt event = MPreviewHandlerObserver::EPreviewError; + TRAP_IGNORE( iObserver->HandlePreviewEventL( event, aError ) ); + } + return; + } + + + TInt ringingVolume = RingingVolume(); + TInt ringingType = RingingType(); + TInt vibra = Vibra(); + TInt echo3D = Echo3D(); + TInt effect3D = Effect3D(); + + __ASSERT_DEBUG( ringingType != ERingingTypeBeepOnce, + TMFDialogUtil::Panic( KErrGeneral ) ); + + iAudioPlayerStatus = EPlayerInitialized; + SetAudioRingingType( ringingType ); + iAudioPlayer->SetVolume( ConvertVolume( ringingVolume ) ); + + TMdaPriorityPreference pref = (TMdaPriorityPreference) KAudioPrefRingFilePreview; + if ( vibra ) + { + pref = (TMdaPriorityPreference) KAudioPrefRingFilePreviewVibra; + } + iAudioPlayer->SetPriority( KAudioPriorityPreview, pref ); + + iAudioPlayerStatus = EPlayerPlaying; + + if ( effect3D == EProfile3DEffectOff ) + { + iAudioPlayer->Play(); // 3D not used + return; + } + + if ( !i3dRingingTonePlugin ) + { + TUid emptyUid = { 0 }; + TRAPD( err, i3dRingingTonePlugin = C3DRingingToneInterface::NewL( emptyUid ) ); + if ( err != KErrNone || !i3dRingingTonePlugin ) + { + iAudioPlayer->Play(); + return; + } + } + + i3dRingingTonePlugin->SetAttr( E3DRTIAttr3DEffect, effect3D ); + i3dRingingTonePlugin->SetAttr( E3DRTIAttr3DEcho, echo3D ); + i3dRingingTonePlugin->SetAttr( E3DRTIAttrDrmPlayerUtility, iAudioPlayer ); + TRAP_IGNORE( i3dRingingTonePlugin->PlayL() ); + + iAudioPlayerStatus = EPlayerPlayingWith3DEffect; + } + + +// ----------------------------------------------------------------------------- +// CMFAudioPreviewHandler::MdapcPlayComplete (from MDrmAudioPlayerCallback) +// +// ----------------------------------------------------------------------------- +// +void CMFAudioPreviewHandler::MdapcPlayComplete( TInt aError ) + { + if ( iObserver ) + { + TInt event = MPreviewHandlerObserver::EAudioPreviewComplete; + TRAP_IGNORE( iObserver->HandlePreviewEventL( event, aError ) ); + } + + Cancel(); + } + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Src/mediafileprotection.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Src/mediafileprotection.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,625 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class used to check the protection of the +* media files. +* +*/ + + + + +// INCLUDE FILES + +#include "mediafileprotection.h" +#include "mediafilelist.h" +#include "mediafilelistdebug.h" +#include + +#include +#include +#include +#include +#include + + + +/****************************************************************************** + * class CMFProtectionHandler + ******************************************************************************/ + +// ----------------------------------------------------------------------------- +// CMFProtectionHandler::NewL +// +// ----------------------------------------------------------------------------- +CMFProtectionHandler* CMFProtectionHandler::NewL() + { + CMFProtectionHandler* self = new (ELeave) CMFProtectionHandler(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + + +// ----------------------------------------------------------------------------- +// CMFProtectionHandler::CMFProtectionHandler +// +// ----------------------------------------------------------------------------- +// +CMFProtectionHandler::CMFProtectionHandler() + { + iMaxFileSize = KErrNotFound; + } + + +// ----------------------------------------------------------------------------- +// CMFProtectionHandler::CMFProtectionHandler +// +// ----------------------------------------------------------------------------- +// +void CMFProtectionHandler::ConstructL() + { + iDriveUtil = CDriveUtil::NewL(); + iVariation = CMediaFileDialogVariation::NewL(); + + iDRMHelper = CDRMHelper::NewL( *CCoeEnv::Static() ); + + iDRMCommon = DRMCommon::NewL(); + User::LeaveIfError( iDRMCommon->Connect() ); + + iExcludedMimeTypes = CMimeTypeList::NewL(); + + User::LeaveIfError( iApaLsSession.Connect() ); + User::LeaveIfError( iFsSession.Connect() ); + } + + +// ---------------------------------------------------------------------------- +// Destructor +// +// ---------------------------------------------------------------------------- +// +CMFProtectionHandler::~CMFProtectionHandler() + { + delete iDriveUtil; + delete iVariation; + + delete iDRMHelper; + + if ( iDRMCommon ) + { + iDRMCommon->Disconnect(); // ignore possible error + delete iDRMCommon; + } + + delete iExcludedMimeTypes; + iApaLsSession.Close(); + iFsSession.Close(); + } + + +// ----------------------------------------------------------------------------- +// CMFProtectionHandler::SetAttr +// +// ----------------------------------------------------------------------------- +void CMFProtectionHandler::SetAttrL( TInt aAttr, TInt aValue ) + { + switch ( aAttr ) + { + case CMediaFileList::EAttrFileSize: + { + iMaxFileSize = aValue; + break; + } + case CMediaFileList::EAttrAutomatedType: + { + iAutomatedType = (CDRMHelper::TDRMHelperAutomatedType) aValue; + break; + } + + default: + { + break; + } + } + } + + +// ----------------------------------------------------------------------------- +// CMFProtectionHandler::SetAttrL +// +// ----------------------------------------------------------------------------- +void CMFProtectionHandler::SetAttrL( TInt aAttr, const TDesC& aValue ) + { + if ( aAttr == CMediaFileList::EAttrExcludeMimeType ) + { + if ( aValue.Length() > KMaxFileName || aValue.Length() == 0 ) + { + User::Leave( KErrArgument ); + } + + iExcludedMimeTypes->AddMimeTypeL( aValue ); + } + } + + +// ----------------------------------------------------------------------------- +// CMFProtectionHandler::IsVideoValid +// +// ----------------------------------------------------------------------------- +// +TBool CMFProtectionHandler::IsVideoValid( const TDesC& aFileName, + TIntention aIntention ) + { + TInt err = KErrNone; + TBool ret = EFalse; + + TRAP( err, ret = IsVideoValidL (aFileName, aIntention ) ) + + if ( err != KErrNone ) + { + return EFalse; // in case of error file is not valid + } + + return ret; + } + + +// ----------------------------------------------------------------------------- +// CMFProtectionHandler::IsVideoValidL +// +// ----------------------------------------------------------------------------- +// +TBool CMFProtectionHandler::IsVideoValidL( const TDesC& aFileName, + TIntention /*aIntention*/ ) + { + TBuf dataType( DataTypeL( aFileName ).Des() ); + + if ( iExcludedMimeTypes->FindMimeTypeL( dataType ) ) + { + return EFalse; + } + + CContent* content = CContent::NewLC( aFileName, + EContentShareReadWrite ); + TInt deliveryMethod = 0; + content->GetAttribute( EDeliveryMethod, deliveryMethod ); + + CleanupStack::PopAndDestroy( content ); + + if( deliveryMethod == EOmaDrm2 ) + { + // if video it is OMA DRM 2 protected, it cannot be previewed + return EFalse; + } + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// CMFProtectionHandler::IsFileValid +// +// Checks protection state of media file. If this function returns EFalse, +// media file cannot be used for playing/selection. +// +// ----------------------------------------------------------------------------- +// +TBool CMFProtectionHandler::IsFileValid( const TDesC& aFileName, + TIntention aIntention ) + { + TInt err = KErrNone; + TBool ret = EFalse; + + TRAP( err, ret = IsFileValidL (aFileName, aIntention ) ) + + if ( err != KErrNone ) + { + return EFalse; // in case of error file is not valid + } + + return ret; + } + + +// ----------------------------------------------------------------------------- +// CMFProtectionHandler::IsFlieDRMExpired +// +// Check if the DRM protect file is expired or have no rights. +// ----------------------------------------------------------------------------- +// +TBool CMFProtectionHandler::IsFlieDRMExpired( const TDesC& aFileName ) + { + // Check whether the file can be set as automated content or not + TBool canSetAutomated = EFalse; + TInt canSetAutomatedErr = iDRMHelper->CanSetAutomated( aFileName, canSetAutomated ); + + // Check if rights expried or no rights to use + if ( canSetAutomatedErr == DRMCommon::ERightsExpired || + canSetAutomatedErr == DRMCommon::ENoRights ) + { + return ETrue; + } + return EFalse; + } + + +// ----------------------------------------------------------------------------- +// CMFProtectionHandler::IsFileValidL +// +// Function is copy from CFLDDRMImplementation.cpp. +// ----------------------------------------------------------------------------- +// +TBool CMFProtectionHandler::IsFileValidL( const TDesC& aFileName, + TIntention aIntention ) + { + TInt err = KErrNone; + TBuf dataType( DataTypeL( aFileName ).Des() ); + + if ( aFileName.Length() == 0 ) + { + return ETrue; // empty filename is valid?? + } + + if ( iExcludedMimeTypes->FindMimeTypeL( dataType ) ) + { + ShowErrorNoteL( R_QTN_INFO_FILE_FORMAT_ERROR ); + return EFalse; + } + + if ( aIntention == CMFProtectionHandler::ESelect && + !CheckFileSize( aFileName, dataType ) ) + { + HBufC* hBuf = StringLoader::LoadLC( R_QTN_INFO_FILE_SIZE_ERROR, iMaxFileSize ); + TMFDialogUtil::ShowInformationNoteL( *hBuf ); + CleanupStack::PopAndDestroy( hBuf ); + return EFalse; + } + + if ( iDriveUtil->IsRom( aFileName ) ) + { + return ETrue; // files in ROM are always valid + } + + // check if file is WMDRM protected + TBool prot = EFalse; + TRAP( err, prot = IsFileWMDRMProtectedL( aFileName ) ); + if ( err != KErrNone ) + { + ShowErrorNoteL( R_QTN_INFO_FILE_FORMAT_ERROR ); + return EFalse; + } + if ( prot ) + { + if ( aIntention == EPlay ) + { + ShowErrorNoteL( R_QTN_INFO_DRM_PREV_RIGHTS_USE ); + } + else + { + ShowErrorNoteL( R_QTN_INFO_DRM_PROTECTED ); + } + return EFalse; + } + + ContentAccess::TVirtualPathPtr path( aFileName, + ContentAccess::KDefaultContentObject ); + CData* data = CData::NewLC( path, EContentShareReadWrite ); + TInt isProtected; + err = data->GetAttribute( EIsProtected, isProtected ); + CleanupStack::PopAndDestroy( data ); + + if ( err != DRMCommon::EOk ) + { + // DRM Helper class knows at least rights db corrupted error message. + // Leaves on system-wide error code. + iDRMHelper->HandleErrorL( err, aFileName ); + return EFalse; + } + + // Obtain information whether the file can be set as automated content + TBool canSetAutomated = EFalse; + TInt canSetAutomatedErr = + iDRMHelper->CanSetAutomated( aFileName, canSetAutomated ); + + if ( !isProtected && canSetAutomated ) + { + // The file in question is not DRM protected. + // Return ETrue if file is also Ok unprotected, otherwise EFalse. + TBool ret = IsFileValidUnprotectedL( aFileName, aIntention ); + return ret; + } + + // Operator requirement: Check restrictions if file is mp4 audio + if ( iVariation->IsBlockedProtectedType( dataType ) ) + { + ShowErrorNoteL( R_QTN_INFO_DRM_PROTECTED ); + return EFalse; + } + + if ( canSetAutomatedErr == DRMCommon::ERightsExpired || + canSetAutomatedErr == DRMCommon::ENoRights ) + { + // Rights are expired, future rights or missing + iDRMHelper->HandleErrorL( canSetAutomatedErr, aFileName ); + return EFalse; + } + + // Operator requirement: Check DRM v2 tones + if ( !canSetAutomated ) + { + // This is DRM v2 file OR count based v1 tone + if ( aIntention == EPlay ) + { + ShowErrorNoteL( R_QTN_INFO_DRM_PREV_RIGHTS_USE ); + } + else + { + ShowErrorNoteL( R_QTN_INFO_DRM_PROTECTED ); + } + return EFalse; + } + + TInt32 infoBits( 0x00000000 ); + + // Find out rights information + if ( !GetFileInfoL( aFileName, infoBits ) ) + { + // Corrupted file or "No rights" situation + return EFalse; + } + + // Operator requirement: Check CFM protection + if ( infoBits & ENoRingingTone ) + { + // This is CFM protected file, ringingtone is set to "no" + if ( aIntention == EPlay ) + { + ShowErrorNoteL( R_QTN_INFO_DRM_PREV_RIGHTS_USE ); + } + else + { + ShowErrorNoteL( R_QTN_INFO_DRM_PREV_RIGHTS_SET ); + } + return EFalse; + } + + if ( aIntention == ESelect ) + { + // Rights are good to go, and intention is selection + // call SetAutomatedPassive to show 'activation query' + iDRMHelper->SetAutomatedType( iAutomatedType ); + err = iDRMHelper->SetAutomatedPassive( aFileName ); + if ( err != KErrCancel ) + { + // User accepted dialog + User::LeaveIfError( err ); + // New way, does not require DRM capability + data = CData::NewLC( path, EContentShareReadWrite ); + err = data->ExecuteIntent( ContentAccess::EPlay ); + // Wrongly requires DRM after all. According to Risto Vilkman + // from DRM, KErrAccessDenied can be ignored, since if + // CanSetAutomated says the tone is OK, it's OK. + if ( err != KErrNone && err != KErrAccessDenied ) + { + User::Leave( err ); + } + CleanupStack::PopAndDestroy( data ); + } + else + { + // User canceled dialog + return EFalse; + } + } + + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// CMFProtectionHandler::GetFileInfo +// +// Function is copy from CFLDDRMImplementation.cpp. +// ----------------------------------------------------------------------------- +// +TBool CMFProtectionHandler::GetFileInfoL( const TDesC& aFileName, + TInt32& aInfoBits ) + { + DRMCommon::TContentProtection contentProtection; // ignored + HBufC8* mimeType = NULL; // ignored + TUint dataLength = 0; // ignored + HBufC8* contentURI = NULL; + + // Obtain content URI + TInt error = iDRMCommon->GetFileInfo( + aFileName, contentProtection, mimeType, contentURI, dataLength ); + delete mimeType; + + if ( error != DRMCommon::EOk ) + { + delete contentURI; + // Handle possible corrupt file situation + iDRMHelper->HandleErrorL( error, aFileName ); + return EFalse; + } + + // Obtain rights object + CDRMRights* rights = NULL; + error = iDRMCommon->GetActiveRights( *contentURI, DRMCommon::EPlay, rights ); + delete contentURI; + + if ( error == DRMCommon::ENoRights ) + { + delete rights; + // There is no rights for given file + // Should never arrive here, ENoRights is handled + // already in IsFileValidL() + iDRMHelper->HandleErrorL( error, aFileName ); + return EFalse; + } + + // Obtain infobits ( needed only for CFM case ) + aInfoBits = rights->GetPermission().iInfoBits; + delete rights; + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// CMFProtectionHandler::IsFileWMDRMProtectedL +// +// Function is copy from CFLDDRMImplementation.cpp. +// ----------------------------------------------------------------------------- +// +TBool CMFProtectionHandler::IsFileWMDRMProtectedL( const TDesC& aFileName ) + { + TBool res = EFalse; + RFile hFile; + + TInt err = hFile.Open( iFsSession, aFileName, + EFileRead | EFileStream | EFileShareReadersOnly ); + if ( err == KErrInUse ) + { + err = hFile.Open( iFsSession, aFileName, + EFileRead | EFileStream | EFileShareAny ); + } + if ( err != KErrNone ) + { + User::Leave( err ); + } + CleanupClosePushL( hFile ); + + TPtrC agent( KNullDesC ); + DRM::CDrmUtility* drmUtil = DRM::CDrmUtility::NewLC(); + drmUtil->GetAgentL( hFile, agent ); + if ( agent.Compare( DRM::KDrmWMAgentName ) == 0 ) + { + res = ETrue; + } + CleanupStack::PopAndDestroy( drmUtil ); + + CleanupStack::PopAndDestroy( &hFile ); + return res; + } + + +// ----------------------------------------------------------------------------- +// CMFProtectionHandler::DataTypeL +// +// Function is copy from CFLDDRMImplementationCommon.cpp. +// ----------------------------------------------------------------------------- +// +TDataType CMFProtectionHandler::DataTypeL( const TDesC& aFileName ) + { + TUid dummyUid = { 0 }; + TDataType dataType( dummyUid ); + User::LeaveIfError( + iApaLsSession.AppForDocument( aFileName, dummyUid, dataType ) ); + + return dataType; + } + + +// ----------------------------------------------------------------------------- +// CMFProtectionHandler::IsFileValidUnprotectedL +// +// Function is copy from CFLDDRMImplementationCommon.cpp. +// ----------------------------------------------------------------------------- +// +TBool CMFProtectionHandler::IsFileValidUnprotectedL( const TDesC& aFileName, + TIntention aIntention ) + { + TDataType dataType = DataTypeL( aFileName ); + TBuf mimeType; + + mimeType = dataType.Des(); + + if ( iVariation->IsBlockedType( mimeType ) ) + { + if ( aIntention == ESelect ) + { + ShowErrorNoteL( R_QTN_INFO_TEXT_NOT_ALLOWED ); + } + return EFalse; + } + + // Operator requirement. Check if DRM is required with tones. + if ( aIntention == EPlay ) + { + if ( iVariation->IsBlockedDemoPlayType( mimeType ) ) + { + return EFalse; + } + } + else + { + if ( iVariation->IsBlockedUnprotectedType( mimeType ) ) + { + ShowErrorNoteL( R_QTN_INFO_NO_DRM ); + return EFalse; + } + } + + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// CMFProtectionHandler::CheckFileSize +// +// ----------------------------------------------------------------------------- +// +TBool CMFProtectionHandler::CheckFileSize( const TDesC& aFile, const TDesC& aMimeType ) + { + _LIT( KVideo, "video" ); + const TInt KKiloByte = 1024; + const TInt KSmallSize = 10; + + if ( iMaxFileSize < KSmallSize ) + { + return ETrue; // too small size limit + } + if ( aMimeType.Find( KVideo ) != KErrNotFound ) + { + return ETrue; // only audio files are checked + } + + TEntry entry; + TInt err = iFsSession.Entry( aFile, entry ); + if ( err == KErrNone && iMaxFileSize != KErrNotFound ) + { + TInt size = iMaxFileSize * KKiloByte; // KBytes -> Bytes + if ( entry.iSize > size ) + { + return EFalse; + } + } + + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// CMFProtectionHandler::ShowErrorNoteL +// +// ----------------------------------------------------------------------------- +// +void CMFProtectionHandler::ShowErrorNoteL( TInt aResourceId ) + { + TMFDialogUtil::ShowInformationNoteL( aResourceId ); + } + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Src/mediafiletest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Src/mediafiletest.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,2489 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class create for testing. +* +*/ + + + + +// INCLUDE FILES + +#include "mediafiletest.h" +#include "mediafiledialog.h" +#include "mediafilepreview.h" +#include "mediafilelistdebug.h" + +#include + +#include // for macro iAvkonAppUi +#include // for CEikCaptionedControl +#include // Math::FRand + +#include // bafl.lib +#include // RFileReadStream + + + +#ifdef _DEBUG +/****************************************************************************** + * class CMFDialogTest + ******************************************************************************/ + + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::NewL +// +// ----------------------------------------------------------------------------- +CMFDialogTest* CMFDialogTest::NewL( CMediaFileDialog* aDialog ) + { + CMFDialogTest* self = new (ELeave) CMFDialogTest( aDialog ); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::CMFDialogTest +// +// ----------------------------------------------------------------------------- +// +CMFDialogTest::CMFDialogTest( CMediaFileDialog* aDialog ) + { + iDlg = aDialog; + + iTestCounter = 0; + iBottomVisited = EFalse; + iDestroyedPtr = NULL; + } + + +// ---------------------------------------------------------------------------- +// Destructor +// +// ---------------------------------------------------------------------------- +// +CMFDialogTest::~CMFDialogTest() + { + SetScreenSaverPeriod( iScreenSaverPeriod ); + + delete iTestCaller; + delete iRandomNum; + + if ( iPopupNote ) + { + iPopupNote->HideInfoPopupNote(); + delete iPopupNote; + } + + if ( iDestroyedPtr ) + { + *iDestroyedPtr = ETrue; + iDestroyedPtr = NULL; + } + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CMFDialogTest::ConstructL() + { + const TInt KLongPeriod = 60*60*24; // 24 h in seconds + + iTestCaller = CMFActiveCaller::NewL( this ); + iRandomNum = CRandomNum::NewL(); + + iScreenSaverPeriod = ScreenSaverPeriodL(); + SetScreenSaverPeriod( KLongPeriod ); + + iPopupNote = CAknInfoPopupNoteController::NewL(); + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::TestL +// +// ----------------------------------------------------------------------------- +// +TBool CMFDialogTest::TestL( TInt /*aAttr*/ ) + { + TInt index = 0; + CDesCArray *arr = new(ELeave) CDesCArrayFlat( 1 ); + CleanupStack::PushL( arr ); + + arr->AppendL(_L("random play")); + arr->AppendL(_L("test 1")); + arr->AppendL(_L("test 2")); + + if ( !TMFDialogUtil::ShowListQueryL( _L("huu"), arr, &index ) ) + { + CleanupStack::PopAndDestroy( arr ); + return EFalse; + } + if ( index == 0 ) + { + NextListItemL(); + } + else if ( index == 1 ) + { + Test1L( 0 ); + } + else if ( index == 2 ) + { + Test2L( 0 ); + } + else + { + } + + CleanupStack::PopAndDestroy( arr ); + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::Test1L +// +// ----------------------------------------------------------------------------- +// +void CMFDialogTest::Test1L( TInt /*aAttr*/ ) + { + } + + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::Test2L +// +// ----------------------------------------------------------------------------- +// +void CMFDialogTest::Test2L( TInt /*aAttr*/ ) + { + TInt num10 = 0; TInt num11 = 0; TInt num12 = 0; + TInt num13 = 0; TInt num14 = 0; TInt num15 = 0; + TInt num16 = 0; TInt num17 = 0; TInt num18 = 0; + TInt num19 = 0; TInt num20 = 0; TInt numOther = 0; + + for (TInt i=0; i<100000; i++) + { + TInt num = iRandomNum->Random( 10, 20 ); + + if ( num == 10 ) + { + num10++; + } + else if ( num == 11 ) + { + num11++; + } + else if ( num == 12 ) + { + num12++; + } + else if ( num == 13 ) + { + num13++; + } + else if ( num == 14 ) + { + num14++; + } + else if ( num == 15 ) + { + num15++; + } + else if ( num == 16 ) + { + num16++; + } + else if ( num == 17 ) + { + num17++; + } + else if ( num == 18 ) + { + num18++; + } + else if ( num == 19 ) + { + num19++; + } + else if ( num == 20 ) + { + num20++; + } + else + { + numOther++; + } + + } + + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::NextFolderL +// +// ----------------------------------------------------------------------------- +// +void CMFDialogTest::NextFolderL() + { + const TInt KDelay = 2000; + + TBool destroyed = EFalse; + iDestroyedPtr = &destroyed; // updated in this class destructor + + TInt currentFolder = iDlg->iState->CurrentFolder(); + TInt currentIndex = iDlg->CurrentItemListIndex(); + TInt folderId = iDlg->iState->FolderId( currentIndex ); + + if ( currentFolder == EEFolderRoot ) + { + // root folder + iBottomVisited = EFalse; + if ( iRandomNum->Match( 30 ) ) + { + SimulateSearchEventL(); // search + } + else if ( folderId == EEFolderMusic || folderId == EEFolderTones || + folderId == EEFolderRecordings || folderId == EEFolderVideos ) + { + SimulateOpenEventL(); // go down + } + else + { + iTestCaller->Start( ENextListItem, KDelay ); + } + } + else if ( currentIndex == KErrNotFound ) + { + // empty folder + SimulateBackEventL(); // go up + } + else if ( folderId == KErrNotFound ) + { + // this folder has files, not subfolders + iBottomVisited = ETrue; + if ( iRandomNum->Match( 50 ) ) + { + // stay in this folder and select a file + iTestCaller->Start( ENextListItem, KDelay ); + return; + } + else + { + SimulateBackEventL(); // go up + } + } + else // this folder has subfolders + { + TInt num = 15; + if ( !iBottomVisited ) + { + num = 85; + } + + if ( iRandomNum->Match( num ) ) + { + SimulateOpenEventL(); // go down + } + else + { + SimulateBackEventL(); // go up + } + } + + // select listbox item after delay + if ( !destroyed ) + { + iDestroyedPtr = NULL; + iTestCaller->Start( ENextListItem, KDelay ); + } + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::NextListItemL +// +// ----------------------------------------------------------------------------- +// +void CMFDialogTest::NextListItemL() + { + const TInt KDelay = 250; + const TInt KLongDelay = 2000; + + TInt delay = KDelay; + + TInt currentIndex = iDlg->CurrentItemListIndex(); + TInt folderId = iDlg->iState->FolderId( currentIndex ); + + if ( folderId == KErrNotFound && currentIndex == 0 ) + { + // this folder contain files - make delay longer to + // allow first file preview + delay = KLongDelay; + } + + TInt itemCount = iDlg->iListBox->Model()->NumberOfItems(); + iNewIndex = iRandomNum->Random( itemCount - 1); + + if ( iDlg->iState->CurrentFolder() == EEFolderRoot ) + { + if ( iRandomNum->Match( 50 ) ) + { + iNewIndex = 2; // more chances to Music folder + } + } + + if ( iNewIndex == currentIndex ) + { + iTestCaller->Start( ENextFolder, delay ); + } + else + { + iTestCaller->Start( EMovePosition, delay ); + } + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::MovePositionL +// +// Scrolls listbox until selected item (iNewIndex) is found. +// ----------------------------------------------------------------------------- +// +void CMFDialogTest::MovePositionL() + { + const TInt KMoveDelay = 150; + const TInt KThousand = 1000; + + TInt currentIndex = iDlg->CurrentItemListIndex(); + TInt folderId = iDlg->iState->FolderId( currentIndex ); + TInt itemCount = iDlg->iListBox->Model()->NumberOfItems(); + + TBool itemFound = EFalse; + if ( currentIndex == iNewIndex ) + { + itemFound = ETrue; // listbox has scrolled to new item + } + if ( currentIndex == KErrNotFound ) + { + itemFound = ETrue; // folder is empty + } + if ( iNewIndex >= itemCount ) + { + itemFound = ETrue; // wrong folder + } + + if ( itemFound ) + { + // next listbox selection found + + TInt delay = KMoveDelay; + if ( folderId == KErrNotFound ) + { + // selection is file - allow time for preview + delay = iRandomNum->Random( 3, 10 ); + delay = delay * KThousand; + } + iTestCaller->Start( ENextFolder, delay ); + return; + } + + // Simulate listbox item selection. + SimulateKeyEventL( EKeyUpArrow ); + + //FLOG( _L("CMediaFileDialog::MovePositionL '%d/%d'"), currentIndex, iNewIndex ); + + iTestCaller->Start( EMovePosition, KMoveDelay ); + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::SimulateKeyEventL +// +// ----------------------------------------------------------------------------- +// +void CMFDialogTest::SimulateKeyEventL( TInt aEvent ) + { + TKeyEvent key; + key.iModifiers = 0; + key.iRepeats = 0; + key.iCode = aEvent; + key.iScanCode = aEvent; + + //iListBox->SetCurrentItemIndexAndDraw( newIndex ); + CCoeEnv::Static()->SimulateKeyEventL( key, EEventKey ); + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::SimulateOpenEventL +// +// ----------------------------------------------------------------------------- +// +void CMFDialogTest::SimulateOpenEventL() + { + TKeyEvent keyEvent; + keyEvent.iCode = EKeyDevice3; + keyEvent.iScanCode = EStdKeyDevice3; + keyEvent.iRepeats = 0; + CCoeEnv::Static()->SimulateKeyEventL( keyEvent, EEventKey ); + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::SimulateBackEventL +// +// ----------------------------------------------------------------------------- +// +void CMFDialogTest::SimulateBackEventL() + { + TKeyEvent keyEvent; + keyEvent.iCode = EKeyDevice1; + keyEvent.iScanCode = EStdKeyDevice1; + keyEvent.iRepeats = 0; + CCoeEnv::Static()->SimulateKeyEventL( keyEvent, EEventKey ); + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::SimulateSearchEventL +// +// ----------------------------------------------------------------------------- +// +void CMFDialogTest::SimulateSearchEventL() + { + // letter a 97/65 + // letter b 98/66 + + TKeyEvent keyEvent; + keyEvent.iCode = 97; + keyEvent.iScanCode = 65; + keyEvent.iRepeats = 0; + CCoeEnv::Static()->SimulateKeyEventL( keyEvent, EEventKey ); + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::SetScreenSaverPeriod +// +// ----------------------------------------------------------------------------- +// +void CMFDialogTest::SetScreenSaverPeriod( TInt aPeriod ) + { + TRAP_IGNORE( SetScreenSaverPeriodL( aPeriod ) ); + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::SetScreenSaverPeriodL +// +// ----------------------------------------------------------------------------- +// +void CMFDialogTest::SetScreenSaverPeriodL( TInt aPeriod ) + { + // from SettingsInternalCRKeys.h + const TUid KCRUidPersonalizationSettings = {0x101F877C}; + const TUint32 KSettingsScreenSaverPeriod = 0x00000008; + + CRepository* repository = + CRepository::NewL( KCRUidPersonalizationSettings ); + + // ignore error + repository->Set( KSettingsScreenSaverPeriod, aPeriod ); + + delete repository; + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::ScreenSaverPeriodL +// +// ----------------------------------------------------------------------------- +// +TInt CMFDialogTest::ScreenSaverPeriodL() + { + // from SettingsInternalCRKeys.h + const TUid KCRUidPersonalizationSettings = {0x101F877C}; + const TUint32 KSettingsScreenSaverPeriod = 0x00000008; + + CRepository* repository = + CRepository::NewL( KCRUidPersonalizationSettings ); + + TInt period = 60; // 60 seconds + // ignore error + repository->Get( KSettingsScreenSaverPeriod, period ); + + delete repository; + + return period; + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::HandleActiveCallL (from MMFActiveCallerObserver) +// +// ----------------------------------------------------------------------------- +// +void CMFDialogTest::HandleActiveCallL( TInt aCallId ) + { + if ( aCallId == ENextFolder ) + { + //FLOG( _L("CMFDialogTest::HandleActiveCallL: ENextFolder") ); + + TRAP_IGNORE( NextFolderL() ); + iDestroyedPtr = NULL; + } + if ( aCallId == ENextListItem ) + { + //FLOG( _L("CMFDialogTest::HandleActiveCallL: ENextListItem") ); + NextListItemL(); + } + + if ( aCallId == EMovePosition ) + { + //FLOG( _L("CMFDialogTest::HandleActiveCallL: EMovePosition") ); + + MovePositionL(); + } + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::SetTime +// +// ----------------------------------------------------------------------------- +// +void CMFDialogTest::SetTime() + { + iTime = TimeBefore(); + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::PrintTimeL +// +// ----------------------------------------------------------------------------- +// +void CMFDialogTest::PrintTimeL( const TDesC& aText ) + { + TBuf<128> buf; + TInt milliSeconds = TimeAfter( iTime ); + buf.Format( _L("%S %d ms"), &aText, milliSeconds ); + + ShowPopupNoteL( buf ); + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::TimeBefore +// +// Function returns TTime of the current time (needed with function TimeAfter). +// ----------------------------------------------------------------------------- +// +TTime CMFDialogTest::TimeBefore() + { + TTime now; + now.UniversalTime(); + return now; + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::TimeAfter +// +// Function returns milliseconds passed since aBefore. +// ----------------------------------------------------------------------------- +// +TInt64 CMFDialogTest::TimeAfter( TTime aBefore ) + { + TTime after; + after.UniversalTime(); + TTimeIntervalMicroSeconds microSeconds=after.MicroSecondsFrom( aBefore ); + TInt64 milliSeconds=microSeconds.Int64()/1000; + return milliSeconds; + } + + +// ----------------------------------------------------------------------------- +// CMFDialogTest::ShowPopupNote +// +// ----------------------------------------------------------------------------- +// +void CMFDialogTest::ShowPopupNoteL( const TDesC& aText ) + { + const TInt KPopupDisplayTime = 3*1000; + const TInt KPopupDelayTime = 500; + + iPopupNote->SetTextL( aText ); + iPopupNote->SetTimeDelayBeforeShow( KPopupDelayTime ); + iPopupNote->SetTimePopupInView( KPopupDisplayTime ); + iPopupNote->ShowInfoPopupNote(); + } + + + + +/****************************************************************************** + * class CRandomNum + ******************************************************************************/ + + + +// ----------------------------------------------------------------------------- +// CRandomNum::NewLC +// +// ----------------------------------------------------------------------------- +// +CRandomNum* CRandomNum::NewLC() + { + CRandomNum* randomdata = new (ELeave) CRandomNum; + CleanupStack::PushL( randomdata ); + return randomdata; + } + + +// ----------------------------------------------------------------------------- +// CRandomNum::NewL +// +// ----------------------------------------------------------------------------- +// +CRandomNum* CRandomNum::NewL() + { + CRandomNum* randomdata = new (ELeave) CRandomNum; + return randomdata; + } + +// ----------------------------------------------------------------------------- +// CRandomNum::CRandomNum +// +// ----------------------------------------------------------------------------- +// +CRandomNum::CRandomNum() + { + TTime now; + now.UniversalTime(); + iSeed = now.Int64(); + } + +// ----------------------------------------------------------------------------- +// CRandomNum::~CRandomNum +// +// ----------------------------------------------------------------------------- +// +CRandomNum::~CRandomNum() + { + } + + +// ----------------------------------------------------------------------------- +// CRandomNum::Random +// +// Return random integer from 0 to aMax (including 0 and aMax). +// ----------------------------------------------------------------------------- +// +TInt CRandomNum::Random( TInt aMax ) + { + TReal real = Math::FRand( iSeed ); // FRand updates iSeed + TReal real2 = real * ( aMax+1 ); + TInt num = (TInt) real2; + return num; + } + + +// ----------------------------------------------------------------------------- +// CRandomNum::Random +// +// Return random integer from aMin to aMax (including aMin and aMax). +// ----------------------------------------------------------------------------- +// +TInt CRandomNum::Random( TInt aMin, TInt aMax ) + { + if ( aMin >= aMax ) + { + return aMin; + } + + TInt range = aMax - aMin; + + TInt num = Random( range ); + + return aMin + num; + } + + +// ----------------------------------------------------------------------------- +// CRandomNum::Match +// +// Return ETrue according to percentage parameter (eg. in case +// aPercentage is 10 Match returns ETrue in 10% of the calls). +// ----------------------------------------------------------------------------- +// +TBool CRandomNum::Match( TInt aPercentage ) + { + if ( aPercentage < 1 ) + { + return EFalse; + } + + TInt num = Random( 99 ); // 0..99 + num++; // 1..100 + + if ( num <= aPercentage ) + { + return ETrue; + } + + return EFalse; + } + + + + + + +/****************************************************************************** + * class CMediaFileDialog3 + ******************************************************************************/ + +/* + +// ----------------------------------------------------------------------------- +// media file dialog resource (test code). +// ----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_media_file_dialog_3 + { + //flags = EEikDialogFlagNoBackup | EEikDialogFlagFillAppClientRect; + flags=EEikDialogFlagWait | EEikDialogFlagFillAppClientRect | EEikDialogFlagNotifyEsc; + //buttons = R_AVKON_SOFTKEYS_OK_BACK__OK; + buttons = r_media_file_dialog_3_cba; + + items= + { + DLG_LINE + { + type=EAknCtSingleGraphicListBox; + itemflags=EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys; + id=1; + control=LISTBOX + { + flags = EAknListBoxSelectionList; + }; + } + }; + + } + + +//------------------------------------------------------------------------------ +// Softkey resource +//------------------------------------------------------------------------------ +// +RESOURCE CBA r_media_file_dialog_3_cba + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id = EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = EAknSoftkeySelect; + txt = qtn_msk_select; + } + }; + } + +RESOURCE MENU_BAR r_media_file_dialog_3_menu + { + titles= + { + MENU_TITLE + { + menu_pane=r_media_file_dialog_3_menu_pane; + } + }; + } + +RESOURCE MENU_PANE r_media_file_dialog_3_menu_pane + { + items= + { + MENU_ITEM { command=EAknCmdOpen; txt=qtn_options_open; }, + MENU_ITEM { command=EAknCmdHelp; txt=qtn_options_help; }, + MENU_ITEM { command=EAknCmdExit; txt=qtn_options_exit; } + }; + } +*/ +/* + +// ----------------------------------------------------------------------------- +// CMediaFileDialog3::ShowDialogL +// +// ----------------------------------------------------------------------------- +TBool CMediaFileDialog3::ShowDialogL() + { + CMediaFileDialog3* dlg = CMediaFileDialog3::NewL(); + TBool ret = dlg->ExecuteLD( R_MEDIA_FILE_DIALOG_3 ); + + return ret; + } + +// ---------------------------------------------------------------------------- +// Destructor +// +// ---------------------------------------------------------------------------- +// +CMediaFileDialog3::~CMediaFileDialog3() + { + delete iVideoPreviewHandler; + + if ( iAvkonAppUi ) + { + iAvkonAppUi->RemoveFromStack( this ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog3::CMediaFileDialog3 +// +// ----------------------------------------------------------------------------- +// +CMediaFileDialog3::CMediaFileDialog3() + { + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialog3::NewL +// +// ----------------------------------------------------------------------------- +CMediaFileDialog3* CMediaFileDialog3::NewL() + { + CMediaFileDialog3* self = new (ELeave) CMediaFileDialog3(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + +// ----------------------------------------------------------------------------- +// CMediaFileDialog3::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog3::ConstructL() + { + FLOG( _L("CMediaFileDialog3::ConstructL START") ); + + CAknDialog::ConstructL( R_MEDIA_FILE_DIALOG_3_MENU ); + + iVideoPreviewHandler = CMFVideoPreviewHandler::NewL(); + + FLOG( _L("CMediaFileDialog3::ConstructL END") ); + } + +// ----------------------------------------------------------------------------- +// CMediaFileDialog3::PreLayoutDynInitL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialog3::PreLayoutDynInitL() + { + } + +//------------------------------------------------------------------------------ +// CMediaFileDialog3::OkToExitL +// +//------------------------------------------------------------------------------ +// +TBool CMediaFileDialog3::OkToExitL(TInt aButtonId) + { + if ( aButtonId == EAknSoftkeyBack ) + { + } + + return CAknDialog::OkToExitL( aButtonId ); + } + + + +//------------------------------------------------------------------------------ +// CMediaFileDialog3::ProcessCommandL +// +// Handle commands from menu. +//------------------------------------------------------------------------------ +// +void CMediaFileDialog3::ProcessCommandL(TInt aCommandId) + { + HideMenu(); + + + switch (aCommandId) + { + case EAknCmdHelp: + { + break; + } + + case EAknCmdOpen: + { + CEikCaptionedControl *ctrl = Line( 1 ); // dialog has one line (listbox) with id 1 + iVideoPreviewHandler->SetAttrL( TMFDialogUtil::EAttrDrawingWindow, (ctrl->iControl->DrawableWindow()) ); + + iVideoPreviewHandler->SetAttrL( TMFDialogUtil::EAttrFileName, _L("C:\\Data\\Videos\\video2.mp4") ); + iVideoPreviewHandler->PlayL(); + + break; + } + + case EAknCmdExit: + case EEikCmdExit: + { + // close dialog and exit calling application + iAvkonAppUi->ProcessCommandL( EAknCmdExit ); + break; + } + + default: + break; + } + } +*/ + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryAllL (obsolete) +// +// Finds all tones, music, videos or recordings. +// ----------------------------------------------------------------------------- +// +/* +void CMediaFileHandler::QueryAllL( TInt aAttr ) + { + if ( !iSessionOpen ) + { + User::Leave( KErrDisconnected ); + } + + if ( aAttr != EAttrMusic && aAttr != EAttrVideo ) + { + User::Leave( KErrNotSupported ); + } + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& musicObjectDef = defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + CMdEObjectDef& videoObjectDef = defNS.GetObjectDefL( MdeConstants::Video::KVideoObject ); + + delete iQuery; + iQuery = NULL; + + if ( aAttr == EAttrVideo ) + { + iQuery = iSession->NewObjectQueryL( defNS, videoObjectDef, this ); + iQueryType = EQueryVideo; + } + else + { + iQuery = iSession->NewObjectQueryL( defNS, musicObjectDef, this ); + iQueryType = EQueryAudio; + } + + + // set attributes that are included in query result + CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName ); + iQuery->AddPropertyFilterL( &namePropertyDef ); + + // define sort order + iQuery->AppendOrderRuleL( TMdEOrderRule( namePropertyDef, ESortAscending ) ); + + iQuery->SetResultMode( EQueryResultModeItem ); + + iQuery->FindL(); + + iQueryType = EQueryAudio; + } +*/ + + + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryArtistUnknownL (obsolete) +// +// Finds all songs for aArtist that miss album property. +// ----------------------------------------------------------------------------- +// +/* +void CMediaFileHandler::QueryArtistUnknownL( const TDesC& aArtist ) + { + if ( !iSessionOpen ) + { + return; + } + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& objectDef = defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + + iQueryType = EQueryAudio; + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); + + iQuery->SetResultMode( EQueryResultModeItem ); + + CMdEPropertyDef& artistPropertyDef = PropertyDefL( EAttrArtist ); + CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName ); + CMdEPropertyDef& albumPropertyDef = PropertyDefL( EAttrAlbum ); + + + CMdELogicCondition& conditions = iQuery->Conditions(); + + // add root condition: get all songs by aArtist + conditions.AddPropertyConditionL( artistPropertyDef, + ETextPropertyConditionCompareEquals, + aArtist ); + + // set attributes that are included in query result + iQuery->AppendOrderRuleL( TMdEOrderRule( namePropertyDef, ESortAscending ) ); + iQuery->AddPropertyFilterL( &namePropertyDef ); + iQuery->AddPropertyFilterL( &artistPropertyDef ); + + + // add other condition: get songs that do not have album attribute + CMdELogicCondition& albumCondition = + conditions.AddLogicConditionL( ELogicConditionOperatorAnd ); + albumCondition.AddPropertyConditionL( albumPropertyDef ); + albumCondition.SetNegate( ETrue ); + + iQuery->FindL(); + } +*/ + +// ----------------------------------------------------------------------------- +// CMediaFileHandler2::QueryAlbumsL (obsolete) +// +// Finds all albums for aArtist. +// ----------------------------------------------------------------------------- +// +/* +void CMediaFileHandler::QueryAlbumsL( const TDesC& aArtist ) + { + if ( !iSessionOpen ) + { + return; + } + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& objectDef = defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + + iQueryType = EQueryAudio; + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); + + iQuery->SetResultMode( EQueryResultModeDistinctValues ); + + CMdEPropertyDef& propertyDef = PropertyDefL( EAttrAlbum ); + + // distinct query requires exactly one property filter + CMdELogicCondition& conditions = iQuery->Conditions(); + conditions.AddPropertyConditionL( propertyDef ); + iQuery->AppendOrderRuleL( TMdEOrderRule( propertyDef, ESortAscending ) ); + iQuery->AddPropertyFilterL( &propertyDef ); + + CMdEPropertyDef& propertyDef2 = PropertyDefL( EAttrArtist ); + conditions.AddPropertyConditionL( propertyDef2, + ETextPropertyConditionCompareEquals, aArtist ); + + iQuery->FindL(); + } +*/ + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryArtistAlbumL (obsolete) +// +// Finds songs for aArtist/aAlbum. +// ----------------------------------------------------------------------------- +// + +/* +void CMediaFileHandler::QueryArtistAlbumL( const TDesC& aArtist, const TDesC& aAlbum ) + { + if ( !iSessionOpen ) + { + return; + } + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& objectDef = defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + + iQueryType = EQueryAudio; + + delete iQuery; + iQuery = NULL; + iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); + + iQuery->SetResultMode( EQueryResultModeItem ); + + CMdEPropertyDef& artistDef = PropertyDefL( EAttrArtist ); + CMdEPropertyDef& albumDef = PropertyDefL( EAttrAlbum ); + CMdEPropertyDef& nameDef = PropertyDefL( EAttrSongName ); + + CMdELogicCondition& conditions = iQuery->Conditions(); + + conditions.AddPropertyConditionL( artistDef, + ETextPropertyConditionCompareEquals, aArtist ); + + conditions.AddPropertyConditionL( albumDef, + ETextPropertyConditionCompareEquals, aAlbum ); + + iQuery->AppendOrderRuleL( TMdEOrderRule( nameDef, ESortAscending ) ); + iQuery->AddPropertyFilterL( &nameDef ); + + + User::Leave(KErrNoMemory); + iQuery->FindL(); + + + } +*/ + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryL (test code) +// +// ----------------------------------------------------------------------------- +// +/* +void CMediaFileHandler::QueryL( TInt aAttr ) + { + if ( aAttr != EAttrArtist && aAttr != EAttrAlbum && + aAttr != EAttrGenre && aAttr != EAttrComposer ) + { + User::Leave( KErrNotSupported ); + } + + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& objectDef = defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); + + + RArray itemIds; + itemIds.Append( 22 ); + itemIds.Append( 5 ); + itemIds.Append( 18 ); + //itemLogicCondition->AddObjectConditionL(itemIds); + + CMdELogicCondition& conditions = iQuery->Conditions(); + conditions.AddObjectConditionL( itemIds ); + iQuery->SetResultMode( EQueryResultModeItem ); + + itemIds.Close(); + + iQuery->FindL(); + } +*/ + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryL (test code) +// +// ----------------------------------------------------------------------------- +// + +/* +void CMediaFileHandler::QueryL() + { + if ( !iSession ) + { + User::Leave( KErrSessionClosed ); + } + + delete iQuery; + iQuery = NULL; + + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + + CMdEObjectDef& objectDef = defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject ); + iQuery = iSession->NewObjectQueryL( defNS, objectDef, this ); + iQuery->SetResultMode( EQueryResultModeId ); + iQuery->FindL(); + + + CMdELogicCondition& conditions = iQuery->Conditions(); + + //conditions.AddPropertyConditionL(composerPropertyDef, + //CMdETextPropertyCondition::ECompareEquals, text); + + } +*/ + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::HandleQueryCompletedOneL +// +// ----------------------------------------------------------------------------- +// + +/* +void CMediaFileHandler::HandleQueryCompletedOneL( CMdEQuery& aQuery, + TInt aError ) + { + CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL(); + + CMdEObjectDef& objectDef = defNS.GetObjectDefL( + MdeConstants::Object::KBaseObject ); + CMdEObjectDef& mediaObjectDef = defNS.GetObjectDefL( + MdeConstants::MediaObject::KMediaObject ); + CMdEObjectDef& audioObjectDef = defNS.GetObjectDefL( + MdeConstants::Audio::KAudioObject ); + + + CMdEPropertyDef& songPropertyDef = objectDef.GetPropertyDefL( + MdeConstants::Object::KTitleProperty ); + CMdEPropertyDef& artistPropertyDef = mediaObjectDef.GetPropertyDefL( + MdeConstants::MediaObject::KArtistProperty ); + CMdEPropertyDef& albumPropertyDef = audioObjectDef.GetPropertyDefL( + MdeConstants::Audio::KAlbumProperty ); + CMdEPropertyDef& genrePropertyDef = mediaObjectDef.GetPropertyDefL( + MdeConstants::MediaObject::KGenreProperty ); + + CMdEProperty* property = NULL; + + const RArray& arr = iQuery->ResultIds(); + + TBuf<256> buf; + TInt count = arr.Count(); + for ( TInt i=0; iGetFullObjectL( id ); + CleanupStack::PushL( object ); + + buf = object->Uri(); + TInt propertyCount = object->PropertyCount(); + for ( TInt j=0; jPropertyL( j ); + const CMdEPropertyDef& prDef = pr.Def(); + buf.Append(_L(" ")); + buf.Append(prDef.Name()); + } + TMFDialogUtil::ShowInformationQueryL( buf ); + + CMdEPropertyDef& tmpDef = object->Def().GetPropertyDefL( MdeConstants::MediaObject::KArtistProperty ); + TInt ret = object->Property( tmpDef, property, 0 ); + if ( ret != KErrNotFound ) + { + buf = property->TextValueL(); + } + + + ret = object->Property( songPropertyDef, property, 0 ); + if ( ret != KErrNotFound ) + { + buf = property->TextValueL(); + } + + ret = object->Property( artistPropertyDef, property, 0 ); + if ( ret != KErrNotFound ) + { + buf = property->TextValueL(); + } + + ret = object->Property( albumPropertyDef, property, 0 ); + if ( ret != KErrNotFound ) + { + buf = property->TextValueL(); + } + + ret = object->Property( genrePropertyDef, property, 0 ); + if ( ret != KErrNotFound ) + { + buf = property->TextValueL(); + } + + + CleanupStack::PopAndDestroy( object ); + } + } +*/ + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::HandleQueryCompletedTwoL +// +// ----------------------------------------------------------------------------- +// + +/* +void CMediaFileHandler::HandleQueryCompletedTwoL( CMdEQuery& aQuery, + TInt aError ) + { + TBuf<256> buf; + + TInt count = iQuery->Count(); + for ( TInt i=0; iResultDistinctValue( i ); + + CMdEObject& object = iQuery->Result( i ); + + buf = object.Uri(); + TInt propertyCount = object.PropertyCount(); + for ( TInt j=0; jTextValueL(); + } + } + } +*/ + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::ResultCount +// +// ----------------------------------------------------------------------------- +// + +/* +TInt CMediaFileHandler::ResultCount() + { + if ( iQueryType == EQueryRomFile ) + { + return iRomFileList.Count(); + } + + if ( iQueryType == ESearchVideo ) + { + return iSearchList->Count(); + } + + if ( !iQuery || !iQueryReady || !iSessionOpen ) + { + return 0; + } + + TInt count = 0; + TQueryResultMode resultMode = iQuery->ResultMode(); + + if ( resultMode == EQueryResultModeDistinctValues || + resultMode == EQueryResultModeItem || + resultMode == EQueryResultModeCount ) + { + count = iQuery->Count(); + } + else if ( resultMode == EQueryResultModeId ) + { + count = iQuery->Count(); + const RArray& arr = iQuery->ResultIds(); + count = arr.Count(); + } + + return count; + } +*/ + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::GetRecentFileAttribute +// +// ----------------------------------------------------------------------------- +// +/* +void CMediaFileHandler::GetRecentFileAttribute( TInt aIndex, TInt aAttr, TDes& aValue ) + { + TInt count = iRecentList->Count(); + + __ASSERT_ALWAYS( aIndex >= 0 && aIndex < count, Panic( KErrGeneral ) ); + + if ( aAttr == EAttrFullName ) + { + StrCopy( aValue, iRecentList->FileName( aIndex ) ); + } + else if ( aAttr == EAttrSongName || aAttr == EAttrFileName ) + { + TParsePtrC parse( iRecentList->FileName( aIndex ) ); + StrCopy( aValue, parse.Name() ); + } + } +*/ + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::RecentFileAttribute +// +// ----------------------------------------------------------------------------- +// +/* +TInt CMediaFileHandler::RecentFileAttribute( TInt aIndex, TInt aAttr ) + { + TInt count = iRecentList->Count(); + __ASSERT_ALWAYS( aIndex >= 0 && aIndex < count, Panic( KErrGeneral ) ); + + TInt ret = KErrNotFound; + + if ( aAttr == EAttrMediaType ) + { + ret = EAttrMusic; + } + if ( aAttr == EAttrStorageType ) + { + ret = EPhoneMemory; + } + + return ret; + } +*/ + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::Attribute +// +// ----------------------------------------------------------------------------- +// +/* +TInt CMediaFileHandler::Attribute( TInt aIndex, TInt aAttr ) + { + if ( iQueryType == EQueryRomFile ) + { + return RomFileAttribute( aIndex, aAttr ); + } + if ( iQueryType == ESearchVideo ) + { + return iSearchList->Attribute( aIndex, aAttr ); + } + + if ( aAttr == EAttrMediaType ) + { + if ( iQueryType == EQueryVideo ) + { + return EAttrVideo; + } + else + { + return EAttrMusic; + } + } + else if ( aAttr == EAttrStorageType ) + { + TInt ret = CMediaFileHandler::EPhoneMemory; + + if ( !iQuery || !iQueryReady || !iSessionOpen ) + { + return ret; + } + TQueryResultMode resultMode = iQuery->ResultMode(); + if ( resultMode != EQueryResultModeItem ) + { + return ret; + } + + CMdEObject& object = iQuery->Result( aIndex ); + if ( iDriveUtil->IsMemoryCard( object.Uri() ) ) + { + ret = CMediaFileHandler::EMemoryCard; + } + else if ( iDriveUtil->IsMassStorage( object.Uri() ) ) + { + ret = CMediaFileHandler::EMassStorage; + } + return ret; + } + + else if ( aAttr == EAttrMediaFileId ) + { + if ( !iQuery || !iQueryReady || !iSessionOpen ) + { + return KErrNotFound; + } + CMdEObject& object = iQuery->Result( aIndex ); + return object.Id(); + } + + return KErrNotFound; + } +*/ + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::GetAttributeL +// +// ----------------------------------------------------------------------------- +// +/* +void CMediaFileHandler::GetAttributeL( TInt aIndex, TInt aAttr, TDes& aValue ) + { + aValue = KNullDesC; + + if ( iQueryType == EQueryRomFile ) + { + GetRomFileAttribute( aIndex, aAttr, aValue ); + return; + } + if ( iQueryType == ESearchVideo ) + { + if ( iSessionOpen ) + { + iSearchList->SetSession( iSession ); + } + else + { + iSearchList->SetSession( NULL ); + } + iSearchList->GetAttributeL( aIndex, aAttr, aValue ); + return; + } + + + if ( !iQuery || !iQueryReady || !iSessionOpen ) + { + return; + } + + TInt count = ResultCount(); + __ASSERT_ALWAYS( aIndex >= 0 && aIndex < count, Panic( KErrGeneral ) ); + + TQueryResultMode resultMode = iQuery->ResultMode(); + + if ( resultMode == EQueryResultModeDistinctValues ) + { + TPtrC ptr = iQuery->ResultDistinctValue( aIndex ); + StrCopy( aValue, ptr ); + } + + if ( resultMode == EQueryResultModeItem ) + { + CMdEObject& object = iQuery->Result( aIndex ); + + if ( aAttr == EAttrFullName ) + { + StrCopy( aValue, object.Uri() ); + return; + } + + CMdEPropertyDef& propDef = PropertyDefL( aAttr ); + CMdEProperty* property = NULL; + TInt ret = object.Property( propDef, property, 0 ); + if ( ret != KErrNotFound ) + { + StrCopy( aValue, property->TextValueL() ); + } + else if ( aAttr == EAttrSongName || aAttr == EAttrFileName) + { + TParsePtrC parse( object.Uri() ); + StrCopy( aValue, parse.Name() ); + } + } + } +*/ + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::UpdateRecentListL +// +// ----------------------------------------------------------------------------- +// +/* +void CMediaFileHandler::UpdateRecentListL() + { + if ( !iSessionOpen ) + { + return; + } + + TInt count = iRecentList->Count(); + + for ( TInt i=0; iId( i ); + CMdEObject* object = NULL; + + TInt err = KErrNone; + TRAP( err, object = iSession->GetFullObjectL( id ) ); + if ( err != KErrNone || !object ) + { + iRecentList->SetPresent( EFalse, i ); + } + else + { + CleanupStack::PushL( object ); + iRecentList->SetFileNameL( object->Uri(), i ); + CleanupStack::PopAndDestroy( object ); + } + } + + iRecentList->Clean(); + } +*/ + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::StoreRecentFileL +// +// ----------------------------------------------------------------------------- +// +/* +void CMediaFileHandler::StoreRecentFileL( TInt aIndex ) + { + if ( iQueryType == EQueryRomFile ) + { + return; // tones not part of recent files + } + + if ( iQueryType == EQueryRecentFile ) + { + TInt64 id = iRecentList->Id( aIndex ); + iRecentList->AddItemL( id ); + return; + } + + if ( !iQuery || !iQueryReady || !iSessionOpen ) + { + return; + } + + TQueryResultMode resultMode = iQuery->ResultMode(); + if ( resultMode == EQueryResultModeItem ) + { + CMdEObject& object = iQuery->Result( aIndex ); + TItemId id = object.Id(); + iRecentList->AddItemL( id ); + } + } +*/ + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::HandleQueryCompletedL +// +// ----------------------------------------------------------------------------- +// + +/* +void CMediaFileHandler::HandleQueryCompletedL( CMdEQuery& aQuery, TInt aError ) + { + iQueryReady = ETrue; + + if ( !iQuery ) + { + iObserver->HandleMFEventL( MMediaFileHandlerObserver::EError, KErrCancel ); + return; // query has been canceled + } + + if ( aError != KErrNone ) + { + iObserver->HandleMFEventL( MMediaFileHandlerObserver::EError, aError ); + return; + } + + TQueryResultMode resultMode = iQuery->ResultMode(); + + if ( resultMode == EQueryResultModeDistinctValues ) + { + iObserver->HandleMFEventL( MMediaFileHandlerObserver::EQueryComplete, aError ); + } + else if ( resultMode == EQueryResultModeId ) + { + // const RArray& arr = iQuery->ResultIds(); + // CopyArrayL( iResultArray, arr ); + // + // copy this arr into member iResultIds and perform full search + // for the whole set or a partial search if result set is very large + // partial search indexes could be in another member iPartialResultdIds + // observer gets notified after the first partial search + + iObserver->HandleMFEventL( MMediaFileHandlerObserver::EError, KErrNotSupported ); + } + else if ( resultMode == EQueryResultModeCount ) + { + iObserver->HandleMFEventL( MMediaFileHandlerObserver::EUnknownQueryComplete, aError ); + } + else if ( resultMode == EQueryResultModeItem ) + { + if ( iQueryType == ESearchAudio ) + { + iSearchList->Reset(); + iSearchList->TakeResultL( iQuery, EAttrMusic ); + SearchVideoL( iSearchText ); + } + else if ( iQueryType == ESearchVideo ) + { + iSearchList->TakeResultL( iQuery, EAttrVideo ); + iSearchList->Sort(); + iObserver->HandleMFEventL( MMediaFileHandlerObserver::EQueryComplete, aError ); + } + else + { + iObserver->HandleMFEventL( MMediaFileHandlerObserver::EQueryComplete, aError ); + } + } + else + { + iObserver->HandleMFEventL( MMediaFileHandlerObserver::EError, KErrNotSupported ); + } + } +*/ + + +/* + //private: + //void ReadDirectoryL( const TDesC& aDirectory ); + //void ReadRomFilesL(); + //void SortRomFiles(); + //static TInt CompareFileName( const TFileName& aFirst, const TFileName& aSecond ); + //static TInt CompareStr( const TFileName& aFirst, const TFileName& aSecond ); + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::ReadRomFilesL (to be removed) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::ReadRomFilesL() + { + _LIT( KFormat, "%S%S" ); + + iRomFileList.Reset(); + + TFileName fileName; + fileName.Format( KFormat, &PathInfo::RomRootPath(), &PathInfo::SoundsPath() ); + TRAP_IGNORE( ReadDirectoryL( fileName ) ); + + fileName.Format( KFormat, &PathInfo::RomRootPath(), &PathInfo::DigitalSoundsPath() ); + TRAP_IGNORE( ReadDirectoryL( fileName ) ); + + fileName.Format( KFormat, &PathInfo::RomRootPath(), &PathInfo::SimpleSoundsPath() ); + TRAP_IGNORE( ReadDirectoryL( fileName ) ); + + TInt count = iRomFileList.Count(); + for ( TInt i=0; i buf( aDirectory ); + + CDir* dir = NULL; + RFs fsSession; + User::LeaveIfError( fsSession.Connect() ); + CleanupClosePushL( fsSession ); + + if ( !BaflUtils::FolderExists( fsSession, aDirectory ) ) + { + User::Leave( KErrNotFound ); + } + + TInt err = fsSession.GetDir( aDirectory, KEntryAttNormal, ESortByName, dir ); + User::LeaveIfError( err ); + CleanupStack::PushL( dir ); + + TInt count = dir->Count(); + + for ( TInt i=0; i(CMediaFileHandler::CompareFileName)); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::QueryRomFilesL (to be removed) +// +// Finds all tones from rom directories. +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::QueryRomFilesL( TInt aAttr ) + { + QueryEmptyL(); + + iQueryType = EQueryRomFile; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::GetRomFileAttribute (to be removed) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHandler::GetRomFileAttribute( TInt aIndex, TInt aAttr, TDes& aValue ) + { + TInt count = iRomFileList.Count(); + + __ASSERT_ALWAYS( aIndex >= 0 && aIndex < count, Panic( KErrGeneral ) ); + + if ( aAttr == EAttrFullName ) + { + StrCopy( aValue, iRomFileList[aIndex] ); + } + else if ( aAttr == EAttrSongName || aAttr == EAttrFileName ) + { + TParsePtrC parse( iRomFileList[aIndex] ); + StrCopy( aValue, parse.Name() ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::RomFileAttribute (to be removed) +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileHandler::RomFileAttribute( TInt aIndex, TInt aAttr ) + { + TInt count = iRomFileList.Count(); + + __ASSERT_ALWAYS( aIndex >= 0 && aIndex < count, Panic( KErrGeneral ) ); + + TInt ret = KErrNotFound; + if ( aAttr == EAttrMediaType ) + { + ret = EMediaTypeTone; + } + else if ( aAttr == EAttrStorageType ) + { + ret = EPhoneMemory; + } + + return ret; + } +*/ + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::CompareFileName +// +// ----------------------------------------------------------------------------- +// +/* +TInt CMediaFileHandler::CompareFileName(const TFileName& aFirst, const TFileName& aSecond) + { + TParsePtrC parseFirst( aFirst ); + TParsePtrC parseSecond( aSecond ); + + return parseFirst.Name().Compare( parseSecond.Name() ); + } +*/ + +// ----------------------------------------------------------------------------- +// CMediaFileHandler::CompareStr +// +// ----------------------------------------------------------------------------- +// +/* +TInt CMediaFileHandler::CompareStr(const TFileName& aFirst, const TFileName& aSecond) + { + return aFirst.Compare( aSecond ); + } +*/ + + + +/******************************************************************************* + * class TMediaFileHistoryItem + *******************************************************************************/ + +/* +// ----------------------------------------------------------------------------- +// TMediaFileHistoryItem::Id +// +// ----------------------------------------------------------------------------- +// +TInt64 TMediaFileHistoryItem::Id() + { + return iId; + } + + +// ----------------------------------------------------------------------------- +// TMediaFileHistoryItem::SetId +// +// ----------------------------------------------------------------------------- +// +void TMediaFileHistoryItem::SetId( TInt64 aId ) + { + iId = aId; + } + + +// ----------------------------------------------------------------------------- +// TMediaFileHistoryItem::Time +// +// ----------------------------------------------------------------------------- +// +TTime TMediaFileHistoryItem::Time() + { + return iTime; + } + + +// ----------------------------------------------------------------------------- +// TMediaFileHistoryItem::SetTime +// +// ----------------------------------------------------------------------------- +// +void TMediaFileHistoryItem::SetTime( TTime aTime ) + { + iTime = aTime; + } + + +// ----------------------------------------------------------------------------- +// TMediaFileHistoryItem::InternalizeL +// +// ----------------------------------------------------------------------------- +// +void TMediaFileHistoryItem::InternalizeL( RReadStream& aStream ) + { + aStream >> iId; + + if ( iId < 0 ) + { + User::Leave( KErrCorrupt ); + } + + TInt64 temp = 0; + aStream >> temp; + + if ( temp <= 0 ) + { + User::Leave( KErrCorrupt ); + } + TTime time( temp ); + iTime = time; + + iPresent = ETrue; + iFullName = KNullDesC; + } + + +// ----------------------------------------------------------------------------- +// TMediaFileHistoryItem::ExternalizeL +// +// ----------------------------------------------------------------------------- +// +void TMediaFileHistoryItem::ExternalizeL( RWriteStream& aStream ) + { + aStream << iId; + aStream << iTime.Int64(); + } +*/ + + + +/******************************************************************************* + * class CMediaFileHistory + *******************************************************************************/ + +/* +// ----------------------------------------------------------------------------- +// CMediaFileHistory::NewL +// +// ----------------------------------------------------------------------------- +// +CMediaFileHistory* CMediaFileHistory::NewL() + { + CMediaFileHistory* self = new (ELeave) CMediaFileHistory(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(self ); + + return self; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHistory::CMediaFileHistory +// +// ----------------------------------------------------------------------------- +// +CMediaFileHistory::CMediaFileHistory() + { + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHistory::ConstructL +// +// Note: Sessionpath in emulator is '\epoc32\winscw\c\private\2000F85A' +// ----------------------------------------------------------------------------- +// +void CMediaFileHistory::ConstructL() + { + _LIT( KHistoryFile, "MediaFileHistory" ); + const TInt KHistoryDrive = EDriveC; + + User::LeaveIfError( iFsSession.Connect() ); + User::LeaveIfError( iFsSession.SetSessionToPrivate( KHistoryDrive ) ); + + User::LeaveIfError( iFsSession.SessionPath( iPath ) ); + BaflUtils::EnsurePathExistsL( iFsSession, iPath ); + iPath.Append( KHistoryFile ); + + TInt err = KErrNone; + TRAP( err, ReadHistoryL() ); + + if ( err != KErrNone && err != KErrNoMemory ) + { + // history file was just created or it is corrupted + iList.Reset(); + } + } + + +// ---------------------------------------------------------------------------- +// Destructor +// +// ---------------------------------------------------------------------------- +// +CMediaFileHistory::~CMediaFileHistory() + { + Clean(); + + TRAP_IGNORE( WriteHistoryL() ); + + iList.Close(); + iFsSession.Close(); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHistory::AddItemL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHistory::AddItemL( TInt64 aId ) + { + TMediaFileHistoryItem item; + + TTime t; + t.UniversalTime(); + + item.SetTime( t ); + item.SetId( aId ); + + AddItemL( item ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHistory::Count +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileHistory::Count() + { + return iList.Count(); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHistory::Reset +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHistory::Reset() + { + iList.Reset(); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHistory::SetFileNameL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHistory::SetFileNameL( const TDesC& aFullName, TInt aIndex ) + { + if ( aIndex < 0 || aIndex >= iList.Count() ) + { + TMFDialogUtil::Panic( KErrArgument ); + } + + TMediaFileHistoryItem& item = iList[aIndex]; + TMFDialogUtil::StrCopy( item.iFullName, aFullName ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHistory::FileName +// +// ----------------------------------------------------------------------------- +// +const TDesC& CMediaFileHistory::FileName( TInt aIndex ) + { + if ( aIndex < 0 || aIndex >= iList.Count() ) + { + TMFDialogUtil::Panic( KErrArgument ); + } + + TMediaFileHistoryItem& item = iList[aIndex]; + return item.iFullName; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHistory::SetPresent +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHistory::SetPresent( TBool aPresent, TInt aIndex ) + { + if ( aIndex < 0 || aIndex >= iList.Count() ) + { + TMFDialogUtil::Panic( KErrArgument ); + } + + TMediaFileHistoryItem& item = iList[aIndex]; + item.iPresent = aPresent; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHistory::Id +// +// ----------------------------------------------------------------------------- +// +TInt64 CMediaFileHistory::Id( TInt aIndex ) + { + if ( aIndex < 0 || aIndex >= iList.Count() ) + { + TMFDialogUtil::Panic( KErrArgument ); + } + + TMediaFileHistoryItem& item = iList[aIndex]; + return item.iId; + + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHistory::InternalizeL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHistory::InternalizeL( RReadStream& aStream ) + { + TInt count = aStream.ReadInt32L(); + if ( count < 0 || count > KMaxHistoryItemCount ) + { + User::Leave( KErrCorrupt ); + } + + for ( TInt i=0; i KMaxHistoryItemCount ) + { + iList.Remove( count - 1 ); + return ETrue; + } + + return EFalse; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHistory::AddItemL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHistory::AddItemL( TMediaFileHistoryItem aItem ) + { + TInt index = ItemIndex( aItem.iId ); + if ( index != KErrNotFound ) + { + iList.Remove(index); + } + + User::LeaveIfError( iList.Append( aItem ) ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHistory::ItemIndex +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileHistory::ItemIndex( TInt aId ) + { + TInt count = iList.Count(); + + for (TInt i=0; i= iList.Count() ) + { + TMFDialogUtil::Panic( KErrArgument ); + } + + return iList[aIndex]; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHistory::Sort +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHistory::Sort() + { + iList.Sort( TLinearOrder(CMediaFileHistory::CompareItems) ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHistory::CompareItems +// +// ----------------------------------------------------------------------------- +// +TInt CMediaFileHistory::CompareItems( const TMediaFileHistoryItem& aFirst, + const TMediaFileHistoryItem& aSecond ) + { + if ( aFirst.iTime > aSecond.iTime ) + { + return -1; + } + else if ( aFirst.iTime < aSecond.iTime ) + { + return 1; + } + return 0; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileHistory::GetTimeText +// +// ----------------------------------------------------------------------------- +// +void CMediaFileHistory::GetTimeText( TDes& aText, TTime aTime ) + { + _LIT( KFormat, "%02d.%02d.%04d %02d:%02d:%02d" ); + + TDateTime dt = aTime.DateTime(); + aText.Format( KFormat, dt.Day()+1, dt.Month()+1, dt.Year(), dt.Hour(), dt.Minute(), dt.Second() ); + } + +*/ + +#endif // #ifdef _DEBUG + +// End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Src/mediafilevariation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Src/mediafilevariation.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,232 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Variation functionality class +* +*/ + + + +// INCLUDE FILES + +#include "mediafilevariation.h" + +#include +#include // for KMaxDataTypeLength +#include + + + +/****************************************************************************** + * class CMediaFileDialogVariation + ******************************************************************************/ + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogVariation::NewL +// +// ----------------------------------------------------------------------------- +// +CMediaFileDialogVariation* CMediaFileDialogVariation::NewL() + { + CMediaFileDialogVariation* self = new ( ELeave ) CMediaFileDialogVariation( 0 ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogVariation::~CMediaFileDialogVariation +// +// ----------------------------------------------------------------------------- +// +CMediaFileDialogVariation::~CMediaFileDialogVariation() + { + iBlockedTones.Close(); + iBlockedUnprotectedTones.Close(); + iBlockedProtectedTones.Close(); + iBlockedDemoPlayTones.Close(); + iExcludedTones.Close(); + iMimeBuf.Close(); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogVariation::CMediaFileDialogVariation +// +// ----------------------------------------------------------------------------- +// +CMediaFileDialogVariation::CMediaFileDialogVariation( TInt aFeatureBitMask ) + : iFeatureBitMask( aFeatureBitMask ) + { + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogVariation::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialogVariation::ConstructL() + { + _LIT( KSpace, " " ); + + CRepository* cenrep = CRepository::NewL( KCRUidProfilesLV ); + CleanupStack::PushL( cenrep ); + + User::LeaveIfError( cenrep->Get( KProfilesLVFlags, iFeatureBitMask ) ); + ReadListKeyL( *cenrep, KProEngBlockedTones, iBlockedTones ); + ReadListKeyL( *cenrep, KProEngBlockedUnprotectedTones, + iBlockedUnprotectedTones ); + ReadListKeyL( *cenrep, KProEngBlockedProtectedTones, + iBlockedProtectedTones ); + ReadListKeyL( *cenrep, KProEngBlockedDemoPlayTones, + iBlockedDemoPlayTones ); + ReadListKeyL( *cenrep, KProEngExcludedTones, + iExcludedTones ); + + CleanupStack::PopAndDestroy( cenrep ); + + iMimeBuf.CreateL( KMaxDataTypeLength + KSpace().Length() ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogVariation::IsFeatureSupported +// +// ----------------------------------------------------------------------------- +// +TBool CMediaFileDialogVariation::IsFeatureSupported( TInt aLocalFeatureId ) + { + return iFeatureBitMask & aLocalFeatureId; + } + + +// ----------------------------------------------------------------------------- +// CProfilesLocalFeatures::IsBlockedType +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CMediaFileDialogVariation::IsBlockedType( const TDesC& aMimeType ) + { + return ContainsMimeType( iBlockedTones, aMimeType ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogVariation::IsBlockedUnprotectedType +// +// ----------------------------------------------------------------------------- +// +TBool CMediaFileDialogVariation::IsBlockedUnprotectedType( + const TDesC& aMimeType ) + { + return ContainsMimeType( iBlockedUnprotectedTones, aMimeType ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogVariation::IsBlockedProtectedType +// +// ----------------------------------------------------------------------------- +// +TBool CMediaFileDialogVariation::IsBlockedProtectedType( const TDesC& aMimeType ) + { + return ContainsMimeType( iBlockedProtectedTones, aMimeType ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogVariation::IsBlockedDemoPlayType +// +// ----------------------------------------------------------------------------- +// +TBool CMediaFileDialogVariation::IsBlockedDemoPlayType( const TDesC& aMimeType ) + { + return ContainsMimeType( iBlockedDemoPlayTones, aMimeType ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogVariation::IsExcludedType +// +// ----------------------------------------------------------------------------- +// +TBool CMediaFileDialogVariation::IsExcludedType( const TDesC& aMimeType ) + { + return ContainsMimeType( iExcludedTones, aMimeType ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogVariation::ReadListKeyL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileDialogVariation::ReadListKeyL( CRepository& aCenRep, + TUint32 aKey, RBuf& aValue ) + { + _LIT( KSpace, " " ); + + TBuf<1> tmp; // one char to get length of actual value + TInt realLen = 0; + TInt err = aCenRep.Get( aKey, tmp, realLen ); + if ( err == KErrOverflow ) + { + // prepare list of blocked MIME types + aValue.CreateL( realLen + KSpace().Length() ); + User::LeaveIfError( aCenRep.Get( aKey, aValue ) ); + aValue.Append( KSpace ); + } + else + { + User::LeaveIfError( err ); + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileDialogVariation::ContainsMimeTypeL +// +// ----------------------------------------------------------------------------- +// +TBool CMediaFileDialogVariation::ContainsMimeType( const TDesC& aList, + const TDesC& aMimeType ) + { + _LIT( KSpace, " " ); + + if( aList.Length() == 0 ) + { + return EFalse; + } + + iMimeBuf.Copy( aMimeType ); + // FindF() would find "audio/3gpp" in "audio/3gpp2" without + // the added space. + iMimeBuf.Append( KSpace ); + + if ( aList.FindF( iMimeBuf ) == KErrNotFound ) + { + // aMimeType was not in blocked list + return EFalse; + } + + return ETrue; + } + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Src/mediafilevideopreviewdialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Src/mediafilevideopreviewdialog.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,350 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Dialog create for video preview +* +*/ + + + +#include +#include "mediafilevideopreviewdialog.h" +#include "mediafilepreview.h" +#include + + + +/****************************************************************************** + * class CVideoPreviewDialog + ******************************************************************************/ + + +// ----------------------------------------------------------------------------- +// CVideoPreviewDialog::ShowDialogLD +// +// NOTE: ExecuteLD deletes dialog object. +// ----------------------------------------------------------------------------- +TBool CVideoPreviewDialog::ShowDialogLD( TInt* aError ) + { + iError = aError; + *iError = KErrNone; + + TBool ret = ExecuteLD( R_VIDEO_PREVIEW_DIALOG ); + + return ret; + } + +// ---------------------------------------------------------------------------- +// Destructor +// +// ---------------------------------------------------------------------------- +// +CVideoPreviewDialog::~CVideoPreviewDialog() + { + CCoeEnv::Static()->RemoveForegroundObserver( *this ); + + delete iIdle; + + if ( iVideoHandlerCreated ) + { + delete iVideoHandler; + } + + if ( iAvkonAppUi ) + { + iAvkonAppUi->RemoveFromStack( this ); + } + } + + +// ----------------------------------------------------------------------------- +// CVideoPreviewDialog::CVideoPreviewDialog +// +// ----------------------------------------------------------------------------- +// +CVideoPreviewDialog::CVideoPreviewDialog( TAny* aVideoHandler ) + { + if ( aVideoHandler ) + { + iVideoHandler = static_cast( aVideoHandler ); + //iVideoHandler = aVideoHandler; + } + iVideoHandlerCreated = EFalse; + } + + +// ----------------------------------------------------------------------------- +// CVideoPreviewDialog::NewL +// +// ----------------------------------------------------------------------------- +CVideoPreviewDialog* CVideoPreviewDialog::NewL( TAny* aVideoHandler ) + { + CVideoPreviewDialog* self = new (ELeave) CVideoPreviewDialog( aVideoHandler ); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + + +// ----------------------------------------------------------------------------- +// CVideoPreviewDialog::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CVideoPreviewDialog::ConstructL() + { + CCoeEnv::Static()->AddForegroundObserverL( *this ); + + CAknDialog::ConstructL( R_VIDEO_PREVIEW_DIALOG_MENU ); + + if ( !iVideoHandler ) + { + iVideoHandler = CMFVideoPreviewHandler::NewL(); + iVideoHandlerCreated = ETrue; + } + + iVideoHandler->SetObserver( this ); + } + + +// ----------------------------------------------------------------------------- +// CVideoPreviewDialog::SetAttrL +// +// ----------------------------------------------------------------------------- +// +void CVideoPreviewDialog::SetAttrL( TInt aAttr, TInt aValue ) + { + iVideoHandler->SetAttrL( aAttr, aValue ); + } + + +// ----------------------------------------------------------------------------- +// CVideoPreviewDialog::SetAttrL +// +// ----------------------------------------------------------------------------- +// +void CVideoPreviewDialog::SetAttrL( TInt aAttr, const TDesC& aValue ) + { + iVideoHandler->SetAttrL( aAttr, aValue ); + } + + +// ----------------------------------------------------------------------------- +// CVideoPreviewDialog::SetAttr +// +// ----------------------------------------------------------------------------- +// +void CVideoPreviewDialog::SetAttrL( TInt aAttr, TAny* aValue ) + { + iVideoHandler->SetAttrL( aAttr, aValue ); + } + + +// ----------------------------------------------------------------------------- +// CVideoPreviewDialog::PreLayoutDynInitL +// +// ----------------------------------------------------------------------------- +// +void CVideoPreviewDialog::PreLayoutDynInitL() + { + } + + +// ----------------------------------------------------------------------------- +// CVideoPreviewDialog::PostLayoutDynInitL +// +// ----------------------------------------------------------------------------- +// +void CVideoPreviewDialog::PostLayoutDynInitL() + { + // dialog has two lines (see .rss). Listbox line id is 1 + //CEikCaptionedControl *ctrl = Line( 1 ); + //iVideoPreviewHandler->SetAttrL( TMFDialogUtil::EAttrDrawingWindow, (ctrl->iControl->DrawableWindow()) ); + + iVideoHandler->SetAttrL( TMFDialogUtil::EAttrDrawingWindow, DrawableWindow() ); + iVideoHandler->PlayL(); + } + + +//------------------------------------------------------------------------------ +// CVideoPreviewDialog::OkToExitL +// +//------------------------------------------------------------------------------ +// +TBool CVideoPreviewDialog::OkToExitL(TInt aButtonId) + { + if ( aButtonId == EEikBidCancel ) + { + if ( iVideoHandler->IsPlaying() ) + { + iVideoHandler->Stop(); + } + + return ETrue; // close dialog + } + + if ( aButtonId == EAknSoftkeySelect || aButtonId == EEikBidOk ) + { + if ( iVideoHandler->IsPlaying() ) + { + iVideoHandler->Stop(); + } + return ETrue; // close dialog + } + + if ( aButtonId == EAknSoftkeyBack ) + { + if ( iVideoHandler->IsPlaying() ) + { + iVideoHandler->Stop(); + } + return ETrue; // close dialog + } + + return CAknDialog::OkToExitL( aButtonId ); + } + + +// ---------------------------------------------------------------------------- +// CVideoPreviewDialog::HandleResourceChange +// +// ---------------------------------------------------------------------------- +// +void CVideoPreviewDialog::HandleResourceChange(TInt aType) + { + if ( aType == KEikDynamicLayoutVariantSwitch ) + { + // handle change in layout orientation + + CAknDialog::HandleResourceChange( aType ); + + TRAP_IGNORE( iVideoHandler->SetDisplayWindowL() ); + return; + } + } + + +//------------------------------------------------------------------------------ +// CVideoPreviewDialog::ProcessCommandL +// +// Handle commands from menu. +//------------------------------------------------------------------------------ +// +void CVideoPreviewDialog::ProcessCommandL(TInt aCommandId) + { + HideMenu(); + + switch (aCommandId) + { + case EAknCmdExit: + case EEikCmdExit: + { + // close dialog and exit calling application + iAvkonAppUi->ProcessCommandL( EAknCmdExit ); + break; + } + + default: + break; + } + } + + +// ----------------------------------------------------------------------------- +// CVideoPreviewDialog::CloseDialogWithDelayL +// +// ----------------------------------------------------------------------------- +// +void CVideoPreviewDialog::CloseDialogWithDelayL() + { + // close after short delay (dialog cannot be closed from this function) + delete iIdle; + iIdle = NULL; + iIdle = CIdle::NewL( CActive::EPriorityIdle ); + if ( iIdle ) + { + iIdle->Start( TCallBack( CloseDialog, this ) ); + } + } + + +// ----------------------------------------------------------------------------- +// CVideoPreviewDialog::CloseDialogL() +// +// ----------------------------------------------------------------------------- +// +void CVideoPreviewDialog::CloseDialogL() + { + // close the dialogue immediately + CloseDialog( this ); + } + +// ----------------------------------------------------------------------------- +// CVideoPreviewDialog::CloseDialog +// +// ----------------------------------------------------------------------------- +// +TInt CVideoPreviewDialog::CloseDialog( TAny *aObj ) + { + CVideoPreviewDialog *dlg = (CVideoPreviewDialog*) aObj; + + TRAP_IGNORE( dlg->TryExitL( EAknSoftkeyBack ) ); + + return 0; + } + + +// ----------------------------------------------------------------------------- +// CVideoPreviewDialog::HandlePreviewEventL (from MPreviewHandlerObserver) +// +// ----------------------------------------------------------------------------- +// +void CVideoPreviewDialog::HandlePreviewEventL( TInt aEvent, TInt aError ) + { + if ( aEvent == MPreviewHandlerObserver::EVideoPreviewComplete ) + { + *iError = aError; + CVideoPreviewDialog::CloseDialogWithDelayL(); + } + + if ( aEvent == MPreviewHandlerObserver::EPreviewError ) + { + *iError = aError; + CVideoPreviewDialog::CloseDialogWithDelayL(); + } + } + + +// ----------------------------------------------------------------------------- +// CVideoPreviewDialog::HandleLosingForeground (from MCoeForegroundObserver) +// +// ----------------------------------------------------------------------------- +// +void CVideoPreviewDialog::HandleLosingForeground() + { + TRAP_IGNORE( CVideoPreviewDialog::CloseDialogWithDelayL() ); + } + + +// ----------------------------------------------------------------------------- +// CVideoPreviewDialog::HandleGainingForeground (from MCoeForegroundObserver) +// +// ----------------------------------------------------------------------------- +// +void CVideoPreviewDialog::HandleGainingForeground() + { + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/Src/mediafilewaitnote.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/Src/mediafilewaitnote.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,344 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Waiting note for query +* +*/ + + + +// INCLUDE FILES +#include "mediafilewaitnote.h" +#include + +#include +#include +#include // macro iAvkonAppUi + + + + + +/******************************************************************************* + * class CMediaFileWaitNote + *******************************************************************************/ + + +// ----------------------------------------------------------------------------- +// CMediaFileWaitNote::CMediaFileWaitNote +// +// ----------------------------------------------------------------------------- +// +CMediaFileWaitNote::CMediaFileWaitNote( MMediaFileWaitNoteObserver* aObserver ) +: iObserver( aObserver ) + { + } + + +// ----------------------------------------------------------------------------- +// CMediaFileWaitNote::NewL +// +// ----------------------------------------------------------------------------- +// +CMediaFileWaitNote* CMediaFileWaitNote::NewL( MMediaFileWaitNoteObserver* aObserver ) + { + CMediaFileWaitNote* self = new (ELeave) CMediaFileWaitNote( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return( self ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileWaitNote::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileWaitNote::ConstructL() + { + iObserverCallNeeded = ETrue; + iDialogDismissed = EFalse; + iLastText = KNullDesC; + iAnimation = EFalse; + iImageFile = KNullDesC; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// +// ----------------------------------------------------------------------------- +// +CMediaFileWaitNote::~CMediaFileWaitNote() + { + delete iProgressDialog; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileWaitNote::LaunchL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileWaitNote::LaunchL( const TDesC& aLabel ) + { + if ( iProgressDialog ) + { + // CAknNoteDialog::~CAknNoteDialog sets iProgressDialog to NULL after: + // 1. CAknProgressDialog::ProcessFinishedL is called + // 2. dialog is closed using Cancel button + return; + } + + iObserverCallNeeded = ETrue; + iDialogDismissed = EFalse; + + iProgressDialog = new(ELeave) + CAknProgressDialog( reinterpret_cast(&iProgressDialog), EFalse ); + + iProgressDialog->PrepareLC( R_MEDIA_FILE_WAIT_NOTE ); + iProgressDialog->SetTextL( aLabel ); + + if ( iImageFile.Length() > 0 ) + { + CEikImage* image = TMFDialogUtil::CreateImageLC( iImageId, iImageFile, + iBitmapId, iBitmapMaskId ); + iProgressDialog->SetImageL( image ); + CleanupStack::Pop( image ); + } + + // get reference to progress info bar + //iProgressInfo = iProgressDialog->GetProgressInfoL(); + + iProgressDialog->SetCallback( this ); + + iProgressDialog->RunLD(); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileWaitNote::SetImageL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileWaitNote::SetImageL( TAknsItemID aId, const TDesC& aImageFile, + TInt aBitmapId, TInt aBitmapMaskId ) + { + if ( aImageFile.Length() > iImageFile.MaxLength() ) + { + return; + } + iImageFile = aImageFile; + iImageId = aId; + iBitmapId = aBitmapId; + iBitmapMaskId = aBitmapMaskId; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileWaitNote::CancelProgressDialogL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileWaitNote::CancelProgressDialogL() + { + // this function is called from CMediaFileDialog so there is no need + // to notify observer (CMediaFileDialog) + iObserverCallNeeded = EFalse; + + if ( iDialogDismissed ) + { + return; // dialog is already closed + } + + if ( !iProgressDialog ) + { + return; // dialog is already closed + } + + iProgressDialog->ProcessFinishedL(); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileWaitNote::SetTextL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileWaitNote::SetTextL( const TDesC& aText ) + { + if ( !iProgressDialog ) + { + return; + } + + if ( iLastText.Compare( aText ) == 0 ) + { + return; // text has not changed + } + + iProgressDialog->SetTextL( aText ); + TMFDialogUtil::StrCopy( iLastText, aText ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileWaitNote::SetProgress +// +// ----------------------------------------------------------------------------- +// +void CMediaFileWaitNote::SetProgress( TInt aValue ) + { + if ( !iProgressDialog || !iProgressInfo ) + { + return; + } + + CEikProgressInfo::SInfo info = iProgressInfo->Info(); + + TInt val = aValue; + if ( val > info.iFinalValue ) + { + val = info.iFinalValue; + } + + iProgressInfo->SetAndDraw( val ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileWaitNote::SetFinalProgress +// +// ----------------------------------------------------------------------------- +// +void CMediaFileWaitNote::SetFinalProgress( TInt aFinalValue ) + { + if ( !iProgressDialog || !iProgressInfo ) + { + return; + } + + if ( aFinalValue < 0 ) + { + iProgressInfo->SetFinalValue( 0 ); + } + else + { + iProgressInfo->SetFinalValue( aFinalValue ); + } + + iProgressInfo->SetAndDraw( 0 ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileWaitNote::NoteControl +// +// ----------------------------------------------------------------------------- +// +CAknNoteControl* CMediaFileWaitNote::NoteControl() + { + if ( !iProgressDialog ) + { + return NULL; + } + CAknNoteControl* note = STATIC_CAST(CAknNoteControl*, iProgressDialog->ControlOrNull(EGeneralNote)); + + return note; + } + + +// ----------------------------------------------------------------------------- +// CMediaFileWaitNote::CancelAnimation +// +// ----------------------------------------------------------------------------- +// +void CMediaFileWaitNote::CancelAnimation() + { + iAnimation = EFalse; + CAknNoteControl* note = NoteControl(); + if ( note ) + { + note->CancelAnimation(); + } + } + + +// ---------------------------------------------------------------------------- +// CMediaFileWaitNote::StartAnimationL +// +// ---------------------------------------------------------------------------- +// +void CMediaFileWaitNote::StartAnimationL() + { + if ( !iAnimation ) + { + CAknNoteControl* note = NoteControl(); + if ( note ) + { + note->StartAnimationL(); + iAnimation = ETrue; + } + } + } + + +// ----------------------------------------------------------------------------- +// CMediaFileWaitNote::DialogDismissedL (From MProgressDialogCallback) +// +// ----------------------------------------------------------------------------- +// +void CMediaFileWaitNote::DialogDismissedL( TInt aButtonId ) + { + iDialogDismissed = ETrue; + + if ( !iObserver ) + { + return; + } + + if ( !iObserverCallNeeded ) + { + return; + } + + TRAP_IGNORE( iObserver->HandleWaitNoteL( aButtonId ) ); + } + + +// ----------------------------------------------------------------------------- +// CMediaFileWaitNote::HideButtonL +// +// ----------------------------------------------------------------------------- +// +void CMediaFileWaitNote::HideButtonL() + { + const TInt KLastButtonIndex = 2; + + if ( !iProgressDialog ) + { + return; + } + + CEikButtonGroupContainer& container = iProgressDialog->ButtonGroupContainer(); + + container.RemoveCommandFromStack( KLastButtonIndex, EAknSoftkeyCancel ); + container.AddCommandToStackL( KLastButtonIndex, EAknSoftkeyEmpty, KNullDesC ); + container.DrawDeferred(); + } + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/bwins/MediaFileListu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/bwins/MediaFileListu.def Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,9 @@ +EXPORTS + ?NewL@CMediaFileList@@SAPAV1@XZ @ 1 NONAME ; class CMediaFileList * CMediaFileList::NewL(void) + ?SetAttrL@CMediaFileList@@QAEXHABVTDesC16@@@Z @ 2 NONAME ; void CMediaFileList::SetAttrL(int, class TDesC16 const &) + ?SetAttrL@CMediaFileList@@QAEXHH@Z @ 3 NONAME ; void CMediaFileList::SetAttrL(int, int) + ?SetAttrL@CMediaFileList@@QAEXHPAX@Z @ 4 NONAME ; void CMediaFileList::SetAttrL(int, void *) + ?SetNullItemL@CMediaFileList@@QAEXABVTDesC16@@0HH@Z @ 5 NONAME ; void CMediaFileList::SetNullItemL(class TDesC16 const &, class TDesC16 const &, int, int) + ?ShowMediaFileListL@CMediaFileList@@QAEHPAVTDes16@@PAH10@Z @ 6 NONAME ; int CMediaFileList::ShowMediaFileListL(class TDes16 *, int *, int *, class TDes16 *) + ??1CMediaFileList@@UAE@XZ @ 7 NONAME ; CMediaFileList::~CMediaFileList(void) + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/eabi/MediaFileListu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/eabi/MediaFileListu.def Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,13 @@ +EXPORTS + _ZN14CMediaFileList12SetNullItemLERK7TDesC16S2_ii @ 1 NONAME + _ZN14CMediaFileList18ShowMediaFileListLEP6TDes16PiS2_S1_ @ 2 NONAME + _ZN14CMediaFileList4NewLEv @ 3 NONAME + _ZN14CMediaFileList8SetAttrLEiPv @ 4 NONAME + _ZN14CMediaFileList8SetAttrLEiRK7TDesC16 @ 5 NONAME + _ZN14CMediaFileList8SetAttrLEii @ 6 NONAME + _ZN14CMediaFileListD0Ev @ 7 NONAME + _ZN14CMediaFileListD1Ev @ 8 NONAME + _ZN14CMediaFileListD2Ev @ 9 NONAME + _ZTI14CMediaFileList @ 10 NONAME ; ## + _ZTV14CMediaFileList @ 11 NONAME ; ## + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/group/MediaFileList.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/group/MediaFileList.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MMP file of mediafilelist. Information require by +* this project. Provide a UI for selecting a ring tong +* from media files. +* +*/ + + + +#include +#include + +TARGET MediaFileList.dll +TARGETTYPE DLL + +UID 0x1000008d 0x20015A2B +VENDORID VID_DEFAULT + +CAPABILITY CAP_GENERAL_DLL + +START RESOURCE ../Src/mediafilelist.rss + HEADER + TARGETPATH RESOURCE_FILES_DIR + LANGUAGE_IDS +END + + +SOURCEPATH ../Src +SOURCE mediafiledialog.cpp +SOURCE mediafiledialogstate.cpp +SOURCE mediafiledialogutils.cpp +SOURCE mediafilehandler.cpp +SOURCE mediafilelist.cpp +SOURCE mediafilepreview.cpp +SOURCE mediafilewaitnote.cpp +SOURCE mediafileprotection.cpp +SOURCE mediafilevariation.cpp +SOURCE mediafilevideopreviewdialog.cpp +SOURCE mediafiletest.cpp + + +USERINCLUDE ../Inc +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mmf/common /epoc32/include/platform/mmf/common + +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY efsrv.lib +LIBRARY eikcoctl.lib +LIBRARY euser.lib +LIBRARY commonengine.lib +LIBRARY eikcore.lib +LIBRARY eikctl.lib +LIBRARY AknSkins.lib +LIBRARY FeatMgr.lib +LIBRARY platformenv.lib +LIBRARY centralrepository.lib +LIBRARY ws32.lib // RWindow methods +LIBRARY ecom.lib +LIBRARY eikdlg.lib +LIBRARY estor.lib +LIBRARY apgrfx.lib // RApaLsSession +LIBRARY apmime.lib // TDataType +LIBRARY CdlEngine.lib +LIBRARY egul.lib // CGulIcon +LIBRARY caf.lib // Content access framework +LIBRARY cafutils.lib // Content access framework +LIBRARY ProfileEng.lib +LIBRARY peninputClient.lib +LIBRARY mediaclientaudio.lib +LIBRARY DrmAudioPlayUtility.lib +LIBRARY mediaclientvideo.lib +LIBRARY DRMCommon.lib +LIBRARY DrmRights.lib +LIBRARY DrmHelper.lib +LIBRARY drmutility.lib + +LIBRARY mdccommon.lib // mds +LIBRARY mdeclient.lib // mds +LIBRARY harvesterclient.lib // mds + +LIBRARY servicehandler.lib // CAiwGenericParamList +LIBRARY browserlauncher.lib // CBrowserLauncher +LIBRARY CommonUI.lib // CDocumentHandler +LIBRARY touchfeedback.lib // MTouchFeedback + +DEBUGLIBRARY flogger.lib + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This file provides the information required for building +* MediaFileList. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv + OPTION TARGETFILE mediafilelist.mif + OPTION HEADERFILE mediafilelist.mbg + OPTION SOURCES \ + -c8,8 qgn_indi_ai_nt_music.svg \ + -c8,8 qgn_prop_mup_audio.svg \ + -c8,8 qgn_prop_fmgr_file_video.svg \ + -c8,8 qgn_prop_fmgr_file_voicerec.svg \ + -c8,8 qgn_prop_mup_artist.svg \ + -c8,8 qgn_prop_mup_album.svg \ + -c8,8 qgn_prop_mup_genre.svg \ + -c8,8 qgn_prop_mup_composer.svg \ + -c8,8 qgn_prop_link_embd_small.svg \ + -c8,8 qgn_prop_folder_small.svg \ + -c8,8 qgn_prop_sml_sync_off.svg \ + -c8,8 qgn_indi_fmgr_ms_add.svg \ + -c8,8 qgn_indi_mmc_add.svg \ + -c8,8 qgn_prop_mce_unknown_read +END + +PRJ_MMPFILES + + +MediaFileList.mmp + +PRJ_EXPORTS +../rom/mediafilelist.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mediafilelist.iby) +../rom/mediafilelistResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(mediafilelistResources.iby) +../loc/MediaFileList.loc MW_LAYER_LOC_EXPORT_PATH(mediafilelist.loc) + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/group/mediafilelist_icons_aif_scalable_dc.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/group/mediafilelist_icons_aif_scalable_dc.mk Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,83 @@ +# +# Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Icons makefiles for project MediaFileList +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=/epoc32/release/$(PLATFORM)/$(CFG)/Z +else +ZDIR=/epoc32/data/z +endif + +# ---------------------------------------------------------------------------- +# +# ---------------------------------------------------------------------------- + +TARGETDIR=$(ZDIR)/resource/apps +HEADERDIR=/epoc32/include +ICONTARGETFILENAME=$(TARGETDIR)/mediafilelist.mif +HEADERFILENAME=$(HEADERDIR)/mediafilelist.mbg + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + +LIB : do_nothing + +CLEANLIB : do_nothing + +# ---------------------------------------------------------------------------- +# +# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by +# MifConv if the mask detph is defined. +# +# NOTE 2: Usually, source paths should not be included in the bitmap +# definitions. MifConv searches for the icons in all icon directories in a +# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps. +# The directory \s60\icons is included in the search only if the feature flag +# __SCALABLE_ICONS is defined. +# ---------------------------------------------------------------------------- + +RESOURCE : + mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \ + /c8,8 qgn_indi_ai_nt_music.svg \ + /c8,8 qgn_prop_mup_audio.svg \ + /c8,8 qgn_prop_fmgr_file_video.svg \ + /c8,8 qgn_prop_fmgr_file_voicerec.svg \ + /c8,8 qgn_prop_mup_artist.svg \ + /c8,8 qgn_prop_mup_album.svg \ + /c8,8 qgn_prop_mup_genre.svg \ + /c8,8 qgn_prop_mup_composer.svg \ + /c8,8 qgn_prop_link_embd_small.svg \ + /c8,8 qgn_prop_folder_small.svg \ + /c8,8 qgn_prop_sml_sync_off.svg \ + /c8,8 qgn_indi_fmgr_ms_add.svg \ + /c8,8 qgn_indi_mmc_add.svg \ + /c8,8 qgn_prop_mce_unknown_read \ + + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(HEADERFILENAME)&& \ + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/loc/MediaFileList.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/loc/MediaFileList.loc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,236 @@ +/* +* 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: +* This is a localisation file for MediaFileList module. +* A .loc file is the one and only place where the logical strings +* to be localised are defined. +* +*/ + + + + +//d: Tone Selection List title. +//l: title_pane_t2/opt9 +//r:5.1 +#define qtn_tsl_title "Select tone" + +//d: Softkey label for previewing video files +//l: control_pane_t1/opt7 +//r:5.1 +#define text_softkey_preview "Preview" + +//d:File format error. +//l:popup_note_window +//r:5.1 +#define qtn_tsl_file_format_error "Tone format not supported" + +//d:File format error. +//l:popup_note_window +//r:5.1 +#define qtn_mp_note_invalid_clip "Invalid clip. Operation cancelled" + +//d:File size error. +//l:popup_note_window +//r:5.1 +// +#define qtn_profiles_tone_maxsize_error "Files larger than %N kB cannot be set as ringing tone" + +//d: Error message text for non-supported file formats +//l: popup_note_window +//r:5.1 +#define qtn_profiles_info_tone_drm_protected "Protected file. Cannot be selected as ringing tone." + +//d:Title in wait note that is shown when opening a folder is slow. +//l:popup_note_wait_window +//r:5.1 +#define qtn_tsl_wait_note_opening "Opening..." + +//d:Title in wait note that is shown when searching media files is slow. +//l:popup_note_wait_window +//r:5.1 +#define qtn_tsl_wait_note_searching "Searching..." + +//d:Title in wait note that is shown when refreshing media files is slow. +//l:popup_note_wait_window +//r:5.1 +#define qtn_tsl_wait_note_updating "Updating..." + +// +// Folder names +// + +//d: Title of the Download tones item. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_download_tones "Download tones" + +//d: Title of the Tones folder. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_tones_folder "Tones" + +//d: Title of the Music folder. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_music_folder "Music" + +//d: Title of the Videos folder. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_videos_folder "Videos" + +//d: Title of the Recordings folder. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_recordings_folder "Recordings" + +//d: Title of the Default tone item. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_according_to_profile "According to profile" + +//d: Title of the Off item. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_off "Off" + +//d: Title of the All music folder. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_all_music_folder "All music" + +//d: Title of the Artist folder. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_artists_folder "Artists" + +//d: Title of the Albums folder. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_albums_folder "Albums" + +//d: Title of the Genres folder. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_genres_folder "Genres" + +//d: Title of the Composers folder. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_composers_folder "Composers" + +//d: Title of the Artist all folder/view. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_all "All" + + + +// +// View names +// + +//d: Navi pane item in Tones view +//l: tabs_3_long_active_pane_t1 +//r:5.1 +#define qtn_tsl_tones_view "Tones" + +//d: Navi pane item in Music view +//l: tabs_3_long_active_pane_t1 +//r:5.1 +#define qtn_tsl_music_view "Music" + +//d: Navi pane item in Videos view +//l: tabs_3_long_active_pane_t1 +//r:5.1 +#define qtn_tsl_videos_view "Videos" + +//d: Navi pane item in Recordings view +//l: tabs_3_long_active_pane_t1 +//r:5.1 +#define qtn_tsl_recordings_view "Recordings" + +//d: Navi pane item in Find results view +//d: not in ui spec +//l: tabs_3_long_active_pane_t1 +//r:5.1 +#define qtn_tsl_find_results "Find results (%N)" + +//d: Navi pane item in Artists view +//l: tabs_3_long_active_pane_t1 +//r:5.1 +#define qtn_tsl_artists_view "Artists" + +//d: Navi pane item in Albums view +//l: tabs_3_long_active_pane_t1 +//r:5.1 +#define qtn_tsl_albums_view "Albums" + +//d: Navi pane item in Genres view +//l: tabs_3_long_active_pane_t1 +//r:5.1 +#define qtn_tsl_genres_view "Genres" + +//d: Navi pane item in Composers view +//l: tabs_3_long_active_pane_t1 +//r:5.1 +#define qtn_tsl_composers_view "Composers" + +//d: Title of the Unknown folder/view. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_unknown_artist "Unknown" + +//d: Title of the Unknown folder/view. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_unknown_album "Unknown" + +//d: Title of the Unknown folder/view. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_unknown_genre "Unknown" + +//d: Title of the Unknown folder/view. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_unknown_composer "Unknown" + + + + +//d: Preview popup metadata field name. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_preview_popup_artist "Artist: " + +//d: Preview popup metadata field name. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_preview_popup_album "Album: " + +//d: Preview popup metadata field name. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_preview_popup_genre "Genre: " + +//d: Preview popup metadata field name. +//l: heading_pane_t1 +//r:5.1 +#define qtn_tsl_preview_popup_composer "Composer: " + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/rom/mediafilelist.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/rom/mediafilelist.iby Wed Sep 01 12:20:44 2010 +0100 @@ -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: IBY file for mediafilelist +* +*/ + + +#ifndef __MEDIAFILELIST_IBY__ +#define __MEDIAFILELIST_IBY__ + +file=ABI_DIR\BUILD_DIR\MediaFileList.dll SHARED_LIB_DIR\MediaFileList.dll + +data=DATAZ_\BITMAP_DIR\mediafilelist.mif BITMAP_DIR\mediafilelist.mif + + +#endif diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/MediaFileList/rom/mediafilelistResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/MediaFileList/rom/mediafilelistResources.iby Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: IBY file for mediafilelist's localization file +* +*/ + +#ifndef __MEDIAFILELIST_RESOURCES_IBY__ +#define __MEDIAFILELIST_RESOURCES_IBY__ + +//resourcefile for MediaFileList (mediafilelist.iby) +data=ZRESOURCE\MEDIAFILELIST.RSC RESOURCE_FILES_DIR\MEDIAFILELIST.RSC + +#endif \ No newline at end of file diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/BWINS/PROFILEENGU.DEF --- a/profilesservices/ProfileEngine/BWINS/PROFILEENGU.DEF Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/BWINS/PROFILEENGU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -6,6 +6,4 @@ ?CreateProfileEngineL@@YAPAVMProfileEngine@@PAVRFs@@@Z @ 5 NONAME ; class MProfileEngine * CreateProfileEngineL(class RFs *) ?ProfileUtilityInstanceL@@YAAAVMProfileUtilitySingleton@@XZ @ 6 NONAME ; class MProfileUtilitySingleton & ProfileUtilityInstanceL(void) ?ReleaseProfileUtility@@YAXXZ @ 7 NONAME ; void ReleaseProfileUtility(void) - ?CreateProfileEngineExtended2L@@YAPAVMProfileEngineExtended2@@XZ @ 8 NONAME ; class MProfileEngineExtended2 * CreateProfileEngineExtended2L(void) - ?CreateProfileEngineExtended2L@@YAPAVMProfileEngineExtended2@@PAVRFs@@@Z @ 9 NONAME ; class MProfileEngineExtended2 * CreateProfileEngineExtended2L(class RFs *) diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EABI/ProfileEngU.DEF --- a/profilesservices/ProfileEngine/EABI/ProfileEngU.DEF Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EABI/ProfileEngU.DEF Wed Sep 01 12:20:44 2010 +0100 @@ -6,6 +6,4 @@ _Z28CreateProfileEngineExtendedLP3RFs @ 5 NONAME _Z21ReleaseProfileUtilityv @ 6 NONAME _Z23ProfileUtilityInstanceLv @ 7 NONAME - _Z29CreateProfileEngineExtended2LP3RFs @ 8 NONAME - _Z29CreateProfileEngineExtended2Lv @ 9 NONAME diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngInc/ProfileEnginePrivateCRKeys.h --- a/profilesservices/ProfileEngine/EngInc/ProfileEnginePrivateCRKeys.h Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngInc/ProfileEnginePrivateCRKeys.h Wed Sep 01 12:20:44 2010 +0100 @@ -55,6 +55,8 @@ */ const TUint32 KProEngSchedulerTaskId = 0x80000005; + + // // The rest of the constants are used with profile-specific settings. The // actual key for a setting of a profile must be constructed as follows: @@ -195,6 +197,20 @@ const TUint32 KProEngVibra = EProfileSettingIdVibra; /** + * This value indicates whether Email vibra should be on or off. Integer (0 or 1). + * + * Default values: + * + * General (0): 0 + * Silent (1): 0 + * Meeting (2): 0 + * Outdoor (3): 1 + * Pager (4): 1 + * Off-line (5): 0 + */ +const TUint32 KProEngEmailVibra = EProfileSettingIdEmailVibra; + +/** * This value indicates whether warning and game tones should be on or off. * Integer (0 or 1). * @@ -414,20 +430,6 @@ */ const TUint32 KProEngAudioFeedback = EProfileSettingIdAudioFeedback; -/** - * - */ -const TUint32 KProEngReminderTone = EProfileSettingIdReminderTone; - -/** - * - */ -const TUint32 KProEngClockAlarmTone = EProfileSettingIdClockAlarmTone; - -/** - * - */ -const TUint32 KProEngAlertVibra = EProfileSettingIdAlertVibra; /** * The id used for storing the default settings for user created profiles. diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfileChangeNotifyHandler.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileChangeNotifyHandler.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileChangeNotifyHandler.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -18,12 +18,12 @@ // INCLUDE FILES +#include "CProfileChangeNotifyHandler.h" +#include "MProfileChangeObserver.h" #include "ProfileEngPanic.h" -#include -#include -#include +#include "ProfileEngineSDKCRKeys.h" +#include #include -#include // ============================ MEMBER FUNCTIONS =============================== diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,14 +19,6 @@ // INCLUDE FILES #include "CProfileEngineImpl.h" -#include "CProfilesNamesArrayImpl.h" -#include "CProfileImpl.h" -#include "CProfileNameImpl.h" -#include "ProfileEngUtils.h" -#include "ProfileEngPanic.h" -#include "CProfileTiming.h" -#include "ProfileEnginePrivateCRKeys.h" -#include "ProfilesDebug.h" #include // BaflUtils #include // RResoureFile #include @@ -34,30 +26,35 @@ #include #include -#include +#include #include #include +#include "CProfilesNamesArrayImpl.h" +#include "CProfileImpl.h" +#include "CProfileNameImpl.h" +#include "ProfileEngUtils.h" #include #include #include +#include "ProfileEngPanic.h" #include #include -#include -#include +#include "MProfileExtraSettings.h" +#include "MProfileFeedbackSettings.h" #include #include -#include // KProEngFeatureIdVTRingingTone +#include "ProfilesVariant.hrh" // KProEngFeatureIdVTRingingTone +#include "CProfileTiming.h" #include +#include "ProfileEnginePrivateCRKeys.h" #include #include #include +#include "ProfilesDebug.h" #include #include -#include -#include - // ============================ MEMBER FUNCTIONS =============================== @@ -240,8 +237,6 @@ MProfileExtended* CProfileEngineImpl::ProfileLC( TInt aId ) { - return Profile2LC( aId ); - /* CProfileImpl* profile = NULL; iMutex.Wait(); @@ -285,7 +280,6 @@ } return profile; - */ } // ----------------------------------------------------------------------------- @@ -297,12 +291,9 @@ MProfileExtended* CProfileEngineImpl::ProfileL( TInt aId ) { - return Profile2L( aId ); - /* MProfileExtended* profile = ProfileLC( aId ); CleanupStack::Pop(); // profile return profile; - */ } @@ -319,7 +310,6 @@ iMutex.Wait(); TInt err( CheckProfileIdL( aId ) ); - if( !err ) { TRAP( err, DoSetActiveProfileL( aId ) ); @@ -579,9 +569,7 @@ if( profileId == activeId ) { - MProfileExtended2 *activeProfile = Profile2LC(activeId); - UpdateActiveProfileSettingsL( *activeProfile ); - CleanupStack::PopAndDestroy(); // activeProfile + UpdateActiveProfileSettingsL( aProfile ); } // write settings to Cenrep: @@ -637,44 +625,22 @@ // (other items were commented in a header). // ----------------------------------------------------------------------------- // -void CProfileEngineImpl::UpdateActiveProfileSettingsL( MProfileExtended2& aProfile, +void CProfileEngineImpl::UpdateActiveProfileSettingsL( MProfile& aProfile, TBool aSetId ) { const MProfileTones& profileTones = aProfile.ProfileTones(); - const MProfileExtraTones2& profileExtraTones = aProfile.ProfileExtraTones2(); const MProfileName& profileName = aProfile.ProfileName(); const TProfileToneSettings& settings = profileTones.ToneSettings(); - // const MProfileVibraSettings &vibraSettings = aProfile.ProfileVibraSettings(); // These cannot fail because this method is called only in between // StartTransaction() and CommitTransaction() calls (except vibra) iCenRep->Set( KProEngActiveRingingType, settings.iRingingType ); - - //Removed. only master volue used - // iCenRep->Set( KProEngActiveRingingVolume, settings.iRingingVolume ); + iCenRep->Set( KProEngActiveRingingVolume, settings.iRingingVolume ); iCenRep->Set( KProEngActiveMessageAlert, !( aProfile.IsSilent() ) ); - - //Since 10.1 - iCenRep->Set( KProEngActiveRingTone,profileTones.RingingTone1() ); - iCenRep->Set( KProEngActiveMessageTone,profileTones.MessageAlertTone() ); - iCenRep->Set( KProEngActiveReminderTone,profileExtraTones.ReminderTone() ); - iCenRep->Set( KProEngActiveClockAlarmTone,profileExtraTones.ClockAlarmTone() ); - - /* - if ( MasterVibraL() ) - { - iCenRep->Set( KProEngActiveAlertVibra,vibraSettings.AlertVibra() ); - } - else - { - iCenRep->Set( KProEngActiveAlertVibra,0 ); - } - */ - if ( !PowerSaveMode() ) { User::LeaveIfError( iVibraCenRep->Set( - KVibraCtrlProfileVibraEnabled, /*vibraSettings.AlertVibra() != 0 &&*/ MasterVibraL() ) ); + KVibraCtrlProfileVibraEnabled, settings.iVibratingAlert ) ); #ifdef RD_TACTILE_FEEDBACK const MProfileExtraSettings& extraSettings = aProfile.ProfileExtraSettings(); @@ -753,8 +719,7 @@ CleanupStack::Pop(); // nameImpl } - // Since 10.1, No dynamic profiles in TB 10.1 - // ReadDynamicProfilesNamesL( aProfilesNames, *profileName ); + ReadDynamicProfilesNamesL( aProfilesNames, *profileName ); CleanupStack::PopAndDestroy(); // profileName } @@ -767,7 +732,7 @@ void CProfileEngineImpl::DoSetActiveProfileL( TInt aId, TTime* aTime ) { - MProfileExtended2* profile = Profile2LC( aId ); + MProfileExtended* profile = ProfileLC( aId ); User::LeaveIfError( iCenRep->StartTransaction( CRepository::EReadWriteTransaction ) ); @@ -972,17 +937,6 @@ } // ----------------------------------------------------------------------------- -// CreateProfileEngineExtendedL create profiles engine and -// return internal interface of the profiles engine -// Returns: Profiles Engine internal interface -// ----------------------------------------------------------------------------- -// -EXPORT_C MProfileEngineExtended2* CreateProfileEngineExtended2L() - { - return CProfileEngineImpl::NewL(); - } - -// ----------------------------------------------------------------------------- // CreateProfileEngineL create profiles engine and return public interface // of the profiles engine. // Returns: Profiles Engine public interface @@ -1004,16 +958,6 @@ return CProfileEngineImpl::NewL( aFs ); } -// ----------------------------------------------------------------------------- -// CreateProfileEngineExtendedL create profiles engine and -// return internal interface of the profiles engine -// Returns: Profiles Engine internal interface -// ----------------------------------------------------------------------------- -// -EXPORT_C MProfileEngineExtended2* CreateProfileEngineExtended2L( RFs* aFs ) - { - return CProfileEngineImpl::NewL( aFs ); - } // ----------------------------------------------------------------------------- // CProfileEngineImpl::PowerSaveMode @@ -1068,183 +1012,4 @@ } - -// ----------------------------------------------------------------------------- -// CProfileEngineImpl::Profile2LC -// -// ----------------------------------------------------------------------------- -// -MProfileExtended2* CProfileEngineImpl::Profile2LC( TInt aId ) - { - CProfileImpl* profile = NULL; - - iMutex.Wait(); - TInt err( CheckProfileIdL( aId ) ); - - if( !err ) - { - TRAP( err, profile = GetProfileL( aId ) ); - } - iMutex.Signal(); - - User::LeaveIfError( err ); - - CleanupStack::PushL( profile ); - - if( iSideVolumeKeys ) - { - // Because SetTemp*VolumeL() functions update only Shared Data those - // values must be read from SD and set to the MProfile instance - // returned to the caller: - TInt activeId( User::LeaveIfError( ActiveProfileId() ) ); - if( activeId == aId ) - { - TProfileToneSettings& settings = - profile->ProfileSetTones().SetToneSettings(); - settings.iRingingVolume = TempRingingVolumeL(); - settings.iMediaVolume = TempMediaVolumeL(); - } - } - - if( !profile->IsProfileNameChanged() ) - { - if( IsDefaultProfile( aId ) ) - { - profile->SetLocalizedProfileNameL( *iProfileLocalisedNames ); - } - else - { - SetLocalizedNameForDynamicProfileL( *profile ); - } - } - - return profile; - } - -// ----------------------------------------------------------------------------- -// CProfileEngineImpl::Profile2L -// -// ----------------------------------------------------------------------------- -// -MProfileExtended2* CProfileEngineImpl::Profile2L( TInt aId ) - { - MProfileExtended2* profile = Profile2LC( aId ); - CleanupStack::Pop(); // profile - return profile; - } - -// ----------------------------------------------------------------------------- -// CProfileEngineImpl::CommitChange2L -// -// ----------------------------------------------------------------------------- -// -void CProfileEngineImpl::CommitChange2L( MProfileExtended2& aProfile ) - { - CommitChangeL (aProfile); - } - - -// ----------------------------------------------------------------------------- -// CProfileEngineImpl::MasterVolumeL -// -// ----------------------------------------------------------------------------- -// -TInt CProfileEngineImpl::MasterVolumeL() const - { - TInt masterVolume( 0 ); - User::LeaveIfError( iCenRep->Get( KProEngMasterVolume, masterVolume ) ); - return masterVolume; - } - -// ----------------------------------------------------------------------------- -// CProfileEngineImpl::SetMasterVolumeL -// -// ----------------------------------------------------------------------------- -// -void CProfileEngineImpl::SetMasterVolumeL( TInt aMasterVolume ) - { - User::LeaveIfError( iCenRep->Set( KProEngMasterVolume, aMasterVolume ) ); - User::LeaveIfError( iCenRep->Set( KProEngActiveRingingVolume, aMasterVolume ) ); - - //Send event through P&S - CreatePubSubKeysIfNeededL(); - PublishChangeL( KProEngActiveProfileModified ); - } - -// ----------------------------------------------------------------------------- -// CProfileEngineImpl::MasterVibraL -// -// ----------------------------------------------------------------------------- -// -TBool CProfileEngineImpl::MasterVibraL() const - { - TInt masterVibra( 0 ); - User::LeaveIfError( iCenRep->Get( KProEngMasterVibra, masterVibra ) ); - return ( masterVibra != 0 ); - } - -// ----------------------------------------------------------------------------- -// CProfileEngineImpl::SetMasterVibraL -// -// ----------------------------------------------------------------------------- -// -void CProfileEngineImpl::SetMasterVibraL( TBool aMasterVibra ) - { - User::LeaveIfError( iCenRep->Set( KProEngMasterVibra, aMasterVibra ? 1 : 0 ) ); - User::LeaveIfError ( iCenRep->Set( KProEngActiveAlertVibra, aMasterVibra ? 1 : 0 ) ); - - /* - MProfileExtended2* activeProfile = Profile2LC( ActiveProfileId() ); - const MProfileVibraSettings &vibraSettings = activeProfile->ProfileVibraSettings(); - if (activeProfile) - { - if (aMasterVibra) - { - iCenRep->Set( KProEngActiveAlertVibra,vibraSettings.AlertVibra() ); - } - else - { - iCenRep->Set( KProEngActiveAlertVibra, 0 ); - } - } - CleanupStack::PopAndDestroy(); // activeProfile - */ - - if ( !PowerSaveMode() ) - { - User::LeaveIfError( iVibraCenRep->Set( - KVibraCtrlProfileVibraEnabled, aMasterVibra ? 1 : 0) ); - } - - //Send event through P&S - CreatePubSubKeysIfNeededL(); - PublishChangeL( KProEngActiveProfileModified ); - } - -// ----------------------------------------------------------------------------- -// CProfileEngineImpl::SilenceModeL -// -// ----------------------------------------------------------------------------- -// -TBool CProfileEngineImpl::SilenceModeL() const - { - TInt silenceMode( 0 ); - User::LeaveIfError( iCenRep->Get( KProEngSilenceMode, silenceMode ) ); - return ( silenceMode != 0 ); - } - -// ----------------------------------------------------------------------------- -// CProfileEngineImpl::SetSilenceModeL -// -// ----------------------------------------------------------------------------- -// -void CProfileEngineImpl::SetSilenceModeL( TBool aSilenceMode ) - { - User::LeaveIfError( iCenRep->Set( KProEngSilenceMode, aSilenceMode ? 1 : 0 ) ); - - //Send event through P&S - CreatePubSubKeysIfNeededL(); - PublishChangeL( KProEngActiveProfileModified ); - } - // End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.h --- a/profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.h Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.h Wed Sep 01 12:20:44 2010 +0100 @@ -24,7 +24,7 @@ #include #include // RFs #include // TProfileRingingVolume -#include // MProfileEngineExtended2 +#include // MProfileEngineExtended #include // MProfileExtended // FORWARD DECLARATIONS @@ -46,7 +46,7 @@ * @since 2.0 */ NONSHARABLE_CLASS(CProfileEngineImpl) : public CBase, - public MProfileEngineExtended2 + public MProfileEngineExtended { public: // Constructors and destructor @@ -186,56 +186,9 @@ TBool IsActiveProfileTimedL(); /** - * From MProfileEngineExtended2. + * From MProfileEngineExtended. */ void SetActiveProfileTimedL( TInt aId, TTime aTime ); - - - /** - * From MProfileEngineExtended2. - */ - virtual MProfileExtended2* Profile2LC( TInt aId ); - - /** - * From MProfileEngineExtended2. - */ - virtual MProfileExtended2* Profile2L( TInt aId ); - - /** - * From MProfileEngineExtended2. - */ - virtual void CommitChange2L( MProfileExtended2& aProfile ); - - - /** - * From MProfileEngineExtended2. - */ - virtual TInt MasterVolumeL() const; - - /** - * From MProfileEngineExtended2. - */ - virtual void SetMasterVolumeL( TInt aMasterVolume ); - - /** - * From MProfileEngineExtended2. - */ - virtual TBool MasterVibraL() const; - - /** - * From MProfileEngineExtended2. - */ - virtual void SetMasterVibraL( TBool aMasterVibra ); - - /** - * From MProfileEngineExtended2. - */ - virtual TBool SilenceModeL() const; - - /** - * From MProfileEngineExtended2. - */ - virtual void SetSilenceModeL( TBool aSilenceMode ); protected: // New functions @@ -276,7 +229,7 @@ * @param aSetId sets the id of the active profile to Central Repository * only if this is ETrue */ - void UpdateActiveProfileSettingsL( MProfileExtended2& aProfile, + void UpdateActiveProfileSettingsL( MProfile& aProfile, TBool aSetId = EFalse ); /** diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfileEngineImplDynamicProfiles.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileEngineImplDynamicProfiles.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileEngineImplDynamicProfiles.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,13 +19,6 @@ // INCLUDE FILES #include "CProfileEngineImpl.h" -#include "CProfilesNamesArrayImpl.h" -#include "CProfileImpl.h" -#include "CProfileNameImpl.h" -#include "ProfileEngUtils.h" -#include "ProfileEng.hrh" -#include "ProfileEngPanic.h" -#include "ProfileEnginePrivateCRKeys.h" #include #include #include @@ -33,11 +26,18 @@ #include #include -#include +#include #include #include +#include "CProfilesNamesArrayImpl.h" +#include "CProfileImpl.h" +#include "CProfileNameImpl.h" +#include "ProfileEngUtils.h" #include +#include +#include "ProfileEngPanic.h" #include +#include "ProfileEnginePrivateCRKeys.h" namespace { diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfileExtraTonesImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileExtraTonesImpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileExtraTonesImpl.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,11 +19,11 @@ // INCLUDE FILES #include "CProfileExtraTonesImpl.h" +#include "ProfilesVariant.hrh" +#include +#include #include "ProfileEngUtils.h" #include "ProfileEnginePrivateCRKeys.h" -#include -#include -#include // ============================ MEMBER FUNCTIONS =============================== @@ -37,8 +37,6 @@ iIMMessageAlertTone = KNullDesC().AllocL(); iEmailAlertTone = KNullDesC().AllocL(); iVideoCallRingingTone = KNullDesC().AllocL(); - iReminderTone = KNullDesC().AllocL(); - iClockAlarmTone = KNullDesC().AllocL(); } // ----------------------------------------------------------------------------- @@ -47,14 +45,12 @@ // ----------------------------------------------------------------------------- // void CProfileExtraTonesImpl::ConstructL( - const MProfileExtraTones2& aProfileExtraTones ) + const MProfileExtraTones& aProfileExtraTones ) { iIMMessageAlertTone = aProfileExtraTones.IMMessageAlertTone().AllocL(); iEmailAlertTone = aProfileExtraTones.EmailAlertTone().AllocL(); iVideoCallRingingTone = aProfileExtraTones.VideoCallRingingTone().AllocL(); - iReminderTone = aProfileExtraTones.ReminderTone().AllocL(); - iClockAlarmTone = aProfileExtraTones.ClockAlarmTone().AllocL(); } // ----------------------------------------------------------------------------- @@ -79,7 +75,7 @@ // ----------------------------------------------------------------------------- // CProfileExtraTonesImpl* CProfileExtraTonesImpl::NewL( - const MProfileExtraTones2& aProfileExtraTones ) + const MProfileExtraTones& aProfileExtraTones ) { CProfileExtraTonesImpl* self = new( ELeave ) CProfileExtraTonesImpl; @@ -97,8 +93,6 @@ delete iIMMessageAlertTone; delete iEmailAlertTone; delete iVideoCallRingingTone; - delete iReminderTone; - delete iClockAlarmTone; } @@ -139,24 +133,6 @@ aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngVideoCallTone, aProfileId ), toneFile ) ); iVideoCallRingingTone = toneFile.AllocL(); - - delete iReminderTone; - iReminderTone = NULL; - - // Reminder tone - User::LeaveIfError( - aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngReminderTone, - aProfileId ), toneFile ) ); - iReminderTone = toneFile.AllocL(); - - delete iClockAlarmTone; - iClockAlarmTone = NULL; - - // Clock alarm tone - User::LeaveIfError( - aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngClockAlarmTone, - aProfileId ), toneFile ) ); - iClockAlarmTone = toneFile.AllocL(); } // ----------------------------------------------------------------------------- @@ -182,16 +158,6 @@ User::LeaveIfError( aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngVideoCallTone, aProfileId ), *iVideoCallRingingTone ) ); - - // Reminder Tone - User::LeaveIfError( - aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngReminderTone, - aProfileId ), *iReminderTone ) ); - - // Clock Alarm Tone - User::LeaveIfError( - aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngClockAlarmTone, - aProfileId ), *iClockAlarmTone ) ); } // ----------------------------------------------------------------------------- @@ -269,56 +235,4 @@ iVideoCallRingingTone = tmp; } - - -// ----------------------------------------------------------------------------- -// CProfileExtraTonesImpl::ReminderTone -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -const TDesC& CProfileExtraTonesImpl::ReminderTone() const - { - return *iReminderTone; - } - -// ----------------------------------------------------------------------------- -// CProfileExtraTonesImpl::SetReminderToneL -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CProfileExtraTonesImpl::SetReminderToneL( - const TDesC& aReminderTone ) - { - HBufC* tmp = aReminderTone.Left( KMaxFileName ).AllocL(); - delete iReminderTone; - iReminderTone = tmp; - } - -// ----------------------------------------------------------------------------- -// CProfileExtraTonesImpl::ClockAlarmTone -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -const TDesC& CProfileExtraTonesImpl::ClockAlarmTone() const - { - return *iClockAlarmTone; - } - -// ----------------------------------------------------------------------------- -// CProfileExtraTonesImpl::SetClockAlarmToneL -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CProfileExtraTonesImpl::SetClockAlarmToneL( - const TDesC& aClockAlarmTone ) - { - HBufC* tmp = aClockAlarmTone.Left( KMaxFileName ).AllocL(); - delete iClockAlarmTone; - iClockAlarmTone = tmp; - } - // End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfileExtraTonesImpl.h --- a/profilesservices/ProfileEngine/EngSrc/CProfileExtraTonesImpl.h Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileExtraTonesImpl.h Wed Sep 01 12:20:44 2010 +0100 @@ -22,8 +22,8 @@ // INCLUDES #include -#include -#include +#include +#include // FORWARD DECLARATIONS class RWriteStream; @@ -38,8 +38,8 @@ * @since 2.0 */ NONSHARABLE_CLASS(CProfileExtraTonesImpl) : public CBase, - public MProfileExtraTones2, - public MProfileSetExtraTones2 + public MProfileExtraTones, + public MProfileSetExtraTones { public: // Constructors and destructor @@ -53,7 +53,7 @@ * @param aProfileExtraTones Profile extra tones */ static CProfileExtraTonesImpl* NewL( - const MProfileExtraTones2& aProfileExtraTones ); + const MProfileExtraTones& aProfileExtraTones ); /** * Destructor. @@ -111,28 +111,6 @@ */ virtual void SetVideoCallRingingToneL( const TDesC& aRingingTone ); - - /** - * From MProfileExtraTones2. - */ - virtual const TDesC& ReminderTone() const; - - /** - * From MProfileSetExtraTones2. - */ - virtual void SetReminderToneL( - const TDesC& aReminderTone ); - - /** - * From MProfileExtraTones2. - */ - virtual const TDesC& ClockAlarmTone() const; - - /** - * From MProfileSetExtraTones2. - */ - virtual void SetClockAlarmToneL( - const TDesC& aClockAlarmTone ); private: @@ -145,7 +123,7 @@ * By default Symbian 2nd phase constructor is private. * @param aProfileExtraTones Profile extra tones */ - void ConstructL( const MProfileExtraTones2& aProfileExtraTones ); + void ConstructL( const MProfileExtraTones& aProfileExtraTones ); private: // Data @@ -157,12 +135,6 @@ // Own: Video call ringing tone file name HBufC* iVideoCallRingingTone; - - //Own: Reminder tone file name - HBufC* iReminderTone; - - //Own: Clock alarm tone file name - HBufC* iClockAlarmTone; }; #endif // __CPROFILEEXTRATONESIMPL_H diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfileFeedbackSettingsImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileFeedbackSettingsImpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileFeedbackSettingsImpl.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,10 +19,10 @@ // INCLUDE FILES #include "CProfileFeedbackSettingsImpl.h" +#include #include "ProfileEngUtils.h" #include "ProfileEnginePrivateCRKeys.h" #include "ProfilesDebug.h" -#include #include // ============================ MEMBER FUNCTIONS =============================== diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfileImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileImpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileImpl.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,28 +19,28 @@ // INCLUDE FILES #include "CProfileImpl.h" -#include "CProfileNameImpl.h" -#include "CProfileTonesImpl.h" -#include "CProfileExtraTonesImpl.h" -#include "CProfileExtraSettingsImpl.h" -#include "CProfilePresenceImpl.h" -#include "ProfileEngUtils.h" -#include "ProfileEnginePrivateCRKeys.h" #include #include +#include #include #include #include #include #include #include -#include +#include #include +#include "CProfileNameImpl.h" +#include "CProfileTonesImpl.h" +#include "CProfileExtraTonesImpl.h" +#include "CProfileExtraSettingsImpl.h" +#include "CProfilePresenceImpl.h" #include #include -#include +#include "ProfilesVariant.hrh" +#include "ProfileEngUtils.h" +#include "ProfileEnginePrivateCRKeys.h" #include -#include "CProfileVibraSettingsImpl.h" // CONSTANTS // Max. number of Alert for groups: @@ -78,7 +78,6 @@ // ProfileUtility must be released in destructor: iFeatures = &( ProfileUtilityInstanceL().ProfilesLocalFeatures() ); iProfileExtraSettings = CProfileExtraSettingsImpl::NewL(); - iProfileVibraSettings = CProfileVibraSettingsImpl::NewL(); } // ----------------------------------------------------------------------------- @@ -87,7 +86,7 @@ // ----------------------------------------------------------------------------- // void CProfileImpl::ConstructL( - const MProfileExtended2& aProfile, + const MProfileExtended& aProfile, TInt aId ) { iProfileName = CProfileNameImpl::NewLC( aId, KNullDesC ); @@ -95,7 +94,7 @@ CommonConstructL(); iProfileTones = CProfileTonesImpl::NewL( aProfile.ProfileTones() ); iProfileExtraTones = CProfileExtraTonesImpl::NewL( - aProfile.ProfileExtraTones2() ); + aProfile.ProfileExtraTones() ); iFeatures = &( ProfileUtilityInstanceL().ProfilesLocalFeatures() ); @@ -104,9 +103,6 @@ aProfile.ProfilePresence() ); iVisibleFlags = aProfile.VisibleFlags(); iModifiableFlags = aProfile.ModifiableFlags(); - - iProfileVibraSettings = CProfileVibraSettingsImpl::NewL(); - } // ----------------------------------------------------------------------------- @@ -146,7 +142,7 @@ // CProfileImpl* CProfileImpl::NewLC( RFs& aFs, - const MProfileExtended2& aProfile, + const MProfileExtended& aProfile, TInt aId ) { CProfileImpl* self = new( ELeave ) CProfileImpl( aFs ); @@ -174,8 +170,6 @@ delete iProfileTones; delete iProfileExtraTones; delete iProfilePresence; - - delete iProfileVibraSettings; } // ----------------------------------------------------------------------------- @@ -222,7 +216,39 @@ const TArray CProfileImpl::AlertForL() { TInt contactIdListCount( iAlertFor.Count() ); + if( contactIdListCount > 0 ) + { + // create CPbkContactEngine + CPbkContactEngine* contactEngine = CPbkContactEngine::NewL( &iFs ); + CleanupStack::PushL( contactEngine ); + CContactIdArray* groupIds = contactEngine->Database().GetGroupIdListL(); + if( !groupIds ) + { // There are no groups in Contacts db -> clear the alert for IDs: + iAlertFor.Reset(); + } + else + { + CleanupStack::PushL( groupIds ); + TInt err; + for( TInt i( 0 ) ; i < contactIdListCount ; ++i ) + { + err = groupIds->Find( iAlertFor[i] ); + + if( err == KErrNotFound ) + { + // remove this + iAlertFor.Remove( i ); + --contactIdListCount; + --i; + err = KErrNone; + } + User::LeaveIfError( err ); + } + CleanupStack::PopAndDestroy(); // groupIds + } + CleanupStack::PopAndDestroy(); // contactEngine + } return iAlertFor.Array(); } @@ -235,16 +261,6 @@ // TBool CProfileImpl::IsSilent() const { - //Since 10.1, firstly check maste silence mode - TInt silenceMode( 0 ); - CRepository* cenrep = CRepository::NewLC( KCRUidProfileEngine ); - cenrep->Get( KProEngSilenceMode , silenceMode ); - CleanupStack::PopAndDestroy( cenrep ); - if ( silenceMode ) - { - return ETrue; - } - TProfileRingingType ringType( iProfileTones->ToneSettings().iRingingType ); if ( ringType == EProfileRingingTypeSilent ) { @@ -499,8 +515,6 @@ iProfilePresence->InternalizeL( aCenRep, aProfileId ); iProfileExtraSettings->InternalizeL( aCenRep, aProfileId ); - - iProfileVibraSettings->InternalizeL( aCenRep, aProfileId ); } void CProfileImpl::ExternalizeL( CRepository& aCenRep ) @@ -537,8 +551,6 @@ iProfileExtraTones->ExternalizeL( aCenRep, profileId ); iProfilePresence->ExternalizeL( aCenRep, profileId ); iProfileExtraSettings->ExternalizeL( aCenRep, profileId ); - - iProfileVibraSettings->ExternalizeL( aCenRep, profileId ); } // ----------------------------------------------------------------------------- @@ -586,49 +598,4 @@ FeatureManager::UnInitializeLib(); } - -// ----------------------------------------------------------------------------- -// CProfileImpl::ProfileExtraTones2 -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -const MProfileExtraTones2& CProfileImpl::ProfileExtraTones2() const - { - return *iProfileExtraTones; - } - -// ----------------------------------------------------------------------------- -// CProfileImpl::ProfileSetExtraTones2 -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -MProfileSetExtraTones2& CProfileImpl::ProfileSetExtraTones2() - { - return *iProfileExtraTones; - } - -// ----------------------------------------------------------------------------- -// CProfileImpl::ProfileVibraSettings -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -const MProfileVibraSettings& CProfileImpl::ProfileVibraSettings() const - { - return *iProfileVibraSettings; - } - -// ----------------------------------------------------------------------------- -// CProfileImpl::ProfileSetVibraSettings -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -MProfileSetVibraSettings& CProfileImpl::ProfileSetVibraSettings() - { - return *iProfileVibraSettings; - } - // End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfileImpl.h --- a/profilesservices/ProfileEngine/EngSrc/CProfileImpl.h Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileImpl.h Wed Sep 01 12:20:44 2010 +0100 @@ -22,7 +22,7 @@ // INCLUDES #include -#include +#include #include // NCentralRepositoryConstants::KMaxBinaryLength // CONSTANTS @@ -40,7 +40,6 @@ class MProfilesNamesArray; class MProfilesLocalFeatures; struct TProfilePresenceSettings; -class CProfileVibraSettingsImpl; // CLASS DECLARATION @@ -51,7 +50,7 @@ * @since 2.0 */ NONSHARABLE_CLASS(CProfileImpl) : public CBase, - public MProfileExtended2 + public MProfileExtended { public: // Constructors and destructor @@ -74,7 +73,7 @@ * @param aId Profile ID */ static CProfileImpl* NewLC( - RFs& aFs, const MProfileExtended2& aProfile, TInt aId ); + RFs& aFs, const MProfileExtended& aProfile, TInt aId ); /** * Destructor. @@ -198,27 +197,6 @@ * From MProfileExtended. */ virtual MProfileSetExtraSettings& ProfileSetExtraSettings() const; - - - /** - * From MProfileExtended2. - */ - virtual const MProfileExtraTones2& ProfileExtraTones2() const; - - /** - * From MProfileExtended2. - */ - virtual MProfileSetExtraTones2& ProfileSetExtraTones2(); - - /** - * From MProfileExtended2. - */ - virtual const MProfileVibraSettings& ProfileVibraSettings() const; - - /** - * From MProfileExtended2. - */ - virtual MProfileSetVibraSettings& ProfileSetVibraSettings(); /** * Externalize data to Central Repository. @@ -245,7 +223,7 @@ * @param aProfile Profile settings * @param aId Profile ID */ - void ConstructL( const MProfileExtended2& aProfile, TInt aId ); + void ConstructL( const MProfileExtended& aProfile, TInt aId ); /** * This method does the common part of the construction. @@ -271,9 +249,6 @@ // Own: Profile presence settings implementation CProfilePresenceImpl* iProfilePresence; - - // Own: Profile vibra settings implementation - CProfileVibraSettingsImpl *iProfileVibraSettings; // Own: Profile modifiable flags TUint32 iModifiableFlags; diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfileNameImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileNameImpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileNameImpl.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,12 +19,12 @@ // INCLUDE FILES #include "CProfileNameImpl.h" -#include "ProfileEnginePrivateCRKeys.h" -#include "ProfileEngUtils.h" #include #include #include #include +#include "ProfileEnginePrivateCRKeys.h" +#include "ProfileEngUtils.h" // ============================ MEMBER FUNCTIONS =============================== diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfilePresenceImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfilePresenceImpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/CProfilePresenceImpl.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -20,14 +20,14 @@ // INCLUDE FILES #include "CProfilePresenceImpl.h" -#include "ProfileEnginePrivateCRKeys.h" -#include "ProfileEngUtils.h" #include #include #include -#include +#include #include #include +#include "ProfileEnginePrivateCRKeys.h" +#include "ProfileEngUtils.h" // EXTERNAL DATA STRUCTURES // EXTERNAL FUNCTION PROTOTYPES diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfilePttSettingsImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfilePttSettingsImpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/CProfilePttSettingsImpl.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,9 +19,9 @@ // INCLUDE FILES #include "CProfilePttSettingsImpl.h" +#include #include "ProfileEngUtils.h" #include "ProfileEnginePrivateCRKeys.h" -#include // ============================ MEMBER FUNCTIONS =============================== diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfileTiming.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileTiming.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileTiming.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -18,14 +18,14 @@ // INCLUDE FILES -#include "CProfileTiming.h" -#include "ProfileEnginePrivateCRKeys.h" -#include "ProfilesDebug.h" +#include "CProfileTiming.h" #include #include // TParse #include #include #include +#include "ProfileEnginePrivateCRKeys.h" +#include "ProfilesDebug.h" // LOCAL CONSTANTS AND MACROS namespace diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfileTonesImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileTonesImpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileTonesImpl.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,16 +19,14 @@ // INCLUDE FILES #include "CProfileTonesImpl.h" +#include +#include #include "ProfileEngUtils.h" #include "ProfileEnginePrivateCRKeys.h" - -#include -#include #include #include #include -#include // ============================ MEMBER FUNCTIONS =============================== @@ -141,40 +139,19 @@ aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngRingingType, aProfileId ), value ) ); iProfileToneSettings.iRingingType = TProfileRingingType( value ); - - //Since 10.1, check if silence mode - User::LeaveIfError( - aCenRep.Get( KProEngSilenceMode , value) ); - if ( value ) - { - iProfileToneSettings.iRingingType = EProfileRingingTypeSilent; - } - User::LeaveIfError( aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngKeypadVolume, aProfileId ), value ) ); iProfileToneSettings.iKeypadVolume = TProfileKeypadVolume( value ); - /* - * User::LeaveIfError( + User::LeaveIfError( aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngRingingVolume, aProfileId ), iProfileToneSettings.iRingingVolume ) ); - */ - - //Since 10.1, Only master volume used. - User::LeaveIfError( - aCenRep.Get( KProEngMasterVolume , iProfileToneSettings.iRingingVolume ) ); - - - /* User::LeaveIfError( aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngVibra, aProfileId ), iProfileToneSettings.iVibratingAlert ) ); - */ - - //Since 10.1,Only master vibra used User::LeaveIfError( - aCenRep.Get( KProEngMasterVibra, iProfileToneSettings.iVibratingAlert ) ); - + aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngEmailVibra, + aProfileId ), iProfileToneSettings.iEmailVibratingAlert ) ); User::LeaveIfError( aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngWarnAndGameTones, aProfileId ), iProfileToneSettings.iWarningAndGameTones ) ); @@ -190,6 +167,7 @@ if ( iPowerSaveMode ) { iProfileToneSettings.iVibratingAlert = iPsmConfigVibra; + iProfileToneSettings.iEmailVibratingAlert = iPsmConfigVibra; iProfileToneSettings.iKeypadVolume = TProfileKeypadVolume( iPsmConfigKeypadVolume ); } @@ -237,8 +215,11 @@ User::LeaveIfError( aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngVibra, aProfileId ), iProfileToneSettings.iVibratingAlert ) ); - } - + + User::LeaveIfError( + aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngEmailVibra, + aProfileId ), iProfileToneSettings.iEmailVibratingAlert ) ); + } User::LeaveIfError( aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngWarnAndGameTones, aProfileId ), iProfileToneSettings.iWarningAndGameTones ) ); diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfileUtilitySingletonImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileUtilitySingletonImpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileUtilitySingletonImpl.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,9 +19,9 @@ // INCLUDE FILES #include "CProfileUtilitySingletonImpl.h" +#include #include "CProfilesLocalFeatures.h" #include "ProfilesDebug.h" -#include // ============================ MEMBER FUNCTIONS =============================== diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfileVibraSettingsImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileVibraSettingsImpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,265 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Profile PTT settings implementation. -* -*/ - -#include "CProfileVibraSettingsImpl.h" -#include "ProfileEngUtils.h" -#include "ProfileEnginePrivateCRKeys.h" - -#include -#include - - -// ============================ MEMBER FUNCTIONS =============================== - -//Default Constructor -CProfileVibraSettingsImpl::CProfileVibraSettingsImpl() : iAlertVibra( 0 ) - { - - } - -// ----------------------------------------------------------------------------- -// CProfileTonesImpl::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CProfileVibraSettingsImpl::ConstructL() - { - - } - - -// ----------------------------------------------------------------------------- -// CProfilePresenceImpl::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CProfileVibraSettingsImpl *CProfileVibraSettingsImpl::NewL() - { - CProfileVibraSettingsImpl* self = new( ELeave ) CProfileVibraSettingsImpl; - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - - return self; - } - -// Destructor -CProfileVibraSettingsImpl::~CProfileVibraSettingsImpl() - { - - } - -// ----------------------------------------------------------------------------- -// CProfileVibraSettingsImpl::InternalizeL -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CProfileVibraSettingsImpl::InternalizeL( CRepository& aCenRep, - TInt aProfileId ) - { - User::LeaveIfError( - aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngAlertVibra, - aProfileId ), iAlertVibra) ); - } - -// ----------------------------------------------------------------------------- -// CProfileVibraSettingsImpl::ExternalizeL -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CProfileVibraSettingsImpl::ExternalizeL( CRepository& aCenRep, - TInt aProfileId ) const - { - User::LeaveIfError( - aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngAlertVibra, - aProfileId ), iAlertVibra ) ); - } - - -// ----------------------------------------------------------------------------- -// CProfileVibraSettingsImpl::AlertVibra -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CProfileVibraSettingsImpl::AlertVibra() const - { - return iAlertVibra; - } - - -// ----------------------------------------------------------------------------- -// CProfileVibraSettingsImpl::RingAlertVibra -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CProfileVibraSettingsImpl::RingAlertVibra() const - { - return iAlertVibra & EProfileRingAlertVibra; - } - -// ----------------------------------------------------------------------------- -// CProfileVibraSettingsImpl::MessageAlertVibra -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CProfileVibraSettingsImpl::MessageAlertVibra() const - { - return iAlertVibra & EProfileMessageAlertVibra; - } - -// ----------------------------------------------------------------------------- -// CProfileVibraSettingsImpl::EmailAlertVibra -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CProfileVibraSettingsImpl::EmailAlertVibra() const - { - return iAlertVibra & EProfileEmailAlertVibra; - } - -// ----------------------------------------------------------------------------- -// CProfileVibraSettingsImpl::ReminderAlarmVibra -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CProfileVibraSettingsImpl::ReminderAlarmVibra() const - { - return iAlertVibra & EProfileReminderAlarmVibra; - } - -// ----------------------------------------------------------------------------- -// CProfileVibraSettingsImpl::InformationVibra -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CProfileVibraSettingsImpl::InformationVibra() const - { - return iAlertVibra & EProfileInformationVibra; - } - -// ----------------------------------------------------------------------------- -// CProfileVibraSettingsImpl::SetAlertVibra -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CProfileVibraSettingsImpl::SetAlertVibra(TInt aAlertVibra) - { - iAlertVibra = aAlertVibra; - } - - -// ----------------------------------------------------------------------------- -// CProfileVibraSettingsImpl::SetRingAlertVibra -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CProfileVibraSettingsImpl::SetRingAlertVibra(TBool aRingAlertVibra) - { - if ( aRingAlertVibra ) - { - iAlertVibra |= EProfileRingAlertVibra; - } - else - { - iAlertVibra &= ~EProfileRingAlertVibra; - } - } - -// ----------------------------------------------------------------------------- -// CProfileVibraSettingsImpl::SetMessageAlertVibra -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CProfileVibraSettingsImpl::SetMessageAlertVibra(TBool aMessageAlertVibra) - { - if ( aMessageAlertVibra ) - { - iAlertVibra |= EProfileMessageAlertVibra; - } - else - { - iAlertVibra &= ~EProfileMessageAlertVibra; - } - } - -// ----------------------------------------------------------------------------- -// CProfileVibraSettingsImpl::SetEmailAlertVibra -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CProfileVibraSettingsImpl::SetEmailAlertVibra(TBool aEmailAlertVibra) - { - if ( aEmailAlertVibra ) - { - iAlertVibra |= EProfileEmailAlertVibra; - } - else - { - iAlertVibra &= ~EProfileEmailAlertVibra; - } - } - -// ----------------------------------------------------------------------------- -// CProfileVibraSettingsImpl::SetReminderAlarmVibra -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CProfileVibraSettingsImpl::SetReminderAlarmVibra(TBool aReminderAlarmVibra) - { - if ( aReminderAlarmVibra ) - { - iAlertVibra |= EProfileReminderAlarmVibra; - } - else - { - iAlertVibra &= ~EProfileReminderAlarmVibra; - } - } - -// ----------------------------------------------------------------------------- -// CProfileVibraSettingsImpl::SetInformationVibra -// -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CProfileVibraSettingsImpl::SetInformationVibra(TBool aInformationVibra) - { - if ( aInformationVibra ) - { - iAlertVibra |= EProfileInformationVibra; - } - else - { - iAlertVibra &= ~EProfileInformationVibra; - } - } - -//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfileVibraSettingsImpl.h --- a/profilesservices/ProfileEngine/EngSrc/CProfileVibraSettingsImpl.h Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Profile PTT settings implementation. -* -*/ - - - -#ifndef __CPROFILEVIBRASETTINGSIMPL_H -#define __CPROFILEVIBRASETTINGSIMPL_H - -// INCLUDES -#include -#include -#include - -// CLASS DECLARATION - -class CRepository; - -/** -* Profile vibra settings implementation. -* -* @lib ?library -* @since 10.1 -*/ -NONSHARABLE_CLASS(CProfileVibraSettingsImpl) : public CBase, - public MProfileVibraSettings, - public MProfileSetVibraSettings - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CProfileVibraSettingsImpl* NewL(); - - /** - * Constructor. - */ - CProfileVibraSettingsImpl(); - - /** - * Destructor. - */ - virtual ~CProfileVibraSettingsImpl(); - - public: // New functions - - /** - * Internalize data from the central repository. - * @since 3.0 - * @param aCenRep Central Repository object to read the settings - * @param aProfileId the id of the profile to be internalized - */ - void InternalizeL( CRepository& aCenRep, TInt aProfileId ); - - /** - * Externalize data to Central Repository. - * @since 3.0 - * @param aCenRep Central Repository object to write the settings - */ - void ExternalizeL( CRepository& aCenRep, TInt aProfileId ) const; - - public: // Functions from base classes - - /** - * From MProfileVibraSettings - */ - virtual TInt AlertVibra() const; - - /** - * From MProfileVibraSettings - */ - virtual TBool RingAlertVibra() const; - - /** - * From MProfileVibraSettings - */ - virtual TBool MessageAlertVibra() const; - - /** - * From MProfileVibraSettings - */ - virtual TBool EmailAlertVibra() const; - - /** - * From MProfileVibraSettings - */ - virtual TBool ReminderAlarmVibra() const; - - /** - * From MProfileVibraSettings - */ - virtual TBool InformationVibra() const; - - - /** - * From MProfileSetVibraSettings - */ - virtual void SetAlertVibra(TInt aAlertVibra); - - /** - * From MProfileSetVibraSettings - */ - virtual void SetRingAlertVibra(TBool aRingAlertVibra); - - /** - * From MProfileSetVibraSettings - */ - virtual void SetMessageAlertVibra(TBool aMessageAlertVibra); - - /** - * From MProfileSetVibraSettings - */ - virtual void SetEmailAlertVibra(TBool aEmailAlertVibra); - - /** - * From MProfileSetVibraSettings - */ - virtual void SetReminderAlarmVibra(TBool aReminderAlarmVibra); - - /** - * From MProfileSetVibraSettings - */ - virtual void SetInformationVibra(TBool aInformationVibra); - - private: - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - private: // Data - - TInt iAlertVibra; - - }; - -#endif //__CPROFILEVIBRASETTINGSIMPL_H - -//End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/CProfilesNamesArrayImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfilesNamesArrayImpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/CProfilesNamesArrayImpl.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,11 +19,11 @@ // INCLUDE FILES #include "CProfilesNamesArrayImpl.h" -#include "CProfileNameImpl.h" -#include "ProfileEngPanic.h" #include #include +#include "CProfileNameImpl.h" #include +#include "ProfileEngPanic.h" #include // LOCAL CONSTANTS AND MACROS diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/EngSrc/ProfileEngUtils.cpp --- a/profilesservices/ProfileEngine/EngSrc/ProfileEngUtils.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/EngSrc/ProfileEngUtils.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -21,7 +21,7 @@ #include "ProfileEngUtils.h" #include "CProfileEngineImpl.h" #include -#include +#include #include #include diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.cpp --- a/profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,16 +19,23 @@ // INCLUDE FILES #include "CProfileChangeEvent.h" -#include "ProfileEnginePrivateCRKeys.h" -#include "ProfilesDebug.h" #include #include +#include #include #include +#include +#include -#include +#include +#include +#include + +#include +#include "ProfileEnginePrivateCRKeys.h" #include +#include "ProfilesDebug.h" // CONSTANTS @@ -56,6 +63,10 @@ // void CProfileChangeEvent::ConstructL() { + FeatureManager::InitializeLibL(); + iCoverDisplay = FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ); + + User::LeaveIfError( iFs.Connect() ); // Open/Create mutex TInt error( KErrNotFound ); @@ -70,6 +81,7 @@ } User::LeaveIfError( error ); iProfileEngine = CreateProfileEngineL( &iFs ); + iGlobalNote = CAknGlobalNote::NewL(); ReadResourcesL(); } @@ -105,12 +117,16 @@ // Destructor CProfileChangeEvent::~CProfileChangeEvent() { + delete iNoteText; + delete iGlobalNote; if( iProfileEngine ) { iProfileEngine->Release(); } iFs.Close(); iMutex.Close(); + + FeatureManager::UnInitializeLib(); } @@ -186,6 +202,15 @@ // void CProfileChangeEvent::ShowNoteL() { + PRODEBUG1( " CProfileChangeEvent:ShowNoteL(%S)", iNoteText ); + // Set secondary display data if cover ui is supported + if ( iCoverDisplay ) + { + CAknSDData* sd = CAknSDData::NewL(KCatProfiles, + ECmdShowTimedProfileExpiryNote, KNullDesC8); + iGlobalNote->SetSecondaryDisplayData( sd ); // ownership transferred + } + iGlobalNote->ShowNoteL( EAknGlobalConfirmationNote, *iNoteText ); } // ----------------------------------------------------------------------------- @@ -195,6 +220,35 @@ // void CProfileChangeEvent::ReadResourcesL() { + PRODEBUG( " CProfileChangeEvent:ReadResourcesL" ); + TParse* fp = new ( ELeave ) TParse(); + fp->Set( KProfileScheduleEventResourceDriveAndDir, + &KDC_RESOURCE_FILES_DIR, NULL ); + iResourceFile.Copy( fp->FullName() ); + delete fp; + + PRODEBUG( " CProfileChangeEvent:ReadResourcesL 2" ); + BaflUtils::NearestLanguageFile( iFs, iResourceFile ); + PRODEBUG1( " CProfileChangeEvent:ReadResourcesL 3 iResourceFile=%S", &iResourceFile ); + + RResourceFile resourceFile; + resourceFile.OpenL( iFs, iResourceFile ); + CleanupClosePushL( resourceFile ); + + PRODEBUG( " CProfileChangeEvent:ReadResourcesL 4" ); + resourceFile.ConfirmSignatureL(); + PRODEBUG( " CProfileChangeEvent:ReadResourcesL 5" ); + + HBufC8* dataBuffer = resourceFile.AllocReadLC( R_PROFILES_CONFIRM_TIMED_EXPIRED ); + + PRODEBUG( " CProfileChangeEvent:ReadResourcesL 6" ); + TResourceReader rsReader; + rsReader.SetBuffer( dataBuffer ); + iNoteText = rsReader.ReadHBufCL(); + PRODEBUG( " CProfileChangeEvent:ReadResourcesL 7" ); + + CleanupStack::PopAndDestroy( 2 ); // dataBuffer, resourceFile + PRODEBUG( " CProfileChangeEvent:ReadResourcesL 8" ); } // End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.h --- a/profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.h Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.h Wed Sep 01 12:20:44 2010 +0100 @@ -27,6 +27,7 @@ // FORWARD DECLARATIONS class MProfileEngine; +class CAknGlobalNote; // CLASS DECLARATION @@ -110,14 +111,28 @@ // Own: Profiles Engine for profile activation MProfileEngine* iProfileEngine; + // Own: Global note to show the expiration conf. note to the user + CAknGlobalNote* iGlobalNote; + + // Own: buffer for the confirmation note text + HBufC* iNoteText; + // File server session needed for resource reading: RFs iFs; + // Used to store the resource file name + TFileName iResourceFile; + // Mutex controlling access to profiles data RMutex iMutex; // The ID of the profile which should be reactivated TInt iPreviousId; + + // Supported features + TBool iCoverDisplay; + + }; #endif // CPROFILECHANGEEVENT_H diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/WrapperSrc/CProEngAlertToneSeekerImpl.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngAlertToneSeekerImpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngAlertToneSeekerImpl.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,7 +19,6 @@ // INCLUDE FILES #include "CProEngAlertToneSeekerImpl.h" -#include "CProEngPostFilter.h" #include #include #include @@ -27,6 +26,7 @@ #include // RFs, TParse #include #include +#include "CProEngPostFilter.h" namespace { diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/WrapperSrc/CProEngCenRepObserverBase.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngCenRepObserverBase.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngCenRepObserverBase.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -21,7 +21,7 @@ #include "CProEngCenRepObserverBase.h" #include #include -#include +#include "ProfileEngineSDKCRKeys.h" // ============================ MEMBER FUNCTIONS =============================== diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/WrapperSrc/CProEngEngineImpl.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngEngineImpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngEngineImpl.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,15 +19,28 @@ // INCLUDE FILES #include "CProEngEngineImpl.h" -#include "CProEngProfileImpl.h" -#include "CProEngToneHandler.h" -#include "CProEngProfileNameArrayImpl.h" #include #include #include #include #include +#include "CProEngProfileImpl.h" +#include "CProEngToneHandler.h" +#include "CProEngProfileNameArrayImpl.h" +#include +#include +#include +#include +#include +#include +#include // RResourceFile +#include // BaflUtils +namespace + { + // The filename of the resource file + _LIT( KProEngResourceFileName, "Z:ProEngWrapper.RSC" ); + } // ============================ MEMBER FUNCTIONS =============================== // ----------------------------------------------------------------------------- @@ -154,7 +167,7 @@ MProEngProfile* profileWrapper = ActiveProfileLC(); CleanupStack::Pop(); // profileWrapper - + return profileWrapper; } @@ -190,6 +203,50 @@ // void CProEngEngineImpl::SetActiveProfileL( TInt aId ) { + if ( // active profile is Off-line + ( iProfileEngine->ActiveProfileId() == EProfileOffLineId ) && + // and currently focused profile is not Off-line + ( aId != EProfileOffLineId ) ) + { + + TInt simCStatus( ESimNotPresent ); + RProperty simStatus; + CleanupClosePushL( simStatus ); + + User::LeaveIfError( simStatus.Attach( KPSUidStartup, KPSSimStatus ) ); + User::LeaveIfError( simStatus.Get( simCStatus ) ); + CleanupStack::PopAndDestroy();//simStatus + + // SIM card does not exist. + if ( simCStatus == ESimNotPresent ) + { + TParse* fp = new ( ELeave ) TParse(); + fp->Set( KProEngResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL ); + TFileName localizedFileName( fp->FullName() ); + delete fp; + + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + BaflUtils::NearestLanguageFile( fs, localizedFileName ); + + RConeResourceLoader resourceLoader( *CCoeEnv::Static() ); + CleanupClosePushL( resourceLoader ); + + TRAP_IGNORE( resourceLoader.OpenL( localizedFileName ) ); + + HBufC* infoNoteText = StringLoader::LoadLC( + R_PROFILE_TEXT_INSERT_SIM ); + CAknInformationNote* note = new ( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *infoNoteText ); + + CleanupStack::PopAndDestroy( infoNoteText ); + CleanupStack::PopAndDestroy( 2 ); //resourceLoader&fs + + return; + } + } iProfileEngine->SetActiveProfileL( aId ); } diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/WrapperSrc/CProEngMediaVariation.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngMediaVariation.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngMediaVariation.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,10 +19,10 @@ // INCLUDE FILES #include "CProEngMediaVariation.h" -#include "ProEngMmfInfoUtility.h" #include #include // RApaLsSession #include +#include "ProEngMmfInfoUtility.h" #include #include diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/WrapperSrc/CProEngNotifyHandlerImpl.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngNotifyHandlerImpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngNotifyHandlerImpl.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,17 +19,17 @@ // INCLUDE FILES #include "CProEngNotifyHandlerImpl.h" -#include "CProEngProfileActivationDelegate.h" -#include "CProEngActiveProfileDelegate.h" -#include "CProEngProfileNameArrayEventDelegate.h" -#include "CProEngProfileEventDelegate.h" -#include "ProfileEnginePrivateCRKeys.h" #include #include #include #include #include +#include "ProfileEnginePrivateCRKeys.h" #include +#include "CProEngProfileActivationDelegate.h" +#include "CProEngActiveProfileDelegate.h" +#include "CProEngProfileNameArrayEventDelegate.h" +#include "CProEngProfileEventDelegate.h" // ============================= LOCAL FUNCTIONS =============================== @@ -53,10 +53,7 @@ // CProEngNotifyHandlerImpl::CProEngNotifyHandlerImpl // ----------------------------------------------------------------------------- // -CProEngNotifyHandlerImpl::CProEngNotifyHandlerImpl() : - iActiveIdEventDelegate( NULL ), - iActiveProfileEventDelegate( NULL ), - iNameArrayEventDelegate( NULL ) +CProEngNotifyHandlerImpl::CProEngNotifyHandlerImpl() { } diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/WrapperSrc/CProEngProfileActivationDelegate.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileActivationDelegate.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileActivationDelegate.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -22,7 +22,7 @@ #include #include #include // KProEngActiveProfileChanged -#include // KCRUidProfileEngine etc. +#include "ProfileEngineSDKCRKeys.h" // KCRUidProfileEngine etc. // ============================ MEMBER FUNCTIONS =============================== diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/WrapperSrc/CProEngProfileImpl.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileImpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileImpl.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -26,7 +26,6 @@ #include #include #include -#include // ============================ MEMBER FUNCTIONS =============================== diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandler.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandler.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandler.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,11 +19,12 @@ // INCLUDE FILES #include "CProEngToneHandler.h" -#include "CProEngMediaVariation.h" #include // BaflUtils +#include // CAknGlobalNote #include // TResourceReader #include // RResourceFile #include // KKilo +#include "CProEngMediaVariation.h" #include #include // KProEngRingingToneMaxSize #include @@ -209,8 +210,29 @@ // CProEngToneHandler::ShowErrorNoteL // ----------------------------------------------------------------------------- // -void CProEngToneHandler::ShowErrorNoteL( TInt /*aResourceId*/ ) +void CProEngToneHandler::ShowErrorNoteL( TInt aResourceId ) { + TParse* fp = new(ELeave) TParse(); + fp->Set(KProEngResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL); + TFileName localizedFileName( fp->FullName() ); + delete fp; + + BaflUtils::NearestLanguageFile( iFs, localizedFileName ); + + RResourceFile resourceFile; + resourceFile.OpenL( iFs, localizedFileName ); + CleanupClosePushL( resourceFile ); + resourceFile.ConfirmSignatureL(); + + HBufC8* resBuf = resourceFile.AllocReadLC( aResourceId ); + TResourceReader reader; + reader.SetBuffer( resBuf ); + TPtrC errorText( reader.ReadTPtrC() ); + + CAknGlobalNote* note = CAknGlobalNote::NewLC(); + note->ShowNoteL( EAknGlobalInformationNote, errorText ); + + CleanupStack::PopAndDestroy( 3, &resourceFile ); } diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandlerDrmFull.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandlerDrmFull.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandlerDrmFull.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -22,7 +22,9 @@ #include #include -#include +#include + +#include // ============================ LOCAL FUNCTIONS ================================ diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/WrapperSrc/CProEngTonesImpl.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngTonesImpl.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngTonesImpl.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -19,12 +19,12 @@ // INCLUDE FILES #include "CProEngTonesImpl.h" -#include "CProEngToneHandler.h" #include #include #include #include #include +#include "CProEngToneHandler.h" #include // TProfileSettingId #include #include diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/WrapperSrc/ProEngWrapper.rss --- a/profilesservices/ProfileEngine/WrapperSrc/ProEngWrapper.rss Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/WrapperSrc/ProEngWrapper.rss Wed Sep 01 12:20:44 2010 +0100 @@ -24,6 +24,9 @@ // INCLUDES #include #include +#include +#include +#include // CONSTANTS // MACROS @@ -47,4 +50,11 @@ // RESOURCE LBUF r_proeng_text_drm_prev_rights_set { txt = qtn_drm_prev_rights_set; } +// ----------------------------------------------------------------------------- +// +// r_profile_text_insert_sim +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_profile_text_insert_sim { buf = qtn_su_note_insert_sim; } // End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/conf/profilesengine.confml Binary file profilesservices/ProfileEngine/conf/profilesengine.confml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/conf/profilesengine_101F8798.crml Binary file profilesservices/ProfileEngine/conf/profilesengine_101F8798.crml has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/group/ProfileEng.mmp --- a/profilesservices/ProfileEngine/group/ProfileEng.mmp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/group/ProfileEng.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -55,8 +55,7 @@ #else SOURCE CProfileEngineImplStaticProfiles.cpp #endif // __DYNAMIC_PROFILES -SOURCE CProfileUtilitySingletonImpl.cpp -SOURCE CProfileVibraSettingsImpl.cpp +SOURCE CProfileUtilitySingletonImpl.cpp USERINCLUDE . ../EngInc ../../group @@ -67,6 +66,7 @@ LIBRARY efsrv.lib LIBRARY bafl.lib LIBRARY FeatMgr.lib +LIBRARY PbkEng.lib LIBRARY cntmodel.lib LIBRARY sssettings.lib // for als check-up LIBRARY centralrepository.lib diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/group/ProfileEng.rss --- a/profilesservices/ProfileEngine/group/ProfileEng.rss Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/group/ProfileEng.rss Wed Sep 01 12:20:44 2010 +0100 @@ -25,8 +25,8 @@ #include #include #include "Profile.hrh" -#include "ProfileEng.rh" -#include "ProfileEng.hrh" +#include +#include #include // CONSTANTS @@ -187,6 +187,11 @@ }, PROFILE_SETTING { + id = EProfileSettingIdEmailVibra; + key_type = EProfileSettingKeyTypeInt; + }, + PROFILE_SETTING + { id = EProfileSettingIdTactileFeedback; key_type = EProfileSettingKeyTypeInt; }, diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/group/ProfileEngine.mmp --- a/profilesservices/ProfileEngine/group/ProfileEngine.mmp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/group/ProfileEngine.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -50,7 +50,7 @@ SOURCE CProEngMediaVariation.cpp SOURCE CProEngPostFilter.cpp SOURCE ProEngFactory.cpp -SOURCE ProEngMmfInfoUtility.cpp +SOURCE ProEngMmfInfoUtility.cpp START RESOURCE ProEngWrapper.rss HEADER @@ -62,7 +62,6 @@ USERINCLUDE ../WrapperInc USERINCLUDE ../EngInc -MW_LAYER_SYSTEMINCLUDE APP_LAYER_SYSTEMINCLUDE LIBRARY bafl.lib @@ -72,10 +71,15 @@ LIBRARY apgrfx.lib // RApaLSSession LIBRARY apmime.lib // TDataType LIBRARY efsrv.lib // RFs, TParse +LIBRARY aknnotify.lib // CAknGlobalNote LIBRARY PlatformEnv.lib // PathInfo LIBRARY ContentListingFramework.lib LIBRARY mmfcontrollerframework.lib - +LIBRARY avkon.lib +LIBRARY eikcdlg.lib +LIBRARY eikctl.lib +LIBRARY CommonEngine.lib +LIBRARY cone.lib LIBRARY DRMCommon.lib LIBRARY DrmRights.lib LIBRARY caf.lib cafutils.lib // Content access framework diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/group/ProfileScheduleEvent.mmp --- a/profilesservices/ProfileEngine/group/ProfileScheduleEvent.mmp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/group/ProfileScheduleEvent.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -41,14 +41,15 @@ USERINCLUDE . ../EngInc ../../group -MW_LAYER_SYSTEMINCLUDE +APP_LAYER_SYSTEMINCLUDE LIBRARY euser.lib LIBRARY commonengine.lib LIBRARY profileeng.lib LIBRARY bafl.lib LIBRARY efsrv.lib +LIBRARY aknnotify.lib // CAknGlobalNote LIBRARY centralrepository.lib -LIBRARY featmgr.lib +LIBRARY featmgr.lib diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_CProfileChangeNotifyHandler.cpp --- a/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_CProfileChangeNotifyHandler.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_CProfileChangeNotifyHandler.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -36,8 +36,8 @@ #include #include #include -#include "MProfileSetTones.h" -#include "ProfileEnginePrivatePSKeys.h" +#include +#include // the header for the tested class #include "T_CProfileChangeNotifyHandler.h" diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfile.cpp --- a/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfile.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfile.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -29,17 +29,17 @@ #include #include #include "MProfileEngine.h" -#include "MProfileEngineExtended.h" +#include #include "MProfile.h" #include "MProfileName.h" #include "MProfileExtraTones.h" -#include "MProfileSetExtraTones.h" +#include #include "MProfileExtraSettings.h" -#include "MProfilesLocalFeatures.h" +#include #include "MProfileTones.h" #include -#include "MProfileExtended.h" -#include "MProfileSetTones.h" +#include +#include //#include "T_ProfileTestTools.h" #include "ProfilesVariant.hrh" diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfileEngine.cpp --- a/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfileEngine.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_MProfileEngine.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -35,11 +35,11 @@ #include #include #include -#include "MProfilesLocalFeatures.h" +#include #include "ProfilesVariant.hrh" -#include "MProfileExtended.h" -#include "MProfileSetName.h" -#include "MProfileEngineExtended.h" +#include +#include +#include #include //#include "T_ProfileTestTools.h" //#include "T_ProfileTestHelper.h" diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngEngine.cpp --- a/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngEngine.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngEngine.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -26,12 +26,12 @@ #include #include #include -#include "MProfileEngineExtended.h" +#include #include "MProfile.h" -#include "MProfileExtended.h" +#include #include #include -#include "ProfileEngineConstants.h" +#include // INTERNAL INCLUDES #include "T_ProfileTestTools.h" diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngProfileName.cpp --- a/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngProfileName.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngProfileName.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -27,10 +27,10 @@ #include #include #include -#include "MProfileEngineExtended.h" +#include #include "MProfile.h" #include "MProfileName.h" -#include "MProfileExtended.h" +#include #include #include diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngProfileNameArray.cpp --- a/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngProfileNameArray.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngProfileNameArray.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -27,11 +27,11 @@ #include #include #include -#include "MProfileEngineExtended.h" +#include #include "MProfile.h" #include "MProfileName.h" #include "MProfilesNamesArray.h" -#include "MProfileExtended.h" +#include #include #include diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngToneSettings.cpp --- a/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngToneSettings.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngToneSettings.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -27,12 +27,12 @@ #include #include #include -#include "MProfileEngineExtended.h" +#include #include "MProfile.h" #include "MProfileTones.h" #include "TProfileToneSettings.h" #include "MProfileExtraTones.h" -#include "MProfileExtended.h" +#include #include #include diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngTones.cpp --- a/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngTones.cpp Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/src/MT_MProEngTones.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -27,11 +27,11 @@ #include #include #include -#include "MProfileEngineExtended.h" +#include #include "MProfile.h" #include "MProfileTones.h" #include "MProfileExtraTones.h" -#include "MProfileExtended.h" +#include #include #include #include diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/data/cenrep/10208ADF.txt Binary file profilesservices/RingingTone3DPlugin/data/cenrep/10208ADF.txt has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/data/patterns/1circular.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/data/patterns/1circular.xml Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,386 @@ + + + + + + + + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/data/patterns/2flyby.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/data/patterns/2flyby.xml Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,1012 @@ + + + + + + + + + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/data/patterns/3zigzag.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/data/patterns/3zigzag.xml Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,479 @@ + + + + + + + + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/data/patterns/4meander.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/data/patterns/4meander.xml Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,731 @@ + + + + + + + + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/data/patterns/5random.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/data/patterns/5random.xml Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,191 @@ + + + + + + + + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/data/tone/3d_effect_01.aac Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_effect_01.aac has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/data/tone/3d_effect_02.aac Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_effect_02.aac has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/data/tone/3d_effect_03.aac Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_effect_03.aac has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/data/tone/3d_effect_04.aac Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_effect_04.aac has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/data/tone/3d_effect_05.aac Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_effect_05.aac has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/data/tone/3d_motorway.aac Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_motorway.aac has changed diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/group/RingingTone3DPluginExports.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/group/RingingTone3DPluginExports.inc Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,35 @@ +/* +* ============================================================================== +* Name : RingingTone3DPluginExports.inc +* Part of : RingingTone3DPlugin +* Interface : ?Interface_category, ?Interface_name +* Description : ?Description +* Version : ?Version +* +* Copyright (c) 2007 Nokia Corporation. +* This material, including documentation and any related +* computer programs, is protected by copyright controlled by +* Nokia Corporation. All rights are reserved. Copying, +* including reproducing, storing, adapting or translating, any +* or all of this material requires the prior written consent of +* Nokia Corporation. This material also contains confidential +* information which may not be disclosed to others without the +* prior written consent of Nokia Corporation. +* ============================================================================== +*/ +// To get the APP_LAYER_SYSTEMINCLUDE-definition +#include + +#ifndef RINGINGTONE3DPLUGINEXPORTS_INC +#define RINGINGTONE3DPLUGINEXPORTS_INC + +// 3D patterns for target device +../data/patterns/1circular.xml Z:/resource/3DTones/1circular.xml +../data/patterns/2flyby.xml Z:/resource/3DTones/2flyby.xml +../data/patterns/3zigzag.xml Z:/resource/3DTones/3zigzag.xml +../data/patterns/4meander.xml Z:/resource/3DTones/4meander.xml +../data/patterns/5random.xml Z:/resource/3DTones/5random.xml + +#endif // RINGINGTONE3DPLUGINEXPORTS_INC + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build info file for Ringing Tone plugin for 3D Audio application. +* +*/ + + +PRJ_PLATFORMS +// Defaults + +PRJ_EXPORTS +#include "RingingTone3DPluginExports.inc" + +PRJ_MMPFILES +../group/ringingtone3dplugin.mmp + +PRJ_TESTMMPFILES +// No test programs. + +PRJ_TESTEXPORTS +// No test programs. + +// End of File + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/group/ringingtone3dplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/group/ringingtone3dplugin.mmp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Ringing Tone plug-in for playing 3D ringing tones. +* +*/ + + +#include +#include + +//OPTION ARMCC --interleave + + +TARGET RingingTone3DPlugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10208ADF // last uid is dll uid + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE C3DAudioPattern.cpp +SOURCE C3DAudioTimeOutTimer.cpp +SOURCE CRingingTone3DPlugin.cpp +SOURCE CRingingTone3DPluginImplementationTable.cpp +SOURCE C3DAudioXMLParser.cpp + + +//ECOM resource definition +START RESOURCE 10208adf.rss +TARGET RingingTone3DPlugin.rsc +TARGETPATH ECOM_RESOURCE_DIR +END // ECOM resource definition + +//START RESOURCE RingingTone3DPlugin.rss +//HEADER +//TARGETPATH RESOURCE_FILES_DIR +//LANG SC +//END + +USERINCLUDE ../inc + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY DopplerBase.lib +LIBRARY SourceDopplerEffect.lib +LIBRARY EnvironmentalReverbUtility.lib +LIBRARY LocationBase.lib +LIBRARY SourceLocationEffect.lib +LIBRARY ListenerLocationEffect.lib +LIBRARY StereoWideningEffect.lib +LIBRARY centralrepository.lib +LIBRARY estor.lib +LIBRARY efsrv.lib +LIBRARY xmlframework.lib // Xml::CParser +LIBRARY bafl.lib // RString +LIBRARY profileeng.lib // Profile Engine +LIBRARY ProfileEngine.lib // Profile engine wrapper api + +LIBRARY DrmAudioPlayUtility.lib + +#ifdef RD_VIDEO_AS_RINGING_TONE +LIBRARY mediaclientvideo.lib +#endif + +LIBRARY PlatformEnv.lib // DriveInfo + +DEBUGLIBRARY flogger.lib + diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/inc/C3DAudioPattern.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/inc/C3DAudioPattern.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,222 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handles accessing 3D motion pattern data. +* +*/ + + +#ifndef C3DAUDIOPATTERN_H +#define C3DAUDIOPATTERN_H + +// INCLUDES +#include // CBase + +// FORWARD DECLARATIONS +class RReadStream; +class RWriteStream; + +// DATA TYPES + +// Struct representing position in three dimensional space. +struct T3DPosition + { + // X-coordinate + TInt iX; + // Y-coordinate + TInt iY; + // Z-coordinate + TInt iZ; + }; + +// Struct representing velocity. +struct T3DVelocity + { + // Boolean indicating is scalar velocity in use + TBool iScalar; + // Scalar velocity + TInt iScalarVelocity; + // Velocity along x-axis. + TInt iXVector; + // Velocity along y-axis. + TInt iYVector; + // Velocity along z-axis. + TInt iZVector; + }; + +// Struct representing update in motion pattern. +struct T3DScriptUpdate + { + // Position of the trajectory. + T3DPosition iPosition; + // Velocity + T3DVelocity iVelocity; + // Time the pattern stays in this position. + TInt iDTime; + }; + +// Struct representing loop in pattern. +struct T3DLoop + { + // Position where to start the loop. + TInt iLoopStart; + // Position where to end the loop. + TInt iLoopEnd; + // How many times the loop is to be gone through. + TInt iCount; + }; + + +// CLASS DECLARATION + +/** +* Handles accessing 3D motion pattern data. +* +* @lib RingingTone3DPlugin.dll +* @since 5.0 +*/ +NONSHARABLE_CLASS (C3DAudioPattern): public CBase + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static C3DAudioPattern* NewL(); + + /** + * Two-phased constructor. + */ + static C3DAudioPattern* NewLC(); + + /** + * Two-phased constructor. + * @param aStream Stream used to internalise the pattern. + */ + static C3DAudioPattern* NewL( RReadStream& aStream ); + + /** + * Two-phased constructor. + * @param aStream Stream used to internalise the pattern. + */ + static C3DAudioPattern* NewLC( RReadStream& aStream ); + + /** + * Destructor + */ + virtual ~C3DAudioPattern(); + + private: + + /** + * C++ default constructor. + */ + C3DAudioPattern(); + + private: + + /** + * Internalizes the pattern from readstream. + * @param aStream Readstream from which to internalize the pattern. + */ + void InternalizeL( RReadStream& aStream ); + + public: + + /** + * Externalizes the pattern. + * @param aStream Writestream to externalize the pattern to. + */ + void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Sets the name of the pattern. + * @param aName Descriptor containing the name of the pattern. + */ + void SetNameL( const TDesC8& aName ); + + /** + * Getter for name of the pattern. + * @return Descriptor containing name of the pattern. + */ + const TDesC8& Name(); + + /** + * Sets the doppler of the pattern. + * @param aDoppler Boolean whether doppler is available or not. + */ + void SetDoppler( const TBool aDoppler ); + + /** + * Queries if doppler-effect is available in the pattern. + * @return Boolean indicating whether doppler is available. + */ + TBool DopplerAvailable() const; + + /** + * Sets the reververation of pattern. + * @param aReverb Index of reverberation used with CEnvironmentalReverbUtility. + */ + void SetReverb( const TUint aReverb ); + + /** + * Queries reverberation preset of the pattern. + * @return Reverberation preset used in pattern. + */ + TInt Reverb() const; + + /** + * Adds a new update to script. + * @param aUpdate Update to add to the script. + */ + void AddUpdateL( T3DScriptUpdate& aUpdate ); + + /** + * Used to indicate a start of a loop in pattern. + * @param aCount Amount of times the loop takes place. + */ + void StartLoopL( TUint& aCount ); + + /** + * Used to indicate end of a loop in pattern. + */ + void EndLoop(); + + /** + * Getter for script containg motion pattern. + * @return Array containing timeframes of pattern. + */ + RArray< T3DScriptUpdate > Script(); + + + private: // Data + + // Name of the pattern. + HBufC8* iName; + // Initial status of doppler-effect. + TBool iInitialDoppler; + // Initial reverb preset. + TUint iInitialReverb; + // Array containing indexes of open loops. + RArray< TInt > iOpenLoops; + // Array containing loops in the pattern. + RArray< T3DLoop > iLoops; + // Array containing the whole pattern as timeframes. + RArray< T3DScriptUpdate > iScript; + + }; + +#endif // C3DAUDIOPATTERN_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/inc/C3DAudioTimeOutTimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/inc/C3DAudioTimeOutTimer.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Timer for reading 3D pattern data. +* +*/ + + +#ifndef C3DAUDIOTIMEOUTTIMER_H +#define C3DAUDIOTIMEOUTTIMER_H + +// INCLUDES +#include // CTimer + + +// CLASS DECLARATIONS + + +/** +* This class specifies the function to be called when a timeout occurs. +* Used in conjunction with C3DAudioTimeOutTimer class. +* +* @lib RingingTone3DPlugin.dll +* @since 5.0 +*/ +NONSHARABLE_CLASS (M3DAudioTimeOutNotifier) + { + public: + + /** + * The function to be called when a timeout occurs. + */ + virtual void TimerExpiredL() = 0; + }; + + + + +/** +* This class will notify an object after a specified timeout. +* +* @lib RingingTone3DPlugin.dll +* @since 5.0 +*/ +NONSHARABLE_CLASS (C3DAudioTimeOutTimer) : public CTimer + { + public: + + /** + * Two-phased constructor. + * @param aPriority Priority to use for this timer. + * @param aTimeOutNotify Object to notify of timeout event. + * @return A pointer to the created instance of C3DAudioTimeOutTimer. + */ + static C3DAudioTimeOutTimer* NewL( const TInt aPriority, + M3DAudioTimeOutNotifier* aTimeOutNotify ); + + /** + * Two-phased constructor. Leaves pointer to object to cleanup stack. + * @param aPriority Priority to use for this timer. + * @param aTimeOutNotify Object to notify of timeout event. + * @return A pointer to the created instance of C3DAudioTimeOutTimer. + */ + static C3DAudioTimeOutTimer* NewLC( const TInt aPriority, + M3DAudioTimeOutNotifier* aTimeOutNotify ); + + /** + * Destructor. + */ + virtual ~C3DAudioTimeOutTimer(); + + private: + + /** + * C++ default constructor. + */ + C3DAudioTimeOutTimer( const TInt aPriority, + M3DAudioTimeOutNotifier* aTimeOutNotify ); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + protected: // from CActive + + /** + * From CActive Called when RunL() leaves. + */ + TInt RunError( TInt aError ); + + /** + * From CActive Called when operation completes. + */ + void RunL(); + + + private: // Data + + // The observer for this objects events. + M3DAudioTimeOutNotifier* iNotify; + }; + +#endif // C3DAUDIOTIMEOUTTIMER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/inc/C3DAudioXMLParser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/inc/C3DAudioXMLParser.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,512 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: XML-Parser used to parse motion patterns. +* +*/ + + +#ifndef C3DAUDIOXMLPARSER_H +#define C3DAUDIOXMLPARSER_H + +// INCLUDES +#include +#include "C3DAudioPattern.h" // C3DAudioPatter, T3DScriptPosition +#include // Xml::MContentHandler +#include // Xml::CParser + +#include // RProperty + + +//CONSTANTS + +// Maximum length for names of element and attribute and for value of attribute. +const TUint KMaxDataLength = 20; +const TUint KBufSize32 = 32; + + +// DATA TYPES + +// Enumeration to use in determining the last tag. +enum TLastTag + { + EInitialization = 0, + EUpdate + }; + + +// Identifiers for reverberation presets. Used in mapping. +enum TReverbPresets + { + EReverbNotEnabled = 0, + EReverbPresetOne = 14, // Livingroom + EReverbPresetTwo = 5, // Cave + EReverbPresetThree = 26, // Stone Corridor + EReverbPresetFour = 8, // Forest + EReverbPresetFive = 24, // Sewerpipe + EReverbPresetSix = 28 // Underwater + }; + + +// FORWARD DECLARATIONS + +class C3DPatternPS; + + +// CLASS DECLARATION + +/** +* XML-parser used to parse motion patterns. +* +* @lib RingingTone3DPlugin.dll +* @since 5.0 +*/ +NONSHARABLE_CLASS (C3DAudioXMLParser) : public CBase, public Xml::MContentHandler + { + public: + + enum TPatternAttributeKeys + { + EKeyPatternId = 1, + EKeyDopplerUsed = 2, + EKeyVelocity = 3 + }; + + public: + + /** + * Two-phased constructor. + */ + static C3DAudioXMLParser* NewL(); + + /** + * Two-phased constructor. + */ + static C3DAudioXMLParser* NewLC(); + + /** + * Destructor. + */ + virtual ~C3DAudioXMLParser(); + + private: + + /** + * C++ default constructor. + */ + C3DAudioXMLParser(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + + public: + + /** + * Parses the motion pattern from XML-file. + * @param aPatternNum Motion pattern to be parsed. + */ + void ParseL( TInt aPatternId ); + + /** + * Parses the motion pattern from XML-file. + * @param aPatternNum Motion pattern to be parsed. + */ + void ParseL( const TDesC& aFileName ); + + /** + * Returns single pattern attribute. + * @param Pattern attribute key. + * @return Pattern attribute value. + */ + TInt Attribute( TInt aKey ); + + const T3DPosition& PositionL( TInt aIndex ); + const T3DVelocity& VelocityL( TInt aIndex ); + const TInt& TimeL( TInt aIndex ); + TInt CountL(); + + private: + /** + * Reads 3D ringing tone pattern data from cache (PubSub) + * @param aPatternId Pattern id. + */ + TBool ReadFromPatternCacheL( TInt aPatternId ); + + /** + * Writes 3D ringing tone pattern data into cache (PubSub) + * @param aPatternId Pattern id. + */ + void WriteToPatternCacheL( TInt aPatternId ); + +#ifdef _DEBUG + public: + void AssertParseDataL( TInt aPatternId ); + static void GetPatternString(TDes& aText, TInt aPattern); + static void FlogPatternsL(TInt aOldPattern, TInt aNewPattern); + static void FlogPatternL(TInt aPattern); + static void FlogPubSubL(TInt aEcho); + static void GetEchoString(TDes& aText, TInt aEcho); +#endif + + + public: // from MContentHandler + + /** + * From MContentHandler This method is a callback to indicate the start of the document. + * @param aDocParam Specifies the various parameters of the document. + * @param aErrorCode The error code. + */ + void OnStartDocumentL( const Xml::RDocumentParameters& aDocParam, TInt aErrorCode ); + + /** + * This method is a callback to indicate the end of the document. + * @param aErrorCode The error code. + */ + void OnEndDocumentL( TInt aErrorCode ); + + /** + * This method is a callback to indicate an element has been parsed. + * @param aElement Handle to the element's details. + * @param aAttributes Attributes for the element. + * @param aErrorCode The error code. + */ + void OnStartElementL( const Xml::RTagInfo& aElement, const Xml::RAttributeArray& aAttributes, TInt aErrorCode ); + + /** + * This method is a callback to indicate the end of the element has been reached. + * @param aElement Handle to the element's details. + * @param aErrorCode The error code. + */ + void OnEndElementL( const Xml::RTagInfo& aElement, TInt aErrorCode ); + + /** + * This method is a callback that sends the content of the element. + * @param aBytes Raw content data for the element + * @param aErrorCode The error code. + */ + void OnContentL( const TDesC8& aBytes, TInt aErrorCode ); + + /** + * This method is a notification of the beginning of the scope of a prefix-URI Namespace mapping. + * @param aPrefix Namespace prefix being declared. + * @param aUri Namespace URI the prefix is mapped to. + * @param aErrorCode The error code. + */ + void OnStartPrefixMappingL( const RString& aPrefix, const RString& aUri, TInt aErrorCode ); + + /** + * This method is a notification of the end of the scope of a prefix-URI mapping. + * @param aPrefix Namespace prefix that was mapped. + * @param aErrorCode The error code. + */ + void OnEndPrefixMappingL( const RString& aPrefix, TInt aErrorCode ); + + /** + * This method is a notification of ignorable whitespace in element content. + * @since Series ?XX ?SeriesXX_version + * @param aBytes Ignored bytes from the document being parsed. + * @param aErrorCode The error code. + */ + void OnIgnorableWhiteSpaceL( const TDesC8& aBytes, TInt aErrorCode ); + + /** + * This method is a notification of a skipped entity. + * @param aName Name of the skipped entity. + * @param aErrorCode The error code. + */ + void OnSkippedEntityL( const RString& aName, TInt aErrorCode ); + + /** + * This method is a receive notification of a processing instruction. + * @param aTarget Processing instruction target. + * @param aData Processing instruction data. If empty none was supplied. + * @param aErrorCode The error code. + */ + void OnProcessingInstructionL( const TDesC8& aTarget, const TDesC8& aData, TInt aErrorCode ); + + /** + * This method indicates an error has occurred. + * @param aErrorCode The error code. + */ + void OnError( TInt aErrorCode ); + + /** + * This method obtains the interface matching the specified uid. + * @param aUid UID identifying the required interface. + */ + TAny* GetExtendedInterface( const TInt32 aUid ); + + + private: + + /** + * Processes the attributes of initialization-element. + * @param aAttributes Array of attributes. + */ + void ProcessInitAttributesL( const Xml::RAttributeArray& aAttributes ); + + /** + * Processes the attributes of loop-element. + * @param aAttributes Array of attributes. + */ + void ProcessLoopAttributesL( const Xml::RAttributeArray& aAttributes ); + + /** + * Processes the attributes of position-element. + * @param aAttributes Array of attributes. + */ + void ProcessPositionAttributesL( const Xml::RAttributeArray& aAttributes ); + + /** + * Processes the attributes of update-element. + * @param aAttributes Array of attributes. + */ + void ProcessUpdateAttributesL( const Xml::RAttributeArray& aAttributes ); + + /** + * Processes the attributes of velocity-element. + * @param aAttributes Array of attributes. + */ + void ProcessVelocityAttributesL( const Xml::RAttributeArray& aAttributes ); + + private: + + /** + * String copy with length check. + * @param aTarget. + * @param aSource. + */ + void CopyL( TDes8& aTarget, const TDesC8& aSource ); + + /** + * Panics plugin dll. + * @param aReason Panic code. + */ + void Panic(TInt aReason); + + void GetPatternFullPathL(TDes& aText, TInt aPatternId); + CBufFlat* ReadPatternFileL( const TDesC& aFullName ); + CBufFlat* ReadPatternFileL( TInt aPatternId ); + + + private: // Data + + // Xml::CParser + Xml::CParser* iParser; + + // file server session + RFs iFsSession; + + // Parsed pattern + C3DAudioPattern* iParsedPattern; + + // element name + TBuf8 iElementName; + + // attribute name + TBuf8 iAttributeName; + + // attribute value + TBuf8 iAttributeValue; + + // Currently parsed pattern update. + T3DScriptUpdate iCurrentUpdate; + + // Last tag occurred. + TLastTag iLastTag; + + // 3DTone file name and path + TFileName iFullPath; + + // Pattern id + TInt iPatternId; + }; + + + +/** +* C3DPatternPS is used for storing 3D pattern data in +* Public and Subcribe. Max pattern size is 65536 bytes. +* +* @lib RingingTone3DPlugin.dll +* @since 5.0 +*/ +NONSHARABLE_CLASS (C3DPatternPS) : public CBase + { + public: + + enum TPatternStoreKeys + { + EKeyPatternId = 1, + EKeyDopplerUsed = 2, + EKeyVelocity = 3, + EKeyDataSize = 4, + EKeyPatternData = 5 + }; + + public: + static C3DPatternPS* NewLC( TInt aStoreId ); + virtual ~C3DPatternPS(); + + private: + C3DPatternPS( TInt aStoreId ); + void ConstructL(); + + public: + void SetIntL( TInt aKey, TInt aValue ); + TInt IntL( TInt aKey ); + + CBufFlat* DataLC(); + void GetDataL( TDes8& aData ); + void SetDataL( const TDesC8& aData ); + + void TestL(); + + private: + TBool DefineKeyL( TInt aKeyId, TInt aKeyType ); + + private: + RProperty iProperty; + TUid iStoreUid; + }; + + + +////////////////////////////////////// START TEST CODE ////////////////////////// + +#include + +const TInt KBufSize128 = 128; +const TInt KBufSize64 = 64; + + +class T3DPatternData + { + public: + TInt iTime; + TInt iX; + TInt iY; + TInt iZ; + }; + + +/** +* C3DPatternParser +* +* Used to parse xml files. +*/ +NONSHARABLE_CLASS (C3DPatternParser) : public CBase, public Xml::MContentHandler + { + public: + static C3DPatternParser* NewL(); + virtual ~C3DPatternParser(); + + private: + C3DPatternParser(); + void ConstructL(); + + public: + void ParseDocumentL(const TDesC& aFullName); + void ParseDocumentL(TInt aPatternId); + TInt PositionCount(); + T3DPatternData& Position(TInt aIndex); + T3DPatternData& Velocity(TInt aIndex); + void GetPatternName(TDes& aText); + void GetEchoName(TDes& aText); + TBool DopplerEnabled(); + + void AssertPosition(TInt aIndex, TInt aX, TInt aY, TInt aZ); + void AssertVelocity(TInt aIndex, TInt aX, TInt aY, TInt aZ); + void AssertTime(TInt aIndex, TInt aTime); + + + + private: + void Print(); + void PrintCoordinates(T3DPatternData& aData, TBool aVelocity); + + + private: // from MContentHandler + + void OnStartDocumentL(const Xml::RDocumentParameters& aDocParam, TInt aErrorCode); + void OnEndDocumentL(TInt aErrorCode); + void OnStartElementL(const Xml::RTagInfo& aElement, + const Xml::RAttributeArray& aAttributes, + TInt aErrorCode); + void OnEndElementL(const Xml::RTagInfo& aElement, TInt aErrorCode); + void OnContentL(const TDesC8& aBytes, TInt aErrorCode); + void OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri, + TInt aErrorCode); + void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode); + void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode); + void OnSkippedEntityL(const RString& aName, TInt aErrorCode); + void OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData, + TInt aErrorCode); + void OnError(TInt aErrorCode); + TAny* GetExtendedInterface(const TInt32 aUid); + + private: + CBufFlat* ReadDocumentL(const TDesC& aFullName); + void ReadPositionAttributesL(const Xml::RAttributeArray& aAttributes); + void ReadVelocityAttributesL(const Xml::RAttributeArray& aAttributes); + void ReadInitAttributesL(const Xml::RAttributeArray& aAttributes); + void ReadUpdateAttributesL(const Xml::RAttributeArray& aAttributes); + + private: + void StrCopy(TDes& aTarget, const TDesC8& aSource); + void StrCopy(TDes& aTarget, const TDesC& aSource); + TInt StrToIntL(const TDesC& aText); + void Panic(TInt aReason); + void GetPatternFileNameL(TDes& aText, TInt aPatternId); + + private: + + // Xml parser + Xml::CParser* iParser; + + // file server session + RFs iFsSession; + + TBuf iElementName; + TBuf iAttributeName; + TBuf iAttributeValue; + TBuf iEchoName; + TBuf iPatternName; + + TBool iDopplerUsed; + TBool iVelocityUsed; + + T3DPatternData iCurrentPosition; + T3DPatternData iCurrentVelocity; + + T3DPatternData iInitPosition; + T3DPatternData iInitVelocity; + + + + // list for parsed 3d pattern position coordinates + RArray iPositionList; + + // list for parsed 3d pattern velocity coordinates + RArray iVelocityList; + }; + +////////////////////////////////////// END TEST CODE //////////////////////////// + + +#endif // C3DAUDIOXMLPARSER_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/inc/CRingingTone3DPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/inc/CRingingTone3DPlugin.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,360 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Plug-In that implements C3DRingingToneInterface. +* +*/ + + +#ifndef CRINGINGTONE3DPLUGIN_H +#define CRINGINGTONE3DPLUGIN_H + +// INCLUDES +#include +#include +#include + +#include +#include "C3DAudioTimeOutTimer.h" +#include "C3DAudioPattern.h" +#include "C3DAudioXMLParser.h" + +#include +#include + + +// FORWARD DECLARATIONS +class C3DAudioTimeOutTimer; +class CEnvironmentalReverbUtility; +class CSourceDoppler; +class CSourceLocation; +class CListenerLocation; + +class C3DPatternParser; + +#ifdef __STEREO_WIDENING_EFFECT_UI +class CStereoWidening; +#endif + + +// CONSTANTS +const TInt32 KRingingTone3DAudioEComPluginUID = 0x10208ADF; +const TInt KBufSize256 = 256; + + + +// CLASS DECLARATION + + +/** +* Plug-In implementing C3DRingingToneInterface. +* +* Used for playing 3D ringing tones. For playing, plugin uses player utility +* (eg CDrmPlayerUtility) from calling application. 3D effect is achieved by +* adding 3D data into normal ringing tone. C3DAudioXMLParser reads this +* data from .xml files (one file per 3D effect). +* +* @lib RingingTone3DPlugin.dll +* @since 5.0 +*/ +NONSHARABLE_CLASS (CRingingTone3DPlugin): public C3DRingingToneInterface, + public M3DAudioTimeOutNotifier + { + private: + + enum TRingingTonePlayerType + { + EMdaAudioPlayerUtility, + EMdaAudioToneUtility, + EDrmPlayerUtility, + EVideoPlayerUtility + }; + + + public: + + /** + * Two-phased constructor. + */ + static CRingingTone3DPlugin* NewL( TAny* aParameter ); + + /** + * Destructor. + */ + virtual ~CRingingTone3DPlugin(); + + private: + + /** + * C++ default constructor. + */ + CRingingTone3DPlugin(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( TAny* aParameter ); + + + public: // Functions from C3DRingingToneInterface + + /** + * Set 3D plugin attribute. + * @param aAttributeKey + * @param aValue + * @return System-wide error code. + */ + TInt SetAttr( T3DRingingToneInterfaceAttr aAttributeKey, TInt aValue ); + + /** + * Set 3D plugin attribute. + * @param aAttributeKey + * @param aValue + * @return System-wide error code. + */ + TInt SetAttr( T3DRingingToneInterfaceAttr aAttributeKey, const TDesC& aValue ); + + /** + * Set 3D plugin attribute. + * @param aAttributeKey + * @param aValue + * @return System-wide error code. + */ + TInt SetAttr( TInt aAttributeKey, TAny* aValue ); + + /** + * Plays 3D ringing tone. + */ + void PlayL(); + + /** + * Stops playing 3D ringing tone. + */ + void Stop(); + + + private: // from M3DAudioTimeOutNotifier + + /** + * Callback initiated from C3DAudioTimeOutTimer. + */ + void TimerExpiredL(); + + private: + + /** + * Initializes player utility. + * @param aSamplePlayer Player utility. + */ + void Init( CMdaAudioPlayerUtility* aSamplePlayer ); + + /** + * Initializes player utility. + * @param aSamplePlayer Player utility. + */ + void Init( CMdaAudioToneUtility* aSamplePlayer ); + + /** + * Initializes player utility. + * @param aSamplePlayer Player utility. + */ + void Init( CDrmPlayerUtility* aSamplePlayer ); + +#ifdef RD_VIDEO_AS_RINGING_TONE + /** + * Initializes player utility. + * @param aSamplePlayer Player utility. + */ + void Init( CVideoPlayerUtility* aSamplePlayer ); +#endif + + /** + * Plays 3D ringing tone. + */ + void DoPlayL(); + + /** + * Add 3D pattern (effect) data into normal ringing tone. + */ + void SetNext3DPatternPositionL(); + + /** + * Plays 3D ringing tone. + */ + void PlayRingingTone(); + + /** + * Stops playing 3D ringing tone. + */ + void StopRingingTone(); + + private: + + /** + * Calculates the correct dTime according to velocity-value in cenrep. + * @param aTime Time from the script to be calculated. + */ + void CalculateDTime( TInt& aTime ); + + /** + * Plugin initialization. + */ + void InitializeL(); + + /** + * Plugin uninitialization. Needed in error case when normal ringing + * tone is played. + */ + void UnInitialize(); + + + private: + + /** + * Gets CEnvironmentalReverbUtility object. + * @return CEnvironmentalReverbUtility. + */ + CEnvironmentalReverbUtility* EnvironmentalReverbUtilityL(); + + /** + * Gets CSourceLocation object. + * @return CSourceLocation. + */ + CSourceLocation* SourceLocationL(); + + /** + * Gets CListenerLocation object. + * @return CListenerLocation. + */ + CListenerLocation* ListenerLocationL(); + + /** + * Gets CSourceDoppler object. + * @return CSourceDoppler. + */ + CSourceDoppler* SourceDopplerL(); + +#ifdef __STEREO_WIDENING_EFFECT_UI + CStereoWidening* StereoWideningL(); +#endif + + + private: + + /** + * Read active profile setting from profile engine. Needed in case calling + * app does not set 3D effect and echo attributes. + */ + void ReadActiveProfileL(); + + /** + * Checks that tone can be used as 3D ringing tone. This check is only + * done if calling app explicitly sets ringing tone attribute. + */ + TBool CheckRingingTone(); + + /** + * Panics plugin dll. + * @param aReason Panic code. + */ + void Panic(TInt aReason); + + +#ifdef _DEBUG + public: + void FlogRepositoryL(CRepository* aRepository, TInt aEcho); + //void FlogPatternsL(TInt aOldPattern, TInt aNewPattern); + void FlogProfileL(MProfile* aProfile); + void FlogPlayer(TInt aPlayer); + void Check3DEchoL(TInt aEcho); + void Check3DPatternL(TInt aPattern); + void FlogPositionL(T3DPosition& aPosition, TInt aIndex); + void FlogVelocityL(T3DVelocity& aVelocity, TInt aIndex); + void FlogTimeL(TInt aTime, TInt aIndex); + void FlogPubSubL(TInt aEcho); +#endif + + + private: // Data + + // 3D Ringing tone velocity + TInt iVelocity; + + // Doppler status + TBool iDoppler; + + // 3D effect (pattern) + TInt iProfile3DToneEffect; + + // 3D echo + TInt iProfile3DToneEcho; + + // ringing tone, used only for validity check + TFileName iRingingTone; + + // profile id, currently not used + TInt iProfileId; + + // ringing tone player type + TInt iPlayerType; + + // is ringing tone playing + TInt iPlaying; + + // 3D pattern parser + C3DAudioXMLParser* iParser; + + // current position in pattern script + TInt iCurrentUpdate; + + // player utility used for playback + CMdaAudioPlayerUtility* iAudioPlayerUtility; + + // player utility + CMdaAudioToneUtility* iAudioToneUtility; + + // player utility + CDrmPlayerUtility* iDrmPlayerUtility; + +#ifdef RD_VIDEO_AS_RINGING_TONE + // player utility + CVideoPlayerUtility* iVideoPlayerUtility; +#endif + + // timer for updating 3D pattern position + C3DAudioTimeOutTimer* iTimer; + + // reverberation utility used to set reverb presets + CEnvironmentalReverbUtility* iReverbEffect; + + // doppler-effect + CSourceDoppler* iDopplerEffect; + + // source location-effect + CSourceLocation* iSource; + + // listener location-effect + CListenerLocation* iListener; + +#ifdef __STEREO_WIDENING_EFFECT_UI + // stereo widening-effect + CStereoWidening* iStereoWidening; +#endif + }; + + + + +#endif // CRINGINGTONE3DPLUGIN_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/inc/RingingTone3DPluginDebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/inc/RingingTone3DPluginDebug.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Plug-In that implements C3DRingingToneInterface. +* +*/ + + + +#ifndef RINGINGTONE_3D_PLUGIN_DEBUG_H +#define RINGINGTONE_3D_PLUGIN_DEBUG_H + + +#ifdef _DEBUG + +#include +#include + +_LIT(KLogFilename,"3d.txt"); +_LIT(KLogDir,"3d"); + +// Declare the FPrint function +inline void FPrint(const TRefByValue aFmt, ...) + { + VA_LIST list; + VA_START(list,aFmt); + RFileLogger::WriteFormat(KLogDir, KLogFilename, EFileLoggingModeAppend, aFmt, list); + } + + +#ifdef __WINS__ +#define FLOG(arg...) { FPrint(arg); } +//#define FLOG(a) { RDebug::Print(a); } +#else +//#define FLOG(arg...) { RDebug::Print(arg); } +#define FLOG(arg...) { FPrint(arg); } +#endif + +#else // _DEBUG + +#define FLOG(arg...) // No loggings + +#endif // _DEBUG + + + + +#endif // RINGINGTONE_3D_PLUGIN_DEBUG_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/inc/tdaudioconstants.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/inc/tdaudioconstants.h Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Common constants and enums used in all three implementations. +* +*/ + + +#ifndef TDAUDIOCONSTANTS_H +#define TDAUDIOCONSTANTS_H + +// CONSTANTS +// Application UID, same UID is used for Central Repository. +//const TUid KUid3DAudioRingingTone = { 0x10201AFD }; +//const TUid K3DAudioRepositoryUid = { 0x10201AFD }; + +const TUid KUid3DAudioRingingTone = { 0x10208ADF }; +const TUid K3DAudioRepositoryUid = { 0x10208ADF }; + +#ifdef __SERIES60_30__ +// Key to ringing tone in first profile (number 0) +const TInt KProEngRingingTone = 0x00000004; + +// Multiplier for each profile. +const TInt KProfileMultiplier = 0x01000000; + +#endif + +// Extension for not supported ringing tones. +_LIT( KRngType, ".rng" ); + +// Filename of "No-Sound" ringing tone. +_LIT( KNoToneFileName, "Z:\\resource\\No_Sound.wav" ); + +// Default velocity for all motion patterns. +const TInt KMotionPatternDefaultVelocity = 5; + +// DATA TYPES +// Keys to Central Repository. +enum T3DAudioRepositoryKeys + { + E3DAudioRepositoryStatus = 0x1, + E3DAudioRepositoryPattern, + E3DAudioRepositoryVelocity, + E3DAudioRepositoryReverb, + E3DAudioRepositoryDoppler, + E3DAudioRepositoryDopplerAvailable, + E3DAudioRepositoryRingingToneInUse, + E3DAudioRepositoryProfileId, + + E3DAudioRepositoryLoadedPattern = 0x10, + E3DAudioRepositoryBlockCount, + E3DAudioRepositoryBlockStart = 0x20 + }; + +#endif // TDAUDIOCONSTANTS_H + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/src/10208adf.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/src/10208adf.rss Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Ringing Tone plugin for playing 3D ringing tones. +* +*/ + + + +// INCLUDES +#include "registryinfo.rh" + +// RESOURCE DEFINITIONS +// ----------------------------------------------------------------------------- +// +// Registry information for Ringing Tone plugin for Profiles application. +// +// ----------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO theInfo + { + // UID for the DLL + dll_uid = 0x10208ADF; + // Declare array of interface info + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = 0x1020299A; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10208ADF; + version_no = 1; + display_name = "3D Ringing Tone Plugin"; + default_data = "default"; + opaque_data = ""; + } + }; + } + }; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/src/C3DAudioPattern.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/src/C3DAudioPattern.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,321 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handles accessing 3D motion pattern data. +* +*/ + + + +// INCLUDE FILES +#include "C3DAudioPattern.h" // C3DAudioPattern +#include // RReadStream, RWriteStream + +// CONSTANTS +// Granularity for array holding updates. +const TInt KPatternArrayGranularity = 84; + +// Maximum length for name of the pattern. +const TUint KMaxPatternNameLength = 100; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +C3DAudioPattern* C3DAudioPattern::NewL() + { + C3DAudioPattern * self = C3DAudioPattern::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::NewLC +// Two-phased constructor. Leaves pointer on cleanup stack. +// ----------------------------------------------------------------------------- +// +C3DAudioPattern* C3DAudioPattern::NewLC() + { + C3DAudioPattern * self = new ( ELeave ) C3DAudioPattern(); + CleanupStack::PushL( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// + +C3DAudioPattern* C3DAudioPattern::NewL( RReadStream& aStream ) + { + C3DAudioPattern* self = C3DAudioPattern::NewLC( aStream ); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::NewLC +// Two-phased constructor. Leaves pointer on cleanup stack. +// ----------------------------------------------------------------------------- +// +C3DAudioPattern* C3DAudioPattern::NewLC( RReadStream& aStream ) + { + C3DAudioPattern* self = new ( ELeave ) C3DAudioPattern(); + CleanupStack::PushL( self ); + self->InternalizeL( aStream ); + return self; + } + + +// Destructor +C3DAudioPattern::~C3DAudioPattern() + { + iScript.Close(); + iLoops.Close(); + iOpenLoops.Close(); + delete iName; + } + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::ExternalizeL +// Externalizes pattern to writestream. +// ----------------------------------------------------------------------------- +// +void C3DAudioPattern::ExternalizeL( RWriteStream& aStream ) const + { + // Name of the pattern + aStream << *iName; + + // Initial doppler and reverb. + aStream.WriteInt8L( iInitialDoppler ); + aStream.WriteUint8L( iInitialReverb ); + + // Number of loops + aStream.WriteUint8L( iLoops.Count() ); + // Each loop + for ( TInt i = 0; i < iLoops.Count(); ++i ) + { + aStream.WriteUint8L( iLoops[i].iLoopStart ); + aStream.WriteUint8L( iLoops[i].iLoopEnd ); + aStream.WriteUint8L( iLoops[i].iCount ); + } + + // Number of updates in the script + aStream.WriteUint8L( iScript.Count() ); + // Each update + for ( TInt i = 0; i < iScript.Count(); ++i ) + { + // Position of the update + aStream.WriteInt16L( iScript[i].iPosition.iX ); + aStream.WriteInt16L( iScript[i].iPosition.iY ); + aStream.WriteInt16L( iScript[i].iPosition.iZ ); + + // Velocity of the update + aStream.WriteInt8L( iScript[i].iVelocity.iScalar ); + aStream.WriteUint16L( iScript[i].iVelocity.iScalarVelocity ); + aStream.WriteInt16L( iScript[i].iVelocity.iXVector ); + aStream.WriteInt16L( iScript[i].iVelocity.iYVector ); + aStream.WriteInt16L( iScript[i].iVelocity.iZVector ); + + // Time reserved for the update. + aStream.WriteUint16L( iScript[i].iDTime ); + } + } + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::InternalizeL +// Internalizes pattern from readstream +// ----------------------------------------------------------------------------- +// +void C3DAudioPattern::InternalizeL( RReadStream& aStream ) + { + // Internalize the name from stream. + delete iName; + iName = NULL; + iName = HBufC8::NewL( aStream, KMaxPatternNameLength ); + + // Initial doppler and reverberation + iInitialDoppler = aStream.ReadInt8L(); + iInitialReverb = aStream.ReadUint8L(); + + // Reset the array of loops. + iLoops.Reset(); + TInt loopCount = aStream.ReadUint8L(); + // Read each loop. + for (TInt i = 0; i < loopCount; ++i) + { + T3DLoop tempLoop; + tempLoop.iLoopStart = aStream.ReadUint8L(); + tempLoop.iLoopEnd = aStream.ReadUint8L(); + tempLoop.iCount = aStream.ReadUint8L(); + iLoops.AppendL( tempLoop ); + } + + // Reset the array of loops. + iScript.Reset(); + TInt scriptCount = aStream.ReadUint8L(); + // Read each update. + for (TInt i = 0; i < scriptCount; ++i) + { + T3DPosition tempPosition; + tempPosition.iX = aStream.ReadInt16L(); + tempPosition.iY = aStream.ReadInt16L(); + tempPosition.iZ = aStream.ReadInt16L(); + + T3DVelocity tempVelocity; + tempVelocity.iScalar = aStream.ReadInt8L(); + tempVelocity.iScalarVelocity = aStream.ReadUint16L(); + tempVelocity.iXVector = aStream.ReadInt16L(); + tempVelocity.iYVector = aStream.ReadInt16L(); + tempVelocity.iZVector = aStream.ReadInt16L(); + + T3DScriptUpdate tempScript; + tempScript.iDTime = aStream.ReadUint16L(); + tempScript.iPosition = tempPosition; + tempScript.iVelocity = tempVelocity; + iScript.AppendL( tempScript ); + } + } + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::SetName +// Set the name of the pattern. Memory will be allocated. +// ----------------------------------------------------------------------------- +// +void C3DAudioPattern::SetNameL( const TDesC8& aName ) + { + delete iName; + iName = NULL; + iName = aName.AllocL(); + } + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::SetReverb +// Set the value of reverberation. +// ----------------------------------------------------------------------------- +// +void C3DAudioPattern::SetReverb( const TUint aReverb ) + { + iInitialReverb = aReverb; + } + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::SetDoppler +// Set the status of doppler. +// ----------------------------------------------------------------------------- +// +void C3DAudioPattern::SetDoppler( const TBool aDoppler ) + { + iInitialDoppler = aDoppler; + } + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::AddUpdate +// Adds a update to script. +// ----------------------------------------------------------------------------- +// +void C3DAudioPattern::AddUpdateL( T3DScriptUpdate& aUpdate ) + { + User::LeaveIfError( iScript.Append( aUpdate ) ); + } + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::StartLoop +// Start loop at current place in the script. +// ----------------------------------------------------------------------------- +// +void C3DAudioPattern::StartLoopL( TUint& aCount ) + { + // Create T3DLoop and append it to array. + T3DLoop loop = { iScript.Count(), 0, aCount }; + User::LeaveIfError( iLoops.Append( loop ) ); + + // Update open loops array, to be able to determine which loop to end. + User::LeaveIfError( iOpenLoops.Append( iLoops.Count() - 1 ) ); + } + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::EndLoop +// End the lastly started loop. +// ----------------------------------------------------------------------------- +// +void C3DAudioPattern::EndLoop() + { + // There is at least one open loop. + if ( iOpenLoops.Count() != 0 ) + { + // Get the index of the loop. + TInt aIndex = iOpenLoops[ iOpenLoops.Count() - 1 ]; + // Set the index of loop end and remove loop from array of open loops. + iLoops[ aIndex ].iLoopEnd = iScript.Count() - 1; + iOpenLoops.Remove( iOpenLoops.Count() - 1 ); + } + } + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::Name +// Get the name of the pattern. +// ----------------------------------------------------------------------------- +// +const TDesC8& C3DAudioPattern::Name() + { + return *iName; + } + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::Script +// Get the script of pattern. +// ----------------------------------------------------------------------------- +// +RArray< T3DScriptUpdate > C3DAudioPattern::Script() + { + return iScript; + } + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::DopplerAvailable +// Is doppler available in the pattern. +// ----------------------------------------------------------------------------- +// +TBool C3DAudioPattern::DopplerAvailable() const + { + return iInitialDoppler; + } + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::Reverb +// Get initial reverb of pattern. +// ----------------------------------------------------------------------------- +// +TInt C3DAudioPattern::Reverb() const + { + return iInitialReverb; + } + +// ----------------------------------------------------------------------------- +// C3DAudioPattern::C3DAudioPattern +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +C3DAudioPattern::C3DAudioPattern(): + iScript( KPatternArrayGranularity ) + { + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/src/C3DAudioTimeOutTimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/src/C3DAudioTimeOutTimer.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Timer for reading 3D pattern data. +* +*/ + + +// INCLUDE FILES +#include "C3DAudioTimeOutTimer.h" + + + +// ========================= MEMBER FUNCTIONS ================================== + +// ----------------------------------------------------------------------------- +// C3DAudioTimeOutTimer::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +C3DAudioTimeOutTimer* C3DAudioTimeOutTimer::NewL( + const TInt aPriority, + M3DAudioTimeOutNotifier* aTimeOutNotify ) + { + C3DAudioTimeOutTimer* self = C3DAudioTimeOutTimer::NewLC( aPriority, + aTimeOutNotify ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// C3DAudioTimeOutTimer::NewLC +// Two-phased constructor. Leaves pointer on cleanup stack. +// ----------------------------------------------------------------------------- +// +C3DAudioTimeOutTimer* C3DAudioTimeOutTimer::NewLC( + const TInt aPriority, + M3DAudioTimeOutNotifier* aTimeOutNotify ) + { + C3DAudioTimeOutTimer* self = new ( ELeave ) C3DAudioTimeOutTimer( aPriority, + aTimeOutNotify ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// C3DAudioTimeOutTimer::C3DAudioTimeOutTimer +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +C3DAudioTimeOutTimer::C3DAudioTimeOutTimer( + const TInt aPriority, + M3DAudioTimeOutNotifier* aTimeOutNotify ): + CTimer( aPriority ), + iNotify( aTimeOutNotify ) + { + } + +// ----------------------------------------------------------------------------- +// C3DAudioTimeOutTimer::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void C3DAudioTimeOutTimer::ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + } + +// Destructor. +C3DAudioTimeOutTimer::~C3DAudioTimeOutTimer() + { + } + +// ----------------------------------------------------------------------------- +// C3DAudioTimeOutTimer::RunError +// Called when RunL() leaves. +// ----------------------------------------------------------------------------- +// +TInt C3DAudioTimeOutTimer::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// C3DAudioTimeOutTimer::RunL +// Called when operation completes. +// ----------------------------------------------------------------------------- +// +void C3DAudioTimeOutTimer::RunL() + { + // Timer request has completed, so notify the timer's owner + if ( iStatus == KErrNone ) + { + iNotify->TimerExpiredL(); + } + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/src/C3DAudioXMLParser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/src/C3DAudioXMLParser.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,2073 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: XML-Parser used to parse motion patterns. +* +*/ + + +// INCLUDE FILES +#include "C3DAudioXMLParser.h" +#include "tdaudioconstants.h" // K3DAudioRepositoryUid +#include // RFs +#include // RBufWriteStream +#include // CRepository + + +#include "RingingTone3DPluginDebug.h" +#include // for TProfile3DToneEffect and TProfile3DToneEcho + +#include +#include +#include + + +//CONSTANTS +const TInt32 KRingingTone3DAudioEComPluginUID = 0x10208ADF; + + +// 3DTone pattern dir +_LIT( K3DTonesDir, "3DTones" ); + +// 3DTone pattern files +_LIT( KPatternCircle, "1circular.xml" ); +_LIT( KPatternFlyBy, "2flyby.xml" ); +_LIT( KPatternZigZag, "3zigzag.xml" ); +_LIT( KPatternRandomWalk, "4meander.xml" ); +_LIT( KPatternChaos, "5random.xml" ); + + +// Elements +_LIT8( KInitElement, "initialization"); +_LIT8( KPositionElement, "position" ); +_LIT8( KUpdateElement, "update" ); +_LIT8( KVelocityElement, "velocity" ); +_LIT8( KLoopElement, "loop" ); + +// Attribute names. +_LIT8( KPatternName, "name" ); +_LIT8( KPatternReverb, "reverb" ); +_LIT8( KPatternDoppler, "doppler" ); +_LIT8( KXCoordinate, "x" ); +_LIT8( KYCoordinate, "y" ); +_LIT8( KZCoordinate, "z" ); +_LIT8( KDTime, "dTime" ); +_LIT8( KScalarVelocity, "scalar" ); +_LIT8( KLoopCount, "count" ); + +// Attribute values +_LIT8( KReverbPresetOne, "Livingroom" ); +_LIT8( KReverbPresetTwo, "Cave" ); +_LIT8( KReverbPresetThree, "Stone Corridor" ); +_LIT8( KReverbPresetFour, "Forest" ); +_LIT8( KReverbPresetFive, "Sewerpipe" ); +_LIT8( KReverbPresetSix, "Underwater" ); +_LIT8( KBooleanTrue, "true" ); + + + +/****************************************************************************** + * class C3DAudioXMLParser + ******************************************************************************/ + + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +C3DAudioXMLParser* C3DAudioXMLParser::NewL() + { + C3DAudioXMLParser* self = C3DAudioXMLParser::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::NewLC +// Two-phased constructor. Leaves pointer on cleanup stack. +// ----------------------------------------------------------------------------- +// +C3DAudioXMLParser* C3DAudioXMLParser::NewLC() + { + C3DAudioXMLParser * self = new ( ELeave ) C3DAudioXMLParser(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// Destructor +C3DAudioXMLParser::~C3DAudioXMLParser() + { + delete iParser; + delete iParsedPattern; + iFsSession.Close(); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::C3DAudioXMLParser +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +C3DAudioXMLParser::C3DAudioXMLParser(): + iParser( NULL ), + iParsedPattern( NULL ) + { + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::ConstructL() + { + _LIT8( KParserMimeType, "text/xml" ); + + iPatternId = KErrNotFound; + + iParser = Xml::CParser::NewL( KParserMimeType, *this ); + + User::LeaveIfError( iFsSession.Connect() ); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::Count +// +// ----------------------------------------------------------------------------- +// +TInt C3DAudioXMLParser::CountL() + { + User::LeaveIfNull( iParsedPattern ); + const RArray& script = iParsedPattern->Script(); + + return script.Count(); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::PositionL +// +// ----------------------------------------------------------------------------- +// +const T3DPosition& C3DAudioXMLParser::PositionL( TInt aIndex ) + { + User::LeaveIfNull( iParsedPattern ); + const RArray& script = iParsedPattern->Script(); + + if ( aIndex < 0 || aIndex >= script.Count() ) + { + User::Leave( KErrArgument ); + } + + return script[ aIndex ].iPosition; + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::VelocityL +// +// ----------------------------------------------------------------------------- +// +const T3DVelocity& C3DAudioXMLParser::VelocityL( TInt aIndex ) + { + User::LeaveIfNull( iParsedPattern ); + const RArray& script = iParsedPattern->Script(); + + if ( aIndex < 0 || aIndex >= script.Count() ) + { + User::Leave( KErrArgument ); + } + + return script[ aIndex ].iVelocity; + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::TimeL +// +// ----------------------------------------------------------------------------- +// +const TInt& C3DAudioXMLParser::TimeL( TInt aIndex ) + { + User::LeaveIfNull( iParsedPattern ); + const RArray& script = iParsedPattern->Script(); + + if ( aIndex < 0 || aIndex >= script.Count() ) + { + User::Leave( KErrArgument ); + } + + return script[ aIndex ].iDTime; + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::Attribute +// +// ----------------------------------------------------------------------------- +// +TInt C3DAudioXMLParser::Attribute( TInt aKey ) + { + TInt num = KErrNotFound; + + switch ( aKey ) + { + case EKeyPatternId: + { + num = iPatternId; + break; + } + case EKeyDopplerUsed: + { + num = iParsedPattern->DopplerAvailable(); + break; + } + case EKeyVelocity: + { + num = KMotionPatternDefaultVelocity; + break; + } + default: + { + break; + } + } + + return num; + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::ParseL +// +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::ParseL( TInt aPatternId ) + { + FLOG( _L("C3DAudioXMLParser::ParseL START") ); + + if ( ReadFromPatternCacheL( aPatternId ) ) + { + +#ifdef _DEBUG + // parsed pattern data found in cache (publish and subcribe) + FlogPatternL( aPatternId ); +#endif + + } + else + { + GetPatternFullPathL( iFullPath, aPatternId ); + ParseL( iFullPath ); + + WriteToPatternCacheL( aPatternId ); + + FLOG( _L("pattern '%S' parsed and written to cache"), &iFullPath ); + } + + iPatternId = aPatternId; + +#ifdef _DEBUG + AssertParseDataL( aPatternId ); +#endif + + + FLOG( _L("C3DAudioXMLParser::ParseL END") ); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::ParseL +// +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::ParseL( const TDesC& aFileName ) + { + delete iParsedPattern; + iParsedPattern = NULL; + iParsedPattern = C3DAudioPattern::NewL(); + + // + // read xml-format pattern file into descriptor + // + CBufFlat* buf = ReadPatternFileL( aFileName ); + CleanupStack::PushL( buf ); + + // + // parse xml-format pattern into C3DAudioPattern + // + TPtr8 ptr = buf->Ptr( 0 ); + iParser->ParseL( ptr ); + iParser->ParseEndL(); + + RArray script = iParsedPattern->Script(); + if ( script.Count() == 0 ) + { + User::Leave( KErrNotFound ); + } + + CleanupStack::PopAndDestroy( buf ); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::ReadFromPatternCacheL +// +// ----------------------------------------------------------------------------- +// +TBool C3DAudioXMLParser::ReadFromPatternCacheL( TInt aPatternId ) + { + C3DPatternPS* pubSub = C3DPatternPS::NewLC( KRingingTone3DAudioEComPluginUID ); + + TInt patternId = pubSub->IntL( C3DPatternPS::EKeyPatternId ); + if ( patternId == aPatternId ) + { + // buffer for 3D pattern data + CBufFlat* buf = pubSub->DataLC(); + + // readstream to construct the pattern. + RBufReadStream readstream( *buf ); + CleanupClosePushL( readstream ); + + // create C3DAudioPattern for accessing 3D ringing tone data + delete iParsedPattern; + iParsedPattern = NULL; + iParsedPattern = C3DAudioPattern::NewL( readstream ); + + CleanupStack::PopAndDestroy( &readstream ); + CleanupStack::PopAndDestroy( buf ); + } + + CleanupStack::PopAndDestroy( pubSub ); + + if ( patternId == aPatternId ) + { + return ETrue; + } + return EFalse; + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::WriteToPatternCacheL +// +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::WriteToPatternCacheL( TInt aPatternId ) + { + const TInt KGranularity = 1024; + + C3DPatternPS* pubSub = C3DPatternPS::NewLC( KRingingTone3DAudioEComPluginUID ); + + // + // write binary-format (parsed) pattern data into descriptor + // + CBufFlat* buf = CBufFlat::NewL( KGranularity ); + CleanupStack::PushL( buf ); + + RBufWriteStream writestream( *buf ); + CleanupClosePushL( writestream ); + iParsedPattern->ExternalizeL( writestream ); + writestream.CommitL(); + CleanupStack::PopAndDestroy( &writestream ); + +#ifdef _DEBUG + TInt oldPatternId = pubSub->IntL( C3DPatternPS::EKeyPatternId ); + FlogPatternsL( oldPatternId, aPatternId ); +#endif + + // + // write pattern data and attributes into public and subscribe + // + pubSub->SetIntL( C3DPatternPS::EKeyPatternId, KErrNotFound ); + pubSub->SetIntL( C3DPatternPS::EKeyDopplerUsed, iParsedPattern->DopplerAvailable() ); + pubSub->SetIntL( C3DPatternPS::EKeyVelocity, KMotionPatternDefaultVelocity ); + pubSub->SetDataL( buf->Ptr( 0 ) ); + pubSub->SetIntL( C3DPatternPS::EKeyPatternId, aPatternId ); + + CleanupStack::PopAndDestroy( buf ); + + CleanupStack::PopAndDestroy( pubSub ); + } + + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::OnStartDocumentL +// Leave if error, otherwise nothing to do. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::OnStartDocumentL( + const Xml::RDocumentParameters& /*aDocParam*/, + TInt aErrorCode ) + { + // Leave if error occurred. + User::LeaveIfError( aErrorCode ); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::OnEndDocumentL +// Leave if error, otherwise nothing to do. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::OnEndDocumentL( + TInt aErrorCode ) + { + // Leave if error occurred. + User::LeaveIfError( aErrorCode ); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::OnStartElementL +// Proceed depending on the element. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::OnStartElementL( + const Xml::RTagInfo& aElement, + const Xml::RAttributeArray& aAttributes, + TInt aErrorCode ) + { + // Leave if error occurred. + User::LeaveIfError( aErrorCode ); + + CopyL( iElementName, aElement.LocalName().DesC() ); + + // Proceed depending of the element. + if ( iElementName.CompareC( KUpdateElement ) == 0 ) + { + ProcessUpdateAttributesL( aAttributes ); + iLastTag = EUpdate; + } + else if ( iElementName.CompareC( KPositionElement ) == 0 ) + { + // Do not take position in initialization in account. + if ( iLastTag == EUpdate ) + { + ProcessPositionAttributesL( aAttributes ); + } + } + else if ( iElementName.CompareC( KVelocityElement ) == 0 ) + { + // Do not take velocity in initialization in account. + if ( iLastTag == EUpdate ) + { + ProcessVelocityAttributesL( aAttributes ); + } + } + else if ( iElementName.CompareC( KInitElement ) == 0 ) + { + // pasi + // Create new motion pattern and process the attributes of it. + delete iParsedPattern; + iParsedPattern = NULL; + iParsedPattern = C3DAudioPattern::NewL(); + + ProcessInitAttributesL( aAttributes ); + iLastTag = EInitialization; + } + else if ( iElementName.CompareC( KLoopElement ) == 0 ) + { + ProcessLoopAttributesL( aAttributes ); + } + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::OnEndElementL +// Proceed for elements that need processing. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::OnEndElementL( const Xml::RTagInfo& aElement, TInt aErrorCode ) + { + // Leave if error occurred. + User::LeaveIfError( aErrorCode ); + + CopyL( iElementName, aElement.LocalName().DesC() ); + + if ( iElementName.CompareC( KUpdateElement ) == 0 ) + { + // Update-element ended, add the update to script. + iParsedPattern->AddUpdateL( iCurrentUpdate ); + } + else if ( iElementName.CompareC( KLoopElement ) == 0 ) + { + // Loop-element ended, end the loop. + iParsedPattern->EndLoop(); + } + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::OnContentL +// Leave if error, otherwise nothing to do. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::OnContentL( const TDesC8& /*aBytes*/, TInt aErrorCode ) + { + // Leave if error occurred. + User::LeaveIfError( aErrorCode ); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::OnStartPrefixMappingL +// Leave if error, otherwise nothing to do. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::OnStartPrefixMappingL( const RString& /*aPrefix*/, + const RString& /*aUri*/, + TInt aErrorCode ) + { + // Leave if error occurred. + User::LeaveIfError( aErrorCode ); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::OnEndPrefixMappingL +// Leave if error, otherwise nothing to do. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::OnEndPrefixMappingL( const RString& /*aPrefix*/, + TInt aErrorCode ) + { + // Leave if error occurred. + User::LeaveIfError( aErrorCode ); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::OnIgnorableWhiteSpaceL +// Leave if error, otherwise nothing to do. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::OnIgnorableWhiteSpaceL( const TDesC8& /*aBytes*/, + TInt aErrorCode ) + { + // Leave if error occurred. + User::LeaveIfError( aErrorCode ); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::OnSkippedEntityL +// Leave if error, otherwise nothing to do. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::OnSkippedEntityL( const RString& /*aName*/, + TInt aErrorCode ) + { + // Leave if error occurred. + User::LeaveIfError( aErrorCode ); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::OnProcessingInstructionL +// Leave if error, otherwise nothing to do. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::OnProcessingInstructionL( const TDesC8& /*aTarget*/, + const TDesC8& /*aData*/, + TInt aErrorCode ) + { + // Leave if error occurred. + User::LeaveIfError( aErrorCode ); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::OnError +// Print error code to debug. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::OnError( TInt aErrorCode ) + { + if ( aErrorCode != KErrNone ) + { + FLOG( _L("### C3DAudioXMLParser::OnError (%d) ###"), aErrorCode ); + } + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::GetExtendedInterface +// Not implemented +// ----------------------------------------------------------------------------- +// +TAny* C3DAudioXMLParser::GetExtendedInterface( const TInt32 /*aUid*/ ) + { + return NULL; + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::ProcessInitAttributesL +// Process the initialization attributes. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::ProcessInitAttributesL( const Xml::RAttributeArray& aAttributes ) + { + // Check each attribute. + for ( TUint i = 0; i < aAttributes.Count(); ++i ) + { + CopyL( iAttributeName, aAttributes[i].Attribute().LocalName().DesC() ); + CopyL( iAttributeValue, aAttributes[i].Value().DesC() ); + + // Set the name of the pattern. + if ( iAttributeName.CompareC( KPatternName ) == 0 ) + { + iParsedPattern->SetNameL( iAttributeValue ); + } + else if ( iAttributeName.CompareC( KPatternReverb ) == 0 ) + { + TUint selectedReverb = EReverbNotEnabled; + + // Determine the reverberation. + if ( iAttributeValue.CompareC( KReverbPresetOne ) == 0 ) + { + selectedReverb = EReverbPresetOne; + } + else if ( iAttributeValue.CompareC( KReverbPresetTwo ) == 0 ) + { + selectedReverb = EReverbPresetTwo; + } + else if ( iAttributeValue.CompareC( KReverbPresetThree ) == 0 ) + { + selectedReverb = EReverbPresetThree; + } + else if ( iAttributeValue.CompareC( KReverbPresetFour ) == 0 ) + { + selectedReverb = EReverbPresetFour; + } + else if ( iAttributeValue.CompareC( KReverbPresetFive ) == 0 ) + { + selectedReverb = EReverbPresetFive; + } + else if ( iAttributeValue.CompareC( KReverbPresetSix ) == 0 ) + { + selectedReverb = EReverbPresetSix; + } + + // Set the reverberation to pattern. + iParsedPattern->SetReverb( selectedReverb ); + } + else if ( iAttributeName.CompareC( KPatternDoppler ) == 0) + { + // Set doppler. + if ( iAttributeValue.CompareC( KBooleanTrue ) == 0 ) + { + iParsedPattern->SetDoppler( ETrue ); + } + } + } + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::ProcessLoopAttributes +// Process the loop-element attributes. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::ProcessLoopAttributesL( const Xml::RAttributeArray& aAttributes ) + { + TLex8 lex; + + for ( TUint i = 0; i < aAttributes.Count(); ++i ) + { + CopyL( iAttributeName, aAttributes[i].Attribute().LocalName().DesC() ); + CopyL( iAttributeValue, aAttributes[i].Value().DesC() ); + + lex.Assign( iAttributeValue ); + + if ( iAttributeName.CompareC( KLoopCount ) == 0 ) + { + TUint loopCount; + User::LeaveIfError ( lex.Val( loopCount ) ); + + // Start the loop in pattern. + iParsedPattern->StartLoopL( loopCount ); + } + } + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::ProcessPositionAttributes +// Process the position-element attributes. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::ProcessPositionAttributesL( const Xml::RAttributeArray& aAttributes ) + { + TLex8 lex; + T3DPosition position = T3DPosition(); + + TInt count = aAttributes.Count(); + for ( TUint i = 0; i < count; ++i ) + { + CopyL( iAttributeName, aAttributes[i].Attribute().LocalName().DesC() ); + CopyL( iAttributeValue, aAttributes[i].Value().DesC() ); + + lex.Assign( iAttributeValue ); + + if ( iAttributeName.CompareC( KXCoordinate ) == 0 ) + { + User::LeaveIfError( lex.Val( position.iX ) ); + } + else if ( iAttributeName.CompareC( KYCoordinate ) == 0 ) + { + User::LeaveIfError( lex.Val( position.iY ) ); + } + else if ( iAttributeName.CompareC( KZCoordinate ) == 0) + { + User::LeaveIfError( lex.Val( position.iZ ) ); + } + } + + // Set position for current update. + iCurrentUpdate.iPosition = position; + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::ProcessUpdateAttributes +// Process the update-element attributes. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::ProcessUpdateAttributesL( const Xml::RAttributeArray& aAttributes ) + { + TLex8 lex; + // New update-element. + iCurrentUpdate = T3DScriptUpdate(); + + for ( TUint i = 0; i < aAttributes.Count(); ++i ) + { + CopyL( iAttributeName, aAttributes[i].Attribute().LocalName().DesC() ); + CopyL( iAttributeValue, aAttributes[i].Value().DesC() ); + + lex.Assign( iAttributeValue ); + + if ( iAttributeName.CompareC( KDTime ) == 0 ) + { + // Set the dTime for the update. + User::LeaveIfError( lex.Val( iCurrentUpdate.iDTime ) ); + } + } + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::ProcessVelocityAttributes +// Process the velocity-element attributes. +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::ProcessVelocityAttributesL( const Xml::RAttributeArray& aAttributes ) + { + TLex8 lex; + T3DVelocity velocity = T3DVelocity(); + + for ( TUint i = 0; i < aAttributes.Count(); ++i ) + { + CopyL( iAttributeName, aAttributes[i].Attribute().LocalName().DesC() ); + CopyL( iAttributeValue, aAttributes[i].Value().DesC() ); + + lex.Assign( iAttributeValue ); + + if ( iAttributeName.CompareC( KScalarVelocity ) == 0 ) + { + velocity.iScalar = ETrue; + User::LeaveIfError( lex.Val( velocity.iScalarVelocity ) ); + velocity.iXVector = 0; + velocity.iYVector = 0; + velocity.iZVector = 0; + break; + } + else if ( iAttributeName.CompareC( KXCoordinate ) == 0 ) + { + User::LeaveIfError( lex.Val( velocity.iXVector ) ); + } + else if ( iAttributeName.CompareC( KYCoordinate ) == 0 ) + { + User::LeaveIfError( lex.Val( velocity.iYVector ) ); + } + else if ( iAttributeName.CompareC( KZCoordinate ) == 0) + { + User::LeaveIfError( lex.Val( velocity.iZVector ) ); + } + } + // Set velocity for current update. + iCurrentUpdate.iVelocity = velocity; + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::CopyL +// +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::CopyL( TDes8& aTarget, const TDesC8& aSource ) + { + if ( aSource.Length() > aTarget.MaxLength() ) + { + +#ifdef _DEBUG + Panic( KErrArgument ); +#endif + + User::Leave( KErrTooBig ); + } + + aTarget.Copy( aSource ); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::Panic() +// +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::Panic(TInt aReason) + { + _LIT(KPanicCategory,"RingingTone3DAudioPlugin"); + + User::Panic(KPanicCategory, aReason); + } + + +// ------------------------------------------------------------------------------- +// C3DAudioXMLParser::ReadPatternFileL +// +// ------------------------------------------------------------------------------- +// +CBufFlat* C3DAudioXMLParser::ReadPatternFileL( const TDesC& aFullName ) + { + const TInt KGranularity = 1024; + + RFile file; + User::LeaveIfError( file.Open( iFsSession, aFullName, EFileRead ) ); + CleanupClosePushL( file ); + + CBufFlat* buf = CBufFlat::NewL( KGranularity ); + CleanupStack::PushL( buf ); + + TInt size = 0; + file.Size( size ); + buf->ResizeL( size ); + + TPtr8 ptr = buf->Ptr( 0 ); + User::LeaveIfError( file.Read( ptr ) ); + + CleanupStack::Pop( buf ); + CleanupStack::PopAndDestroy( &file ); + + return buf; + } + + +// ------------------------------------------------------------------------------- +// C3DAudioXMLParser::GetPatternFullPathL +// +// ------------------------------------------------------------------------------- +// +void C3DAudioXMLParser::GetPatternFullPathL(TDes& aText, TInt aPatternId) + { + _LIT( KFormatString, "%S%S%S\\%S"); + + TBuf pattern; + + // emulator dir "\epoc32\release\winscw\udeb\Z\resource\3DTones" + // hardware dir "z:\data\Z\resource\3DTones" + + switch (aPatternId) + { + case EProfile3DEffectCircle: + { + pattern = KPatternCircle; + break; + } + case EProfile3DEffectFlyby: + { + pattern = KPatternFlyBy; + break; + } + case EProfile3DEffectZigZag: + { + pattern = KPatternZigZag; + break; + } + case EProfile3DEffectRandomWalk: + { + pattern = KPatternRandomWalk; + break; + } + case EProfile3DEffectChaos: + { + pattern = KPatternChaos; + break; + } + default: + { + User::Leave( KErrNotSupported ); + break; + } + } + + TDriveUnit drive( EDriveZ ); + TDriveName driveName = drive.Name(); + + aText.Format(KFormatString, &driveName, &KDC_RESOURCE_FILES_DIR, &K3DTonesDir, &pattern); + } + + + + + + +#ifdef _DEBUG + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::AssertParseDataL +// +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::AssertParseDataL( TInt aPatternId ) + { + const TInt KGranularity = 1024; + + C3DPatternPS* ps = C3DPatternPS::NewLC( KRingingTone3DAudioEComPluginUID ); + + CBufFlat* buf = CBufFlat::NewL( KGranularity ); + CleanupStack::PushL( buf ); + + RBufWriteStream writestream( *buf ); + CleanupClosePushL( writestream ); + iParsedPattern->ExternalizeL( writestream ); + writestream.CommitL(); + CleanupStack::PopAndDestroy( &writestream ); + + CBufFlat* buf2 = ps->DataLC(); + + + TInt id = ps->IntL(C3DPatternPS::EKeyPatternId); + if ( id != aPatternId ) + { + Panic( KErrGeneral ); + } + + TPtr8 p1 = buf->Ptr( 0 ); + TPtr8 p2 = buf2->Ptr( 0 ); + + TInt ret = p1.Compare( p2 ); + if ( ret != 0 ) + { + Panic( KErrGeneral ); + } + TInt doppler = ps->IntL( C3DPatternPS::EKeyDopplerUsed ); + if ( doppler != iParsedPattern->DopplerAvailable() ) + { + Panic( KErrGeneral ); + } + TInt velocity = ps->IntL( C3DPatternPS::EKeyVelocity ); + if (velocity != KMotionPatternDefaultVelocity) + { + Panic( KErrGeneral ); + } + + CleanupStack::PopAndDestroy( buf2 ); + CleanupStack::PopAndDestroy( buf ); + CleanupStack::PopAndDestroy( ps ); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::FlogPatternsL() +// +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::FlogPatternsL(TInt aOldPattern, TInt aNewPattern) + { + TBuf<128> buf; TBuf<128> buf2; + + GetPatternString(buf, aOldPattern); + GetPatternString(buf2, aNewPattern); + FLOG( _L("pattern changed from '%S' to '%S'"), &buf, &buf2 ); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::FlogPatternL() +// +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::FlogPatternL(TInt aPattern) + { + TBuf<128> buf; + + GetPatternString(buf, aPattern); + FLOG( _L("pattern '%S' found in cache"), &buf ); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::GetPatternString() +// +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::GetPatternString(TDes& aText, TInt aPattern) + { + switch (aPattern) + { + case EProfile3DEffectOff: + aText = _L("EProfile3DEffectOff"); + break; + case EProfile3DEffectCircle: + aText = _L("EProfile3DEffectCircle"); + break; + case EProfile3DEffectFlyby: + aText = _L("EProfile3DEffectFlyby"); + break; + case EProfile3DEffectZigZag: + aText = _L("EProfile3DEffectZigZag"); + break; + case EProfile3DEffectRandomWalk: + aText = _L("EProfile3DEffectRandomWalk"); + break; + case EProfile3DEffectChaos: + aText = _L("EProfile3DEffectChaos"); + break; + case EProfile3DEffectStereoWidening: + aText = _L("EProfile3DEffectStereoWidening"); + break; + case KErrNotFound: + aText = _L("KErrNotFound"); + break; + + default: + aText = _L("### unknown pattern ###"); + break; + } + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::FlogPubSubL() +// +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::FlogPubSubL(TInt aEcho) + { + FLOG( _L("------ start pubsub data ------") ); + + TInt num = 0; + TBuf<128> buf; + + C3DPatternPS* pubSub = C3DPatternPS::NewLC( KRingingTone3DAudioEComPluginUID ); + + num = pubSub->IntL(C3DPatternPS::EKeyPatternId); + C3DAudioXMLParser::GetPatternString(buf, num); + FLOG( _L("pattern: %S (%d)"), &buf, num ); + + GetEchoString(buf, aEcho); + FLOG( _L("echo: %S (%d)"), &buf, aEcho ); + + num = pubSub->IntL(C3DPatternPS::EKeyVelocity); + FLOG( _L("velocity: %d"), num ); + + num = pubSub->IntL(C3DPatternPS::EKeyDopplerUsed); + FLOG( _L("doppler: %d"), num ); + + num = pubSub->IntL(C3DPatternPS::EKeyDataSize); + FLOG( _L("data size: %d"), num ); + + CleanupStack::PopAndDestroy( pubSub ); + + FLOG( _L("------ end pubsub data ------") ); + } + + +// ----------------------------------------------------------------------------- +// C3DAudioXMLParser::GetEchoString() +// +// ----------------------------------------------------------------------------- +// +void C3DAudioXMLParser::GetEchoString(TDes& aText, TInt aEcho) + { + switch (aEcho) + { + case EProfile3DEchoOff: + aText = _L("EProfile3DEchoOff"); + break; + case EProfile3DEchoLivingRoom: + aText = _L("EProfile3DEchoLivingRoom"); + break; + case EProfile3DEchoCave: + aText = _L("EProfile3DEchoCave"); + break; + case EProfile3DEchoStoneCorridor: + aText = _L("EProfile3DEchoStoneCorridor"); + break; + case EProfile3DEchoForest: + aText = _L("EProfile3DEchoForest"); + break; + case EProfile3DEchoSewerPipe: + aText = _L("EProfile3DEchoSewerPipe"); + break; + case EProfile3DEchoUnderwater: + aText = _L("EProfile3DEchoUnderwater"); + break; + default: + aText = _L("### unknown echo ###"); + break; + } + } + +#endif // _DEBUG + + + + +/****************************************************************************** + * class C3DPatternPS + ******************************************************************************/ + + + +// ----------------------------------------------------------------------------- +// C3DPatternPS::NewLC +// +// ----------------------------------------------------------------------------- +// +C3DPatternPS* C3DPatternPS::NewLC( TInt aStoreId ) + { + C3DPatternPS* self = new ( ELeave ) C3DPatternPS( aStoreId ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// Destructor +C3DPatternPS::~C3DPatternPS() + { + iProperty.Close(); + } + + +// ----------------------------------------------------------------------------- +// C3DPatternPS::C3DPatternPS +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +C3DPatternPS::C3DPatternPS( TInt aStoreId ) + { + iStoreUid.iUid = aStoreId; + } + + +// ----------------------------------------------------------------------------- +// C3DPatternPS::ConstructL +// +// ----------------------------------------------------------------------------- +// +void C3DPatternPS::ConstructL() + { + TBool ret = DefineKeyL( EKeyPatternId, RProperty::EInt ); + if ( ret ) + { + // first time initialization + TInt err = iProperty.Set( iStoreUid, EKeyPatternId, KErrNotFound ); + User::LeaveIfError( err ); + } + + DefineKeyL( EKeyDopplerUsed, RProperty::EInt ); + DefineKeyL( EKeyVelocity, RProperty::EInt ); + DefineKeyL( EKeyDataSize, RProperty::EInt ); + DefineKeyL( EKeyPatternData, RProperty::ELargeText ); + } + + +// ----------------------------------------------------------------------------- +// C3DPatternPS::DefineKeyL +// +// ----------------------------------------------------------------------------- +// +TBool C3DPatternPS::DefineKeyL( TInt aKeyId, TInt aKeyType ) + { + TInt err = iProperty.Define( iStoreUid, aKeyId, aKeyType ); + + if ( err != KErrNone && err != KErrAlreadyExists ) + { + User::Leave( err ); + } + + if ( err == KErrNone ) + { + return ETrue; // key was created + } + + return EFalse; // key already existed + } + + + +// ----------------------------------------------------------------------------- +// C3DPatternPS::IntL +// +// ----------------------------------------------------------------------------- +// +TInt C3DPatternPS::IntL( TInt aKey ) + { + TInt num = KErrNotFound; + TInt err = iProperty.Get( iStoreUid, aKey, num ); + User::LeaveIfError( err ); + + return num; + } + + +// ----------------------------------------------------------------------------- +// C3DPatternPS::SetIntL +// +// ----------------------------------------------------------------------------- +// +void C3DPatternPS::SetIntL( TInt aKey, TInt aValue ) + { + TInt err = iProperty.Set( iStoreUid, aKey, aValue ); + User::LeaveIfError( err ); + } + + +// ----------------------------------------------------------------------------- +// C3DPatternPS::SetDataL +// +// ----------------------------------------------------------------------------- +// +void C3DPatternPS::SetDataL( const TDesC8& aData ) + { + const TInt KMaxSize = 65536; + + if ( aData.Size() > KMaxSize ) + { + User::Leave( KErrOverflow ); + } + + TInt err = iProperty.Set( iStoreUid, EKeyPatternData, aData ); + User::LeaveIfError( err ); + + TInt size = aData.Size(); + err = iProperty.Set( iStoreUid, EKeyDataSize, size ); + User::LeaveIfError( err ); + } + + +// ----------------------------------------------------------------------------- +// C3DPatternPS::GetDataL +// +// ----------------------------------------------------------------------------- +// +void C3DPatternPS::GetDataL( TDes8& aData ) + { + TInt err = iProperty.Get( iStoreUid, EKeyPatternData, aData ); + User::LeaveIfError( err ); + } + + +// ----------------------------------------------------------------------------- +// C3DPatternPS::DataLC +// +// ----------------------------------------------------------------------------- +// +CBufFlat* C3DPatternPS::DataLC() + { + const TInt KGranularity = 1024; + + CBufFlat* buf = CBufFlat::NewL( KGranularity ); + CleanupStack::PushL( buf ); + + TInt size = IntL( C3DPatternPS::EKeyDataSize ); + buf->ResizeL( size ); + TPtr8 ptr8 = buf->Ptr( 0 ); + GetDataL( ptr8 ); + + return buf; + } + + + + + + +////////////////////////////////////// START TEST CODE ////////////////////////// + +// element names +_LIT(KKInitElement, "initialization"); +_LIT(KKUpdateElement, "update"); +_LIT(KKPositionElement, "position"); +_LIT(KKVelocityElement, "velocity"); + +// attribute names +_LIT( KKXCoordinate, "x" ); +_LIT( KKYCoordinate, "y" ); +_LIT( KKZCoordinate, "z" ); + +_LIT( KKPatternName, "name" ); +_LIT( KKEchoName, "reverb" ); +_LIT( KKDoppler, "doppler" ); +_LIT( KKDTime, "dTime" ); + +// attribute values +_LIT( KKBooleanTrue, "true" ); + + + + +// "Z:\\resource\\10208ADF\\3zigzag.xml" + + +// ----------------------------------------------------------------------------- +// C3DPatternParser::NewL +// +// ----------------------------------------------------------------------------- +// +C3DPatternParser* C3DPatternParser::NewL() + { + C3DPatternParser* self = new (ELeave) C3DPatternParser(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// +// ----------------------------------------------------------------------------- +// +C3DPatternParser::~C3DPatternParser() + { + iPositionList.Close(); + iVelocityList.Close(); + delete iParser; + iFsSession.Close(); + } + + +// ----------------------------------------------------------------------------- +// C3DPatternParser::C3DPatternParser +// +// ----------------------------------------------------------------------------- +// +C3DPatternParser::C3DPatternParser() + { + } + + +// ----------------------------------------------------------------------------- +// C3DPatternParser::ConstructL +// +// ----------------------------------------------------------------------------- +// +void C3DPatternParser::ConstructL() + { + _LIT8(KMimeType, "text/xml"); + + iParser = Xml::CParser::NewL( KMimeType, *this ); + + User::LeaveIfError( iFsSession.Connect() ); + } + + +// ----------------------------------------------------------------------------- +// C3DPatternParser::ReadFileL +// +// ----------------------------------------------------------------------------- +// +CBufFlat* C3DPatternParser::ReadDocumentL(const TDesC& aFullName) + { + const TInt KGranularity = 1024; + + RFile file; + User::LeaveIfError( file.Open(iFsSession, aFullName, EFileRead) ); + CleanupClosePushL(file); + + CBufFlat* buffer = CBufFlat::NewL(KGranularity); + CleanupStack::PushL(buffer); + + TInt size = 0; + file.Size(size); + buffer->ResizeL(size); + + TPtr8 ptr = buffer->Ptr(0); + User::LeaveIfError( file.Read(ptr) ); + + CleanupStack::Pop(buffer); + CleanupStack::PopAndDestroy(&file); + + return buffer; + } + + +// ----------------------------------------------------------------------------- +// C3DPatternParser::ParseDocumentL +// +// ----------------------------------------------------------------------------- +// +void C3DPatternParser::ParseDocumentL(const TDesC& aFullName) + { + iVelocityUsed = EFalse; + iDopplerUsed = EFalse; + + iPositionList.Reset(); + iVelocityList.Reset(); + + + CBufFlat* buf = ReadDocumentL(aFullName); + CleanupStack::PushL(buf); + TPtr8 ptr = buf->Ptr(0); + + iParser->ParseL(ptr); + + iParser->ParseEndL(); + + ///Print(); + + CleanupStack::PopAndDestroy(buf); + } + + +// ----------------------------------------------------------------------------- +// C3DPatternParser::ParseDocumentL +// +// ----------------------------------------------------------------------------- +// +void C3DPatternParser::ParseDocumentL(TInt aPatternId) + { + TFileName name; + GetPatternFileNameL(name, aPatternId); + + ParseDocumentL(name); + } + + +// ----------------------------------------------------------------------------- +// C3DPatternParser::GetPatternName +// +// ----------------------------------------------------------------------------- +// +void C3DPatternParser::GetPatternName(TDes& aText) + { + StrCopy(aText, iPatternName); + } + + +// ----------------------------------------------------------------------------- +// C3DPatternParser::GetEchoName +// +// ----------------------------------------------------------------------------- +// +void C3DPatternParser::GetEchoName(TDes& aText) + { + StrCopy(aText, iEchoName); + } + + +// ----------------------------------------------------------------------------- +// C3DPatternParser::GetEchoName +// +// ----------------------------------------------------------------------------- +// +TBool C3DPatternParser::DopplerEnabled() + { + return iDopplerUsed; + } + + +// ----------------------------------------------------------------------------- +// C3DPatternParser::PositionCount +// +// ----------------------------------------------------------------------------- +// +TInt C3DPatternParser::PositionCount() + { + return iPositionList.Count(); + } + + +// ----------------------------------------------------------------------------- +// C3DPatternParser::Position +// +// ----------------------------------------------------------------------------- +// +T3DPatternData& C3DPatternParser::Position(TInt aIndex) + { + if (aIndex < 0 || aIndex >= iPositionList.Count()) + { + Panic(KErrArgument); + } + + return iPositionList[aIndex]; + } + + +// ----------------------------------------------------------------------------- +// C3DPatternParser::Velocity +// +// ----------------------------------------------------------------------------- +// +T3DPatternData& C3DPatternParser::Velocity(TInt aIndex) + { + if (aIndex < 0 || aIndex >= iVelocityList.Count()) + { + Panic(KErrArgument); + } + + return iVelocityList[aIndex]; + } + + +// ----------------------------------------------------------------------------- +// C3DPatternParser::AssertPosition +// +// ----------------------------------------------------------------------------- +// +void C3DPatternParser::AssertPosition(TInt aIndex, TInt aX, TInt aY, TInt aZ) + { + T3DPatternData d = Position(aIndex); + + if (d.iX != aX || d.iY != aY || d.iZ != aZ) + { + Panic(KErrArgument); + } + } + + +// ----------------------------------------------------------------------------- +// C3DPatternParser::AssertVelocity +// +// ----------------------------------------------------------------------------- +// +void C3DPatternParser::AssertVelocity(TInt aIndex, TInt aX, TInt aY, TInt aZ) + { + T3DPatternData d = Velocity(aIndex); + + if (d.iX != aX || d.iY != aY || d.iZ != aZ) + { + Panic(KErrArgument); + } + } + + +// ----------------------------------------------------------------------------- +// C3DPatternParser::AssertTime +// +// ----------------------------------------------------------------------------- +// +void C3DPatternParser::AssertTime(TInt aIndex, TInt aTime) + { + T3DPatternData d = Position(aIndex); + + if (d.iTime != aTime) + { + Panic(KErrArgument); + } + } + + +// ------------------------------------------------------------------------------- +// C3DPatternParser::StrCopy +// +// String copy with lenght check. +// ------------------------------------------------------------------------------- +// +void C3DPatternParser::StrCopy(TDes& aTarget, const TDesC8& aSource) + { + TInt len = aTarget.MaxLength(); + if(len < aSource.Length()) + { + aTarget.Copy(aSource.Left(len)); + return; + } + aTarget.Copy(aSource); + } + + +// ------------------------------------------------------------------------------- +// C3DPatternParser::StrCopy +// +// String copy with lenght check. +// ------------------------------------------------------------------------------- +// +void C3DPatternParser::StrCopy(TDes& aTarget, const TDesC& aSource) + { + TInt len = aTarget.MaxLength(); + if(len < aSource.Length()) + { + aTarget.Copy(aSource.Left(len)); + return; + } + aTarget.Copy(aSource); + } + + +// ------------------------------------------------------------------------------- +// C3DPatternParser::StrToIntL +// +// ------------------------------------------------------------------------------- +// +TInt C3DPatternParser::StrToIntL(const TDesC& aText) + { + TInt num = KErrNotFound; + + TLex lex(aText); + + User::LeaveIfError( lex.Val(num) ); + return num; + } + +// ----------------------------------------------------------------------------- +// C3DPatternParser::Panic +// +// ----------------------------------------------------------------------------- +// +void C3DPatternParser::Panic(TInt aReason) + { + _LIT(KPanicCategory,"C3DPatternParser"); + + User::Panic(KPanicCategory, aReason); + } + + +// ------------------------------------------------------------------------------- +// C3DPatternParser::GetPatternFileNameL +// +// ------------------------------------------------------------------------------- +// +void C3DPatternParser::GetPatternFileNameL(TDes& aText, TInt aPatternId) + { + _LIT( KFormatString, "%S%S%S%S"); + _LIT( KPatternDir, "3DTones\\" ); + + _LIT( KPatternCircle, "1circular.xml" ); + _LIT( KPatternFlyBy, "2flyby.xml" ); + _LIT( KPatternZigZag, "3zigzag.xml" ); + _LIT( KPatternRandomWalk, "4meander.xml" ); + _LIT( KPatternChaos, "5random.xml" ); + + TBuf pattern; + + switch (aPatternId) + { + case EProfile3DEffectCircle: + { + pattern = KPatternCircle; + break; + } + case EProfile3DEffectFlyby: + { + pattern = KPatternFlyBy; + break; + } + case EProfile3DEffectZigZag: + { + pattern = KPatternZigZag; + break; + } + case EProfile3DEffectRandomWalk: + { + pattern = KPatternRandomWalk; + break; + } + case EProfile3DEffectChaos: + { + pattern = KPatternChaos; + break; + } + default: + { + User::Leave( KErrNotSupported ); + break; + } + } + + TDriveUnit drive(EDriveZ); + TDriveName driveName = drive.Name(); + + aText.Format(KFormatString, &driveName, &KDC_RESOURCE_FILES_DIR, &KPatternDir, &pattern); + } + + +// ------------------------------------------------------------------------------- +// C3DPatternParser::ReadPositionAttributesL +// +// ------------------------------------------------------------------------------- +// +void C3DPatternParser::ReadPositionAttributesL(const Xml::RAttributeArray& aAttributes) + { + TInt count = aAttributes.Count(); + + for (TUint i=0; i buf; TBuf buf2; + + GetPatternName(buf); + GetEchoName(buf2); + FLOG( _L("pattern: '%S' echo: '%S' doppler: %d"), &buf, &buf2, iDopplerUsed); + + FLOG( _L("init position and velocity:") ); + PrintCoordinates(iInitPosition, EFalse); + PrintCoordinates(iInitVelocity, ETrue); + + FLOG( _L("positions and velocities:") ); + + TInt count = PositionCount(); + for (TInt i=0; i // CEnvironmentalReverbUtility +#include // CSourceDoppler +#include // CSourceLocation +#include // CListenerLocation + +#ifndef SPP_NSS_3D_RINGING_TONE_STW_DISABLED +#include // CStereoWidening +#endif + + +#include +#include +#include +#include +#include +#include +#include // for TProfile3DToneEffect and TProfile3DToneEcho + + +// CONSTANTS +const TUint32 KDopplerFactor = 100; + + + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CRingingTone3DPlugin* CRingingTone3DPlugin::NewL( TAny* aParameter ) + { + // aParameter comes from REComSession::CreateImplementationL + // (TAny *aConstructionParameters) + + CRingingTone3DPlugin* self = new ( ELeave ) CRingingTone3DPlugin(); + CleanupStack::PushL( self ); + self->ConstructL( aParameter ); + CleanupStack::Pop(); + + return self; + } + +// Destructor +CRingingTone3DPlugin::~CRingingTone3DPlugin() + { + + // Stop() may leave because of CDrmPlayerUtility error + // (CMMFDrmAudioPlayerUtility::IsValidCustomCommandDestination + // uses CleanupClosePushL). + TRAP_IGNORE( Stop() ); + + delete iTimer; + delete iParser; + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::Stop +// Stop the playback. +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::Stop() + { + FLOG( _L("CRingingTone3DPlugin::Stop START") ); + + // Stop the playback and timer. + if ( iTimer ) + { + iTimer->Cancel(); + } + + StopRingingTone(); + + delete iReverbEffect; + iReverbEffect = NULL; + + delete iDopplerEffect; + iDopplerEffect = NULL; + + delete iListener; + iListener = NULL; + + delete iSource; + iSource = NULL; + +#ifdef __STEREO_WIDENING_EFFECT_UI + delete iStereoWidening; + iStereoWidening = NULL; +#endif + + FLOG( _L("CRingingTone3DPlugin::Stop END") ); + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::CRingingTone3DPlugin +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CRingingTone3DPlugin::CRingingTone3DPlugin() + { + iPlaying = EFalse; + iPlayerType = KErrNotFound; + iProfileId = KErrNotFound; + + iProfile3DToneEffect = KErrNotFound; + iProfile3DToneEcho = KErrNotFound; + iRingingTone = KNullDesC; + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::ConstructL( TAny* aParameter ) + { + FLOG( _L("CRingingTone3DPlugin::ConstructL START") ); + + iTimer = C3DAudioTimeOutTimer::NewL( EPriorityHigh, this ); + iParser = C3DAudioXMLParser::NewL(); + + FLOG( _L("CRingingTone3DPlugin::ConstructL END") ); + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::Init +// +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::Init( CMdaAudioPlayerUtility* aSamplePlayer ) + { + FLOG( _L("CRingingTone3DPlugin::InitL START") ); + + __ASSERT_ALWAYS( aSamplePlayer, Panic(KErrArgument) ); + + iAudioPlayerUtility = aSamplePlayer; + iPlayerType = EMdaAudioPlayerUtility; + +#ifdef _DEBUG + FlogPlayer( iPlayerType ); +#endif + + FLOG( _L("CRingingTone3DPlugin::InitL END") ); + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::Init +// +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::Init( CMdaAudioToneUtility* aSamplePlayer ) + { + FLOG( _L("CRingingTone3DPlugin::InitL START") ); + + __ASSERT_ALWAYS( aSamplePlayer, Panic(KErrArgument) ); + + iAudioToneUtility = aSamplePlayer; + iPlayerType = EMdaAudioToneUtility; + +#ifdef _DEBUG + FlogPlayer( iPlayerType ); +#endif + + FLOG( _L("CRingingTone3DPlugin::InitL END") ); + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::Init +// +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::Init( CDrmPlayerUtility* aSamplePlayer ) + { + //FLOG( _L("CRingingTone3DPlugin::InitL START") ); + + __ASSERT_ALWAYS( aSamplePlayer, Panic(KErrArgument) ); + + iDrmPlayerUtility = aSamplePlayer; + iPlayerType = EDrmPlayerUtility; + +#ifdef _DEBUG + FlogPlayer( iPlayerType ); +#endif + + //FLOG( _L("CRingingTone3DPlugin::InitL END") ); + } + +#ifdef RD_VIDEO_AS_RINGING_TONE +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::Init +// +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::Init( CVideoPlayerUtility* aSamplePlayer ) + { + FLOG( _L("CRingingTone3DPlugin::InitL START") ); + + __ASSERT_ALWAYS( aSamplePlayer, Panic(KErrArgument) ); + + iVideoPlayerUtility = aSamplePlayer; + iPlayerType = EVideoPlayerUtility; + +#ifdef _DEBUG + FlogPlayer( iPlayerType ); +#endif + + FLOG( _L("CRingingTone3DPlugin::InitL END") ); + } +#endif + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::SetAttr (from C3DRingingToneInterface.h) +// +// ----------------------------------------------------------------------------- +// +TInt CRingingTone3DPlugin::SetAttr( T3DRingingToneInterfaceAttr aAttributeKey, + TInt aValue ) + { + switch (aAttributeKey) + { + case E3DRTIAttrProfileId: + { + iProfileId = aValue; + break; + } + case E3DRTIAttr3DEffect: + { + iProfile3DToneEffect = aValue; + break; + } + case E3DRTIAttr3DEcho: + { + iProfile3DToneEcho = aValue; + break; + } + default: + { + break; + } + } + + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::SetAttr (from C3DRingingToneInterface.h) +// +// ----------------------------------------------------------------------------- +// +TInt CRingingTone3DPlugin::SetAttr( T3DRingingToneInterfaceAttr aAttributeKey, + const TDesC& aValue ) + { + switch (aAttributeKey) + { + case E3DRTIAttr3DRingingTone: + { + if ( aValue.Length() < iRingingTone.MaxLength() ) + { + iRingingTone = aValue; + } + break; + } + default: + { + break; + } + } + + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::SetAttr (from C3DRingingToneInterface.h) +// +// ----------------------------------------------------------------------------- +// +TInt CRingingTone3DPlugin::SetAttr( TInt aAttributeKey, TAny* aValue ) + { + switch (aAttributeKey) + { + case E3DRTIAttrAudioPlayerUtility: + { + Init( ( CMdaAudioPlayerUtility* )aValue ); + break; + } + case E3DRTIAttrAudioToneUtility: + { + Init( ( CMdaAudioToneUtility* )aValue ); + break; + } + case E3DRTIAttrDrmPlayerUtility: + { + Init( ( CDrmPlayerUtility* )aValue ); + break; + } +#ifdef RD_VIDEO_AS_RINGING_TONE + case E3DRTIAttrVideoPlayerUtility: + { + Init( ( CVideoPlayerUtility* )aValue ); + break; + } +#endif + default: + { + break; + } + } + + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::PlayL +// Start the playback, initialize first in case there has been changes. +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::PlayL() + { + TInt err = KErrNone; + + TRAP( err, DoPlayL() ); + + if ( err != KErrNone ) + { + // 3D play failed - play normal ringing tone + UnInitialize(); + PlayRingingTone(); + } + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::DoPlayL +// +// Start the playback, initialize first in case there has been changes. +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::DoPlayL() + { + FLOG( _L("CRingingTone3DPlugin::DoPlayL START") ); + + __ASSERT_ALWAYS( iPlayerType != KErrNotFound, Panic(KErrNotReady) ); + + TInt err = KErrNone; + + if ( iTimer ) + { + iTimer->Cancel(); + } + else + { + User::Leave( KErrNoMemory ); // ConstructL has failed + } + + TRAP( err, InitializeL() ); // Initialize the plug-in + + if ( err != KErrNone ) + { + FLOG( _L("### CRingingTone3DPlugin::InitializeL failed (%d) ###"), err); + User::Leave(err); + } + + if ( iProfile3DToneEffect == EProfile3DEffectOff ) + { + PlayRingingTone(); // play normal ringing tone + + FLOG( _L("CRingingTone3DPlugin::DoPlayL END") ); + return; + } + + +#ifdef __STEREO_WIDENING_EFFECT_UI + if ( iStereoWidening ) + { + if ( !iStereoWidening->IsEnabled() ) + { + FLOG( _L("### CStereoWidening not enabled ###") ); + + TRAP( err, iStereoWidening->EnableL() ); + if ( err != KErrNone ) + { + FLOG( _L("### CStereoWidening::EnableL failed (%d) ###"), err); + User::Leave( err ); + } + } + + // play normal ringing tone with stereowidening + PlayRingingTone(); + + FLOG( _L("CRingingTone3DPlugin::DoPlayL END") ); + return; + } +#endif + + + iCurrentUpdate = KErrNotFound; + + SetNext3DPatternPositionL(); + + PlayRingingTone(); // Start playing 3D ringing tone. + + FLOG( _L("CRingingTone3DPlugin::DoPlayL END") ); + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::TimerExpiredL +// Callback method for timer expiration. +// Used to update the location and doppler-effects. +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::TimerExpiredL() + { + //FLOG( _L("CRingingTone3DPlugin::TimerExpiredL START") ); + + if ( iCurrentUpdate % 10 == 0 ) + { + FLOG( _L("CRingingTone3DPlugin::TimerExpiredL called (count = %d)"), iCurrentUpdate); + } + + SetNext3DPatternPositionL(); + + //FLOG( _L("CRingingTone3DPlugin::TimerExpiredL END") ); + } + + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::SetNext3DPatternPositionL +// +// Used to update the location and doppler-effects. +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::SetNext3DPatternPositionL() + { + //FLOG( _L("CRingingTone3DPlugin::SetNext3DPatternPositionL START") ); + + TInt err = KErrNone; + + if ( !iSource || !iListener ) + { + FLOG( _L("### CSourceLocation or CListenerLocation or C3DAudioPattern is NULL ###") ); + User::Leave( KErrDied ); + } + + if ( iCurrentUpdate == KErrNotFound ) + { + iCurrentUpdate = 0; // first position + } + else + { + iCurrentUpdate++; // next position + } + + // iCurrentUpdate out of bounds. Start from the beginning. + if ( iCurrentUpdate >= iParser->CountL() ) + { + iCurrentUpdate = 0; + } + + + // + // update doppler-effect + // + if ( iDoppler && iDopplerEffect ) + { + // Current doppler-velocity. + T3DVelocity velocity = iParser->VelocityL( iCurrentUpdate ); + + // Update the velocity and apply. + TRAP( err, iDopplerEffect->SetCartesianVelocityL( ( TInt32& )velocity.iXVector, + ( TInt32& )velocity.iYVector, + ( TInt32& )velocity.iZVector ) ); + if ( err != KErrNone ) + { + FLOG( _L("### CSourceDoppler::SetCartesianVelocityL failed (%d) ###"), err); + User::Leave( err ); + } + + if ( !iDopplerEffect->IsEnabled() ) + { + FLOG( _L("### CSourceDoppler not enabled ###") ); + + TRAP( err, iDopplerEffect->EnableL() ); + + if ( err != KErrNone ) + { + FLOG( _L("### CSourceDoppler::EnableL failed (%d) ###"), err); + User::Leave( err ); + } + } + + TRAP( err, iDopplerEffect->ApplyL() ); + if ( err != KErrNone ) + { + FLOG( _L("### CSourceDoppler::ApplyL failed (%d) ###"), err); + User::Leave( err ); + } + +#ifdef _DEBUG + //FlogVelocityL( velocity, iCurrentUpdate ); +#endif + + } + + + // + // set new 3D pattern position + // + T3DPosition position = iParser->PositionL( iCurrentUpdate ); + + TRAP( err, iSource->SetLocationCartesianL( ( TInt32& )position.iX, + ( TInt32& )position.iY, + ( TInt32& )position.iZ ) ); + if ( err != KErrNone ) + { + FLOG( _L("### CSourceLocation::SetLocationCartesianL failed (%d) ###"), err); + User::Leave( err ); + } + + if ( !iSource->IsEnabled() ) + { + FLOG( _L("### CSourceLocation not enabled ###") ); + + TRAP( err, iSource->EnableL() ); + if ( err != KErrNone ) + { + FLOG( _L("### CSourceLocation::EnableL failed (%d) ###"), err); + User::Leave( err ); + } + } + + TRAP( err, iSource->ApplyL() ); + if ( err != KErrNone ) + { + FLOG( _L("### CSourceLocation::ApplyL failed (%d) ###"), err); + User::Leave( err ); + } + + +#ifdef _DEBUG + //FlogPositionL( position, iCurrentUpdate ); +#endif + + + // + // if reverb is created and not enabled try to enable it. + // + if ( iReverbEffect ) + { + TBool enabled = iReverbEffect->EnvironmentalReverb().IsEnabled(); + if ( !enabled ) + { + FLOG( _L("### CEnvironmentalReverb not enabled ###") ); + + TRAP( err, iReverbEffect->EnvironmentalReverb().EnableL() ); + if ( err != KErrNone ) + { + FLOG( _L("### CEnvironmentalReverb::EnableL failed (%d) ###"), err); + User::Leave( err ); + } + } + } + + + // + // if listener location is created and not enabled try to enable it + // + if ( !iListener->IsEnabled() ) + { + FLOG( _L("### CListnerLocation not enabled ###") ); + + TRAP( err, iListener->EnableL() ); + if ( err != KErrNone ) + { + FLOG( _L("### CListnerLocation::EnableL failed (%d) ###"), err); + User::Leave( err ); + } + } + + + // Get the update time and calculate it according to velocity set. + TInt dTime = iParser->TimeL( iCurrentUpdate ) * 1000; + + CalculateDTime( dTime ); + +#ifdef _DEBUG + //FlogTimeL( dTime, iCurrentUpdate ); +#endif + + // Start the timer if pattern changes. + if ( dTime != 0 ) + { + iTimer->After( dTime ); + } + + //FLOG( _L("CRingingTone3DPlugin::SetNext3DPatternPositionL END") ); + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::CalculateDTime +// Calculate the time spent in current update, depending on the velocity set. +// ----------------------------------------------------------------------------- +void CRingingTone3DPlugin::CalculateDTime( TInt& aTime ) + { + // Velocity is set to zero, so no movement will appear. + if ( iVelocity == 0 ) + { + aTime = 0; + } + // Velocity is under five (default), so the updates take more time. + else if ( iVelocity < KMotionPatternDefaultVelocity ) + { + aTime = aTime + ( ( aTime / 5 ) * ( KMotionPatternDefaultVelocity - iVelocity ) ); + } + // Velocity is over five (default), so the updates take less time. + else if ( iVelocity > KMotionPatternDefaultVelocity ) + { + aTime = aTime - ( ( aTime / 6 ) * ( iVelocity - KMotionPatternDefaultVelocity ) ); + } + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::InitializeL() +// Initialize the plugin to current settings. +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::UnInitialize() + { + if ( iReverbEffect ) + { + TRAP_IGNORE( iReverbEffect->DisableEnvironmentalReverbL() ); + } + if ( iListener ) + { + TRAP_IGNORE( iListener->DisableL() ); + } + if ( iSource ) + { + TRAP_IGNORE( iSource->DisableL() ); + } + + if ( iDopplerEffect ) + { + TRAP_IGNORE( iDopplerEffect->DisableL() ); + } + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::InitializeL() +// Initialize the plugin to current settings. +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::InitializeL() + { + FLOG( _L("CRingingTone3DPlugin::InitializeL START") ); + + if ( iProfile3DToneEffect == KErrNotFound || iProfile3DToneEcho == KErrNotFound ) + { + // profile 3D settings not available - get them from active profile + ReadActiveProfileL(); + } + + // if ringing tone has been set (SetAttr), check its validity + if ( !CheckRingingTone() ) + { + FLOG( _L("### invalid 3D ringing tone ###") ); + FLOG( _L("CRingingTone3DPlugin::InitializeL END") ); + User::Leave(KErrNotFound); + } + + if ( iProfile3DToneEffect == EProfile3DEffectOff ) + { + FLOG( _L("3D ringing tones not enabled") ); + FLOG( _L("CRingingTone3DPlugin::InitializeL END") ); + return; + } + +#ifdef _DEBUG + Check3DPatternL(iProfile3DToneEffect); + Check3DEchoL(iProfile3DToneEcho); +#endif + + +#ifdef __STEREO_WIDENING_EFFECT_UI + if ( iProfile3DToneEffect == EProfile3DEffectStereoWidening ) + { + const TInt KStereoWideningLevel = 50; + + if ( !iStereoWidening ) + { + iStereoWidening = StereoWideningL(); + } + + iStereoWidening->SetStereoWideningLevelL( KStereoWideningLevel ); + iStereoWidening->EnableL(); + + FLOG( _L("CStereoWidening used as 3D effect") ); + FLOG( _L("CRingingTone3DPlugin::InitializeL END") ); + return; + } +#endif + + // + // parse 3D pattern + // + TInt err = KErrNone; + TRAP( err ,iParser->ParseL( iProfile3DToneEffect ) ); + if ( err != KErrNone ) + { + FLOG( _L("### C3DAudioXMLParser::ParseL failed (err=%d, pattern=%d) ###"), err, iProfile3DToneEffect); + User::Leave( err ); + } + + +#ifdef _DEBUG + C3DAudioXMLParser::FlogPubSubL( iProfile3DToneEcho ); +#endif + + iVelocity = iParser->Attribute( C3DAudioXMLParser::EKeyVelocity ); + iDoppler = iParser->Attribute( C3DAudioXMLParser::EKeyDopplerUsed ); + + if ( iProfile3DToneEcho != EProfile3DEchoOff ) + { + TInt err = KErrNone; + + if ( !iReverbEffect ) + { + TRAP( err, iReverbEffect = EnvironmentalReverbUtilityL()); + if ( err != KErrNone ) + { + FLOG( _L("### CEnvironmentalReverbUtility::NewL failed (%d) ###"), err); + User::Leave(err); + } + } + + // Apply the preset. This also enables reverb effect. + TRAP( err, iReverbEffect->ApplyPresetL( iProfile3DToneEcho ) ); + if ( err != KErrNone ) + { + FLOG( _L("### CEnvironmentalReverbUtility::ApplyPresetL failed (%d) ###"), err); + User::Leave(err); + } + } + + + // SourceLocation and ListenerLocation are not created. + if ( !iSource ) + { + iSource = SourceLocationL(); + } + + if ( !iListener ) + { + iListener = ListenerLocationL(); + } + + // Veriable to set the location. + TInt32 zeroInt = 0; + + // Set both locations to (0, 0, 0) and enable them. + iListener->SetLocationCartesianL( zeroInt, zeroInt, zeroInt ); + iListener->EnableL(); + + iSource->SetLocationCartesianL( zeroInt, zeroInt, zeroInt ); + iSource->EnableL(); + + // Doppler is enabled + if ( iDoppler ) + { + // The effect is not created + if ( !iDopplerEffect ) + { + iDopplerEffect = SourceDopplerL(); + } + + TInt maxFactor = iDopplerEffect->FactorMax(); + if ( KDopplerFactor > maxFactor ) + { + iDopplerEffect->SetFactorL( maxFactor ); + FLOG( _L("### CSourceDoppler::SetFactorL: max factor (%d) overflow ###"), maxFactor ); + } + else + { + // Set doppler factor. + iDopplerEffect->SetFactorL( KDopplerFactor ); + } + + // Enable the effect. + iDopplerEffect->EnableL(); + } + + + FLOG( _L("CRingingTone3DPlugin::InitializeL END") ); + } + + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::EnvironmentalReverbUtilityL() +// +// ----------------------------------------------------------------------------- +// +CEnvironmentalReverbUtility* CRingingTone3DPlugin::EnvironmentalReverbUtilityL() + { + CEnvironmentalReverbUtility* ret = NULL; + + switch ( iPlayerType ) + { + case EMdaAudioPlayerUtility: + { + ret = CEnvironmentalReverbUtility::NewL( *iAudioPlayerUtility ); + break; + } + case EMdaAudioToneUtility: + { + ret = CEnvironmentalReverbUtility::NewL( *iAudioToneUtility ); + break; + } + case EDrmPlayerUtility: + { + ret = CEnvironmentalReverbUtility::NewL( *iDrmPlayerUtility ); + break; + } +#ifdef RD_VIDEO_AS_RINGING_TONE + case EVideoPlayerUtility: + { + ret = CEnvironmentalReverbUtility::NewL( *iVideoPlayerUtility ); + break; + } +#endif + default: + { + Panic(KErrArgument); + break; + } + } + + return ret; + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::SourceLocationL() +// +// ----------------------------------------------------------------------------- +// +CSourceLocation* CRingingTone3DPlugin::SourceLocationL() + { + CSourceLocation* ret = NULL; + + switch ( iPlayerType ) + { + case EMdaAudioPlayerUtility: + { + ret = CSourceLocation::NewL( *iAudioPlayerUtility ); + break; + } + case EMdaAudioToneUtility: + { + ret = CSourceLocation::NewL( *iAudioToneUtility ); + break; + } + case EDrmPlayerUtility: + { + ret = CSourceLocation::NewL( *iDrmPlayerUtility ); + break; + } +#ifdef RD_VIDEO_AS_RINGING_TONE + case EVideoPlayerUtility: + { + ret = CSourceLocation::NewL( *iVideoPlayerUtility ); + break; + } +#endif + default: + { + Panic(KErrArgument); + break; + } + } + + return ret; + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::ListenerLocationL() +// +// ----------------------------------------------------------------------------- +// +CListenerLocation* CRingingTone3DPlugin::ListenerLocationL() + { + CListenerLocation* ret = NULL; + + switch ( iPlayerType ) + { + case EMdaAudioPlayerUtility: + { + ret = CListenerLocation::NewL( *iAudioPlayerUtility ); + break; + } + case EMdaAudioToneUtility: + { + ret = CListenerLocation::NewL( *iAudioToneUtility ); + break; + } + case EDrmPlayerUtility: + { + ret = CListenerLocation::NewL( *iDrmPlayerUtility ); + break; + } +#ifdef RD_VIDEO_AS_RINGING_TONE + case EVideoPlayerUtility: + { + ret = CListenerLocation::NewL( *iVideoPlayerUtility ); + break; + } +#endif + default: + { + Panic(KErrArgument); + break; + } + } + + return ret; + } + + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::SourceDopplerL() +// +// ----------------------------------------------------------------------------- +// +CSourceDoppler* CRingingTone3DPlugin::SourceDopplerL() + { + CSourceDoppler* ret = NULL; + + switch ( iPlayerType ) + { + case EMdaAudioPlayerUtility: + { + ret = CSourceDoppler::NewL( *iAudioPlayerUtility ); + break; + } + case EMdaAudioToneUtility: + { + ret = CSourceDoppler::NewL( *iAudioToneUtility ); + break; + } + case EDrmPlayerUtility: + { + ret = CSourceDoppler::NewL( *iDrmPlayerUtility ); + break; + } +#ifdef RD_VIDEO_AS_RINGING_TONE + case EVideoPlayerUtility: + { + ret = CSourceDoppler::NewL( *iVideoPlayerUtility ); + break; + } +#endif + default: + { + Panic(KErrArgument); + break; + } + } + + return ret; + } + + + +#ifdef __STEREO_WIDENING_EFFECT_UI +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::StereoWideningL() +// +// ----------------------------------------------------------------------------- +// +CStereoWidening* CRingingTone3DPlugin::StereoWideningL() + { + CStereoWidening* ret = NULL; + + switch ( iPlayerType ) + { + case EMdaAudioPlayerUtility: + { + ret = CStereoWidening::NewL( *iAudioPlayerUtility ); + break; + } + case EMdaAudioToneUtility: + { + ret = CStereoWidening::NewL( *iAudioToneUtility ); + break; + } + case EDrmPlayerUtility: + { + ret = CStereoWidening::NewL( *iDrmPlayerUtility ); + break; + } + case EVideoPlayerUtility: + { + ret = CStereoWidening::NewL( *iVideoPlayerUtility ); + break; + } + default: + { + Panic(KErrArgument); + break; + } + } + + return ret; + } +#endif + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::PlayRingingTone() +// +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::PlayRingingTone() + { + if ( iPlaying ) + { + return; + } + iPlaying = ETrue; + + switch ( iPlayerType ) + { + case EMdaAudioPlayerUtility: + { + iAudioPlayerUtility->Play(); + break; + } + case EMdaAudioToneUtility: + { + iAudioToneUtility->Play(); + break; + } + case EDrmPlayerUtility: + { + iDrmPlayerUtility->Play(); + break; + } +#ifdef RD_VIDEO_AS_RINGING_TONE + case EVideoPlayerUtility: + { + iVideoPlayerUtility->Play(); + break; + } +#endif + default: + { + break; + } + } + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::StopRingingTone() +// +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::StopRingingTone() + { + if ( !iPlaying ) + { + return; + } + iPlaying = EFalse; + + switch ( iPlayerType ) + { + case EMdaAudioPlayerUtility: + { + iAudioPlayerUtility->Stop(); + break; + } + case EMdaAudioToneUtility: + { + iAudioToneUtility->CancelPlay(); + break; + } + case EDrmPlayerUtility: + { + iDrmPlayerUtility->Stop(); + break; + } +#ifdef RD_VIDEO_AS_RINGING_TONE + case EVideoPlayerUtility: + { + iVideoPlayerUtility->Stop(); + break; + } +#endif + default: + { + Panic(KErrArgument); + break; + } + } + + FLOG( _L("CRingingTone3DPlugin::StopRingingTone: ringing stopped") ); + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::Panic() +// +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::Panic(TInt aReason) + { + _LIT(KPanicCategory,"RingingTone3DAudioPlugin"); + + User::Panic(KPanicCategory, aReason); + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::ReadActiveProfileL() +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::ReadActiveProfileL() + { + MProfileEngine* profileEngine = CreateProfileEngineL(); + CleanupReleasePushL( *profileEngine ); + + MProfile* activeProfile = profileEngine->ActiveProfileL(); + CleanupReleasePushL( *activeProfile ); + +#ifdef _DEBUG + FlogProfileL(activeProfile); +#endif + + //const MProfileTones& profileTones = activeProfile->ProfileTones(); + //iRingingTone = profileTones.RingingTone1(); + + const MProfileExtraSettings& extra = activeProfile->ProfileExtraSettings(); + const MProfile3DToneSettings& threeD = extra.Profile3DToneSettings(); + + iProfile3DToneEffect = threeD.Effect(); + iProfile3DToneEcho = threeD.Echo(); + + CleanupStack::PopAndDestroy(activeProfile); + CleanupStack::PopAndDestroy( profileEngine ); + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::CheckRingingTone() +// ----------------------------------------------------------------------------- +// +TBool CRingingTone3DPlugin::CheckRingingTone() + { + if ( iRingingTone.Length() == 0 ) + { + return ETrue; // nothing to check + } + + TParsePtr fileParser( iRingingTone ); + TPtrC extPtr = fileParser.Ext(); + + // Ringing tone is valid for 3D-playback, i.e not a .rng-tone or "No ringing tone". + // Or the user has set the RingingToneInUse flag to EFalse in CR. + if ( extPtr.Compare( KRngType ) == 0 || iRingingTone.Compare( KNoToneFileName ) == 0 ) + { + return EFalse; + } + + return ETrue; + } + + + +#ifdef _DEBUG + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::Check3DPatternL() +// +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::Check3DPatternL(TInt aPattern) + { + + if ( aPattern != EProfile3DEffectOff && aPattern != EProfile3DEffectCircle && + aPattern != EProfile3DEffectFlyby && aPattern != EProfile3DEffectZigZag && + aPattern != EProfile3DEffectRandomWalk && aPattern != EProfile3DEffectChaos && + aPattern != EProfile3DEffectStereoWidening ) + { + User::Leave(KErrArgument); + } + } + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::Check3DEchoL() +// +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::Check3DEchoL(TInt aEcho) + { + + if ( aEcho != EProfile3DEchoOff && aEcho != EProfile3DEchoLivingRoom && + aEcho != EProfile3DEchoCave && aEcho != EProfile3DEchoStoneCorridor && + aEcho != EProfile3DEchoForest && aEcho != EProfile3DEchoSewerPipe && + aEcho != EProfile3DEchoUnderwater ) + { + User::Leave(KErrArgument); + } + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::FlogRepository() +// +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::FlogRepositoryL(CRepository* aRepository, TInt aEcho) + { + FLOG( _L("------ start repository data ------") ); + + TInt num = 0; + TBuf<128> buf; + + User::LeaveIfError( aRepository->Get( E3DAudioRepositoryPattern, num ) ); + C3DAudioXMLParser::GetPatternString(buf, num); + FLOG( _L("pattern: %S (%d)"), &buf, num ); + + User::LeaveIfError( aRepository->Get( E3DAudioRepositoryReverb, num ) ); + C3DAudioXMLParser::GetEchoString(buf, num); + + C3DAudioXMLParser::GetEchoString(buf, aEcho); + FLOG( _L("echo: %S (%d)"), &buf, aEcho ); + + User::LeaveIfError( aRepository->Get( E3DAudioRepositoryVelocity, num ) ); + FLOG( _L("velocity: %d"), num ); + + User::LeaveIfError( aRepository->Get( E3DAudioRepositoryDoppler, num ) ); + FLOG( _L("doppler: %d"), num ); + + User::LeaveIfError( aRepository->Get( E3DAudioRepositoryBlockCount, num ) ); + FLOG( _L("block count: %d"), num ); + + FLOG( _L("------ end repository data ------") ); + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::FlogProfile() +// +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::FlogProfileL(MProfile* aProfile) + { + FLOG( _L("------ start profile data ------") ); + + TInt num = 0; + TBuf<128> buf; + + const MProfileName& name = aProfile->ProfileName(); + buf = name.Name(); + FLOG( _L("profile name: %S"), &buf ); + + const MProfileTones& profileTones = aProfile->ProfileTones(); + TFileName ringingTone = profileTones.RingingTone1(); + FLOG( _L("ringing tone: %S"), &ringingTone ); + + const MProfileExtraSettings& extra = aProfile->ProfileExtraSettings(); + const MProfile3DToneSettings& threeD = extra.Profile3DToneSettings(); + + num = threeD.Effect(); + C3DAudioXMLParser::GetPatternString(buf, num); + FLOG( _L("pattern: %S (%d)"), &buf, num ); + + num = threeD.Echo(); + C3DAudioXMLParser::GetEchoString(buf, num); + FLOG( _L("echo: %S (%d)"), &buf, num ); + + + FLOG( _L("------ end profile data ------") ); + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::FlogPlayer() +// +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::FlogPlayer(TInt aPlayer) + { + TBuf<128> buf; + + switch ( aPlayer ) + { + case EMdaAudioPlayerUtility: + buf = _L("EMdaAudioPlayerUtility"); + break; + case EMdaAudioToneUtility: + buf = _L("EMdaAudioToneUtility"); + break; + case EDrmPlayerUtility: + buf = _L("EDrmPlayerUtility"); + break; + case EVideoPlayerUtility: + buf = _L("EVideoPlayerUtility"); + break; + + default: + buf = _L("### unknown player ###"); + break; + } + + + FLOG( _L("player type: %S"), &buf ); + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::FlogPositionL() +// +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::FlogPositionL(T3DPosition& aPosition, TInt aIndex) + { + TBuf<128> buf; + TInt x = aPosition.iX; + TInt y = aPosition.iY; + TInt z = aPosition.iZ; + + buf.Format(_L("%d: position x=%d y=%d z=%d"), aIndex, x,y,z); + FLOG(buf); + } + + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::FlogVelocityL() +// +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::FlogVelocityL(T3DVelocity& aVelocity, TInt aIndex) + { + TBuf<128> buf; + + TInt x = aVelocity.iXVector; + TInt y = aVelocity.iYVector; + TInt z = aVelocity.iZVector; + + buf.Format(_L("%d: velocity x=%d y=%d z=%d"), aIndex, x,y,z); + FLOG(buf); + } + +// ----------------------------------------------------------------------------- +// CRingingTone3DPlugin::FlogTimeL() +// +// ----------------------------------------------------------------------------- +// +void CRingingTone3DPlugin::FlogTimeL(TInt aTime, TInt aIndex) + { + TBuf<128> buf; + + buf.Format(_L("%d: time = %d"), aIndex, aTime); + FLOG(buf); + } + +#endif // _DEBUG + + + + + + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/RingingTone3DPlugin/src/CRingingTone3DPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/profilesservices/RingingTone3DPlugin/src/CRingingTone3DPluginImplementationTable.cpp Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation proxy for this plugin. +* +*/ + + +// INCLUDE FILES +#include +#include +#include "CRingingTone3DPlugin.h" + +// Map the interface UIDs to implementation factory functions +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KRingingTone3DAudioEComPluginUID, + CRingingTone3DPlugin::NewL ) + }; + +// Exported proxy for instantiation method resolution +EXPORT_C const TImplementationProxy* ImplementationGroupProxy ( TInt& aTableCount ) + { + aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); + return ImplementationTable; + } + +// End of File diff -r 8ee96d21d9bf -r 7e0eff37aedb profilesservices/group/bld.inf --- a/profilesservices/group/bld.inf Tue Aug 31 15:29:50 2010 +0300 +++ b/profilesservices/group/bld.inf Wed Sep 01 12:20:44 2010 +0100 @@ -23,4 +23,7 @@ //Components: //profilesservices +#include "../FileList/group/bld.inf" +#include "../MediaFileList/group/bld.inf" #include "../ProfileEngine/group/bld.inf" +#include "../RingingTone3DPlugin/group/bld.inf" diff -r 8ee96d21d9bf -r 7e0eff37aedb sysdef_1_4_0.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sysdef_1_4_0.dtd Wed Sep 01 12:20:44 2010 +0100 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 8ee96d21d9bf -r 7e0eff37aedb sysdef_1_5_1.dtd --- a/sysdef_1_5_1.dtd Tue Aug 31 15:29:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -