# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1268984070 -7200 # Node ID e3554c9069b68f2b26435f07b859c5595c7401b8 # Parent 3f8368f032cf6fad53ef09bad3b441d1b50cc8d2 Revision: 201005 Kit: 201011 diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel.pro Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,22 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs +SUBDIRS = src + #tsrc +CONFIG += ordered + +include(rom/cp_rom.pri) \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/controlpanel_plat.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/controlpanel_plat.pri Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,34 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +PLATFORM_HEADERS += $$PWD/cpglobal.h \ + $$PWD/cpplugininterface.h \ + $$PWD/cppluginplatinterface.h \ + $$PWD/cpsettingformitemdata.h \ + $$PWD/cppluginlauncher.h \ + $$PWD/cpbasesettingview.h \ + $$PWD/cpitemdatahelper.h \ + $$PWD/cpsettingformentryitemdata.h \ + $$PWD/cpsettingformentryitemdataimpl.h \ + $$PWD/cppluginloader.h \ + $$PWD/logger.h \ + $$PWD/loggerglobal.h \ + $$PWD/logoutput.h \ + $$PWD/logoutputfactory.h \ + $$PWD/cplogger.h \ + $$PWD/cppluginutility.h + +HEADERS += $$PLATFORM_HEADERS \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/cpbasesettingview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/cpbasesettingview.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef CPBASESETTINGVIEW_H +#define CPBASESETTINGVIEW_H + +#include "cpglobal.h" +#include + +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(); + void setSettingForm(HbDataForm *settingForm); + HbDataForm *settingForm() const; +signals: + void aboutToClose(); +private: + Q_DISABLE_COPY(CpBaseSettingView) + Q_DECLARE_PRIVATE_D(d_ptr, CpBaseSettingView) + Q_PRIVATE_SLOT(d_func(), void _q_softkeyClicked()) + Q_PRIVATE_SLOT(d_func(), void _q_viewChanged(HbView *view)) +private: + CpBaseSettingViewPrivate *d_ptr; +}; + +#endif /* CPBASESETTINGVIEW_H */ diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/cpglobal.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/cpglobal.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CP_GLOBAL_H +#define CP_GLOBAL_H + +#include + +#ifdef BUILD_CP_FRAMEWORK + #define CP_EXPORT Q_DECL_EXPORT +#else + #define CP_EXPORT Q_DECL_IMPORT +#endif + +#endif diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/cpitemdatahelper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/cpitemdatahelper.h Fri Mar 19 09:34:30 2010 +0200 @@ -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: +* +*/ +#ifndef CP_ITEM_DATA_HELPER_H +#define CP_ITEM_DATA_HELPER_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); + +private: + CpItemDataHelperPrivate *d; +}; + +#endif diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/cplogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/cplogger.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef CPLOGGER_H +#define CPLOGGER_H + + +/* + Windows: C:/ControlPanel/debug/bin/controlpanellog.conf + Symbian: C:/data/.config/controlpanellog.conf + + Format: + + [ControlPanel] + logdatetime = 1 + logloggername = 1 + output = debugoutput fileoutput + fileoutput/logfile = C:/data/logs/controlpanel.log + fileoutput/truncate = 0 +*/ + +#include +#include + +#define CPFW_LOGGER_NAME QLatin1String("CpFramework") + +#if defined (Q_OS_SYMBIAN) + #define CP_LOGGER_CONFIG_PATH QLatin1String("C:/data/.config/controlpanellog.conf") +#elif defined (Q_WS_WIN) + #ifdef _DEBUG + #define CP_LOGGER_CONFIG_PATH QLatin1String("C:/controlpanel/debug/bin/controlpanellog.conf") + #else + #define CP_LOGGER_CONFIG_PATH QLatin1String("C:/controlpanel/release/bin/controlpanellog.conf") + #endif +#endif + +#define CPFW_LOG(str) Logger::instance(CPFW_LOGGER_NAME)->log(str); + +#endif /* CPLOGGER_H */ diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/cpplugininterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/cpplugininterface.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CPPLUGININTERFACE_H +#define CPPLUGININTERFACE_H + +#include +#include + +/*! + \class CpPluginInterface + \brief The class CpPluginInterface is an interface for plugins which can be displayed in control panel application. + */ + +class CpSettingFormItemData; +class CpItemDataHelper; + +class CpPluginInterface +{ +public: + /*! + Destructor of CpPluginInterface. + */ + virtual ~CpPluginInterface() + { + } + + /*! + Create a 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 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/cppluginlauncher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/cppluginlauncher.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This class is for loading and display a plugin's view. +* This class may dropped, suggest not using it. If you +* want to use it, pls inform us, or check the wiki +* http://s60wiki.nokia.com/S60Wiki/Team_S60_China_SW/Qt_Control_Panel/FAQ +* +*/ + +#ifndef CPPLUGINLAUNCHER_H +#define CPPLUGINLAUNCHER_H + +#include "cpglobal.h" + +class QString; +class CpPluginPlatInterface; + +class CP_EXPORT CpPluginLauncher +{ +public: + static bool launchCpPluginView(const QString &pluginFile,int index = 0); +}; + +#endif /* CPPLUGINLAUNCHER_H */ diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/cppluginloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/cppluginloader.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CPPLUGINLOADER_H +#define CPPLUGINLOADER_H + +#include +#include + +class QString; +class CpPluginInterface; +class CpPluginPlatInterface; + +class CP_EXPORT CpPluginLoader +{ +public: + static CpPluginInterface *loadCpPlugin(const QString &pluginFile); + static CpPluginPlatInterface *loadPlatCpPlugin(const QString &pluginFile); +}; + +#endif /* CPPLUGINLOADER_H */ diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/cppluginplatinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/cppluginplatinterface.h Fri Mar 19 09:34:30 2010 +0200 @@ -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: +* +*/ + +#ifndef CPPLUGINPLATINTERFACE_H +#define CPPLUGINPLATINTERFACE_H + +#include + +/*! + \class CpPluginPlatInterface + \brief The class CpPluginPlatInterface is an interface for plugins which can be displayed in control panel application. + */ + +class CpSettingFormItemData; +class CpItemDataHelper; + +class CpPluginPlatInterface +{ +public: + /*! + Destructor of CpPluginPlatInterface. + */ + virtual ~CpPluginPlatInterface() + { + } + + /*! + Create a data form mode item, by which the control panel framework can build a data form model. + */ + virtual CpSettingFormItemData *createSettingFormItemData(CpItemDataHelper &itemDataHelper) const = 0; +}; + +Q_DECLARE_INTERFACE(CpPluginPlatInterface, "com.nokia.plugin.controlpanel.platform.interface/1.0"); + +#endif /* CPPLUGINPLATINTERFACE_H */ diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/cppluginutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/cppluginutility.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CP_PLUGINUTILITY_H +#define CP_PLUGINUTILITY_H + +#include +class HbDataForm; + +class CP_EXPORT CpPluginUtility +{ +/*! + This function can add the proto type of setting items (like entry item) + which is supplied by control panel into your dataform's instance + */ +public: + static void addCpItemPrototype(HbDataForm *settingForm); +}; + +#endif diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/cpsettingformentryitemdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/cpsettingformentryitemdata.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CP_SETTINGFORM_ENTRY_ITEM_DATA_H +#define CP_SETTINGFORM_ENTRY_ITEM_DATA_H + +#include +#include +#include +#include + +class CpItemDataHelper; +class CpBaseSettingView; +class HbDataForm; + +class CP_EXPORT CpSettingFormEntryItemData : public CpSettingFormItemData +{ + Q_OBJECT +public: + enum ItemType{ EntryItem = HbDataFormModelItem::CustomItemBase + 1}; + + 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); + + virtual ~CpSettingFormEntryItemData(); + + QString text() const; + void setText(const QString &text); + + QString description() const; + void setDescription(const QString &description); + + HbIcon entryItemIcon() const; + void setEntryItemIcon(const HbIcon &icon); + +private slots: + void onLaunchView(); +private: + virtual CpBaseSettingView *createSettingView() const = 0; + friend class CpPluginLauncher; +}; + +#endif diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/cpsettingformentryitemdataimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/cpsettingformentryitemdataimpl.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CP_SETTINGFORM_ENTRY_ITEM_DATA_IMPL_H +#define CP_SETTINGFORM_ENTRY_ITEM_DATA_IMPL_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) + + { + } + + /*! + Destructor. + */ + virtual ~CpSettingFormEntryItemDataImpl() + { + } + + /*! + Implement CpSettingFormEntryItemData::createSettingView + */ + virtual CpBaseSettingView *createSettingView() const + { + return new PLUGIN_VIEW(); + } +}; + +#endif // CP_SETTINGFORM_ENTRY_ITEM_DATA_IMPL_H diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/cpsettingformitemdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/cpsettingformitemdata.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This class is a control panel defined HbDataFormModelItem, +* +* +*/ +#ifndef CP_SETTING_FORM_ITEM_DATA_H +#define CP_SETTING_FORM_ITEM_DATA_H + +#include +#include +#include +#include + +class QString; +class CpItemDataHelper; + +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(); +}; + + +#endif diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/logger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/logger.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies 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 LOGGER_H +#define LOGGER_H + +#include +#include +#include + +class LogOutput; +class QSettings; +class LoggerPrivate; + +/* + +configuration format: + + [myapplog] + logDateTime = 1 + logLoggerName = 1 + 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; +}; + +#endif //LOGGER_H diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/loggerglobal.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/loggerglobal.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef 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 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/logoutput.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/logoutput.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/controlpanel_plat/inc/logoutputfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/controlpanel_plat/inc/logoutputfactory.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef 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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/example_common.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/example_common.pri Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,81 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: 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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/examples.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/examples.pro Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,21 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs +SUBDIRS = groupplugin/groupplugin.pro viewplugin/viewplugin.pro themeplugin/themeplugin.pro +CONFIG += ordered + +include (rom/rom.pri) \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/examples/groupplugin/groupplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/groupplugin/groupplugin.pri Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,20 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: 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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/groupplugin/groupplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/groupplugin/groupplugin.pro Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,28 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +TARGET = cpgroupplugin + +include (../example_common.pri) +include (groupplugin.pri) + +# Input +symbian: { + TARGET.UID3 = 0x20025FE3 +} + + diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/examples/groupplugin/src/cpgroupplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/groupplugin/src/cpgroupplugin.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/groupplugin/src/cpgroupplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/groupplugin/src/cpgroupplugin.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/groupplugin/src/cpsamplegroup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/groupplugin/src/cpsamplegroup.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/groupplugin/src/cpsamplegroup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/groupplugin/src/cpsamplegroup.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/rom/controlpanel_examples.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/rom/controlpanel_examples.iby Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,23 @@ + +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/rom/rom.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/rom/rom.pri Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,21 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/themeplugin/src/cpthemeplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/themeplugin/src/cpthemeplugin.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/themeplugin/src/cpthemeplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/themeplugin/src/cpthemeplugin.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef 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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/themeplugin/src/cpthemepluginentryitemdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/themeplugin/src/cpthemepluginentryitemdata.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include "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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/themeplugin/src/cpthemepluginentryitemdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/themeplugin/src/cpthemepluginentryitemdata.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/themeplugin/themeplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/themeplugin/themeplugin.pri Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,19 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: cpthemeplugin source files +# + +# Input +HEADERS += src/*.h +SOURCES += src/*.cpp \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/examples/themeplugin/themeplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/themeplugin/themeplugin.pro Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,29 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +TARGET = cpthemeplugin + +CONFIG += hb plugin + +LIBS += -lcpframework + +include ( ../example_common.pri ) +include ( themeplugin.pri ) + +symbian { + TARGET.UID3 = 0X20025FDB +} diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/examples/viewplugin/src/cpsampleview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/viewplugin/src/cpsampleview.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -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: + * + */ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/viewplugin/src/cpsampleview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/viewplugin/src/cpsampleview.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/viewplugin/src/cpviewplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/viewplugin/src/cpviewplugin.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/viewplugin/src/cpviewplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/viewplugin/src/cpviewplugin.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/examples/viewplugin/viewplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/viewplugin/viewplugin.pri Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,23 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +# Input +HEADERS += src/cpviewplugin.h \ + src/cpsampleview.h + +SOURCES += src/cpviewplugin.cpp \ + src/cpsampleview.cpp + diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/examples/viewplugin/viewplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/examples/viewplugin/viewplugin.pro Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,27 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +TARGET = cpviewplugin + +include (../example_common.pri) +include (viewplugin.pri) + +symbian: { + TARGET.UID3 = 0x20025FE2 +} + + diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/rom/controlpanel.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/rom/controlpanel.iby Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __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 + +#endif diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/rom/cp_rom.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/rom/cp_rom.pri Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,21 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +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 3f8368f032cf -r e3554c9069b6 controlpanel/src/bwins/cpframeworku.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/bwins/cpframeworku.def Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,143 @@ +EXPORTS + ?trUtf8@CpItemDataHelper@@SA?AVQString@@PBD0@Z @ 1 NONAME ; class QString CpItemDataHelper::trUtf8(char const *, char const *) + ?log@Logger@@QAEXABVQString@@@Z @ 2 NONAME ; void Logger::log(class QString const &) + ?tr@CpDataFormViewItem@@SA?AVQString@@PBD0@Z @ 3 NONAME ; class QString CpDataFormViewItem::tr(char const *, char const *) + ?disconnectFromForm@CpItemDataHelper@@QAEXPBDPAVQObject@@0@Z @ 4 NONAME ; void CpItemDataHelper::disconnectFromForm(char const *, class QObject *, char const *) + ??1CpSettingFormItemData@@UAE@XZ @ 5 NONAME ; CpSettingFormItemData::~CpSettingFormItemData(void) + ?removeConnection@CpItemDataHelper@@QAEXPAVHbDataFormModelItem@@PBDPAVQObject@@1@Z @ 6 NONAME ; void CpItemDataHelper::removeConnection(class HbDataFormModelItem *, char const *, class QObject *, char const *) + ?staticMetaObject@LogOutput@@2UQMetaObject@@B @ 7 NONAME ; struct QMetaObject const LogOutput::staticMetaObject + ?metaObject@Logger@@UBEPBUQMetaObject@@XZ @ 8 NONAME ; struct QMetaObject const * Logger::metaObject(void) const + ??4CpDataFormViewItem@@IAEAAV0@ABV0@@Z @ 9 NONAME ; class CpDataFormViewItem & CpDataFormViewItem::operator=(class CpDataFormViewItem const &) + ?load@CpDataFormViewItem@@UAEXXZ @ 10 NONAME ; void CpDataFormViewItem::load(void) + ??_ECpDataFormViewItem@@UAE@I@Z @ 11 NONAME ; CpDataFormViewItem::~CpDataFormViewItem(unsigned int) + ??0CpSettingFormEntryItemData@@QAE@AAVCpItemDataHelper@@ABVQString@@1ABVHbIcon@@PBVHbDataFormModelItem@@@Z @ 12 NONAME ; CpSettingFormEntryItemData::CpSettingFormEntryItemData(class CpItemDataHelper &, class QString const &, class QString const &, class HbIcon const &, class HbDataFormModelItem const *) + ?name@Logger@@QBE?AVQString@@XZ @ 13 NONAME ; class QString Logger::name(void) const + ?tr@Logger@@SA?AVQString@@PBD0@Z @ 14 NONAME ; class QString Logger::tr(char const *, char const *) + ??1LogOutput@@UAE@XZ @ 15 NONAME ; LogOutput::~LogOutput(void) + ?bindToForm@CpItemDataHelper@@QAEXPAVHbDataForm@@@Z @ 16 NONAME ; void CpItemDataHelper::bindToForm(class HbDataForm *) + ??_ELogger@@UAE@I@Z @ 17 NONAME ; Logger::~Logger(unsigned int) + ?trUtf8@Logger@@SA?AVQString@@PBD0@Z @ 18 NONAME ; class QString Logger::trUtf8(char const *, char const *) + ?tr@CpSettingFormEntryItemData@@SA?AVQString@@PBD0H@Z @ 19 NONAME ; class QString CpSettingFormEntryItemData::tr(char const *, char const *, int) + ?setName@LogOutput@@QAEXABVQString@@@Z @ 20 NONAME ; void LogOutput::setName(class QString const &) + ?staticMetaObject@CpDataFormViewItem@@2UQMetaObject@@B @ 21 NONAME ; struct QMetaObject const CpDataFormViewItem::staticMetaObject + ?getStaticMetaObject@CpSettingFormItemData@@SAABUQMetaObject@@XZ @ 22 NONAME ; struct QMetaObject const & CpSettingFormItemData::getStaticMetaObject(void) + ?setLogDateTime@Logger@@QAEX_N@Z @ 23 NONAME ; void Logger::setLogDateTime(bool) + ?staticMetaObject@CpBaseSettingView@@2UQMetaObject@@B @ 24 NONAME ; struct QMetaObject const CpBaseSettingView::staticMetaObject + ?metaObject@CpSettingFormEntryItemData@@UBEPBUQMetaObject@@XZ @ 25 NONAME ; struct QMetaObject const * CpSettingFormEntryItemData::metaObject(void) const + ?tr@CpDataFormViewItem@@SA?AVQString@@PBD0H@Z @ 26 NONAME ; class QString CpDataFormViewItem::tr(char const *, char const *, int) + ?trUtf8@CpSettingFormItemData@@SA?AVQString@@PBD0H@Z @ 27 NONAME ; class QString CpSettingFormItemData::trUtf8(char const *, char const *, int) + ??0CpSettingFormEntryItemData@@QAE@PAVHbDataForm@@ABVQString@@1ABVHbIcon@@PBVHbDataFormModelItem@@@Z @ 28 NONAME ; CpSettingFormEntryItemData::CpSettingFormEntryItemData(class HbDataForm *, class QString const &, class QString const &, class HbIcon const &, class HbDataFormModelItem const *) + ?trUtf8@CpSettingFormEntryItemData@@SA?AVQString@@PBD0H@Z @ 29 NONAME ; class QString CpSettingFormEntryItemData::trUtf8(char const *, char const *, int) + ?qt_metacast@CpSettingFormEntryItemData@@UAEPAXPBD@Z @ 30 NONAME ; void * CpSettingFormEntryItemData::qt_metacast(char const *) + ??0Logger@@AAE@ABVQString@@PAVQObject@@@Z @ 31 NONAME ; Logger::Logger(class QString const &, class QObject *) + ??0CpBaseSettingView@@QAE@PAVQGraphicsWidget@@PAVQGraphicsItem@@@Z @ 32 NONAME ; CpBaseSettingView::CpBaseSettingView(class QGraphicsWidget *, class QGraphicsItem *) + ??1CpBaseSettingView@@UAE@XZ @ 33 NONAME ; CpBaseSettingView::~CpBaseSettingView(void) + ?qt_metacall@LogOutput@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 34 NONAME ; int LogOutput::qt_metacall(enum QMetaObject::Call, int, void * *) + ?onLaunchView@CpSettingFormEntryItemData@@AAEXXZ @ 35 NONAME ; void CpSettingFormEntryItemData::onLaunchView(void) + ?addCreateLogOutputEntry@LogOutputFactory@@SAXABVQString@@P6APAVLogOutput@@XZ@Z @ 36 NONAME ; void LogOutputFactory::addCreateLogOutputEntry(class QString const &, class LogOutput * (*)(void)) + ?removeLogOutput@Logger@@QAEXPAVLogOutput@@@Z @ 37 NONAME ; void Logger::removeLogOutput(class LogOutput *) + ?aboutToClose@CpBaseSettingView@@IAEXXZ @ 38 NONAME ; void CpBaseSettingView::aboutToClose(void) + ?connectToForm@CpItemDataHelper@@QAEXPBDPAVQObject@@0@Z @ 39 NONAME ; void CpItemDataHelper::connectToForm(char const *, class QObject *, char const *) + ?d_func@CpBaseSettingView@@ABEPBVCpBaseSettingViewPrivate@@XZ @ 40 NONAME ; class CpBaseSettingViewPrivate const * CpBaseSettingView::d_func(void) const + ?setParentLogger@LogOutput@@QAEXPAVLogger@@@Z @ 41 NONAME ; void LogOutput::setParentLogger(class Logger *) + ?tr@LogOutput@@SA?AVQString@@PBD0@Z @ 42 NONAME ; class QString LogOutput::tr(char const *, char const *) + ?getStaticMetaObject@CpItemDataHelper@@SAABUQMetaObject@@XZ @ 43 NONAME ; struct QMetaObject const & CpItemDataHelper::getStaticMetaObject(void) + ?tr@CpItemDataHelper@@SA?AVQString@@PBD0@Z @ 44 NONAME ; class QString CpItemDataHelper::tr(char const *, char const *) + ?tr@CpBaseSettingView@@SA?AVQString@@PBD0@Z @ 45 NONAME ; class QString CpBaseSettingView::tr(char const *, char const *) + ?addItemPrototype@CpItemDataHelper@@QAEXPAVHbAbstractViewItem@@@Z @ 46 NONAME ; void CpItemDataHelper::addItemPrototype(class HbAbstractViewItem *) + ?tr@LogOutput@@SA?AVQString@@PBD0H@Z @ 47 NONAME ; class QString LogOutput::tr(char const *, char const *, int) + ??_ELogOutput@@UAE@I@Z @ 48 NONAME ; LogOutput::~LogOutput(unsigned int) + ?text@CpSettingFormEntryItemData@@QBE?AVQString@@XZ @ 49 NONAME ; class QString CpSettingFormEntryItemData::text(void) const + ?setDescription@CpSettingFormEntryItemData@@QAEXABVQString@@@Z @ 50 NONAME ; void CpSettingFormEntryItemData::setDescription(class QString const &) + ?metaObject@CpBaseSettingView@@UBEPBUQMetaObject@@XZ @ 51 NONAME ; struct QMetaObject const * CpBaseSettingView::metaObject(void) const + ?qt_metacast@LogOutput@@UAEPAXPBD@Z @ 52 NONAME ; void * LogOutput::qt_metacast(char const *) + ?logLoggerName@Logger@@QBE_NXZ @ 53 NONAME ; bool Logger::logLoggerName(void) const + ?description@CpSettingFormEntryItemData@@QBE?AVQString@@XZ @ 54 NONAME ; class QString CpSettingFormEntryItemData::description(void) const + ??1CpItemDataHelper@@UAE@XZ @ 55 NONAME ; CpItemDataHelper::~CpItemDataHelper(void) + ?metaObject@CpDataFormViewItem@@UBEPBUQMetaObject@@XZ @ 56 NONAME ; struct QMetaObject const * CpDataFormViewItem::metaObject(void) const + ?metaObject@CpItemDataHelper@@UBEPBUQMetaObject@@XZ @ 57 NONAME ; struct QMetaObject const * CpItemDataHelper::metaObject(void) const + ??0CpSettingFormItemData@@QAE@W4DataItemType@HbDataFormModelItem@@ABVQString@@PBV2@@Z @ 58 NONAME ; CpSettingFormItemData::CpSettingFormItemData(enum HbDataFormModelItem::DataItemType, class QString const &, class HbDataFormModelItem const *) + ?staticMetaObject@CpItemDataHelper@@2UQMetaObject@@B @ 59 NONAME ; struct QMetaObject const CpItemDataHelper::staticMetaObject + ?trUtf8@Logger@@SA?AVQString@@PBD0H@Z @ 60 NONAME ; class QString Logger::trUtf8(char const *, char const *, int) + ?dateTimeFormat@Logger@@QBE?AVQString@@XZ @ 61 NONAME ; class QString Logger::dateTimeFormat(void) const + ??1CpDataFormViewItem@@UAE@XZ @ 62 NONAME ; CpDataFormViewItem::~CpDataFormViewItem(void) + ?addLogOutput@Logger@@QAE_NPAVLogOutput@@@Z @ 63 NONAME ; bool Logger::addLogOutput(class LogOutput *) + ?trUtf8@CpItemDataHelper@@SA?AVQString@@PBD0H@Z @ 64 NONAME ; class QString CpItemDataHelper::trUtf8(char const *, char const *, int) + ?parentLogger@LogOutput@@QAEPAVLogger@@XZ @ 65 NONAME ; class Logger * LogOutput::parentLogger(void) + ?trUtf8@CpBaseSettingView@@SA?AVQString@@PBD0H@Z @ 66 NONAME ; class QString CpBaseSettingView::trUtf8(char const *, char const *, int) + ?logOutput@Logger@@QAEPAVLogOutput@@ABVQString@@@Z @ 67 NONAME ; class LogOutput * Logger::logOutput(class QString const &) + ?getStaticMetaObject@LogOutput@@SAABUQMetaObject@@XZ @ 68 NONAME ; struct QMetaObject const & LogOutput::getStaticMetaObject(void) + ?qt_metacast@CpBaseSettingView@@UAEPAXPBD@Z @ 69 NONAME ; void * CpBaseSettingView::qt_metacast(char const *) + ?settingForm@CpBaseSettingView@@QBEPAVHbDataForm@@XZ @ 70 NONAME ; class HbDataForm * CpBaseSettingView::settingForm(void) const + ?qt_metacall@CpBaseSettingView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 71 NONAME ; int CpBaseSettingView::qt_metacall(enum QMetaObject::Call, int, void * *) + ?metaObject@CpSettingFormItemData@@UBEPBUQMetaObject@@XZ @ 72 NONAME ; struct QMetaObject const * CpSettingFormItemData::metaObject(void) const + ?createItem@CpDataFormViewItem@@UAEPAVHbAbstractViewItem@@XZ @ 73 NONAME ; class HbAbstractViewItem * CpDataFormViewItem::createItem(void) + ?qt_metacall@CpSettingFormEntryItemData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 74 NONAME ; int CpSettingFormEntryItemData::qt_metacall(enum QMetaObject::Call, int, void * *) + ??_ECpSettingFormItemData@@UAE@I@Z @ 75 NONAME ; CpSettingFormItemData::~CpSettingFormItemData(unsigned int) + ?tr@CpItemDataHelper@@SA?AVQString@@PBD0H@Z @ 76 NONAME ; class QString CpItemDataHelper::tr(char const *, char const *, int) + ??_ECpItemDataHelper@@UAE@I@Z @ 77 NONAME ; CpItemDataHelper::~CpItemDataHelper(unsigned int) + ?setDateTimeFormat@Logger@@QAEXABVQString@@@Z @ 78 NONAME ; void Logger::setDateTimeFormat(class QString const &) + ??0CpItemDataHelper@@QAE@PAVHbDataForm@@@Z @ 79 NONAME ; CpItemDataHelper::CpItemDataHelper(class HbDataForm *) + ?createCustomWidget@CpDataFormViewItem@@MAEPAVHbWidget@@XZ @ 80 NONAME ; class HbWidget * CpDataFormViewItem::createCustomWidget(void) + ?loadPlatCpPlugin@CpPluginLoader@@SAPAVCpPluginPlatInterface@@ABVQString@@@Z @ 81 NONAME ; class CpPluginPlatInterface * CpPluginLoader::loadPlatCpPlugin(class QString const &) + ?setEntryItemIcon@CpSettingFormEntryItemData@@QAEXABVHbIcon@@@Z @ 82 NONAME ; void CpSettingFormEntryItemData::setEntryItemIcon(class HbIcon const &) + ?trUtf8@CpSettingFormItemData@@SA?AVQString@@PBD0@Z @ 83 NONAME ; class QString CpSettingFormItemData::trUtf8(char const *, char const *) + ?qt_metacast@CpDataFormViewItem@@UAEPAXPBD@Z @ 84 NONAME ; void * CpDataFormViewItem::qt_metacast(char const *) + ?qt_metacall@CpDataFormViewItem@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 85 NONAME ; int CpDataFormViewItem::qt_metacall(enum QMetaObject::Call, int, void * *) + ?trUtf8@CpDataFormViewItem@@SA?AVQString@@PBD0H@Z @ 86 NONAME ; class QString CpDataFormViewItem::trUtf8(char const *, char const *, int) + ??0CpSettingFormItemData@@QAE@PBVHbDataFormModelItem@@@Z @ 87 NONAME ; CpSettingFormItemData::CpSettingFormItemData(class HbDataFormModelItem const *) + ?qt_metacall@Logger@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 88 NONAME ; int Logger::qt_metacall(enum QMetaObject::Call, int, void * *) + ?configure@Logger@@QAEXABVQString@@W4Format@QSettings@@@Z @ 89 NONAME ; void Logger::configure(class QString const &, enum QSettings::Format) + ?tr@CpSettingFormItemData@@SA?AVQString@@PBD0@Z @ 90 NONAME ; class QString CpSettingFormItemData::tr(char const *, char const *) + ?trUtf8@LogOutput@@SA?AVQString@@PBD0@Z @ 91 NONAME ; class QString LogOutput::trUtf8(char const *, char const *) + ?staticMetaObject@CpSettingFormEntryItemData@@2UQMetaObject@@B @ 92 NONAME ; struct QMetaObject const CpSettingFormEntryItemData::staticMetaObject + ?trUtf8@CpBaseSettingView@@SA?AVQString@@PBD0@Z @ 93 NONAME ; class QString CpBaseSettingView::trUtf8(char const *, char const *) + ?addConnection@CpItemDataHelper@@QAEXPAVHbDataFormModelItem@@PBDPAVQObject@@1@Z @ 94 NONAME ; void CpItemDataHelper::addConnection(class HbDataFormModelItem *, char const *, class QObject *, char const *) + ?staticMetaObject@Logger@@2UQMetaObject@@B @ 95 NONAME ; struct QMetaObject const Logger::staticMetaObject + ?setText@CpSettingFormEntryItemData@@QAEXABVQString@@@Z @ 96 NONAME ; void CpSettingFormEntryItemData::setText(class QString const &) + ?qt_metacall@CpItemDataHelper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 97 NONAME ; int CpItemDataHelper::qt_metacall(enum QMetaObject::Call, int, void * *) + ?instance@Logger@@SAPAV1@ABVQString@@@Z @ 98 NONAME ; class Logger * Logger::instance(class QString const &) + ?name@LogOutput@@QBE?AVQString@@XZ @ 99 NONAME ; class QString LogOutput::name(void) const + ?trUtf8@CpDataFormViewItem@@SA?AVQString@@PBD0@Z @ 100 NONAME ; class QString CpDataFormViewItem::trUtf8(char const *, char const *) + ?getStaticMetaObject@Logger@@SAABUQMetaObject@@XZ @ 101 NONAME ; struct QMetaObject const & Logger::getStaticMetaObject(void) + ?tr@CpSettingFormEntryItemData@@SA?AVQString@@PBD0@Z @ 102 NONAME ; class QString CpSettingFormEntryItemData::tr(char const *, char const *) + ??1Logger@@UAE@XZ @ 103 NONAME ; Logger::~Logger(void) + ?qt_metacast@CpSettingFormItemData@@UAEPAXPBD@Z @ 104 NONAME ; void * CpSettingFormItemData::qt_metacast(char const *) + ??0CpSettingFormEntryItemData@@QAE@PBVHbDataFormModelItem@@@Z @ 105 NONAME ; CpSettingFormEntryItemData::CpSettingFormEntryItemData(class HbDataFormModelItem const *) + ?canSetModelIndex@CpDataFormViewItem@@UBE_NABVQModelIndex@@@Z @ 106 NONAME ; bool CpDataFormViewItem::canSetModelIndex(class QModelIndex const &) const + ?closeAll@Logger@@SAXXZ @ 107 NONAME ; void Logger::closeAll(void) + ?clearAllLogOutput@Logger@@QAEXXZ @ 108 NONAME ; void Logger::clearAllLogOutput(void) + ?setSettingForm@CpBaseSettingView@@QAEXPAVHbDataForm@@@Z @ 109 NONAME ; void CpBaseSettingView::setSettingForm(class HbDataForm *) + ??0CpDataFormViewItem@@IAE@ABV0@@Z @ 110 NONAME ; CpDataFormViewItem::CpDataFormViewItem(class CpDataFormViewItem const &) + ?createLogOutput@LogOutputFactory@@SAPAVLogOutput@@ABVQString@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 111 NONAME ; class LogOutput * LogOutputFactory::createLogOutput(class QString const &, class QHash const &) + ?trUtf8@CpSettingFormEntryItemData@@SA?AVQString@@PBD0@Z @ 112 NONAME ; class QString CpSettingFormEntryItemData::trUtf8(char const *, char const *) + ?addCpItemPrototype@CpPluginUtility@@SAXPAVHbDataForm@@@Z @ 113 NONAME ; void CpPluginUtility::addCpItemPrototype(class HbDataForm *) + ?staticMetaObject@CpSettingFormItemData@@2UQMetaObject@@B @ 114 NONAME ; struct QMetaObject const CpSettingFormItemData::staticMetaObject + ?tr@CpBaseSettingView@@SA?AVQString@@PBD0H@Z @ 115 NONAME ; class QString CpBaseSettingView::tr(char const *, char const *, int) + ??1CpSettingFormEntryItemData@@UAE@XZ @ 116 NONAME ; CpSettingFormEntryItemData::~CpSettingFormEntryItemData(void) + ??0CpDataFormViewItem@@QAE@PAVQGraphicsItem@@@Z @ 117 NONAME ; CpDataFormViewItem::CpDataFormViewItem(class QGraphicsItem *) + ?setLogLoggerName@Logger@@QAEX_N@Z @ 118 NONAME ; void Logger::setLogLoggerName(bool) + ?launchCpPluginView@CpPluginLauncher@@SA_NABVQString@@H@Z @ 119 NONAME ; bool CpPluginLauncher::launchCpPluginView(class QString const &, int) + ?qt_metacast@CpItemDataHelper@@UAEPAXPBD@Z @ 120 NONAME ; void * CpItemDataHelper::qt_metacast(char const *) + ?createLogOutput@LogOutputFactory@@SAPAVLogOutput@@ABVQString@@@Z @ 121 NONAME ; class LogOutput * LogOutputFactory::createLogOutput(class QString const &) + ?loadCpPlugin@CpPluginLoader@@SAPAVCpPluginInterface@@ABVQString@@@Z @ 122 NONAME ; class CpPluginInterface * CpPluginLoader::loadCpPlugin(class QString const &) + ??0LogOutput@@IAE@PAVLogger@@@Z @ 123 NONAME ; LogOutput::LogOutput(class Logger *) + ?tr@Logger@@SA?AVQString@@PBD0H@Z @ 124 NONAME ; class QString Logger::tr(char const *, char const *, int) + ??_ECpBaseSettingView@@UAE@I@Z @ 125 NONAME ; CpBaseSettingView::~CpBaseSettingView(unsigned int) + ?close@Logger@@SAXABVQString@@@Z @ 126 NONAME ; void Logger::close(class QString const &) + ?getStaticMetaObject@CpDataFormViewItem@@SAABUQMetaObject@@XZ @ 127 NONAME ; struct QMetaObject const & CpDataFormViewItem::getStaticMetaObject(void) + ?metaObject@LogOutput@@UBEPBUQMetaObject@@XZ @ 128 NONAME ; struct QMetaObject const * LogOutput::metaObject(void) const + ?tr@CpSettingFormItemData@@SA?AVQString@@PBD0H@Z @ 129 NONAME ; class QString CpSettingFormItemData::tr(char const *, char const *, int) + ?trUtf8@LogOutput@@SA?AVQString@@PBD0H@Z @ 130 NONAME ; class QString LogOutput::trUtf8(char const *, char const *, int) + ?getStaticMetaObject@CpSettingFormEntryItemData@@SAABUQMetaObject@@XZ @ 131 NONAME ; struct QMetaObject const & CpSettingFormEntryItemData::getStaticMetaObject(void) + ?qt_metacast@Logger@@UAEPAXPBD@Z @ 132 NONAME ; void * Logger::qt_metacast(char const *) + ?configure@Logger@@QAEXAAVQSettings@@@Z @ 133 NONAME ; void Logger::configure(class QSettings &) + ?logDateTime@Logger@@QBE_NXZ @ 134 NONAME ; bool Logger::logDateTime(void) const + ?d_func@CpBaseSettingView@@AAEPAVCpBaseSettingViewPrivate@@XZ @ 135 NONAME ; class CpBaseSettingViewPrivate * CpBaseSettingView::d_func(void) + ?getStaticMetaObject@CpBaseSettingView@@SAABUQMetaObject@@XZ @ 136 NONAME ; struct QMetaObject const & CpBaseSettingView::getStaticMetaObject(void) + ?entryItemIcon@CpSettingFormEntryItemData@@QBE?AVHbIcon@@XZ @ 137 NONAME ; class HbIcon CpSettingFormEntryItemData::entryItemIcon(void) const + ?qt_metacall@CpSettingFormItemData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 138 NONAME ; int CpSettingFormItemData::qt_metacall(enum QMetaObject::Call, int, void * *) + ??_ECpSettingFormEntryItemData@@UAE@I@Z @ 139 NONAME ; CpSettingFormEntryItemData::~CpSettingFormEntryItemData(unsigned int) + ?widgetFromModelIndex@CpItemDataHelper@@QAEPAVHbWidget@@ABVQModelIndex@@@Z @ 140 NONAME ; class HbWidget * CpItemDataHelper::widgetFromModelIndex(class QModelIndex const &) + ?load@LogOutput@@QAE_NAAVQSettings@@@Z @ 141 NONAME ; bool LogOutput::load(class QSettings &) + diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/common.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/common.pri Fri Mar 19 09:34:30 2010 +0200 @@ -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: 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 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/cpframework.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/cpframework.pri Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,36 @@ + +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: cpframework source files +# + +HEADERS += src/cpbasepath.h \ + src/cpviewlauncher.h \ + src/cpbasesettingview_p.h \ + src/cpwatchdog.h \ + src/cputility.h \ + src/cpdataformviewitem.h + +SOURCES += src/cppluginlauncher.cpp \ + src/cpviewlauncher.cpp \ + src/cppluginloader.cpp \ + src/cpsettingformentryitemdata.cpp \ + src/cpsettingformitemdata.cpp \ + src/cpbasesettingview.cpp \ + src/cpbasesettingview_p.cpp \ + src/cpwatchdog.cpp \ + src/cpdataformviewitem.cpp \ + src/cpitemdatahelper.cpp \ + src/cputility.cpp \ + src/cppluginutility.cpp diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/cpframework.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/cpframework.pro Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,51 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +TARGET = cpframework + +include ( ../common.pri ) +include ( ../logger/logger.pri) +include ( ./cpframework.pri ) +include ( ../../controlpanel_plat/inc/controlpanel_plat.pri ) + +symbian: { + TARGET.UID3 = 0x20025FDA +} + +CONFIG += Hb xml +DEFINES += BUILD_CP_FRAMEWORK BUILD_LOGGER_DLL + +symbian: { + # export headers to mw + EXPORT_PLATFORM_HEADERS += \ + ../../controlpanel_plat/inc/cpglobal.h \ + ../../controlpanel_plat/inc/cpplugininterface.h \ + ../../controlpanel_plat/inc/cppluginplatinterface.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 + + headers.sources = $$EXPORT_PLATFORM_HEADERS + for(header, headers.sources):BLD_INF_RULES.prj_exports += "./$$header $$MW_LAYER_PLATFORM_EXPORT_PATH($$basename(header))" +} +include (../logger/logger_export.pri) + diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cpbasepath.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cpbasepath.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CPBASEPATH_H +#define CPBASEPATH_H + +#ifdef Q_OS_SYMBIAN + #define CP_PLUGIN_PATH QString("/resource/qt/plugins/controlpanel") + #define CP_PLUGIN_CONFIG_PATH QString("/resource/qt/plugins/controlpanel/config") +#else + #ifdef _DEBUG + #define CP_PLUGIN_PATH QString("/ControlPanel/debug/bin") + #define CP_PLUGIN_CONFIG_PATH QString("/ControlPanel/debug/bin/config") + #else + #define CP_PLUGIN_PATH QString("/ControlPanel/release/bin") + #define CP_PLUGIN_CONFIG_PATH QString("/ControlPanel/release/bin/config") + #endif +#endif + +#endif /* CPBASEPATH_H */ diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cpbasesettingview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cpbasesettingview.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies 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 "cpbasesettingview.h" +#include "cpbasesettingview_p.h" +#include +#include "cpitemdatahelper.h" + + +/*! + \class CpBaseSettingView + \brief The CpBaseSettingView is base class for all setting views in control panel application. + This class is responsible for processing some common properties, such as setting view's title, content widget and back key action. + */ + +/*! + 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; +} + +/*! + \deprecated void CpBaseSettingView::setSettingForm(HbDataForm *settingForm) will be deprecated, please + use setWidget(QGraphicsWidget* widget) to instead. + Set the data form for the setting view. + */ +void CpBaseSettingView::setSettingForm(HbDataForm *settingForm) +{ + d_ptr->setSettingForm(settingForm); +} + +/*! + \deprecated HbDataForm *CpBaseSettingView::settingForm() const will be deprecated, please + use widget() const to instead. + Get the data form for the setting view. + */ +HbDataForm *CpBaseSettingView::settingForm() const +{ + return qobject_cast(widget()); +} + +// diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cpbasesettingview_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cpbasesettingview_p.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies 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 "cpbasesettingview_p.h" +#include "cpbasesettingview.h" +#include +#include +#include +#include +#include +#include +#include "cpitemdatahelper.h" +#include "cpdataformviewitem.h" +#include "cpsettingformentryitemdata.h" +#include "cppluginutility.h" + +static HbMainWindow *mainWindow() +{ + QList< HbMainWindow* > mainWindows = hbInstance->allMainWindows(); + if (!mainWindows.isEmpty()) { + return mainWindows.front(); + } + return 0; +} + + +CpBaseSettingViewPrivate::CpBaseSettingViewPrivate() : + mBaseSettingView(0), + mSoftKeyBackAction(0), + //mSettingForm(0), + mIsActiveView(false) +{ +} + +CpBaseSettingViewPrivate::~CpBaseSettingViewPrivate() +{ + clearSoftkey(); + + delete mSoftKeyBackAction; + mSoftKeyBackAction = 0; +} + +void CpBaseSettingViewPrivate::init(QGraphicsWidget *widget,CpBaseSettingView *baseSettingView) +{ + mBaseSettingView = baseSettingView; + + if (!widget) { + widget = new HbDataForm(); + CpPluginUtility::addCpItemPrototype(qobject_cast(widget)); + } + + //setSettingForm(settingForm); + mBaseSettingView->setWidget(widget); + + mBaseSettingView->setTitle("Control Panel"); //give a default title, sub classes need set it correctly + + mSoftKeyBackAction = new HbAction(Hb::BackAction, mBaseSettingView); + QObject::connect(mSoftKeyBackAction, + SIGNAL(triggered()), + mBaseSettingView, + SLOT(_q_softkeyClicked()) ); + + if (mainWindow()) { + QObject::connect(mainWindow(), + SIGNAL(currentViewChanged(HbView *)), + mBaseSettingView, + SLOT(_q_viewChanged(HbView *)) ); + } + + setSoftkey(); +} + +void CpBaseSettingViewPrivate::setSettingForm(HbDataForm *settingForm) +{ + mBaseSettingView->setWidget(settingForm); + CpPluginUtility::addCpItemPrototype(settingForm); +} + +void CpBaseSettingViewPrivate::setSoftkey() +{ + if (mainWindow()) { + mainWindow()->addSoftKeyAction(Hb::SecondarySoftKey, + mSoftKeyBackAction); + } +} + +void CpBaseSettingViewPrivate::clearSoftkey() +{ + if (mainWindow()) + { + mainWindow()->removeSoftKeyAction(Hb::SecondarySoftKey, + mSoftKeyBackAction); + } +} + +void CpBaseSettingViewPrivate::_q_softkeyClicked() +{ + emit mBaseSettingView->aboutToClose(); +} + +void CpBaseSettingViewPrivate::_q_viewChanged(HbView *view) +{ + if (mIsActiveView && view != mBaseSettingView) { + mIsActiveView = false; + clearSoftkey(); + } + else if (!mIsActiveView && mBaseSettingView == view) { + mIsActiveView = true; + setSoftkey(); + } +} + +#include "moc_cpbasesettingview.cpp" + diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cpbasesettingview_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cpbasesettingview_p.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef CPBASESETTINGVIEW_P_H +#define CPBASESETTINGVIEW_P_H + +class QObject; +class QString; +class CpBaseSettingView; +class HbAction; +class HbView; +class HbDataForm; +class QModelIndex; +class HbDataFormModelItem; +class HbAbstractViewItem; +class CpItemDataHelper; +class CpItemDataHelper; +class QGraphicsWidget; + +class CpBaseSettingViewPrivate +{ +public: + CpBaseSettingViewPrivate(); + ~CpBaseSettingViewPrivate(); + /* + initialize + */ + void init(QGraphicsWidget *widget,CpBaseSettingView *baseSettingView); + void setSettingForm(HbDataForm *settingForm); + + /* + softkey + */ + void setSoftkey(); + void clearSoftkey(); + + //SLOTS + void _q_softkeyClicked(); + void _q_viewChanged(HbView *view); +private: + //DATA + CpBaseSettingView *mBaseSettingView; + HbAction *mSoftKeyBackAction; + HbDataForm *mSettingForm; + bool mIsActiveView; + friend class CpBaseSettingView; +}; + +#endif //CPBASESETTINGVIEW_P_H diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cpdataformviewitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cpdataformviewitem.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "cpdataformviewitem.h" +#include +#include +#include +#include +#include +/*! + \class CpDataFormViewItem + \brief The CpDataFormViewItem 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(CpDataFormViewItem::createCpItemProtoType()); + form->setItemPrototypes(); + \endcode +*/ +class CpDataFormViewItemPrivate +{ +public: + CpDataFormViewItemPrivate() : mWidget(0) + { + } + ~CpDataFormViewItemPrivate() + { + } +private: + HbWidget *mWidget; + friend class CpDataFormViewItem; +}; + +/*! + Constructor + */ +CpDataFormViewItem::CpDataFormViewItem(QGraphicsItem *parent) +: HbDataFormViewItem(parent),d_ptr(new CpDataFormViewItemPrivate()) +{ +} + +/*! + Destructor of CpDataFormViewItem + */ +CpDataFormViewItem::~CpDataFormViewItem() +{ + delete d_ptr; +} + +/*! + Creates CpDataFormViewItem. This function is called form HbAbstractItemContainer when model is getting parsed for creating items. + */ +HbAbstractViewItem *CpDataFormViewItem::createItem() +{ + return new CpDataFormViewItem(*this); +} + +/*! + Copy constructor of CpDataFormViewItem + */ +CpDataFormViewItem::CpDataFormViewItem(const CpDataFormViewItem &other) +: HbDataFormViewItem(other), d_ptr(new CpDataFormViewItemPrivate(*other.d_ptr)) +{ + +} + +/*! + Assignment operator + */ +CpDataFormViewItem &CpDataFormViewItem::operator=(const CpDataFormViewItem &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 CpDataFormViewItem. + */ +bool CpDataFormViewItem::canSetModelIndex(const QModelIndex &index) const +{ + int itemTypeId = index.data(HbDataFormModelItem::ItemTypeRole).toInt(); + return (itemTypeId == HbDataFormModelItem::CustomItemBase+1); +} +/*! + Inherit from HbDataFormViewItem, return the setting item's widget of control panel + */ +HbWidget *CpDataFormViewItem::createCustomWidget() +{ + HbDataFormModelItem::DataItemType itemType = static_cast( + modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); + + if (itemType == HbDataFormModelItem::CustomItemBase+1) { + HbPushButton *button = new HbPushButton(QString("Push button")); + d_ptr->mWidget = button; + button->setMinimumHeight(50); + button->setMaximumHeight(60); + button->setOrientation(Qt::Horizontal); + 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 recommanded to call this function mannually. + */ +void CpDataFormViewItem::load() +{ + HbDataFormViewItem::load(); + + if (d_ptr->mWidget) { + HbDataFormModelItem::DataItemType itemType = static_cast( + modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); + + if(itemType == HbDataFormModelItem::CustomItemBase+1) { + + 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())); + } + + } + } + } +} + diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cpdataformviewitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cpdataformviewitem.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef CP_DATAFORMVIEWITEM_H +#define CP_DATAFORMVIEWITEM_H + +#include +#include +class CpDataFormViewItemPrivate; +class CP_EXPORT CpDataFormViewItem : public HbDataFormViewItem +{ + Q_OBJECT +public: + explicit CpDataFormViewItem(QGraphicsItem *parent = 0); + ~CpDataFormViewItem(); + virtual HbAbstractViewItem *createItem(); + virtual bool canSetModelIndex(const QModelIndex &index) const; +public slots: + virtual void load(); +protected: + CpDataFormViewItem(const CpDataFormViewItem &ohter); + CpDataFormViewItem &operator=(const CpDataFormViewItem &ohter); + virtual HbWidget *createCustomWidget(); +private: + CpDataFormViewItemPrivate *d_ptr; + friend class CpDataFormViewItemPrivate; +}; + + +#endif // CP_DATAFORMVIEWITEM_H diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cpitemdatahelper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cpitemdatahelper.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,280 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies 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 "cpitemdatahelper.h" +#include +#include +#include +#include + + +class CpItemDataHelperPrivate +{ +public: + 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 = mDataForm->dataFormViewItem(index); + return viewItem->dataItemContentWidget(); + } + return 0; + } + +public: + HbDataForm *mDataForm; + QList mItemConnections; + QList mFormConnections; + QList mItemPrototypes; +}; + + +/*! + \class CpItemDataHelper + \brief The CpItemDataHelper class is a helper class to help control panel plugins (group plugins) to connect slots to inner widgets of setting items. + 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); +} diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cppluginlauncher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cppluginlauncher.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include +#include +#include +#include "cpitemdatahelper.h" + +/*! + \class CpPluginLauncher + \brief The CpPluginLauncher class loads a controlpanel plugin at run-time.And display the specify plugin view in client process. + */ + +static CpSettingFormEntryItemData *createEntrySettingItem(const QString &pluginFile,int index = 0) +{ + { + CpPluginInterface *plugin = CpPluginLoader().loadCpPlugin(pluginFile); + if (plugin) { + CpItemDataHelper dummy(0); + QList allItemData = plugin->createSettingFormItemData(dummy); + + CpSettingFormItemData *found = 0; + + int size = allItemData.size(); + for (int i = 0; i < size; ++i) { + if (i == index) { + found = allItemData.value(i); + } + else { + delete allItemData.value(i); + } + } + + if (found) { + CpSettingFormEntryItemData *entryItemData = qobject_cast(found); + if (entryItemData) { + return entryItemData; + } + else { + delete found; + } + } + } + } + + + //CpPluginPlatInterface : deprecated! + { + CpPluginPlatInterface *plugin = CpPluginLoader().loadPlatCpPlugin(pluginFile); + if (plugin) { + CpItemDataHelper dummy(0); + CpSettingFormItemData *itemData = plugin->createSettingFormItemData(dummy); + CpSettingFormEntryItemData *entryItemData = qobject_cast(itemData); + if (entryItemData) { + return entryItemData; + } + else { + delete itemData; + } + } + } + + return 0; +} + +/*! + 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 +*/ +bool CpPluginLauncher::launchCpPluginView(const QString &pluginFile,int index /*= 0*/) +{ + QSharedPointer entryItemData(createEntrySettingItem(pluginFile,index)); + if (!entryItemData.isNull()) { + entryItemData->onLaunchView(); + return true; + } + return false; +} + diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cppluginloader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cppluginloader.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include +#include +#include +#include +#include +#include "cpbasepath.h" +#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 + +template +static PLUGIN* loadPlugin(const QString &pluginFile) +{ + QFileInfo fileInfo(pluginFile); + + 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); + if (fileInfo.exists() && QLibrary::isLibrary(fileInfo.absoluteFilePath())) { + break; + } + } + } + + QPluginLoader loader(fileInfo.absoluteFilePath()); + PLUGIN *plugin = qobject_cast (loader.instance()); + if (!plugin) { + loader.unload(); + } + + return plugin; +} + +/*! + load a controlpanel plugin by 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::loadCpPlugin(const QString &pluginFile) +{ + return loadPlugin(pluginFile); +} + + +/*! + \deprecated CpPluginPlatInterface *CpPluginLoader::loadPlatCpPlugin(const QString &) is deprecated. + please use CpPluginInterface to implement controlpanel plugin and use CpPluginLoader::loadCpPlugin(const QString &) to load the plugin. + */ + +CpPluginPlatInterface *CpPluginLoader::loadPlatCpPlugin(const QString &pluginFile) +{ + return loadPlugin(pluginFile); +} + + diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cppluginutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cppluginutility.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "cppluginutility.h" +#include "cpdataformviewitem.h" + +#include +/*! \class CpPluginUtility + \brief This class supply the utility function for the plugin, currently there is only one function. + */ +/*! + This class will add the control panel's proto type of setting items( only entry item currently) to the settingForm. + */ +void CpPluginUtility::addCpItemPrototype(HbDataForm *settingForm) +{ + if (settingForm != NULL) { + QListprototypeList = settingForm->itemPrototypes(); + prototypeList.append(new CpDataFormViewItem()); + settingForm->setItemPrototypes(prototypeList); + } +} diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cpsettingformentryitemdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cpsettingformentryitemdata.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "cpsettingformentryitemdata.h" +#include "cpviewlauncher.h" +#include +#include +#include +#include +#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) +{ +} + + +/*! + 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) +{ + itemDataHelper.addConnection(this,SIGNAL(pressed()),this,SLOT(onLaunchView())); + setType ( static_cast (CpSettingFormEntryItemData::EntryItem) ); + setContentWidgetData(QString("text"),QVariant(text)); + setContentWidgetData(QString("additionalText"),QVariant(description)); + setContentWidgetData(QString("icon"),QVariant(icon)); +} + +/*! + 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) +{ + if (dataForm) { + dataForm->addConnection(this,SIGNAL(pressed()),this,SLOT(onLaunchView())); + } + setType ( static_cast (CpSettingFormEntryItemData::EntryItem) ); + setContentWidgetData(QString("text"),QVariant(text)); + setContentWidgetData(QString("additionalText"),QVariant(description)); + setContentWidgetData(QString("icon"),QVariant(icon)); +} + + +/*! + Destructor. +*/ +CpSettingFormEntryItemData::~CpSettingFormEntryItemData() +{ +} + + +/*! + Get the text string of the entry item. +*/ +QString CpSettingFormEntryItemData::text() const +{ + return contentWidgetData(QString("text")).toString(); +} + +/*! + Set the text string of the entry item. +*/ +void CpSettingFormEntryItemData::setText(const QString &text) +{ + setContentWidgetData(QString("text"),QVariant(text)); +} + +/*! + Get the description string of the entry item. +*/ +QString CpSettingFormEntryItemData::description() const +{ + return contentWidgetData(QString("additionalText")).toString(); +} + +/*! + Set the description string of the entry item. +*/ +void CpSettingFormEntryItemData::setDescription(const QString &description) +{ + setContentWidgetData(QString("additionalText"),QVariant(description)); +} + +/*! + Return the icon of the entry item +*/ +HbIcon CpSettingFormEntryItemData::entryItemIcon()const +{ + return qvariant_cast(contentWidgetData(QString("icon"))); +} + +/*! + Set the icon for the entry item +*/ +void CpSettingFormEntryItemData::setEntryItemIcon(const HbIcon& icon) +{ + setContentWidgetData(QString("icon"),icon); +} + +void CpSettingFormEntryItemData::onLaunchView() +{ + if (CpBaseSettingView *view = createSettingView()) { + CpViewLauncher::launchView(view); + } +} diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cpsettingformitemdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cpsettingformitemdata.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cputility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cputility.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies 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 "cputility.h" +#include +#include +#include +#include "cpbasepath.h" +#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::applicationPluginDirectories() +{ + static QStringList dirs; + if (dirs.empty()) { + CPFW_LOG("ControlPanel application plugin derectories:"); +// dirs = directoriesFromAllDrives(CP_APPLICATION_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 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cputility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cputility.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef 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 application plugin directories of the device + */ + static QStringList applicationPluginDirectories(); + + /* + get all config directories of the device + */ + static QStringList configFileDirectories(); + +}; + +#endif diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cpviewlauncher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cpviewlauncher.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -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: +* +*/ + +#include "cpviewlauncher.h" +#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; + + QObject::connect(mView, SIGNAL(aboutToClose()), this, SLOT(viewDone())); + + mPreView = mainWnd->currentView(); + + // activates the plugin view + mainWnd->addView(mView); + mainWnd->setCurrentView(mView); + } +} + +void CpViewLauncher::viewDone() +{ + HbMainWindow *mainWnd = ::mainWindow(); + if (mainWnd && mView) { + //restore previous status + mainWnd->removeView(mView); + + mView->deleteLater(); + mView = 0; + + mainWnd->setCurrentView(mPreView); + } + + deleteLater(); +} diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cpviewlauncher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cpviewlauncher.h Fri Mar 19 09:34:30 2010 +0200 @@ -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: +* +*/ + +#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 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cpwatchdog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cpwatchdog.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,286 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies 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 3f8368f032cf -r e3554c9069b6 controlpanel/src/cpframework/src/cpwatchdog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/cpframework/src/cpwatchdog.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#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 3f8368f032cf -r e3554c9069b6 controlpanel/src/eabi/cpframeworku.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/eabi/cpframeworku.def Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,153 @@ +EXPORTS + _ZN14CpPluginLoader12loadCpPluginERK7QString @ 1 NONAME + _ZN14CpPluginLoader16loadPlatCpPluginERK7QString @ 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 + _ZN16CpItemDataHelperC1EP10HbDataForm @ 15 NONAME + _ZN16CpItemDataHelperC2EP10HbDataForm @ 16 NONAME + _ZN16CpItemDataHelperD0Ev @ 17 NONAME + _ZN16CpItemDataHelperD1Ev @ 18 NONAME + _ZN16CpItemDataHelperD2Ev @ 19 NONAME + _ZN16CpPluginLauncher18launchCpPluginViewERK7QStringi @ 20 NONAME + _ZN16LogOutputFactory15createLogOutputERK7QString @ 21 NONAME + _ZN16LogOutputFactory15createLogOutputERK7QStringRK5QHashIS0_8QVariantE @ 22 NONAME + _ZN16LogOutputFactory23addCreateLogOutputEntryERK7QStringPFP9LogOutputvE @ 23 NONAME + _ZN17CpBaseSettingView11qt_metacallEN11QMetaObject4CallEiPPv @ 24 NONAME + _ZN17CpBaseSettingView11qt_metacastEPKc @ 25 NONAME + _ZN17CpBaseSettingView12aboutToCloseEv @ 26 NONAME + _ZN17CpBaseSettingView14setSettingFormEP10HbDataForm @ 27 NONAME + _ZN17CpBaseSettingView16staticMetaObjectE @ 28 NONAME DATA 16 + _ZN17CpBaseSettingView19getStaticMetaObjectEv @ 29 NONAME + _ZN17CpBaseSettingViewC1EP15QGraphicsWidgetP13QGraphicsItem @ 30 NONAME + _ZN17CpBaseSettingViewC2EP15QGraphicsWidgetP13QGraphicsItem @ 31 NONAME + _ZN17CpBaseSettingViewD0Ev @ 32 NONAME + _ZN17CpBaseSettingViewD1Ev @ 33 NONAME + _ZN17CpBaseSettingViewD2Ev @ 34 NONAME + _ZN18CpDataFormViewItem10createItemEv @ 35 NONAME + _ZN18CpDataFormViewItem11qt_metacallEN11QMetaObject4CallEiPPv @ 36 NONAME + _ZN18CpDataFormViewItem11qt_metacastEPKc @ 37 NONAME + _ZN18CpDataFormViewItem16staticMetaObjectE @ 38 NONAME DATA 16 + _ZN18CpDataFormViewItem18createCustomWidgetEv @ 39 NONAME + _ZN18CpDataFormViewItem19getStaticMetaObjectEv @ 40 NONAME + _ZN18CpDataFormViewItem4loadEv @ 41 NONAME + _ZN18CpDataFormViewItemC1EP13QGraphicsItem @ 42 NONAME + _ZN18CpDataFormViewItemC1ERKS_ @ 43 NONAME + _ZN18CpDataFormViewItemC2EP13QGraphicsItem @ 44 NONAME + _ZN18CpDataFormViewItemC2ERKS_ @ 45 NONAME + _ZN18CpDataFormViewItemD0Ev @ 46 NONAME + _ZN18CpDataFormViewItemD1Ev @ 47 NONAME + _ZN18CpDataFormViewItemD2Ev @ 48 NONAME + _ZN18CpDataFormViewItemaSERKS_ @ 49 NONAME + _ZN21CpSettingFormItemData11qt_metacallEN11QMetaObject4CallEiPPv @ 50 NONAME + _ZN21CpSettingFormItemData11qt_metacastEPKc @ 51 NONAME + _ZN21CpSettingFormItemData16staticMetaObjectE @ 52 NONAME DATA 16 + _ZN21CpSettingFormItemData19getStaticMetaObjectEv @ 53 NONAME + _ZN21CpSettingFormItemDataC1EN19HbDataFormModelItem12DataItemTypeERK7QStringPKS0_ @ 54 NONAME + _ZN21CpSettingFormItemDataC1EPK19HbDataFormModelItem @ 55 NONAME + _ZN21CpSettingFormItemDataC2EN19HbDataFormModelItem12DataItemTypeERK7QStringPKS0_ @ 56 NONAME + _ZN21CpSettingFormItemDataC2EPK19HbDataFormModelItem @ 57 NONAME + _ZN21CpSettingFormItemDataD0Ev @ 58 NONAME + _ZN21CpSettingFormItemDataD1Ev @ 59 NONAME + _ZN21CpSettingFormItemDataD2Ev @ 60 NONAME + _ZN26CpSettingFormEntryItemData11qt_metacallEN11QMetaObject4CallEiPPv @ 61 NONAME + _ZN26CpSettingFormEntryItemData11qt_metacastEPKc @ 62 NONAME + _ZN26CpSettingFormEntryItemData12onLaunchViewEv @ 63 NONAME + _ZN26CpSettingFormEntryItemData14setDescriptionERK7QString @ 64 NONAME + _ZN26CpSettingFormEntryItemData16setEntryItemIconERK6HbIcon @ 65 NONAME + _ZN26CpSettingFormEntryItemData16staticMetaObjectE @ 66 NONAME DATA 16 + _ZN26CpSettingFormEntryItemData19getStaticMetaObjectEv @ 67 NONAME + _ZN26CpSettingFormEntryItemData7setTextERK7QString @ 68 NONAME + _ZN26CpSettingFormEntryItemDataC2EP10HbDataFormRK7QStringS4_RK6HbIconPK19HbDataFormModelItem @ 69 NONAME + _ZN26CpSettingFormEntryItemDataC2EPK19HbDataFormModelItem @ 70 NONAME + _ZN26CpSettingFormEntryItemDataC2ER16CpItemDataHelperRK7QStringS4_RK6HbIconPK19HbDataFormModelItem @ 71 NONAME + _ZN26CpSettingFormEntryItemDataD0Ev @ 72 NONAME + _ZN26CpSettingFormEntryItemDataD1Ev @ 73 NONAME + _ZN26CpSettingFormEntryItemDataD2Ev @ 74 NONAME + _ZN6Logger11qt_metacallEN11QMetaObject4CallEiPPv @ 75 NONAME + _ZN6Logger11qt_metacastEPKc @ 76 NONAME + _ZN6Logger12addLogOutputEP9LogOutput @ 77 NONAME + _ZN6Logger14setLogDateTimeEb @ 78 NONAME + _ZN6Logger15removeLogOutputEP9LogOutput @ 79 NONAME + _ZN6Logger16setLogLoggerNameEb @ 80 NONAME + _ZN6Logger16staticMetaObjectE @ 81 NONAME DATA 16 + _ZN6Logger17clearAllLogOutputEv @ 82 NONAME + _ZN6Logger17setDateTimeFormatERK7QString @ 83 NONAME + _ZN6Logger19getStaticMetaObjectEv @ 84 NONAME + _ZN6Logger3logERK7QString @ 85 NONAME + _ZN6Logger5closeERK7QString @ 86 NONAME + _ZN6Logger8closeAllEv @ 87 NONAME + _ZN6Logger8instanceERK7QString @ 88 NONAME + _ZN6Logger9configureER9QSettings @ 89 NONAME + _ZN6Logger9configureERK7QStringN9QSettings6FormatE @ 90 NONAME + _ZN6Logger9logOutputERK7QString @ 91 NONAME + _ZN6LoggerC1ERK7QStringP7QObject @ 92 NONAME + _ZN6LoggerC2ERK7QStringP7QObject @ 93 NONAME + _ZN6LoggerD0Ev @ 94 NONAME + _ZN6LoggerD1Ev @ 95 NONAME + _ZN6LoggerD2Ev @ 96 NONAME + _ZN9LogOutput11qt_metacallEN11QMetaObject4CallEiPPv @ 97 NONAME + _ZN9LogOutput11qt_metacastEPKc @ 98 NONAME + _ZN9LogOutput12parentLoggerEv @ 99 NONAME + _ZN9LogOutput15setParentLoggerEP6Logger @ 100 NONAME + _ZN9LogOutput16staticMetaObjectE @ 101 NONAME DATA 16 + _ZN9LogOutput19getStaticMetaObjectEv @ 102 NONAME + _ZN9LogOutput4loadER9QSettings @ 103 NONAME + _ZN9LogOutput7setNameERK7QString @ 104 NONAME + _ZN9LogOutputC2EP6Logger @ 105 NONAME + _ZN9LogOutputD0Ev @ 106 NONAME + _ZN9LogOutputD1Ev @ 107 NONAME + _ZN9LogOutputD2Ev @ 108 NONAME + _ZNK16CpItemDataHelper10metaObjectEv @ 109 NONAME + _ZNK17CpBaseSettingView10metaObjectEv @ 110 NONAME + _ZNK17CpBaseSettingView11settingFormEv @ 111 NONAME + _ZNK18CpDataFormViewItem10metaObjectEv @ 112 NONAME + _ZNK18CpDataFormViewItem16canSetModelIndexERK11QModelIndex @ 113 NONAME + _ZNK21CpSettingFormItemData10metaObjectEv @ 114 NONAME + _ZNK26CpSettingFormEntryItemData10metaObjectEv @ 115 NONAME + _ZNK26CpSettingFormEntryItemData11descriptionEv @ 116 NONAME + _ZNK26CpSettingFormEntryItemData13entryItemIconEv @ 117 NONAME + _ZNK26CpSettingFormEntryItemData4textEv @ 118 NONAME + _ZNK6Logger10metaObjectEv @ 119 NONAME + _ZNK6Logger11logDateTimeEv @ 120 NONAME + _ZNK6Logger13logLoggerNameEv @ 121 NONAME + _ZNK6Logger14dateTimeFormatEv @ 122 NONAME + _ZNK6Logger4nameEv @ 123 NONAME + _ZNK9LogOutput10metaObjectEv @ 124 NONAME + _ZNK9LogOutput4nameEv @ 125 NONAME + _ZTI16CpItemDataHelper @ 126 NONAME + _ZTI17CpBaseSettingView @ 127 NONAME + _ZTI18CpDataFormViewItem @ 128 NONAME + _ZTI21CpSettingFormItemData @ 129 NONAME + _ZTI26CpSettingFormEntryItemData @ 130 NONAME + _ZTI6Logger @ 131 NONAME + _ZTI9LogOutput @ 132 NONAME + _ZTV16CpItemDataHelper @ 133 NONAME + _ZTV17CpBaseSettingView @ 134 NONAME + _ZTV18CpDataFormViewItem @ 135 NONAME + _ZTV21CpSettingFormItemData @ 136 NONAME + _ZTV26CpSettingFormEntryItemData @ 137 NONAME + _ZTV6Logger @ 138 NONAME + _ZTV9LogOutput @ 139 NONAME + _ZThn16_N17CpBaseSettingViewD0Ev @ 140 NONAME + _ZThn16_N17CpBaseSettingViewD1Ev @ 141 NONAME + _ZThn16_N18CpDataFormViewItemD0Ev @ 142 NONAME + _ZThn16_N18CpDataFormViewItemD1Ev @ 143 NONAME + _ZThn8_N17CpBaseSettingViewD0Ev @ 144 NONAME + _ZThn8_N17CpBaseSettingViewD1Ev @ 145 NONAME + _ZThn8_N18CpDataFormViewItemD0Ev @ 146 NONAME + _ZThn8_N18CpDataFormViewItemD1Ev @ 147 NONAME + _ZThn8_N21CpSettingFormItemDataD0Ev @ 148 NONAME + _ZThn8_N21CpSettingFormItemDataD1Ev @ 149 NONAME + _ZThn8_N26CpSettingFormEntryItemDataD0Ev @ 150 NONAME + _ZThn8_N26CpSettingFormEntryItemDataD1Ev @ 151 NONAME + diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/logger/logger.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/logger/logger.pri Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,18 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: controlpanel project - common qmake settings +# + +HEADERS += $$PWD/src/*.h +SOURCES += $$PWD/src/*.cpp diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/src/logger/logger_export.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/logger/logger_export.pri Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,28 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: 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 3f8368f032cf -r e3554c9069b6 controlpanel/src/logger/src/logger.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/logger/src/logger.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,255 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies 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 "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 3f8368f032cf -r e3554c9069b6 controlpanel/src/logger/src/loglogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/logger/src/loglogger.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/src/logger/src/logoutput.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/logger/src/logoutput.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/src/logger/src/logoutputfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/logger/src/logoutputfactory.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/src/logger/src/logoutputimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/logger/src/logoutputimpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,195 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies 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 + +//DebugLogOutput +REGISTER_OUTPUT_LOG(DEBUGOUTPUT_NAME,DebugLogOutput) + +DebugLogOutput::DebugLogOutput() +{ +} + +DebugLogOutput::~DebugLogOutput() +{ +} + +void DebugLogOutput::output(const QString &log) +{ +#ifdef Q_WS_WIN + QT_WA({ + OutputDebugStringW(reinterpret_cast(log.utf16())); + }, { + OutputDebugStringA(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 | QIODevice::Append; + + if (mTruncateFile) { + mode |= QIODevice::Truncate; + } + + 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 3f8368f032cf -r e3554c9069b6 controlpanel/src/logger/src/logoutputimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/logger/src/logoutputimpl.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/src/src.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/src/src.pro Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,19 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs +SUBDIRS = cpframework +CONFIG += ordered \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/tsrc/tsrc.pro Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,26 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs +SUBDIRS = unit/ut_cpplugin \ + unit/ut_cpapi + #unit/ut_profileengwrapper +CONFIG += ordered +test.depends = first +test.CONFIG += recursive +autotest.depends = first +autotest.CONFIG += recursive +QMAKE_EXTRA_TARGETS += test autotest diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/tsrc/unit/ut_cpapi/data/controlpanellog.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/tsrc/unit/ut_cpapi/data/controlpanellog.conf Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,7 @@ +[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 3f8368f032cf -r e3554c9069b6 controlpanel/tsrc/unit/ut_cpapi/runtest.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/tsrc/unit/ut_cpapi/runtest.bat Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,19 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +\epoc32\RELEASE\WINSCW\udeb\ut_cpapi.exe -xml -o c:\ut_cpapi.xml +copy \epoc32\winscw\c\ut_cpapi.xml +del \epoc32\winscw\c\ut_cpapi.xml \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/tsrc/unit/ut_cpapi/src/ut_cpapi.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/tsrc/unit/ut_cpapi/src/ut_cpapi.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,179 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies 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_cpapi.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//testing following classes + +#include "cpbasesettingview.h" +#include "cpsettingformentryitemdata.h" +#include "cpsettingformentryitemdataimpl.h" +#include +#include +#include +#include +#include +#include + +void TestCpAPI::initTestCase() +{ + mainWindow = new HbMainWindow; + mainWindow->show(); +} + +void TestCpAPI::cleanupTestCase() +{ + delete mainWindow; + mainWindow = 0; +} +void TestCpAPI::testCpBaseSettingView() +{ + CpBaseSettingView * pview = new CpBaseSettingView(0); + QVERIFY( pview != 0 ); + HbDataForm *pForm = new HbDataForm(0); + pview->setSettingForm(pForm); + QVERIFY( pview->settingForm() == pForm ); + delete pview; + HbPushButton *widget = new HbPushButton(); + QVERIFY(widget != 0); + CpBaseSettingView *pView1 = new CpBaseSettingView(widget); + QVERIFY(pView1!=0); + HbPushButton *button = qobject_cast(pView1->widget()); + QVERIFY(button != 0); + delete pView1; + +} + +void TestCpAPI::testCpSettingFormEntryItemDataImpl() +{ + CpItemDataHelper *pHelper = new CpItemDataHelper(); + CpSettingFormEntryItemDataImpl *pdataimp = new CpSettingFormEntryItemDataImpl( *pHelper, "text", "description" ); + QVERIFY( pdataimp !=0 ); + QString strtxt = "input texts"; + pdataimp->setText(strtxt); + QVERIFY( pdataimp->text() == strtxt ); + + QString strDes = "input descriptions"; + pdataimp->setDescription(strDes); + QVERIFY( pdataimp->description() == strDes); + delete pdataimp; + delete pHelper; +} +void TestCpAPI::testCpSettingFormItemData() +{ + CpSettingFormItemData *pdata = new CpSettingFormItemData( HbDataFormModelItem::TextItem, "label" ); + QVERIFY( pdata !=0 ); + delete pdata; + pdata = 0; + pdata = new CpSettingFormItemData( HbDataFormModelItem::SliderItem, "label" ); + QVERIFY( pdata !=0 ); + delete pdata; + pdata = 0; + pdata = new CpSettingFormItemData( HbDataFormModelItem::VolumeSliderItem, "label" ); + QVERIFY( pdata !=0 ); + delete pdata; + pdata = new CpSettingFormItemData( HbDataFormModelItem::CheckBoxItem, "label" ); + QVERIFY( pdata !=0 ); + delete pdata; + pdata = 0; + pdata = new CpSettingFormItemData( HbDataFormModelItem::ToggleValueItem, "label" ); + QVERIFY( pdata !=0 ); + delete pdata; + pdata = 0; + pdata = new CpSettingFormItemData( HbDataFormModelItem::RadioButtonListItem, "label" ); + QVERIFY( pdata !=0 ); + delete pdata; + pdata = 0; + pdata = new CpSettingFormItemData( HbDataFormModelItem::MultiselectionItem, "label" ); + QVERIFY( pdata !=0 ); + delete pdata; + pdata = 0; + pdata = new CpSettingFormItemData( HbDataFormModelItem::ComboBoxItem, "label" ); + QVERIFY( pdata !=0 ); + delete pdata; + pdata = 0; +} +void TestCpAPI::testItemDataHelper() +{ + HbDataForm* form = new HbDataForm(); + HbDataFormModel *model = new HbDataFormModel(); + HbDataFormModelItem *general = model->appendDataFormPage(QString("General")); + CpItemDataHelper *phelper = new CpItemDataHelper(); + phelper->addConnection( general, "hello",form,"hello"); + phelper->removeConnection(general,"hello",form, "hello"); + phelper->bindToForm(form); + HbSettingFormItem *pitem = new HbSettingFormItem(); + phelper->addItemPrototype(pitem); + delete phelper; +} +void TestCpAPI::testCpPluginUtility() +{ + HbDataForm* form = new HbDataForm(); + QList oldList = form->itemPrototypes(); + CpPluginUtility::addCpItemPrototype(form); + QList newList = form->itemPrototypes(); + QVERIFY( oldList.count() == newList.count()-1 ); +} + +void TestCpAPI::testCpPluginLoader() +{ + CpPluginInterface *plugin = CpPluginLoader::loadCpPlugin("non_existing_plugin.dll"); + QVERIFY(plugin == 0); + + plugin = CpPluginLoader::loadCpPlugin("cppincodeplugin"); + QVERIFY(plugin != 0); + + plugin = CpPluginLoader::loadCpPlugin("cppincodeplugin.dll"); + QVERIFY(plugin != 0); + + plugin = CpPluginLoader::loadCpPlugin("cppincodeplugin.qtplugin"); + QVERIFY(plugin != 0); +} + +void TestCpAPI::testCpPluginInterface() +{ + CpPluginInterface *plugin = CpPluginLoader::loadCpPlugin("cppersonalizationplugin.dll"); + if (plugin) { + CpItemDataHelper helper; + QList itemData = plugin->createSettingFormItemData(helper); + QVERIFY(itemData.size() > 0); + qDeleteAll(itemData.begin(),itemData.end()); + itemData.clear(); + } +} + +void TestCpAPI::testCpLogger() +{ + const QString logConf = "C:/data/.config/ut_cpapi/controlpanellog.conf"; + Logger::instance(CPFW_LOGGER_NAME)->configure(logConf,QSettings::IniFormat); + CPFW_LOG("Hello World!"); + Logger::closeAll(); +} + + +QTEST_MAIN(TestCpAPI) diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/tsrc/unit/ut_cpapi/src/ut_cpapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/tsrc/unit/ut_cpapi/src/ut_cpapi.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* 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 testCpSettingFormEntryItemDataImpl(); //test CpSettingFormEntryItemDataImpl functions + void testCpSettingFormItemData(); //test CpSettingFormItemData functions + void testItemDataHelper(); //testing item data helper class CpItemDataHelper + void testCpPluginUtility(); + void testCpPluginLoader(); //test cppluginloader functions + void testCpPluginInterface(); // + void testCpLogger(); //test cplogger functions + void cleanupTestCase(); // Finalize test data +private: + HbMainWindow* mainWindow; +}; + +#endif //__UT_CPAPI_H__ diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/tsrc/unit/ut_cpapi/ut_cpapi.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/tsrc/unit/ut_cpapi/ut_cpapi.pro Fri Mar 19 09:34:30 2010 +0200 @@ -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: +# + +TEMPLATE = app +TARGET = ut_cpapi +QT += testlib +CONFIG += hb qtestlib +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 + } +} +QMAKE_EXTRA_TARGETS += test autotest + +DEPENDPATH += . + +INCLUDEPATH += . \ + src/\ + ../../../src/inc \ + ../../../controlpanel_plat/inc + +LIBS += -lcpframework + +# Input +HEADERS += src/ut_cpapi.h +SOURCES += src/ut_cpapi.cpp + +symbian { + BLD_INF_RULES.prj_exports += "data/controlpanellog.conf C:/data/.config/ut_cpapi/controlpanellog.conf" +} \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 controlpanel/tsrc/unit/ut_cpplugin/runtest.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/tsrc/unit/ut_cpplugin/runtest.bat Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,19 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +\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 3f8368f032cf -r e3554c9069b6 controlpanel/tsrc/unit/ut_cpplugin/src/ut_cpplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/tsrc/unit/ut_cpplugin/src/ut_cpplugin.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,176 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/tsrc/unit/ut_cpplugin/src/ut_cpplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/tsrc/unit/ut_cpplugin/src/ut_cpplugin.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef __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 3f8368f032cf -r e3554c9069b6 controlpanel/tsrc/unit/ut_cpplugin/ut_cpplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/tsrc/unit/ut_cpplugin/ut_cpplugin.pro Fri Mar 19 09:34:30 2010 +0200 @@ -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: +# + +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 3f8368f032cf -r e3554c9069b6 controlpanel/tsrc/unit/ut_profileengwrapper/runtest.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/tsrc/unit/ut_profileengwrapper/runtest.bat Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,19 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +\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 3f8368f032cf -r e3554c9069b6 controlpanel/tsrc/unit/ut_profileengwrapper/src/ut_profileengwrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/tsrc/unit/ut_profileengwrapper/src/ut_profileengwrapper.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies 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 3f8368f032cf -r e3554c9069b6 controlpanel/tsrc/unit/ut_profileengwrapper/src/ut_profileengwrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/tsrc/unit/ut_profileengwrapper/src/ut_profileengwrapper.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#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 3f8368f032cf -r e3554c9069b6 controlpanel/tsrc/unit/ut_profileengwrapper/ut_profileengwrapper.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanel/tsrc/unit/ut_profileengwrapper/ut_profileengwrapper.pro Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,42 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +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 3f8368f032cf -r e3554c9069b6 ftuwizardmodel/ftuwizardmodel.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftuwizardmodel/ftuwizardmodel.pro Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,62 @@ +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: 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 3f8368f032cf -r e3554c9069b6 ftuwizardmodel/inc/ftuwizard.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftuwizardmodel/inc/ftuwizard.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,248 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 + +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 menustrip UI component. + */ + QFileInfo mMenustripDefaultIcon; + /** + * The pressed icon to be shown in menustrip UI component. + */ + QFileInfo mMenustripPressedIcon; + /** + * The focussed icon to be shown in menustrip UI component. + */ + QFileInfo mMenustripFocussedIcon; + /** + * The text to be shown in menustrip UI component. + */ + QString mMenustripLabel; + /** + * 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; +} 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. + * @since S60 ?S60_version. + */ + virtual void initializeWizard() = 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); + + /** + * Emit this signal to put the ftu view to full-screen view, i.e. no + * titlebar, infotext & menustrip. + * @param caller The calling wizard plugin instance. + */ + void fullScreenModeRequested(FtuWizard *caller); + + /** + * Emit this signal to come out of fullscreen mode, i.e. show the titlebar, + * infotext and menustrip + * @param caller The calling wizard plugin instance. + */ + void partialScreenModeRequested(FtuWizard *caller); + + /** + * 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); + +}; + +#endif // FTUWIZARD_H + diff -r 3f8368f032cf -r e3554c9069b6 ftuwizardmodel/inc/ftuwizardfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftuwizardmodel/inc/ftuwizardfactory.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: 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 3f8368f032cf -r e3554c9069b6 ftuwizardmodel/inc/ftuwizardmodellib.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftuwizardmodel/inc/ftuwizardmodellib.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: 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 3f8368f032cf -r e3554c9069b6 ftuwizardmodel/rom/ftuwizardmodel.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ftuwizardmodel/rom/ftuwizardmodel.iby Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/filelist_api/filelist_api.metaxml --- a/gsprofilesrv_plat/filelist_api/filelist_api.metaxml Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ - - - FileList API - An UI for the file selection lists. - c++ - profilesservices - - - - - - - - - no - no - - diff -r 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/filelist_api/group/bld.inf --- a/gsprofilesrv_plat/filelist_api/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/filelist_api/inc/CFLDController.h --- a/gsprofilesrv_plat/filelist_api/inc/CFLDController.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,238 +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: -* 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/filelist_api/inc/CFLDFileListContainer.h --- a/gsprofilesrv_plat/filelist_api/inc/CFLDFileListContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,276 +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: -* 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/filelist_api/inc/FileListModel.hrh --- a/gsprofilesrv_plat/filelist_api/inc/FileListModel.hrh Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +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: -* 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/filelist_api/inc/FileListModel.rh --- a/gsprofilesrv_plat/filelist_api/inc/FileListModel.rh Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +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: -* 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/filelist_api/inc/MFLDFileListBoxObserver.h --- a/gsprofilesrv_plat/filelist_api/inc/MFLDFileListBoxObserver.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +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: -* 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/ftuwizardmodel_api/ftuwizardmodel_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/ftuwizardmodel_api/ftuwizardmodel_api.metaxml Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,15 @@ + + + Ftuwizardmodel API + FtuWizard is an interface through which setting wizard plugin can be executed in the FTU fw. + c++ + ftuwizardmodel + + + + + + no + no + + diff -r 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/ftuwizardmodel_api/ftuwizardmodel_api.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/ftuwizardmodel_api/ftuwizardmodel_api.pro Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,27 @@ +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/ftuwizardmodel_api/inc/ftuwizard.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/ftuwizardmodel_api/inc/ftuwizard.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,247 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: FtuWizard class definition +* +*/ + +#ifndef FTUWIZARD_H +#define FTUWIZARD_H + +#include "ftuwizardmodellib.h" + +#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 menustrip UI component. + */ + QFileInfo mMenustripDefaultIcon; + /** + * The pressed icon to be shown in menustrip UI component. + */ + QFileInfo mMenustripPressedIcon; + /** + * The focussed icon to be shown in menustrip UI component. + */ + QFileInfo mMenustripFocussedIcon; + /** + * The text to be shown in menustrip UI component. + */ + QString mMenustripLabel; + /** + * 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; +} 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. + * @since S60 ?S60_version. + */ + virtual void initializeWizard() = 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); + + /** + * Emit this signal to put the ftu view to full-screen view, i.e. no + * titlebar, infotext & menustrip. + * @param caller The calling wizard plugin instance. + */ + void fullScreenModeRequested(FtuWizard *caller); + + /** + * Emit this signal to come out of fullscreen mode, i.e. show the titlebar, + * infotext and menustrip + * @param caller The calling wizard plugin instance. + */ + void partialScreenModeRequested(FtuWizard *caller); + + /** + * 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); + +}; + +#endif // FTUWIZARD_H + diff -r 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/ftuwizardmodel_api/inc/ftuwizardfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/ftuwizardmodel_api/inc/ftuwizardfactory.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/ftuwizardmodel_api/inc/ftuwizardmodellib.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsprofilesrv_plat/ftuwizardmodel_api/inc/ftuwizardmodellib.h Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/group/bld.inf --- a/gsprofilesrv_plat/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ b/gsprofilesrv_plat/group/bld.inf Fri Mar 19 09:34:30 2010 +0200 @@ -23,9 +23,6 @@ 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" diff -r 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/profiles_engine_api/inc/TProfileToneSettings.h --- a/gsprofilesrv_plat/profiles_engine_api/inc/TProfileToneSettings.h Tue Feb 02 00:22:03 2010 +0200 +++ b/gsprofilesrv_plat/profiles_engine_api/inc/TProfileToneSettings.h Fri Mar 19 09:34:30 2010 +0200 @@ -38,7 +38,6 @@ 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/profiles_engine_api/tsrc/group/bld.inf --- a/gsprofilesrv_plat/profiles_engine_api/tsrc/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ b/gsprofilesrv_plat/profiles_engine_api/tsrc/group/bld.inf Fri Mar 19 09:34:30 2010 +0200 @@ -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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/profiles_mediafilelist_api/group/bld.inf --- a/gsprofilesrv_plat/profiles_mediafilelist_api/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/profiles_mediafilelist_api/inc/mediafilelist.h --- a/gsprofilesrv_plat/profiles_mediafilelist_api/inc/mediafilelist.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,187 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/profiles_mediafilelist_api/profiles_mediafilelist_api.metaxml --- a/gsprofilesrv_plat/profiles_mediafilelist_api/profiles_mediafilelist_api.metaxml Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - -MediaFileList API -An UI for the media file selection lists. -c++ -profilesservices - - - - -no -no - - diff -r 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_backgroundimage_api/tsrc/group/bld.inf --- a/gsprofilesrv_plat/settings_backgroundimage_api/tsrc/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /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: -* -*/ - - -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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_backgroundimage_api/tsrc/group/settings_backgroundimage_api.mk --- a/gsprofilesrv_plat/settings_backgroundimage_api/tsrc/group/settings_backgroundimage_api.mk Tue Feb 02 00:22:03 2010 +0200 +++ /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: -# - -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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_framework_api/inc/GSMainView.h --- a/gsprofilesrv_plat/settings_framework_api/inc/GSMainView.h Tue Feb 02 00:22:03 2010 +0200 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSMainView.h Fri Mar 19 09:34:30 2010 +0200 @@ -181,13 +181,6 @@ // UID of the selected plugin in the container's lbx. TUid iSelectedPluginUid; - - //keep the exact position of the listbox including current item index, - //iVerticalOffset and TopItemindex - RArray position; - - //record the screen mode, portrait/landscape - TBool iScreenMode; }; #endif // GSMAINVIEW_H diff -r 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_framework_api/inc/GSParentContainer.h --- a/gsprofilesrv_plat/settings_framework_api/inc/GSParentContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSParentContainer.h Fri Mar 19 09:34:30 2010 +0200 @@ -112,17 +112,6 @@ */ void SetListBoxEmptyTextL(const TDes& aEmpty ); - /** - * @return the exact position of the listbox containing current item index, - * iVerticalOffset and TopItemindex - */ - void GetPositionL(RArray& posArray); - - /** - * set listbox's exact position. - */ - void SetPosition(const RArray& pos, TBool aChangeMode); - public: // From CCoeControl diff -r 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_framework_api/inc/GSParentPlugin.h --- a/gsprofilesrv_plat/settings_framework_api/inc/GSParentPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ b/gsprofilesrv_plat/settings_framework_api/inc/GSParentPlugin.h Fri Mar 19 09:34:30 2010 +0200 @@ -328,13 +328,6 @@ // 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, - //iVerticalOffset and TopItemindex - RArray position; - - //record the screen mode, portrait/landscape - TBool iScreenMode; }; diff -r 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_framework_api/tsrc/group/bld.inf --- a/gsprofilesrv_plat/settings_framework_api/tsrc/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /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: -* -*/ - - -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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_framework_api/tsrc/group/settings_framework_api.mk --- a/gsprofilesrv_plat/settings_framework_api/tsrc/group/settings_framework_api.mk Tue Feb 02 00:22:03 2010 +0200 +++ /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: -# - -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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_launch_api/inc/GSLauncher.h --- a/gsprofilesrv_plat/settings_launch_api/inc/GSLauncher.h Tue Feb 02 00:22:03 2010 +0200 +++ b/gsprofilesrv_plat/settings_launch_api/inc/GSLauncher.h Fri Mar 19 09:34:30 2010 +0200 @@ -23,11 +23,8 @@ #include #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. @@ -86,9 +83,6 @@ CGSLauncher(); void ConstructL(); - -private: // data - CGSLauncherExtension* iExt; }; #endif // C_GSLAUNCHER_H diff -r 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_launch_api/tsrc/group/bld.inf --- a/gsprofilesrv_plat/settings_launch_api/tsrc/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /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: -* -*/ - - -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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_launch_api/tsrc/group/settings_launch_api.mk --- a/gsprofilesrv_plat/settings_launch_api/tsrc/group/settings_launch_api.mk Tue Feb 02 00:22:03 2010 +0200 +++ /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: -# - -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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_listbox_api/tsrc/group/bld.inf --- a/gsprofilesrv_plat/settings_listbox_api/tsrc/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /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: -* -*/ - - -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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_listbox_api/tsrc/group/settings_listbox_api.mk --- a/gsprofilesrv_plat/settings_listbox_api/tsrc/group/settings_listbox_api.mk Tue Feb 02 00:22:03 2010 +0200 +++ /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: -# - -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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/bwins/SettingsPluginApiTestu.def --- a/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/bwins/SettingsPluginApiTestu.def Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &) - diff -r 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/conf/tcSettingsPluginApiTest.cfg --- a/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/conf/tcSettingsPluginApiTest.cfg Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -#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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/conf/ui_SettingsPluginApiTest.cfg --- a/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/conf/ui_SettingsPluginApiTest.cfg Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -#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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/eabi/SettingsPluginApiTestu.def --- a/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/eabi/SettingsPluginApiTestu.def Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -EXPORTS - _Z9LibEntryLR13CTestModuleIf @ 1 NONAME - _ZTI13CTestGSPlugin @ 2 NONAME ; ## - _ZTV13CTestGSPlugin @ 3 NONAME ; ## - diff -r 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.iby --- a/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.mmp --- a/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.pkg --- a/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/SettingsPluginApiTest.pkg Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/bld.inf --- a/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/inc/SettingsPluginApiTest.h --- a/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/inc/SettingsPluginApiTest.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/inc/TestGSPlugin.h --- a/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/inc/TestGSPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /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: -* -*/ -#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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/init/SettingsPluginApiTest.bat --- a/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/init/SettingsPluginApiTest.bat Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +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 - -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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/init/testframework_SettingsPluginApiTest.ini --- a/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/init/testframework_SettingsPluginApiTest.ini Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,181 +0,0 @@ -# -# 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/SettingsPluginApiTest.cpp --- a/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/SettingsPluginApiTest.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,181 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/SettingsPluginApiTestblocks.cpp --- a/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/SettingsPluginApiTestblocks.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,231 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/TestGSPlugin.cpp --- a/gsprofilesrv_plat/settings_plugin_api/tsrc/SettingsPluginApiTest/src/TestGSPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /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: -* -*/ -#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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/Data/GSCommonResources.rss --- a/gssettingsuis/Gs/Data/GSCommonResources.rss Tue Feb 02 00:22:03 2010 +0200 +++ b/gssettingsuis/Gs/Data/GSCommonResources.rss Fri Mar 19 09:34:30 2010 +0200 @@ -99,7 +99,6 @@ { command = EAknSoftkeyOpen; txt = qtn_set_options_open; - flags = EEikMenuItemAction; // action command } }; } @@ -139,7 +138,6 @@ { command = EGSCmdAppChange; txt = qtn_set_options_change; - flags = EEikMenuItemAction; // action command } }; } diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/Data/SoftReject.rss --- a/gssettingsuis/Gs/Data/SoftReject.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,193 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAdminPlugin/GSAdminPlugin.mmp --- a/gssettingsuis/Gs/GSAdminPlugin/GSAdminPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAdminPlugin/bld.inf --- a/gssettingsuis/Gs/GSAdminPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAdminPlugin/clean.cmd --- a/gssettingsuis/Gs/GSAdminPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSAdminPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAdminPlugin/data/10283340.rss --- a/gssettingsuis/Gs/GSAdminPlugin/data/10283340.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAdminPlugin/data/GSAdminPluginRsc.rss --- a/gssettingsuis/Gs/GSAdminPlugin/data/GSAdminPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAdminPlugin/inc/GSAdminPlugin.h --- a/gssettingsuis/Gs/GSAdminPlugin/inc/GSAdminPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAdminPlugin/loc/GSAdminPlugin.loc --- a/gssettingsuis/Gs/GSAdminPlugin/loc/GSAdminPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAdminPlugin/src/GSAdminPlugin.cpp --- a/gssettingsuis/Gs/GSAdminPlugin/src/GSAdminPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,258 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAdminPlugin/src/GSAdminPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSAdminPlugin/src/GSAdminPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSApplication/Data/GSApp.rss --- a/gssettingsuis/Gs/GSApplication/Data/GSApp.rss Tue Feb 02 00:22:03 2010 +0200 +++ b/gssettingsuis/Gs/GSApplication/Data/GSApp.rss Fri Mar 19 09:34:30 2010 +0200 @@ -140,7 +140,6 @@ { command = EAknSoftkeyOpen; txt = qtn_set_options_open; - flags = EEikMenuItemAction; // action command } }; } diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSApplication/Data/GSApp_reg.rss --- a/gssettingsuis/Gs/GSApplication/Data/GSApp_reg.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSApplication/Data/SoftReject.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/Data/SoftReject.rss Fri Mar 19 09:34:30 2010 +0200 @@ -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 \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSApplication/GSApplication.mmp --- a/gssettingsuis/Gs/GSApplication/GSApplication.mmp Tue Feb 02 00:22:03 2010 +0200 +++ b/gssettingsuis/Gs/GSApplication/GSApplication.mmp Fri Mar 19 09:34:30 2010 +0200 @@ -16,31 +16,17 @@ * */ -#include "../Logger/GsLoggingConfiguration.h" #include #include // Default system include paths for middleware layer modules. -APP_LAYER_SYSTEMINCLUDE +MW_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 +TARGETTYPE none // Source files -SOURCEPATH Src -SOURCE GSApp.cpp -SOURCE GSUi.cpp -SOURCE GSMainView.cpp -SOURCE GSMainContainer.cpp -SOURCE GSDocument.cpp SOURCEPATH Data @@ -50,45 +36,15 @@ LANGUAGE_IDS END // GSApp.rss -START RESOURCE GSApp_reg.rss -DEPENDS gsapp.rsg -TARGETPATH /private/10003a3f/apps +START RESOURCE SoftReject.rss +HEADER +TARGETPATH RESOURCE_FILES_DIR 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSApplication/Inc/GSApp.h --- a/gssettingsuis/Gs/GSApplication/Inc/GSApp.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSApplication/Inc/GSDocument.h --- a/gssettingsuis/Gs/GSApplication/Inc/GSDocument.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSApplication/Inc/GSEngineInterface.h --- a/gssettingsuis/Gs/GSApplication/Inc/GSEngineInterface.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSApplication/Inc/GSMainContainer.h --- a/gssettingsuis/Gs/GSApplication/Inc/GSMainContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,190 +0,0 @@ -/* -* 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 - -// CLASS DECLARATION -class CAknViewAppUi; -class CAknSingleLargeStyleListBox; -class CGSPluginInterface; - -/** -* 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); - - /** - * @return the exact position of the listbox containing current item index, - * iVerticalOffset and TopItemindex - */ - void GetPositionL(RArray& posArray); - - /** - * set listbox's exact position. - */ - void SetPosition(const RArray& pos, TBool aChangeMode); - - - 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; -}; - - -#endif // GSCONTAINER_H -// End of File diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSApplication/Inc/GSUi.h --- a/gssettingsuis/Gs/GSApplication/Inc/GSUi.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSApplication/Src/GSApp.cpp --- a/gssettingsuis/Gs/GSApplication/Src/GSApp.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSApplication/Src/GSDocument.cpp --- a/gssettingsuis/Gs/GSApplication/Src/GSDocument.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSApplication/Src/GSMainContainer.cpp --- a/gssettingsuis/Gs/GSApplication/Src/GSMainContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,523 +0,0 @@ -/* -* 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 - -//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() ); - - 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; - } - __GSLOGSTRING( "[CGSMainContainer] ~CGSMainContainer" ); - } - -// --------------------------------------------------------------------------- -// CGSMainContainer::UpdateListbox -// -// Updates listbox from iPluginArray. -// --------------------------------------------------------------------------- -// -void CGSMainContainer::UpdateListBoxL() - { - __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; - } - - 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 ); - } - } - -// ----------------------------------------------------------------------------- -// CGSParentContainer::GetPositionL() -// -//Get the exact position of listbox. -// ----------------------------------------------------------------------------- -// -void CGSMainContainer::GetPositionL(RArray& posArray) - { - posArray.AppendL(iListBox->CurrentItemIndex()); - posArray.AppendL(iListBox->View()->ItemOffsetInPixels()); - posArray.AppendL(iListBox->View()->TopItemIndex()); - return; - } - -// ----------------------------------------------------------------------------- -// CGSParentContainer::GetPositionL() -// -//Get the exact position of listbox. -// ----------------------------------------------------------------------------- -// -void CGSMainContainer::SetPosition(const RArray& pos, TBool aChangeMode) - { - iListBox->SetCurrentItemIndex(pos.operator[](0)); - - if (aChangeMode) - { - iListBox->View()->VerticalMoveToItemL(pos.operator[](0), - CListBoxView::ESingleSelection); - } - else - { - iListBox->View()->SetItemOffsetInPixels(pos.operator[](1)); - iListBox->View()->SetTopItemIndex(pos.operator[](2)); - } - } -// End of File diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSApplication/Src/GSMainView.cpp --- a/gssettingsuis/Gs/GSApplication/Src/GSMainView.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,454 +0,0 @@ -/* -* 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 ); - } - - -// --------------------------------------------------------------------------- -// 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; - User::LeaveIfError( fsSession.Connect() ); - CleanupClosePushL( 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 ); - - CleanupStack::PopAndDestroy( &fsSession ); - } - - -// --------------------------------------------------------------------------- -// 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 (position.Count() > 0) - { - if (iScreenMode == Layout_Meta_Data::IsLandscapeOrientation()) - { - iContainer->SetPosition(position, EFalse); - } - else - { - iContainer->SetPosition(position, 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 ) - { - if (position.Count() > 0) - { - position.Reset(); - } - TRAPD(err, iContainer->GetPositionL(position)); - iScreenMode = 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSApplication/Src/GSUi.cpp --- a/gssettingsuis/Gs/GSApplication/Src/GSUi.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,438 +0,0 @@ -/* -* 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: - GSDocument().WatchDog()->ReportCleanExitL(); - Exit(); - break; - case EAknCmdExit: - GSDocument().WatchDog()->ReportCleanExitL(); - Exit(); - break; - case EAknSoftkeyExit: - GSDocument().WatchDog()->ReportCleanExitL(); - 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 ); - GSDocument().WatchDog()->ReportCleanExitL(); - 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..." ); - TRAP_IGNORE( GSDocument().WatchDog()->ReportCleanExitL() ); - Exit(); - break; - default: - break; - } - - } - - - - -//End of File diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSApplication/bld.inf --- a/gssettingsuis/Gs/GSApplication/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ b/gssettingsuis/Gs/GSApplication/bld.inf Fri Mar 19 09:34:30 2010 +0200 @@ -23,11 +23,12 @@ 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 ) +../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 ) +loc/SoftReject.loc MW_LAYER_LOC_EXPORT_PATH( SoftReject.loc ) PRJ_EXTENSIONS START EXTENSION s60/mifconv diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSApplication/loc/SoftReject.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSApplication/loc/SoftReject.loc Fri Mar 19 09:34:30 2010 +0200 @@ -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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAppsPlugin/GSAppsPlugin.mmp --- a/gssettingsuis/Gs/GSAppsPlugin/GSAppsPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAppsPlugin/bld.inf --- a/gssettingsuis/Gs/GSAppsPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAppsPlugin/clean.cmd --- a/gssettingsuis/Gs/GSAppsPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +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 - -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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAppsPlugin/data/1020723A.rss --- a/gssettingsuis/Gs/GSAppsPlugin/data/1020723A.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAppsPlugin/data/GSAppsPluginRsc.rss --- a/gssettingsuis/Gs/GSAppsPlugin/data/GSAppsPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAppsPlugin/inc/GSAppsPlugin.h --- a/gssettingsuis/Gs/GSAppsPlugin/inc/GSAppsPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAppsPlugin/loc/GSAppsPlugin.loc --- a/gssettingsuis/Gs/GSAppsPlugin/loc/GSAppsPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAppsPlugin/src/GSAppsPlugin.cpp --- a/gssettingsuis/Gs/GSAppsPlugin/src/GSAppsPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,297 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAppsPlugin/src/GSAppsPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSAppsPlugin/src/GSAppsPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Data/200110f0.rss --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Data/200110f0.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Data/GSAutoKeyguardPluginRsc.rss --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Data/GSAutoKeyguardPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,392 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/GSAutoKeyguardPlugin.mmp --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/GSAutoKeyguardPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPlugin.h --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,187 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPlugin.hrh --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPlugin.hrh Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginAutoKeyguardSettingPage.h --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginAutoKeyguardSettingPage.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginAutoKeyguardTimeQuery.h --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginAutoKeyguardTimeQuery.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginContainer.h --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginModel.h --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSAutoKeyguardPluginModel.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSPubSubsListener.h --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/GSPubSubsListener.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/MGSSettingPSObserver.h --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Inc/MGSSettingPSObserver.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPlugin.cpp --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,471 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginAutoKeyguardSettingPage.cpp --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginAutoKeyguardSettingPage.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginAutoKeyguardTimeQuery.cpp --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginAutoKeyguardTimeQuery.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginContainer.cpp --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,297 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginModel.cpp --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSAutoKeyguardPluginModel.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSPubSubsListener.cpp --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/Src/GSPubSubsListener.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/bld.inf --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSAutoKeyguardPlugin/loc/gsautokeyguardplugin.loc --- a/gssettingsuis/Gs/GSAutoKeyguardPlugin/loc/gsautokeyguardplugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSBackgroundImage/GSBackgroundImage.mmp --- a/gssettingsuis/Gs/GSBackgroundImage/GSBackgroundImage.mmp Tue Feb 02 00:22:03 2010 +0200 +++ b/gssettingsuis/Gs/GSBackgroundImage/GSBackgroundImage.mmp Fri Mar 19 09:34:30 2010 +0200 @@ -42,7 +42,7 @@ //System include paths // Default system include paths for middleware layer modules. -APP_LAYER_SYSTEMINCLUDE +MW_LAYER_SYSTEMINCLUDE // Libraries required by framework LIBRARY bafl.lib diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Data/102824A5.rss --- a/gssettingsuis/Gs/GSCallBarringPlugin/Data/102824A5.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Data/GSCallBarringPluginRsc.rss --- a/gssettingsuis/Gs/GSCallBarringPlugin/Data/GSCallBarringPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,610 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/GSCallBarringPlugin.mmp --- a/gssettingsuis/Gs/GSCallBarringPlugin/GSCallBarringPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Inc/CallBarringPlugin.hrh --- a/gssettingsuis/Gs/GSCallBarringPlugin/Inc/CallBarringPlugin.hrh Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCallBarringPlugin.h --- a/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCallBarringPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,206 +0,0 @@ -/* -* 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; - - 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCallBarringPluginContainer.h --- a/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCallBarringPluginContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCellularCallBarringContainer.h --- a/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCellularCallBarringContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCellularCallBarringView.h --- a/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSCellularCallBarringView.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,189 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSInternetBarringContainer.h --- a/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSInternetBarringContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSInternetBarringView.h --- a/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSInternetBarringView.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSLocalBaseView.h --- a/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSLocalBaseView.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSMainBarringContainer.h --- a/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSMainBarringContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSMainBarringView.h --- a/gssettingsuis/Gs/GSCallBarringPlugin/Inc/GSMainBarringView.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Inc/LocalViewIds.h --- a/gssettingsuis/Gs/GSCallBarringPlugin/Inc/LocalViewIds.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPlugin.cpp --- a/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,530 +0,0 @@ -/* -* 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; - } - - // End of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPluginContainer.cpp --- a/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPluginContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCellularCallBarringContainer.cpp --- a/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCellularCallBarringContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCellularCallBarringView.cpp --- a/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCellularCallBarringView.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,575 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Src/GSInternetBarringContainer.cpp --- a/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSInternetBarringContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,262 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Src/GSInternetBarringView.cpp --- a/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSInternetBarringView.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,313 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Src/GSLocalBaseView.cpp --- a/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSLocalBaseView.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,210 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Src/GSMainBarringContainer.cpp --- a/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSMainBarringContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/Src/GSMainBarringView.cpp --- a/gssettingsuis/Gs/GSCallBarringPlugin/Src/GSMainBarringView.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,249 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/bld.inf --- a/gssettingsuis/Gs/GSCallBarringPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/clean.cmd --- a/gssettingsuis/Gs/GSCallBarringPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSCallBarringPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallBarringPlugin/loc/CallBarringPlugin.loc --- a/gssettingsuis/Gs/GSCallBarringPlugin/loc/CallBarringPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,164 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Data/102824A3.rss --- a/gssettingsuis/Gs/GSCallDivertPlugin/Data/102824A3.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Data/GSCallDivertPluginRsc.rss --- a/gssettingsuis/Gs/GSCallDivertPlugin/Data/GSCallDivertPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,559 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/GSCallDivertPlugin.mmp --- a/gssettingsuis/Gs/GSCallDivertPlugin/GSCallDivertPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Inc/CallDivertPlugin.hrh --- a/gssettingsuis/Gs/GSCallDivertPlugin/Inc/CallDivertPlugin.hrh Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertContainer.h --- a/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertModel.h --- a/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertModel.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,224 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertPlugin.h --- a/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,172 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertPluginContainer.h --- a/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertPluginContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertQuery.h --- a/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertQuery.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertView.h --- a/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSCallDivertView.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,365 +0,0 @@ -/* -* 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 ); - - 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSLocalBaseView.h --- a/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSLocalBaseView.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSRestrictedDivertContainer.h --- a/gssettingsuis/Gs/GSCallDivertPlugin/Inc/GSRestrictedDivertContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Inc/LocalViewId.h --- a/gssettingsuis/Gs/GSCallDivertPlugin/Inc/LocalViewId.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertContainer.cpp --- a/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,224 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertModel.cpp --- a/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertModel.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,598 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPlugin.cpp --- a/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,432 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPluginContainer.cpp --- a/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPluginContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -/* -* 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() - { - iListboxItemArray->SetItemVisibilityL( EGSSettIdVideoDivert, - CGSListBoxItemTextArray::EVisible ); - } -//End of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertQuery.cpp --- a/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertQuery.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,222 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertView.cpp --- a/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertView.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1361 +0,0 @@ -/* -* 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" ); - - -// ========================= 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 ) - { - 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; - } - - -// End of File diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Src/GSLocalBaseView.cpp --- a/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSLocalBaseView.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,209 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/Src/GSRestrictedDivertContainer.cpp --- a/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSRestrictedDivertContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/bld.inf --- a/gssettingsuis/Gs/GSCallDivertPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/clean.cmd --- a/gssettingsuis/Gs/GSCallDivertPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSCallDivertPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallDivertPlugin/loc/cf.loc --- a/gssettingsuis/Gs/GSCallDivertPlugin/loc/cf.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,261 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/GSCallPlugin.mmp --- a/gssettingsuis/Gs/GSCallPlugin/GSCallPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/bld.inf --- a/gssettingsuis/Gs/GSCallPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/clean.cmd --- a/gssettingsuis/Gs/GSCallPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSCallPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/data/102824A1.rss --- a/gssettingsuis/Gs/GSCallPlugin/data/102824A1.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/data/GSCallPluginRsc.rss --- a/gssettingsuis/Gs/GSCallPlugin/data/GSCallPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1340 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/data/SoftReject.rss --- a/gssettingsuis/Gs/GSCallPlugin/data/SoftReject.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/inc/GSCallPlugin.h --- a/gssettingsuis/Gs/GSCallPlugin/inc/GSCallPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,479 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/inc/GSCallPlugin.hrh --- a/gssettingsuis/Gs/GSCallPlugin/inc/GSCallPlugin.hrh Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,214 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/inc/GSCallPluginContainer.h --- a/gssettingsuis/Gs/GSCallPlugin/inc/GSCallPluginContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,259 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/inc/GSCallPluginModel.h --- a/gssettingsuis/Gs/GSCallPlugin/inc/GSCallPluginModel.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,297 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/inc/MGsFWMSKLabelObserver.h --- a/gssettingsuis/Gs/GSCallPlugin/inc/MGsFWMSKLabelObserver.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/loc/GSCallPlugin.loc --- a/gssettingsuis/Gs/GSCallPlugin/loc/GSCallPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,514 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/loc/SoftReject.loc --- a/gssettingsuis/Gs/GSCallPlugin/loc/SoftReject.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/src/GSCallPlugin.cpp --- a/gssettingsuis/Gs/GSCallPlugin/src/GSCallPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2177 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginContainer.cpp --- a/gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1064 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginModel.cpp --- a/gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginModel.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,758 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSConPlugin/GSConPlugin.mmp --- a/gssettingsuis/Gs/GSConPlugin/GSConPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSConPlugin/bld.inf --- a/gssettingsuis/Gs/GSConPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSConPlugin/clean.cmd --- a/gssettingsuis/Gs/GSConPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSConPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSConPlugin/data/10207251.rss --- a/gssettingsuis/Gs/GSConPlugin/data/10207251.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSConPlugin/data/GSConPluginRsc.rss --- a/gssettingsuis/Gs/GSConPlugin/data/GSConPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSConPlugin/inc/GSConPlugin.h --- a/gssettingsuis/Gs/GSConPlugin/inc/GSConPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSConPlugin/loc/GSConPlugin.loc --- a/gssettingsuis/Gs/GSConPlugin/loc/GSConPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSConPlugin/src/GSConPlugin.cpp --- a/gssettingsuis/Gs/GSConPlugin/src/GSConPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,286 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSConPlugin/src/GSConPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSConPlugin/src/GSConPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDataCallPlugin/Data/10207437.rss --- a/gssettingsuis/Gs/GSDataCallPlugin/Data/10207437.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDataCallPlugin/Data/GsDataCallPluginRsc.rss --- a/gssettingsuis/Gs/GSDataCallPlugin/Data/GsDataCallPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,239 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDataCallPlugin/GSDataCallPlugin.mmp --- a/gssettingsuis/Gs/GSDataCallPlugin/GSDataCallPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPlugin.h --- a/gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPluginContainer.h --- a/gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPluginContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPluginModel.h --- a/gssettingsuis/Gs/GSDataCallPlugin/Inc/GSDataCallPluginModel.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDataCallPlugin/Inc/GsDataCallPlugin.hrh --- a/gssettingsuis/Gs/GSDataCallPlugin/Inc/GsDataCallPlugin.hrh Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPlugin.cpp --- a/gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,483 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginContainer.cpp --- a/gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,191 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginModel.cpp --- a/gssettingsuis/Gs/GSDataCallPlugin/Src/GSDataCallPluginModel.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,188 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDataCallPlugin/bld.inf --- a/gssettingsuis/Gs/GSDataCallPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDataCallPlugin/clean.cmd --- a/gssettingsuis/Gs/GSDataCallPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSDataCallPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDataCallPlugin/loc/GSDataCallPlugin.loc --- a/gssettingsuis/Gs/GSDataCallPlugin/loc/GSDataCallPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDeviceManagementPlugin/GSDeviceManagementPlugin.mmp --- a/gssettingsuis/Gs/GSDeviceManagementPlugin/GSDeviceManagementPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDeviceManagementPlugin/bld.inf --- a/gssettingsuis/Gs/GSDeviceManagementPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDeviceManagementPlugin/clean.cmd --- a/gssettingsuis/Gs/GSDeviceManagementPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSDeviceManagementPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDeviceManagementPlugin/data/10283316.rss --- a/gssettingsuis/Gs/GSDeviceManagementPlugin/data/10283316.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDeviceManagementPlugin/data/GSDeviceManagementPluginRsc.rss --- a/gssettingsuis/Gs/GSDeviceManagementPlugin/data/GSDeviceManagementPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDeviceManagementPlugin/inc/GSDeviceManagementPlugin.h --- a/gssettingsuis/Gs/GSDeviceManagementPlugin/inc/GSDeviceManagementPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDeviceManagementPlugin/loc/GSDeviceManagementPlugin.loc --- a/gssettingsuis/Gs/GSDeviceManagementPlugin/loc/GSDeviceManagementPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDeviceManagementPlugin/src/GSDeviceManagementPlugin.cpp --- a/gssettingsuis/Gs/GSDeviceManagementPlugin/src/GSDeviceManagementPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,247 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDeviceManagementPlugin/src/GSDeviceManagementPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSDeviceManagementPlugin/src/GSDeviceManagementPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDiagnosticsPlugin/GSDiagnosticsPlugin.mmp --- a/gssettingsuis/Gs/GSDiagnosticsPlugin/GSDiagnosticsPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDiagnosticsPlugin/bld.inf --- a/gssettingsuis/Gs/GSDiagnosticsPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDiagnosticsPlugin/clean.cmd --- a/gssettingsuis/Gs/GSDiagnosticsPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSDiagnosticsPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDiagnosticsPlugin/data/102750D3.rss --- a/gssettingsuis/Gs/GSDiagnosticsPlugin/data/102750D3.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDiagnosticsPlugin/data/GSDiagnosticsPluginRsc.rss --- a/gssettingsuis/Gs/GSDiagnosticsPlugin/data/GSDiagnosticsPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDiagnosticsPlugin/inc/GSDiagnosticsPlugin.h --- a/gssettingsuis/Gs/GSDiagnosticsPlugin/inc/GSDiagnosticsPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDiagnosticsPlugin/inc/GSDiagnosticsPlugin.loc --- a/gssettingsuis/Gs/GSDiagnosticsPlugin/inc/GSDiagnosticsPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDiagnosticsPlugin/src/GSDiagnosticsPlugin.cpp --- a/gssettingsuis/Gs/GSDiagnosticsPlugin/src/GSDiagnosticsPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,337 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDiagnosticsPlugin/src/GSDiagnosticsPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSDiagnosticsPlugin/src/GSDiagnosticsPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/Data/10207440.rss --- a/gssettingsuis/Gs/GSDisplayPlugin/Data/10207440.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/Data/2000B591.xml --- a/gssettingsuis/Gs/GSDisplayPlugin/Data/2000B591.xml Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/Data/GsDisplayPluginRsc.rss --- a/gssettingsuis/Gs/GSDisplayPlugin/Data/GsDisplayPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,766 +0,0 @@ -/* -* 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 r_ambient_light_sensor_slider - { - 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 r_setting_screen_saver_slider - { - layout = EAknSettingsItemSliderLayout; - minvalue = 5; - maxvalue = 90; - step = 5; - 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; - } - -//---------------------------------------------------- -// -// 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 r_setting_backlight_slider - { - 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/GSDisplayPlugin.mmp --- a/gssettingsuis/Gs/GSDisplayPlugin/GSDisplayPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPlugin.h --- a/gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,335 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginAO.h --- a/gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginAO.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginContainer.h --- a/gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,167 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginModel.h --- a/gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPluginModel.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,357 +0,0 @@ -/* -* 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 ScreenSaverPeriodL(); - - /** - * 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 SetScreenSaverPeriodL( 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* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/Inc/GsDisplayPlugin.hrh --- a/gssettingsuis/Gs/GSDisplayPlugin/Inc/GsDisplayPlugin.hrh Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/Inc/PSMDisplayPlugin.h --- a/gssettingsuis/Gs/GSDisplayPlugin/Inc/PSMDisplayPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPlugin.cpp --- a/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1339 +0,0 @@ -/* -* 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() == EPsmsrvModeNormal ) - { -#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() == EPsmsrvModeNormal ) - { -#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() == EPsmsrvModeNormal ) - { -#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->ScreenSaverPeriodL(); - - 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->SetScreenSaverPeriodL( 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 ) - { - 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginAO.cpp --- a/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginAO.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginContainer.cpp --- a/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,701 +0,0 @@ -/* -* 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->ScreenSaverPeriodL(); - 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginModel.cpp --- a/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginModel.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,797 +0,0 @@ -/* -* 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 ); - 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; - } - } - - -// ---------------------------------------------------------------------------- -// 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::ScreenSaverPeriodL -// -// Reads screen saver period from shared data and returns it. -// ---------------------------------------------------------------------------- -// -TInt CGSDisplayPluginModel::ScreenSaverPeriodL() - { - TInt period = KGSSettingOff; - User::LeaveIfError( iPersonalizationRepository-> - Get( KSettingsScreenSaverPeriod, period ) ); - - return period; - } - -// ---------------------------------------------------------------------------- -// CGSDisplayPluginModel::SetScreenSaverPeriodL -// -// Writes screen saver text to shared data. -// ---------------------------------------------------------------------------- -// -void CGSDisplayPluginModel::SetScreenSaverPeriodL( const TInt aPeriod ) - { - User::LeaveIfError( iPersonalizationRepository-> - Set( KSettingsScreenSaverPeriod, aPeriod ) ); - } - - -// ---------------------------------------------------------------------------- -// 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/Src/PSMDisplayPlugin.cpp --- a/gssettingsuis/Gs/GSDisplayPlugin/Src/PSMDisplayPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,218 +0,0 @@ -/* -* 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->ScreenSaverPeriodL(); - 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->SetScreenSaverPeriodL( 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/bld.inf --- a/gssettingsuis/Gs/GSDisplayPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/clean.cmd --- a/gssettingsuis/Gs/GSDisplayPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSDisplayPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSDisplayPlugin/loc/GsDisplPlugin.loc --- a/gssettingsuis/Gs/GSDisplayPlugin/loc/GsDisplPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,403 +0,0 @@ -/* -* 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 saver 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 seconds" - - -//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 "5 secs." - -//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 "90 secs." - - -// ************************************ - -// **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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSFramework/GSFWIcons.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gssettingsuis/Gs/GSFramework/GSFWIcons.mk Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,72 @@ +# +# 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: +# + +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)\gsfwicon.mif +HEADERFILENAME=$(HEADERDIR)\gsfwicon.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_prop_set_default_sub.bmp \ + /c8,1 qgn_prop_set_device_tab4.bmp + + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(HEADERFILENAME)&& \ + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSFramework/GSFramework.mmp --- a/gssettingsuis/Gs/GSFramework/GSFramework.mmp Tue Feb 02 00:22:03 2010 +0200 +++ b/gssettingsuis/Gs/GSFramework/GSFramework.mmp Fri Mar 19 09:34:30 2010 +0200 @@ -51,7 +51,7 @@ // System include paths -APP_LAYER_SYSTEMINCLUDE +MW_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include/ecom // Parent plugin resources @@ -91,12 +91,12 @@ 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 ../GSFWIcons.mk DOCUMENT GSFrameworkRsc.rss DOCUMENT GSParentPluginRsc.rss diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSFramework/src/GSBaseView.cpp --- a/gssettingsuis/Gs/GSFramework/src/GSBaseView.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/gssettingsuis/Gs/GSFramework/src/GSBaseView.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -105,7 +105,7 @@ switch ( aEventType ) { case EEventEnterKeyPressed: - case EEventItemSingleClicked: + case EEventItemDoubleClicked: HandleListBoxSelectionL(); break; default: diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSFramework/src/GSParentContainer.cpp --- a/gssettingsuis/Gs/GSFramework/src/GSParentContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/gssettingsuis/Gs/GSFramework/src/GSParentContainer.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -522,7 +522,7 @@ switch (aEventType) { case EEventEnterKeyPressed: - case EEventItemSingleClicked: + case EEventItemDoubleClicked: { __GSLOGSTRING1( "[CGSParentContainer] Activating view plugin in index[%d]", @@ -833,37 +833,4 @@ } } -// ----------------------------------------------------------------------------- -// CGSParentContainer::GetPositionL() -// -//Get the exact position of listbox. -// ----------------------------------------------------------------------------- -// -void CGSParentContainer::GetPositionL(RArray& posArray) - { - posArray.AppendL(iListBox->CurrentItemIndex()); - posArray.AppendL(iListBox->View()->ItemOffsetInPixels()); - posArray.AppendL(iListBox->View()->TopItemIndex()); - return; - } - -// ----------------------------------------------------------------------------- -// CGSParentContainer::GetPositionL() -// -//Get the exact position of listbox. -// ----------------------------------------------------------------------------- -// -void CGSParentContainer::SetPosition(const RArray& pos, TBool aChangeMode) - { - iListBox->SetCurrentItemIndex(pos.operator[](0)); - iListBox->View()->SetItemOffsetInPixels(pos.operator[](1)); - if (aChangeMode) - { - iListBox->View()->VerticalMoveToItemL(pos.operator[](0), CListBoxView::ESingleSelection); - } - else - { - iListBox->View()->SetTopItemIndex(pos.operator[](2)); - } - } //End of File diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSFramework/src/GSParentPlugin.cpp --- a/gssettingsuis/Gs/GSFramework/src/GSParentPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/gssettingsuis/Gs/GSFramework/src/GSParentPlugin.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -35,9 +35,8 @@ #include #include #include -#include #include -#include + // Middle Softkey control ID. const TInt KGSMSKControlID = 3; const TInt KGSMSKLength = 256; @@ -214,18 +213,17 @@ // Update listbox from already existing iPluginArray: iContainer->UpdateListBoxL(); - if (position.Count() > 0) - { - if (iScreenMode == Layout_Meta_Data::IsLandscapeOrientation()) - { - iContainer->SetPosition(position, EFalse); - } - else - { - iContainer->SetPosition(position, ETrue); - } - } - iAppUi->AddToViewStackL(*this, iContainer); + iAppUi->AddToViewStackL( *this, iContainer ); + if( iTopPluginUid != KGSNoneSelected ) + { + iContainer->SetTopItem( iTopPluginUid ); + } + if( iSelectedPluginUid != KGSNoneSelected ) + { + iContainer->SetSelectedItem( iSelectedPluginUid ); + } + } + // Navigating to parent view will reset all child plugin selected indexes: for( TInt i = 0; i < iPluginArray->Count(); i++ ) { @@ -238,21 +236,19 @@ SetMiddleSoftKeyLabelL( R_QTN_MSK_OPEN, EAknSoftkeyOpen ); CheckMiddleSoftkeyLabelL(); - // If this view was launched from external source, use "exit" as RSK - if (iPrevViewId.iAppUid != KUidGS) + // If this view was launched from external source, use "exit" as RSK + if ( iPrevViewId.iAppUid != KUidGS ) + { + CEikButtonGroupContainer* cbaGroup = Cba(); + if(cbaGroup) { - 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); - } + HBufC* rightSKText = StringLoader::LoadLC (R_GS_PARENTPLUGIN_CBA_EXIT); + TPtr rskPtr = rightSKText->Des(); + cbaGroup->SetCommandL(2,EAknSoftkeyExit,*rightSKText); + CleanupStack::PopAndDestroy(rightSKText); } + } - } } // --------------------------------------------------------------------------- @@ -268,14 +264,26 @@ if ( iContainer ) { - if (position.Count() > 0) - { - position.Reset(); - } - TRAPD(err, iContainer->GetPositionL(position)); - iScreenMode = Layout_Meta_Data::IsLandscapeOrientation(); + CGSPluginInterface* selectedPlugin = iContainer->SelectedPlugin(); + if( selectedPlugin ) + { + iSelectedPluginUid = selectedPlugin->Id(); + } + else + { + iSelectedPluginUid = KGSNoneSelected; + } - iAppUi->RemoveFromViewStack(*this, iContainer); + CGSPluginInterface* topPlugin = iContainer->TopPlugin(); + if ( topPlugin ) + { + iTopPluginUid = topPlugin->Id(); + } + else + { + iTopPluginUid = KGSNoneSelected; + } + iAppUi->RemoveFromViewStack( *this, iContainer ); delete iContainer; iContainer = NULL; } @@ -367,11 +375,6 @@ break; case EAknCmdHelp: { - if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) - { - HlpLauncher::LaunchHelpApplicationL( - iEikonEnv->WsSession(), iAppUi->AppHelpContextL() ); - } break; } default: diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSGenPlugin/GSGenPlugin.mmp --- a/gssettingsuis/Gs/GSGenPlugin/GSGenPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSGenPlugin/bld.inf --- a/gssettingsuis/Gs/GSGenPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSGenPlugin/clean.cmd --- a/gssettingsuis/Gs/GSGenPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSGenPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSGenPlugin/data/10207238.rss --- a/gssettingsuis/Gs/GSGenPlugin/data/10207238.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSGenPlugin/data/GSGenPluginRsc.rss --- a/gssettingsuis/Gs/GSGenPlugin/data/GSGenPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSGenPlugin/inc/GSGenPlugin.h --- a/gssettingsuis/Gs/GSGenPlugin/inc/GSGenPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSGenPlugin/loc/GSGenPlugin.loc --- a/gssettingsuis/Gs/GSGenPlugin/loc/GSGenPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSGenPlugin/src/GSGenPlugin.cpp --- a/gssettingsuis/Gs/GSGenPlugin/src/GSGenPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,298 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSGenPlugin/src/GSGenPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSGenPlugin/src/GSGenPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSIndicatorPlugin/data/200100DD.rss --- a/gssettingsuis/Gs/GSIndicatorPlugin/data/200100DD.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSIndicatorPlugin/group/GSindicatorplugin.mmp --- a/gssettingsuis/Gs/GSIndicatorPlugin/group/GSindicatorplugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSIndicatorPlugin/group/bld.inf --- a/gssettingsuis/Gs/GSIndicatorPlugin/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSIndicatorPlugin/inc/GSindicatorpluginimplementation.h --- a/gssettingsuis/Gs/GSIndicatorPlugin/inc/GSindicatorpluginimplementation.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSIndicatorPlugin/rom/gsindicatorplugin.iby --- a/gssettingsuis/Gs/GSIndicatorPlugin/rom/gsindicatorplugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSIndicatorPlugin/src/GSindicatorpluginimplementation.cpp --- a/gssettingsuis/Gs/GSIndicatorPlugin/src/GSindicatorpluginimplementation.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSIndicatorPlugin/src/dllmain.cpp --- a/gssettingsuis/Gs/GSIndicatorPlugin/src/dllmain.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSInstallationsPlugin/GSInstallationsPlugin.mmp --- a/gssettingsuis/Gs/GSInstallationsPlugin/GSInstallationsPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSInstallationsPlugin/bld.inf --- a/gssettingsuis/Gs/GSInstallationsPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSInstallationsPlugin/clean.cmd --- a/gssettingsuis/Gs/GSInstallationsPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSInstallationsPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSInstallationsPlugin/data/10283320.rss --- a/gssettingsuis/Gs/GSInstallationsPlugin/data/10283320.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSInstallationsPlugin/data/GSInstallationsPluginRsc.rss --- a/gssettingsuis/Gs/GSInstallationsPlugin/data/GSInstallationsPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSInstallationsPlugin/inc/GSInstallationsPlugin.h --- a/gssettingsuis/Gs/GSInstallationsPlugin/inc/GSInstallationsPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSInstallationsPlugin/loc/GSInstallationsPlugin.loc --- a/gssettingsuis/Gs/GSInstallationsPlugin/loc/GSInstallationsPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSInstallationsPlugin/src/GSInstallationsPlugin.cpp --- a/gssettingsuis/Gs/GSInstallationsPlugin/src/GSInstallationsPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,246 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSInstallationsPlugin/src/GSInstallationsPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSInstallationsPlugin/src/GSInstallationsPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Data/102824A7.rss --- a/gssettingsuis/Gs/GSNetworkPlugin/Data/102824A7.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Data/2000B593.xml --- a/gssettingsuis/Gs/GSNetworkPlugin/Data/2000B593.xml Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Data/GsNetworkPluginRsc.rss --- a/gssettingsuis/Gs/GSNetworkPlugin/Data/GsNetworkPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,582 +0,0 @@ -/* -* 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; - } - }; - } - -//---------------------------------------------------- -// -// 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/GSNetworkPlugin.mmp --- a/gssettingsuis/Gs/GSNetworkPlugin/GSNetworkPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* 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 -// End of File - diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkDebugHelper.h --- a/gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkDebugHelper.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPlugin.h --- a/gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,519 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginAO.h --- a/gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginAO.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginContainer.h --- a/gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,229 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginModel.h --- a/gssettingsuis/Gs/GSNetworkPlugin/Inc/GSNetworkPluginModel.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,280 +0,0 @@ -/* -* 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(); - - /** - * 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Inc/GsNetworkPlugin.hrh --- a/gssettingsuis/Gs/GSNetworkPlugin/Inc/GsNetworkPlugin.hrh Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Inc/MGsFWMSKLabelObserver.h --- a/gssettingsuis/Gs/GSNetworkPlugin/Inc/MGsFWMSKLabelObserver.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Inc/PSMNetworkPlugin.h --- a/gssettingsuis/Gs/GSNetworkPlugin/Inc/PSMNetworkPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /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: -* -*/ - - -#ifndef PSMNETWORKPLUGIN_H -#define PSMNETWORKPLUGIN_H - -// INCLUDES -#include -#include -#include //CPsmPluginBase - -class CGSNetworkPluginModel; - -/** -* 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; - - private: // data - - CGSNetworkPluginModel *iModel; //data model - - }; - -#endif // PSMNETWORKPLUGIN_H diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkDebugHelper.cpp --- a/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkDebugHelper.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,356 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPlugin.cpp --- a/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1913 +0,0 @@ -/* -* 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, "" ); - -// 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 ) - { - while ( !iApprovedNetwork ) - { - AknPopupListEmpty* list; - if ( showGraphicalList && - FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) ) - { - list = new ( ELeave ) CAknSingleGraphicPopupMenuStyleListBox; - } - else - { - list = new ( ELeave ) CAknSinglePopupMenuStyleListBox; - } - - 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); - } - - //set icon for network - if ( showGraphicalList ) - { - if ( FeatureManager::FeatureSupported( - KFeatureIdProtocolWcdma ) ) - { - if ( info.iAccess != - MPsetNetworkSelect::ENetNetworkGSM ) - { - insertString->Des().Insert( 0, KGSNetWCDMAIcon ); - } - else - { - insertString->Des().Insert( 0, KGSNetGSMIcon ); - } - } - } - 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 - if ( 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 - } - - 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" - { - //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 ) - { - // 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" ); - iNetworkText = iNWInfo.iLongName.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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginAO.cpp --- a/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginAO.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +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 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginContainer.cpp --- a/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,604 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginModel.cpp --- a/gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPluginModel.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,667 +0,0 @@ -/* -* 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 - -//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 ); - // 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::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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/Src/PSMNetworkPlugin.cpp --- a/gssettingsuis/Gs/GSNetworkPlugin/Src/PSMNetworkPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +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: 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 ); - - __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; - } - -// --------------------------------------------------------- -// 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 ) - { - if ( !IsPhoneOfflineL() && - FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) && - iModel->IsNetworkModeVisible() ) - { - 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(); - } - } - -//End of File - - diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/bld.inf --- a/gssettingsuis/Gs/GSNetworkPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* 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 -END - - -PRJ_MMPFILES -GSNetworkPlugin.mmp - - -PRJ_TESTMMPFILES - -// End of File diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/clean.cmd --- a/gssettingsuis/Gs/GSNetworkPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSNetworkPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSNetworkPlugin/loc/GsNetworkPlugin.loc --- a/gssettingsuis/Gs/GSNetworkPlugin/loc/GsNetworkPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,168 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSOpticalJoystickPlugin/Data/1028331A.rss --- a/gssettingsuis/Gs/GSOpticalJoystickPlugin/Data/1028331A.rss Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSOpticalJoystickPlugin/Data/GSOpticalJoystickPluginRsc.rss --- a/gssettingsuis/Gs/GSOpticalJoystickPlugin/Data/GSOpticalJoystickPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSOpticalJoystickPlugin/GSOpticalJoystickPlugin.mmp --- a/gssettingsuis/Gs/GSOpticalJoystickPlugin/GSOpticalJoystickPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +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 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPlugin.h --- a/gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +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 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPlugin.hrh --- a/gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPlugin.hrh Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPluginContainer.h --- a/gssettingsuis/Gs/GSOpticalJoystickPlugin/Inc/GSOpticalJoystickPluginContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPlugin.cpp --- a/gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,416 +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 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPluginContainer.cpp --- a/gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPluginContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,226 +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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSOpticalJoystickPlugin/Src/GSOpticalJoystickPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSOpticalJoystickPlugin/bld.inf --- a/gssettingsuis/Gs/GSOpticalJoystickPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSOpticalJoystickPlugin/clean.cmd --- a/gssettingsuis/Gs/GSOpticalJoystickPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSOpticalJoystickPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSOpticalJoystickPlugin/loc/GSOpticalJoystickPlugin.loc --- a/gssettingsuis/Gs/GSOpticalJoystickPlugin/loc/GSOpticalJoystickPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataAccessPointPlugin/GSPDataAccessPointPlugin.mmp --- a/gssettingsuis/Gs/GSPDataAccessPointPlugin/GSPDataAccessPointPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataAccessPointPlugin/bld.inf --- a/gssettingsuis/Gs/GSPDataAccessPointPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataAccessPointPlugin/clean.cmd --- a/gssettingsuis/Gs/GSPDataAccessPointPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSPDataAccessPointPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataAccessPointPlugin/data/10282DC5.rss --- a/gssettingsuis/Gs/GSPDataAccessPointPlugin/data/10282DC5.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataAccessPointPlugin/data/GSPDataAccessPointPluginRsc.rss --- a/gssettingsuis/Gs/GSPDataAccessPointPlugin/data/GSPDataAccessPointPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataAccessPointPlugin/inc/GSPDataAccessPointModel.h --- a/gssettingsuis/Gs/GSPDataAccessPointPlugin/inc/GSPDataAccessPointModel.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataAccessPointPlugin/inc/GSPDataAccessPointPlugin.h --- a/gssettingsuis/Gs/GSPDataAccessPointPlugin/inc/GSPDataAccessPointPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,160 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataAccessPointPlugin/loc/GSPDataAccessPointPlugin.loc --- a/gssettingsuis/Gs/GSPDataAccessPointPlugin/loc/GSPDataAccessPointPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointModel.cpp --- a/gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointModel.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointPlugin.cpp --- a/gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,308 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSPDataAccessPointPlugin/src/GSPDataAccessPointPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataConnectionPlugin/GSPDataConnectionPlugin.mmp --- a/gssettingsuis/Gs/GSPDataConnectionPlugin/GSPDataConnectionPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataConnectionPlugin/bld.inf --- a/gssettingsuis/Gs/GSPDataConnectionPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataConnectionPlugin/clean.cmd --- a/gssettingsuis/Gs/GSPDataConnectionPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSPDataConnectionPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataConnectionPlugin/data/10282DC3.rss --- a/gssettingsuis/Gs/GSPDataConnectionPlugin/data/10282DC3.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataConnectionPlugin/data/GSPDataConnectionPluginRsc.rss --- a/gssettingsuis/Gs/GSPDataConnectionPlugin/data/GSPDataConnectionPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataConnectionPlugin/inc/GSPDataConnectionModel.h --- a/gssettingsuis/Gs/GSPDataConnectionPlugin/inc/GSPDataConnectionModel.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataConnectionPlugin/inc/GSPDataConnectionPlugin.h --- a/gssettingsuis/Gs/GSPDataConnectionPlugin/inc/GSPDataConnectionPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,173 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataConnectionPlugin/loc/GSPDataConnectionPlugin.loc --- a/gssettingsuis/Gs/GSPDataConnectionPlugin/loc/GSPDataConnectionPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionModel.cpp --- a/gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionModel.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionPlugin.cpp --- a/gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,362 +0,0 @@ -/* -* 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 ); - - CAknRadioButtonSettingPage* dlg = - new (ELeave) CAknRadioButtonSettingPage - ( R_GS_PDATACONNECTION_SETTING_PAGE, - aPDataConnectionState, - items ); - dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); - 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSPDataConnectionPlugin/src/GSPDataConnectionPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataHSDPAPlugin/GSPDataHSDPAPlugin.mmp --- a/gssettingsuis/Gs/GSPDataHSDPAPlugin/GSPDataHSDPAPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataHSDPAPlugin/bld.inf --- a/gssettingsuis/Gs/GSPDataHSDPAPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataHSDPAPlugin/clean.cmd --- a/gssettingsuis/Gs/GSPDataHSDPAPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSPDataHSDPAPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataHSDPAPlugin/data/10282DC7.rss --- a/gssettingsuis/Gs/GSPDataHSDPAPlugin/data/10282DC7.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataHSDPAPlugin/data/GSPDataHSDPAPluginRsc.rss --- a/gssettingsuis/Gs/GSPDataHSDPAPlugin/data/GSPDataHSDPAPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,168 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataHSDPAPlugin/inc/GSPDataHSDPAModel.h --- a/gssettingsuis/Gs/GSPDataHSDPAPlugin/inc/GSPDataHSDPAModel.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataHSDPAPlugin/inc/GSPDataHSDPAPlugin.h --- a/gssettingsuis/Gs/GSPDataHSDPAPlugin/inc/GSPDataHSDPAPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,215 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataHSDPAPlugin/loc/GSPDataHSDPAPlugin.loc --- a/gssettingsuis/Gs/GSPDataHSDPAPlugin/loc/GSPDataHSDPAPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAModel.cpp --- a/gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAModel.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAPlugin.cpp --- a/gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,530 +0,0 @@ -/* -* 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.SetState( RStarterSession::EOffline ); - rSession.SetState( RStarterSession::ENormal ); - 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataPlugin/Data/1020724F.rss --- a/gssettingsuis/Gs/GSPDataPlugin/Data/1020724F.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataPlugin/Data/GSPDataPluginRsc.rss --- a/gssettingsuis/Gs/GSPDataPlugin/Data/GSPDataPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataPlugin/GSPDataPlugin.mmp --- a/gssettingsuis/Gs/GSPDataPlugin/GSPDataPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataPlugin/Inc/GSPDataPlugin.h --- a/gssettingsuis/Gs/GSPDataPlugin/Inc/GSPDataPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataPlugin/Src/GSPDataPlugin.cpp --- a/gssettingsuis/Gs/GSPDataPlugin/Src/GSPDataPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,311 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataPlugin/Src/GSPDataPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSPDataPlugin/Src/GSPDataPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataPlugin/bld.inf --- a/gssettingsuis/Gs/GSPDataPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataPlugin/clean.cmd --- a/gssettingsuis/Gs/GSPDataPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSPDataPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPDataPlugin/loc/GSPDataPlugin.loc --- a/gssettingsuis/Gs/GSPDataPlugin/loc/GSPDataPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPowerSavingQueryPlugin/Data/2002120C.rss --- a/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Data/2002120C.rss Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPowerSavingQueryPlugin/Data/GSPowerSavingQueryPluginRsc.rss --- a/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Data/GSPowerSavingQueryPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,202 +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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPowerSavingQueryPlugin/GSPowerSavingQueryPlugin.mmp --- a/gssettingsuis/Gs/GSPowerSavingQueryPlugin/GSPowerSavingQueryPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPlugin.h --- a/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +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 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPlugin.hrh --- a/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPlugin.hrh Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPluginContainer.h --- a/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPluginContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPluginModel.h --- a/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Inc/GSPowerSavingQueryPluginModel.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPlugin.cpp --- a/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,384 +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 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginContainer.cpp --- a/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,180 +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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginModel.cpp --- a/gssettingsuis/Gs/GSPowerSavingQueryPlugin/Src/GSPowerSavingQueryPluginModel.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPowerSavingQueryPlugin/bld.inf --- a/gssettingsuis/Gs/GSPowerSavingQueryPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPowerSavingQueryPlugin/loc/GSPowerSavingQueryPlugin.loc --- a/gssettingsuis/Gs/GSPowerSavingQueryPlugin/loc/GSPowerSavingQueryPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPrslnPlugin/GSPrslnPlugin.mmp --- a/gssettingsuis/Gs/GSPrslnPlugin/GSPrslnPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPrslnPlugin/bld.inf --- a/gssettingsuis/Gs/GSPrslnPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPrslnPlugin/clean.cmd --- a/gssettingsuis/Gs/GSPrslnPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSPrslnPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPrslnPlugin/data/10207253.rss --- a/gssettingsuis/Gs/GSPrslnPlugin/data/10207253.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPrslnPlugin/data/GSPrslnPluginRsc.rss --- a/gssettingsuis/Gs/GSPrslnPlugin/data/GSPrslnPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPrslnPlugin/inc/GSPrslnPlugin.h --- a/gssettingsuis/Gs/GSPrslnPlugin/inc/GSPrslnPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPrslnPlugin/loc/GSPrslnPlugin.loc --- a/gssettingsuis/Gs/GSPrslnPlugin/loc/GSPrslnPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPrslnPlugin/src/GSPrslnPlugin.cpp --- a/gssettingsuis/Gs/GSPrslnPlugin/src/GSPrslnPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,318 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSPrslnPlugin/src/GSPrslnPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSPrslnPlugin/src/GSPrslnPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSecurityPlugin/Data/1020743A.rss --- a/gssettingsuis/Gs/GSSecurityPlugin/Data/1020743A.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSecurityPlugin/Data/GSSecurityPluginRsc.rss --- a/gssettingsuis/Gs/GSSecurityPlugin/Data/GSSecurityPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSecurityPlugin/GSSecurityPlugin.mmp --- a/gssettingsuis/Gs/GSSecurityPlugin/GSSecurityPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSecurityPlugin/Inc/GSSecurityPlugin.h --- a/gssettingsuis/Gs/GSSecurityPlugin/Inc/GSSecurityPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSecurityPlugin/Src/GSSecurityPlugin.cpp --- a/gssettingsuis/Gs/GSSecurityPlugin/Src/GSSecurityPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,281 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSecurityPlugin/Src/GSSecurityPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSSecurityPlugin/Src/GSSecurityPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSecurityPlugin/bld.inf --- a/gssettingsuis/Gs/GSSecurityPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSecurityPlugin/clean.cmd --- a/gssettingsuis/Gs/GSSecurityPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSSecurityPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSecurityPlugin/loc/GSSecurityPlugin.loc --- a/gssettingsuis/Gs/GSSecurityPlugin/loc/GSSecurityPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSynchronisationPlugin/GSSynchronisationPlugin.mmp --- a/gssettingsuis/Gs/GSSynchronisationPlugin/GSSynchronisationPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSynchronisationPlugin/bld.inf --- a/gssettingsuis/Gs/GSSynchronisationPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSynchronisationPlugin/clean.cmd --- a/gssettingsuis/Gs/GSSynchronisationPlugin/clean.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -del *.cwlink -del *.mcp -del *.xml -del *.resources -del *_UID_.cpp -rd GSSynchronisationPlugin_Data /s /q \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSynchronisationPlugin/data/10283318.rss --- a/gssettingsuis/Gs/GSSynchronisationPlugin/data/10283318.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSynchronisationPlugin/data/GSSynchronisationPluginRsc.rss --- a/gssettingsuis/Gs/GSSynchronisationPlugin/data/GSSynchronisationPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSynchronisationPlugin/inc/GSSynchronisationPlugin.h --- a/gssettingsuis/Gs/GSSynchronisationPlugin/inc/GSSynchronisationPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSynchronisationPlugin/loc/GSSyncPlugin.loc --- a/gssettingsuis/Gs/GSSynchronisationPlugin/loc/GSSyncPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSynchronisationPlugin/src/GSSynchronisationPlugin.cpp --- a/gssettingsuis/Gs/GSSynchronisationPlugin/src/GSSynchronisationPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,245 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSSynchronisationPlugin/src/GSSynchronisationPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSSynchronisationPlugin/src/GSSynchronisationPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSTelPlugin/Data/1020723E.rss --- a/gssettingsuis/Gs/GSTelPlugin/Data/1020723E.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSTelPlugin/Data/GSTelPluginRsc.rss --- a/gssettingsuis/Gs/GSTelPlugin/Data/GSTelPluginRsc.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSTelPlugin/GSTelPlugin.mmp --- a/gssettingsuis/Gs/GSTelPlugin/GSTelPlugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSTelPlugin/Inc/GSPhoneSettingConstants.h --- a/gssettingsuis/Gs/GSTelPlugin/Inc/GSPhoneSettingConstants.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,164 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSTelPlugin/Inc/GSTelPlugin.h --- a/gssettingsuis/Gs/GSTelPlugin/Inc/GSTelPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSTelPlugin/Src/GSTelPlugin.cpp --- a/gssettingsuis/Gs/GSTelPlugin/Src/GSTelPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,292 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSTelPlugin/Src/GSTelPluginImplementationTable.cpp --- a/gssettingsuis/Gs/GSTelPlugin/Src/GSTelPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSTelPlugin/bld.inf --- a/gssettingsuis/Gs/GSTelPlugin/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/GSTelPlugin/loc/GSTelPlugin.loc --- a/gssettingsuis/Gs/GSTelPlugin/loc/GSTelPlugin.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/conf/s60settingsuis.confml Binary file gssettingsuis/Gs/conf/s60settingsuis.confml has changed diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/conf/s60settingsuis_2002120B.crml Binary file gssettingsuis/Gs/conf/s60settingsuis_2002120B.crml has changed diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/group/bld.inf --- a/gssettingsuis/Gs/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ b/gssettingsuis/Gs/group/bld.inf Fri Mar 19 09:34:30 2010 +0200 @@ -42,41 +42,9 @@ #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 diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/gslauncher/group/GSLauncher.mmp --- a/gssettingsuis/Gs/gslauncher/group/GSLauncher.mmp Tue Feb 02 00:22:03 2010 +0200 +++ b/gssettingsuis/Gs/gslauncher/group/GSLauncher.mmp Fri Mar 19 09:34:30 2010 +0200 @@ -29,15 +29,11 @@ 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/gslauncher/inc/GSLauncher.h --- a/gssettingsuis/Gs/gslauncher/inc/GSLauncher.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/gslauncher/src/GSLauncher.cpp --- a/gssettingsuis/Gs/gslauncher/src/GSLauncher.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/gssettingsuis/Gs/gslauncher/src/GSLauncher.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -15,22 +15,8 @@ * */ -#include "GSLauncher.h" +#include -#include -#include -#include -#include -#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS -#include -#endif - -#include -#include - - -const TUid KGSMessageViewLaunch = { 0x1 }; -const TInt KGSApaMsgLength = 1024; // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- @@ -58,9 +44,7 @@ // EXPORT_C CGSLauncher* CGSLauncher::NewL() { - CGSLauncher* self = CGSLauncher::NewLC(); - CleanupStack::Pop( self ); - return self; + return NULL; } // --------------------------------------------------------------------------- @@ -69,10 +53,7 @@ // EXPORT_C CGSLauncher* CGSLauncher::NewLC() { - CGSLauncher* self = new( ELeave ) CGSLauncher; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; + return NULL; } @@ -88,48 +69,10 @@ // implementation_description // --------------------------------------------------------------------------- // -EXPORT_C void CGSLauncher::LaunchGSViewL( const TUid aTarget, - const TUid aCustomMessageId, - const TDesC8& aCustomMessage ) +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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/help/data/xhtml.zip Binary file gssettingsuis/Gs/help/data/xhtml.zip has changed diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/help/inc/cp.hlp.hrh --- a/gssettingsuis/Gs/help/inc/cp.hlp.hrh Tue Feb 02 00:22:03 2010 +0200 +++ b/gssettingsuis/Gs/help/inc/cp.hlp.hrh Fri Mar 19 09:34:30 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -10,24 +10,32 @@ * Nokia Corporation - initial contribution. * * Contributors: -* -* Description: +* +* Description: * */ - + // -// cp.hlp.hrh generated by CSXHelp Utilities. -// +// cp.hlp.hrh +// + +// +// File generated by CSXHelp Utilities on 2009-04-17 +// #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_INSTALLATIONS, "CP_HLP_INSTALLATIONS"); // +_LIT(KCP_HLP_SYNCHRONISATION, "CP_HLP_SYNCHRONISATION"); // _LIT(KCP_HLP_DEVICE_MANAGEMENT, "CP_HLP_DEVICE_MANAGEMENT"); // +_LIT(KRD_HLP_REMOTE_DRIVES, "RD_HLP_REMOTE_DRIVES"); // +_LIT(KRD_HLP_REMOTE_DRIVE_CONFIG, "RD_HLP_REMOTE_DRIVE_CONFIG"); // _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_SETTINGS, "SET_HLP_WLAN_SETTINGS"); // _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"); // @@ -44,19 +52,39 @@ _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(KDIV_HLP_CALL_FORW_MAIN, "DIV_HLP_CALL_FORW_MAIN"); // +_LIT(KDIV_HLP_CALL_FORW_VOI, "DIV_HLP_CALL_FORW_VOI"); // +_LIT(KSET_HLP_ACCESSORIES_HEADPHONE, "SET_HLP_ACCESSORIES_HEADPHONE"); // +_LIT(KSET_HLP_ACCESSORIES_HEADSET, "SET_HLP_ACCESSORIES_HEADSET"); // + +_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(KSET_HLP_ACCESS_WIRED_CK, "SET_HLP_ACCESS_WIRED_CK"); // +_LIT(KSET_HLP_ACCESS_WIRELESS_CK, "SET_HLP_ACCESS_WIRELESS_CK"); // +_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_WLAN_EAP_LEAP, "SET_HLP_WLAN_EAP_LEAP"); // +_LIT(KSET_HLP_AP_SETTING_DATA, "SET_HLP_AP_SETTING_DATA"); // _LIT(KSET_HLP_WLAN_EAP_FAST_TYPES, "SET_HLP_WLAN_EAP_FAST_TYPES"); // +_LIT(KSET_HLP_AP_SETTING_DATA_AS, "SET_HLP_AP_SETTING_DATA_AS"); // _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_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_SETTING_WLAN, "SET_HLP_AP_SETTING_WLAN"); // +_LIT(KSET_HLP_AP_SETTING_WLAN_AS, "SET_HLP_AP_SETTING_WLAN_AS"); // _LIT(KSET_HLP_WLAN_EAP_PAP, "SET_HLP_WLAN_EAP_PAP"); // +_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(KDIV_HLP_BARRING_MAIN, "DIV_HLP_BARRING_MAIN"); // +_LIT(KDIV_HLP_CALL_FORW_VOIP, "DIV_HLP_CALL_FORW_VOIP"); // +_LIT(KSET_HLP_BARRING_SETTINGS, "SET_HLP_BARRING_SETTINGS"); // _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_VPN_AP_SETTINGS_VIEW, "SET_HLP_VPN_AP_SETTINGS_VIEW"); // _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"); // @@ -86,44 +114,8 @@ _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(KPREDINPUT_HLP_INPUT, "PREDINPUT_HLP_INPUT"); // _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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/readme.txt --- a/gssettingsuis/Gs/readme.txt Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSActiveIdlePlugin.iby --- a/gssettingsuis/Gs/rom/GSActiveIdlePlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSActiveIdlePluginResources.iby --- a/gssettingsuis/Gs/rom/GSActiveIdlePluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSAdminPlugin.iby --- a/gssettingsuis/Gs/rom/GSAdminPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSAdminPluginResources.iby --- a/gssettingsuis/Gs/rom/GSAdminPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSApp.iby --- a/gssettingsuis/Gs/rom/GSApp.iby Tue Feb 02 00:22:03 2010 +0200 +++ b/gssettingsuis/Gs/rom/GSApp.iby Fri Mar 19 09:34:30 2010 +0200 @@ -20,9 +20,6 @@ #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 @@ -30,8 +27,6 @@ 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 diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSAppsPlugin.iby --- a/gssettingsuis/Gs/rom/GSAppsPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSAppsPluginResources.iby --- a/gssettingsuis/Gs/rom/GSAppsPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSAutoKeyguardPlugin.iby --- a/gssettingsuis/Gs/rom/GSAutoKeyguardPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSAutoKeyguardPluginResources.iby --- a/gssettingsuis/Gs/rom/GSAutoKeyguardPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSCallDivertPlugin.iby --- a/gssettingsuis/Gs/rom/GSCallDivertPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSCallDivertPluginResources.iby --- a/gssettingsuis/Gs/rom/GSCallDivertPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSCallPlugin.iby --- a/gssettingsuis/Gs/rom/GSCallPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSCallPluginResources.iby --- a/gssettingsuis/Gs/rom/GSCallPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSConPlugin.iby --- a/gssettingsuis/Gs/rom/GSConPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSConPluginResources.iby --- a/gssettingsuis/Gs/rom/GSConPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSDataCallPlugin.iby --- a/gssettingsuis/Gs/rom/GSDataCallPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSDataCallPluginResources.iby --- a/gssettingsuis/Gs/rom/GSDataCallPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSDeviceManagementPlugin.iby --- a/gssettingsuis/Gs/rom/GSDeviceManagementPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSDeviceManagementPluginResources.iby --- a/gssettingsuis/Gs/rom/GSDeviceManagementPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSDisplayPlugin.iby --- a/gssettingsuis/Gs/rom/GSDisplayPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSDisplayPluginResources.iby --- a/gssettingsuis/Gs/rom/GSDisplayPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSGenPlugin.iby --- a/gssettingsuis/Gs/rom/GSGenPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSGenPluginResources.iby --- a/gssettingsuis/Gs/rom/GSGenPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSInstallationsPlugin.iby --- a/gssettingsuis/Gs/rom/GSInstallationsPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSInstallationsPluginResources.iby --- a/gssettingsuis/Gs/rom/GSInstallationsPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSInteractionPlugin.iby --- a/gssettingsuis/Gs/rom/GSInteractionPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSInteractionPluginResources.iby --- a/gssettingsuis/Gs/rom/GSInteractionPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSNetworkPlugin.iby --- a/gssettingsuis/Gs/rom/GSNetworkPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSNetworkPluginResources.iby --- a/gssettingsuis/Gs/rom/GSNetworkPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSOpticalJoystickPlugin.iby --- a/gssettingsuis/Gs/rom/GSOpticalJoystickPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSOpticalJoystickPluginResources.iby --- a/gssettingsuis/Gs/rom/GSOpticalJoystickPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSPDataAccessPointPlugin.iby --- a/gssettingsuis/Gs/rom/GSPDataAccessPointPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSPDataAccessPointPluginResources.iby --- a/gssettingsuis/Gs/rom/GSPDataAccessPointPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSPDataConnectionPlugin.iby --- a/gssettingsuis/Gs/rom/GSPDataConnectionPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSPDataConnectionPluginResources.iby --- a/gssettingsuis/Gs/rom/GSPDataConnectionPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSPDataHSDPAPlugin.iby --- a/gssettingsuis/Gs/rom/GSPDataHSDPAPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSPDataHSDPAPluginResources.iby --- a/gssettingsuis/Gs/rom/GSPDataHSDPAPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSPDataPlugin.iby --- a/gssettingsuis/Gs/rom/GSPDataPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSPDataPluginResources.iby --- a/gssettingsuis/Gs/rom/GSPDataPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSPowerSavingQueryPlugin.iby --- a/gssettingsuis/Gs/rom/GSPowerSavingQueryPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSPowerSavingQueryPluginResources.iby --- a/gssettingsuis/Gs/rom/GSPowerSavingQueryPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSPrslnPlugin.iby --- a/gssettingsuis/Gs/rom/GSPrslnPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSPrslnPluginResources.iby --- a/gssettingsuis/Gs/rom/GSPrslnPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSSecurityPlugin.iby --- a/gssettingsuis/Gs/rom/GSSecurityPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSSecurityPluginResources.iby --- a/gssettingsuis/Gs/rom/GSSecurityPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSSynchronisationPlugin.iby --- a/gssettingsuis/Gs/rom/GSSynchronisationPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSSynchronisationPluginResources.iby --- a/gssettingsuis/Gs/rom/GSSynchronisationPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSTelPlugin.iby --- a/gssettingsuis/Gs/rom/GSTelPlugin.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/rom/GSTelPluginResources.iby --- a/gssettingsuis/Gs/rom/GSTelPluginResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface.cpp --- a/gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,463 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface.h --- a/gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface_DllMain.cpp --- a/gssettingsuis/Gs/tsrc/private/Src/T_CGSPluginInterface_DllMain.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/private/T_CGSPluginInterface.mmp --- a/gssettingsuis/Gs/tsrc/private/T_CGSPluginInterface.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /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: -* -*/ - -#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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/private/bld.inf --- a/gssettingsuis/Gs/tsrc/private/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/private/move_T_GSPluginInterface.bat --- a/gssettingsuis/Gs/tsrc/private/move_T_GSPluginInterface.bat Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +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 - -copy \epoc32\RELEASE\winscw\udeb\T_CGSPluginInterface.dll \epoc32\RELEASE\winscw\udeb\Z\sys\bin /Y \ No newline at end of file diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/BWINS/MT_CGSLauncherU.DEF --- a/gssettingsuis/Gs/tsrc/public/basic/BWINS/MT_CGSLauncherU.DEF Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -EXPORTS - ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * __cdecl CreateTestSuiteL(void) diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/BWINS/MT_GSFrameworku.def --- a/gssettingsuis/Gs/tsrc/public/basic/BWINS/MT_GSFrameworku.def Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) - diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/BWINS/T_GSBackgroundImageU.DEF --- a/gssettingsuis/Gs/tsrc/public/basic/BWINS/T_GSBackgroundImageU.DEF Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -EXPORTS - ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * __cdecl CreateTestSuiteL(void) diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/BWINS/T_GSListBoxu.def --- a/gssettingsuis/Gs/tsrc/public/basic/BWINS/T_GSListBoxu.def Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) - diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/EABI/MT_CGSLauncherU.DEF --- a/gssettingsuis/Gs/tsrc/public/basic/EABI/MT_CGSLauncherU.DEF Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z16CreateTestSuiteLv @ 1 NONAME - diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/EABI/MT_GSFrameworku.def --- a/gssettingsuis/Gs/tsrc/public/basic/EABI/MT_GSFrameworku.def Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z16CreateTestSuiteLv @ 1 NONAME - diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/EABI/T_GSBackgroundImageU.DEF --- a/gssettingsuis/Gs/tsrc/public/basic/EABI/T_GSBackgroundImageU.DEF Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z16CreateTestSuiteLv @ 1 NONAME - diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/EABI/T_GSListBoxu.def --- a/gssettingsuis/Gs/tsrc/public/basic/EABI/T_GSListBoxu.def Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z16CreateTestSuiteLv @ 1 NONAME - diff -r 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage.cpp --- a/gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,304 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage.h --- a/gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage_DllMain.cpp --- a/gssettingsuis/Gs/tsrc/public/basic/GSBackgroundImage/T_GSBackgroundImage_DllMain.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework.cpp --- a/gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1315 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework.h --- a/gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,207 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework_DllMain.cpp --- a/gssettingsuis/Gs/tsrc/public/basic/GSFramework/MT_GSFramework_DllMain.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSBaseView.cpp --- a/gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSBaseView.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSBaseView.h --- a/gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSBaseView.h Tue Feb 02 00:22:03 2010 +0200 +++ /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: -* -*/ -#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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSPlugin.cpp --- a/gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSPlugin.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /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: -* -*/ -#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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSPlugin.h --- a/gssettingsuis/Gs/tsrc/public/basic/GSFramework/TestGSPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /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: -* -*/ -#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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox.cpp --- a/gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,548 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox.h --- a/gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox_DllMain.cpp --- a/gssettingsuis/Gs/tsrc/public/basic/GSListBox/T_GSListBox_DllMain.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher.cpp --- a/gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,193 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher.h --- a/gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher_DllMain.cpp --- a/gssettingsuis/Gs/tsrc/public/basic/MT_GSLauncher/MT_CGSLauncher_DllMain.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/group/MT_CGSLauncher.mmp --- a/gssettingsuis/Gs/tsrc/public/basic/group/MT_CGSLauncher.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/group/MT_GSFramework.mmp --- a/gssettingsuis/Gs/tsrc/public/basic/group/MT_GSFramework.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/group/T_GSBackgroundImage.mmp --- a/gssettingsuis/Gs/tsrc/public/basic/group/T_GSBackgroundImage.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/group/T_GSListBox.mmp --- a/gssettingsuis/Gs/tsrc/public/basic/group/T_GSListBox.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/group/bld.inf --- a/gssettingsuis/Gs/tsrc/public/basic/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /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: -* -*/ - -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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/group/copy_binaries_to_sys_dir.mk --- a/gssettingsuis/Gs/tsrc/public/basic/group/copy_binaries_to_sys_dir.mk Tue Feb 02 00:22:03 2010 +0200 +++ /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: -# - -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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/group/move.cmd --- a/gssettingsuis/Gs/tsrc/public/basic/group/move.cmd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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 - -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 3f8368f032cf -r e3554c9069b6 gssettingsuis/Gs/tsrc/public/basic/test.xml --- a/gssettingsuis/Gs/tsrc/public/basic/test.xml Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,147 +0,0 @@ - - - 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 3f8368f032cf -r e3554c9069b6 layers.sysdef.xml --- a/layers.sysdef.xml Tue Feb 02 00:22:03 2010 +0200 +++ b/layers.sysdef.xml Fri Mar 19 09:34:30 2010 +0200 @@ -1,14 +1,21 @@ - ]> - + + + + + + + + diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/BWINS/FileListU.DEF --- a/profilesservices/FileList/BWINS/FileListU.DEF Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/EABI/FileListU.DEF --- a/profilesservices/FileList/EABI/FileListU.DEF Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Inc/CFLDFileListModel.h --- a/profilesservices/FileList/Inc/CFLDFileListModel.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,379 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDBrowserLauncher.cpp --- a/profilesservices/FileList/Src/CFLDBrowserLauncher.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +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: 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDBrowserLauncher.h --- a/profilesservices/FileList/Src/CFLDBrowserLauncher.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +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: 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDChangedItemObserver.cpp --- a/profilesservices/FileList/Src/CFLDChangedItemObserver.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDChangedItemObserver.h --- a/profilesservices/FileList/Src/CFLDChangedItemObserver.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDCommandAbsorbingControl.cpp --- a/profilesservices/FileList/Src/CFLDCommandAbsorbingControl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,153 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDCommandAbsorbingControl.h --- a/profilesservices/FileList/Src/CFLDCommandAbsorbingControl.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDController.cpp --- a/profilesservices/FileList/Src/CFLDController.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,414 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDDRMImplementation.cpp --- a/profilesservices/FileList/Src/CFLDDRMImplementation.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,451 +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: 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDDRMImplementation.h --- a/profilesservices/FileList/Src/CFLDDRMImplementation.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,171 +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: 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDDRMImplementationCommon.cpp --- a/profilesservices/FileList/Src/CFLDDRMImplementationCommon.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +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: 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDDRMImplementationEmpty.cpp --- a/profilesservices/FileList/Src/CFLDDRMImplementationEmpty.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +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: 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDEntryReference.cpp --- a/profilesservices/FileList/Src/CFLDEntryReference.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDEntryReference.h --- a/profilesservices/FileList/Src/CFLDEntryReference.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDFileListContainer.cpp --- a/profilesservices/FileList/Src/CFLDFileListContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,513 +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: -* 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 ); - } - } - - 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDFileListModel.cpp --- a/profilesservices/FileList/Src/CFLDFileListModel.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1039 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDOperationObserver.cpp --- a/profilesservices/FileList/Src/CFLDOperationObserver.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDOperationObserver.h --- a/profilesservices/FileList/Src/CFLDOperationObserver.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDPlayerBase.cpp --- a/profilesservices/FileList/Src/CFLDPlayerBase.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,376 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDPlayerBase.h --- a/profilesservices/FileList/Src/CFLDPlayerBase.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,192 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDPopupList.cpp --- a/profilesservices/FileList/Src/CFLDPopupList.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,636 +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: 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 } - } - 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDPopupList.h --- a/profilesservices/FileList/Src/CFLDPopupList.h Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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; - -#ifdef RD_VIDEO_AS_RINGING_TONE - /// Current softkeystate - MFLDFileListBoxObserver::TFileListSoftKeyState iSoftKeyState; - -#endif - - TFileName iCurrentFileName; - - // Have the checks in AttemptExitL been done already - TBool iExitChecksDone; - TPoint iPoint; - }; - -#endif // CFLDPOPUPLIST_H - -// End of File diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDRingingTonePlayer.cpp --- a/profilesservices/FileList/Src/CFLDRingingTonePlayer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,474 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDRingingTonePlayer.h --- a/profilesservices/FileList/Src/CFLDRingingTonePlayer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,193 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDSingleGraphicEntryFormatter.cpp --- a/profilesservices/FileList/Src/CFLDSingleGraphicEntryFormatter.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,296 +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: 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDSingleGraphicEntryFormatter.h --- a/profilesservices/FileList/Src/CFLDSingleGraphicEntryFormatter.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDSoftKeyChanger.cpp --- a/profilesservices/FileList/Src/CFLDSoftKeyChanger.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,189 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDSoftKeyChanger.h --- a/profilesservices/FileList/Src/CFLDSoftKeyChanger.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDVideoPlayer.cpp --- a/profilesservices/FileList/Src/CFLDVideoPlayer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,612 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDVideoPlayer.h --- a/profilesservices/FileList/Src/CFLDVideoPlayer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,187 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDWaitNote.cpp --- a/profilesservices/FileList/Src/CFLDWaitNote.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/CFLDWaitNote.h --- a/profilesservices/FileList/Src/CFLDWaitNote.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/FLDListBoxTemplate.h --- a/profilesservices/FileList/Src/FLDListBoxTemplate.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,172 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/MFLDEntryFormatter.h --- a/profilesservices/FileList/Src/MFLDEntryFormatter.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/MFLDFileObserver.h --- a/profilesservices/FileList/Src/MFLDFileObserver.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +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: 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/Src/MFLDFileProcessor.h --- a/profilesservices/FileList/Src/MFLDFileProcessor.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/group/FileList.mmp --- a/profilesservices/FileList/group/FileList.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/group/FileList.rss --- a/profilesservices/FileList/group/FileList.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,184 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/group/bld.inf --- a/profilesservices/FileList/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/group/filelist_icons_aif_scalable_dc.mk --- a/profilesservices/FileList/group/filelist_icons_aif_scalable_dc.mk Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -# -# 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/loc/FileList.loc --- a/profilesservices/FileList/loc/FileList.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/rom/filelist.iby --- a/profilesservices/FileList/rom/filelist.iby Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/rom/filelistResources.iby --- a/profilesservices/FileList/rom/filelistResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/tsrc/public/basic/bwins/T_CFLDFileListu.def --- a/profilesservices/FileList/tsrc/public/basic/bwins/T_CFLDFileListu.def Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) - diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/tsrc/public/basic/eabi/T_CFLDFileListu.def --- a/profilesservices/FileList/tsrc/public/basic/eabi/T_CFLDFileListu.def Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -EXPORTS - _Z16CreateTestSuiteLv @ 1 NONAME - _ZTI16T_CFLDController @ 2 NONAME ; ## - _ZTI23T_CFLDFileListContainer @ 3 NONAME ; ## - _ZTV16T_CFLDController @ 4 NONAME ; ## - _ZTV23T_CFLDFileListContainer @ 5 NONAME ; ## - diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/tsrc/public/basic/group/FLDTest.rss --- a/profilesservices/FileList/tsrc/public/basic/group/FLDTest.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/tsrc/public/basic/group/T_CFLDFileList.mmp --- a/profilesservices/FileList/tsrc/public/basic/group/T_CFLDFileList.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/tsrc/public/basic/group/bld.inf --- a/profilesservices/FileList/tsrc/public/basic/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/tsrc/public/basic/inc/FLDTestConst.h --- a/profilesservices/FileList/tsrc/public/basic/inc/FLDTestConst.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/tsrc/public/basic/inc/T_CFLDController.h --- a/profilesservices/FileList/tsrc/public/basic/inc/T_CFLDController.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/tsrc/public/basic/inc/T_CFLDFileListContainer.h --- a/profilesservices/FileList/tsrc/public/basic/inc/T_CFLDFileListContainer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/tsrc/public/basic/rom/FileList_ats3.iby --- a/profilesservices/FileList/tsrc/public/basic/rom/FileList_ats3.iby Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/tsrc/public/basic/src/T_CFLDController.cpp --- a/profilesservices/FileList/tsrc/public/basic/src/T_CFLDController.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,210 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/tsrc/public/basic/src/T_CFLDDllMain.cpp --- a/profilesservices/FileList/tsrc/public/basic/src/T_CFLDDllMain.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/FileList/tsrc/public/basic/src/T_CFLDFileListContainer.cpp --- a/profilesservices/FileList/tsrc/public/basic/src/T_CFLDFileListContainer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,395 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Inc/mediafiledialog.h --- a/profilesservices/MediaFileList/Inc/mediafiledialog.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,501 +0,0 @@ -/* -* 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 ); - - - 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Inc/mediafiledialogstate.h --- a/profilesservices/MediaFileList/Inc/mediafiledialogstate.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,280 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Inc/mediafiledialogutils.h --- a/profilesservices/MediaFileList/Inc/mediafiledialogutils.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,425 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Inc/mediafilehandler.h --- a/profilesservices/MediaFileList/Inc/mediafilehandler.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,566 +0,0 @@ -/* -* 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(); - - 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(); - - 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Inc/mediafilelist.h --- a/profilesservices/MediaFileList/Inc/mediafilelist.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,187 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Inc/mediafilelistdebug.h --- a/profilesservices/MediaFileList/Inc/mediafilelistdebug.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Inc/mediafilepreview.h --- a/profilesservices/MediaFileList/Inc/mediafilepreview.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,353 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Inc/mediafileprotection.h --- a/profilesservices/MediaFileList/Inc/mediafileprotection.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,202 +0,0 @@ -/* -* 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 ); - - 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Inc/mediafiletest.h --- a/profilesservices/MediaFileList/Inc/mediafiletest.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,275 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Inc/mediafilevariation.h --- a/profilesservices/MediaFileList/Inc/mediafilevariation.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Inc/mediafilevideopreviewdialog.h --- a/profilesservices/MediaFileList/Inc/mediafilevideopreviewdialog.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Inc/mediafilewaitnote.h --- a/profilesservices/MediaFileList/Inc/mediafilewaitnote.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,206 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Src/mediafiledialog.cpp --- a/profilesservices/MediaFileList/Src/mediafiledialog.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3286 +0,0 @@ -/* -* 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 - - - - - -/****************************************************************************** - * 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) - { - // 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 ); - - TBool ret = ETrue; - - // 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 ) - { - 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() ) - { - // 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 ( aMediaType == CMediaFileList::EMediaFileTypeVideo ) - { - PreviewVideoL( iBuf ); - return; - } - - if ( iState->CurrentFolder() == EEFolderSearch ) - { - if ( IsVideoFile( currentIndex ) ) - { - return; // search folder may contain videos - no automatic preview - } - } - - if ( !iProtectionHandler->IsFileValid( iBuf, CMFProtectionHandler::EPlay ) ) - { - 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::DoUpdateListBoxL -// -// Update listbox contents (currently open folder items). -// ---------------------------------------------------------------------------- -// -void CMediaFileDialog::DoUpdateListBoxL( TBool aRestFindBox ) - { - 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 ) - { - TBool closeDialog = HandleOKL( EAttrDoubleClicked ); - - if ( closeDialog ) - { - // close after short delay (dialog cannot be closed from this function) - CloseDialogWithDelayL(); - } - iIsDoubleClicked = ETrue; - } - 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Src/mediafiledialogstate.cpp --- a/profilesservices/MediaFileList/Src/mediafiledialogstate.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1501 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Src/mediafiledialogutils.cpp --- a/profilesservices/MediaFileList/Src/mediafiledialogutils.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1132 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Src/mediafilehandler.cpp --- a/profilesservices/MediaFileList/Src/mediafilehandler.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3717 +0,0 @@ -/* -* 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::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::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.Append( 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.Append( 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Src/mediafilelist.cpp --- a/profilesservices/MediaFileList/Src/mediafilelist.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,170 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Src/mediafilelist.rss --- a/profilesservices/MediaFileList/Src/mediafilelist.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,725 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Src/mediafilepreview.cpp --- a/profilesservices/MediaFileList/Src/mediafilepreview.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1539 +0,0 @@ -/* -* 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(); - } - - -// ----------------------------------------------------------------------------- -// 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; - } - - if ( iBacklightTimer ) - { - delete iBacklightTimer; - iBacklightTimer = NULL; - } - } - - -// ----------------------------------------------------------------------------- -// 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Src/mediafileprotection.cpp --- a/profilesservices/MediaFileList/Src/mediafileprotection.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,603 +0,0 @@ -/* -* 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::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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Src/mediafiletest.cpp --- a/profilesservices/MediaFileList/Src/mediafiletest.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2489 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Src/mediafilevariation.cpp --- a/profilesservices/MediaFileList/Src/mediafilevariation.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,232 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Src/mediafilevideopreviewdialog.cpp --- a/profilesservices/MediaFileList/Src/mediafilevideopreviewdialog.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,350 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/Src/mediafilewaitnote.cpp --- a/profilesservices/MediaFileList/Src/mediafilewaitnote.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,344 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/bwins/MediaFileListu.def --- a/profilesservices/MediaFileList/bwins/MediaFileListu.def Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/eabi/MediaFileListu.def --- a/profilesservices/MediaFileList/eabi/MediaFileListu.def Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/group/MediaFileList.mmp --- a/profilesservices/MediaFileList/group/MediaFileList.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* 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 - -DEBUGLIBRARY flogger.lib - -// End of File diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/group/bld.inf --- a/profilesservices/MediaFileList/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +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: -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/group/mediafilelist_icons_aif_scalable_dc.mk --- a/profilesservices/MediaFileList/group/mediafilelist_icons_aif_scalable_dc.mk Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -# -# 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/loc/MediaFileList.loc --- a/profilesservices/MediaFileList/loc/MediaFileList.loc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,236 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/rom/mediafilelist.iby --- a/profilesservices/MediaFileList/rom/mediafilelist.iby Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 profilesservices/MediaFileList/rom/mediafilelistResources.iby --- a/profilesservices/MediaFileList/rom/mediafilelistResources.iby Tue Feb 02 00:22:03 2010 +0200 +++ /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: 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 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/MProfileEngineExtended.h --- a/profilesservices/ProfileEngine/EngInc/MProfileEngineExtended.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,163 +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: Extended profile engine interface. -* -*/ - - - -#ifndef __MPROFILEENGINEEXTENDED_H__ -#define __MPROFILEENGINEEXTENDED_H__ - -// INCLUDES -#include - -// DATA TYPES -enum TProfileUtilityObjectType - { - EProfileUtilityObjectPresenceTool = 0 - }; - -// FUNCTION PROTOTYPES -class MProfileEngineExtended; -class MProfilesLocalFeatures; - -/** -* Create extended profile engine, ownership transfered. -* -* @lib ProfileEng.lib -* @since 2.0 -*/ -IMPORT_C MProfileEngineExtended* CreateProfileEngineExtendedL(); - -/** -* 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 3.0 -*/ -IMPORT_C MProfileEngineExtended* CreateProfileEngineExtendedL( RFs* aFs ); - -// FORWARD DECLARATIONS -class MProfileExtended; -class MProfilePresence; - -// 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 MProfileEngineExtended : public MProfileEngine - { - protected: // Destructor - - virtual ~MProfileEngineExtended() {}; - - public: // New functions - - /** - * Create extended profile, ownership transfered. - * @since 2.0 - * @param aId Profile ID - * @return Instance of the MProfileExtended - */ - virtual MProfileExtended* ProfileLC( TInt aId ) = 0; - - /** - * Create extended profile, ownership transfered. - * @since 2.0 - * @param aId Profile ID - * @return Instance of the MProfileExtended - */ - virtual MProfileExtended* ProfileL( 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 CommitChangeL( MProfileExtended& aProfile ) = 0; - - /** - * Send presence settings. - * @since 2.1 - * @param aProfile Profile - */ - virtual void SendPresenceSettingsL( - const MProfilePresence& aPresence ) = 0; - - /** - * Delete profile. - * @since 2.1 - * @param aId Profile ID - * @return Error code - */ - virtual TInt DeleteProfileL( TInt aId ) = 0; - - /** - * Create new profile, ownership transfered. - * @since 2.1 - * @return Instance of the MProfileExtended - */ - virtual MProfileExtended* CreateProfileL() = 0; - - /** - * Returns is profile default profile. - * @since 2.0 - * @param aId Profile ID - * @return Is profile default profile - */ - virtual TBool IsDefaultProfile( TInt aId ) = 0; - - /** - * Returns locally variated features of Profiles. - * @since 2.6 - */ - virtual MProfilesLocalFeatures& LocalFeatures() = 0; - - /** - * Returns an utility object needed for a specific task. The returned - * object can be generally of any class and the caller must know what - * it wants and cast the returned object to the correct class. - * The ownership is not transferred. - * @param aType the type of the utility object to be returned. - * @param aImpl the utility object needed by the client on return, NULL - * if there isn't any of the given type - */ - virtual void GetProfileUtilityObject( - TProfileUtilityObjectType aType, TAny*& aImpl ) = 0; - - /** - * Set timed active profile. When the time expires the profile which was - * active before calling this method will be reactivated. - * If ID is incorrect then leave with KErrNotFound. - * @since 3.2 - * @param aId Profile ID - * @param aTime time when the profile activation expires - */ - virtual void SetActiveProfileTimedL( TInt aId, TTime aTime ) = 0; - - }; - -#endif // __MPROFILEENGINEEXTENDED_H__ - -// End of File diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/MProfileExtended.h --- a/profilesservices/ProfileEngine/EngInc/MProfileExtended.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,156 +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: Extended profile interface. -* -*/ - - - -#ifndef __MPROFILEEXTENDED_H__ -#define __MPROFILEEXTENDED_H__ - -// INCLUDES -#include - -// DATA TYPES -enum TProfileFlags - { - EProfileFlagRingingTone = 0x0001, - EProfileFlagRingingType = 0x0002, - EProfileFlagRingingVolume = 0x0004, - EProfileFlagMessageAlertTone = 0x0008, - EProfileFlagInstantMessageAlertTone = 0x0010, - EProfileFlagVibratingAlert = 0x0020, - EProfileFlagKeypadVolume = 0x0040, - EProfileFlagWarningTones = 0x0080, - EProfileFlagAlertFor = 0x0100, - EProfileFlagAvailabilityAttribute = 0x0200, - EProfileFlagStatusMessage = 0x0400, - EProfileFlagProfileName = 0x0800, - EProfileFlagEmailAlertTone = 0x1000, - EProfileFlagVideoCallRingingTone = 0x2000, - EProfileFlagMediaVolume = 0x4000, - EProfileFlagTextToSpeechTone = 0x8000, -// Free slot = 0x10000, - EProfileFlagPttTone = 0x20000, - EProfileFlagPttStatus = 0x40000, - EProfileFlag3DEffect = 0x80000, - EProfileFlag3DEcho = 0x100000, - EProfileFlagTactileFeedback = 0x200000, - EProfileFlagAudioFeedback = 0x400000, - EProfileFlagAll = 0xFFFF - }; - -// FORWARD DECLARATIONS -class MProfileSetName; -class MProfileSetTones; -class MProfilePresence; -class MProfileSetPresence; -class MProfileSetExtraTones; -class MProfileSetExtraSettings; -class CRepository; - -// CLASS DECLARATION - -/** -* Extended profile interface. -* This interface extend MProfile interface. -* -* @lib N/A -* @since 2.0 -*/ -class MProfileExtended : public MProfile - { - protected: // Destructor - - virtual ~MProfileExtended() {}; - - public: // New functions - - /** - * This method set alert for items to the profile. - * @since 2.0 - * @param aAlertFor Alert for item array. - */ - virtual void SetAlertForL( - const TArray& aAlertFor ) = 0; - - /** - * Returns set profile name interface. - * @since 2.0 - * @return Returns set profile name interface. - */ - virtual MProfileSetName& ProfileSetName() const = 0; - - /** - * Returns set profile tones interface. - * @since 2.0 - * @return Returns set profile tones interface. - */ - virtual MProfileSetTones& ProfileSetTones() const = 0; - - /** - * Returns profile presence interface. - * @since 2.0 - * @return Returns profile presence interface. - */ - virtual const MProfilePresence& ProfilePresence() const = 0; - - /** - * Returns set profile presence interface. - * @since 2.0 - * @return Returns set profile presence interface. - */ - virtual MProfileSetPresence& ProfileSetPresence() const = 0; - - /** - * Returns set profile extra tones interface. - * @since 2.0 - * @return Returns set profile extra tones interface. - */ - virtual MProfileSetExtraTones& ProfileSetExtraTones() const = 0; - - /** - * Returns profile modifiable flags. See TProfileFlags. - * @since 2.0 - * @return Returns profile modifiable flags. - */ - virtual TUint32 ModifiableFlags() const = 0; - - /** - * Returns profile visible flags. See TProfileFlags. - * @since 2.0 - * @return Returns profile visible flags. - */ - virtual TUint32 VisibleFlags() const = 0; - - /** - * Externalize data to Central Repository. - * @since 2.8 - * @param aCenRep Central Repository object to write the settings - */ - virtual void ExternalizeL( CRepository& aCenRep ) = 0; - - /** - * Returns set profile extra settings interface. - * @since 3.0 - * @return set profile extra settings interface. - */ - virtual MProfileSetExtraSettings& ProfileSetExtraSettings() const = 0; - - }; - -#endif // __MPROFILEEXTENDED_H__ - -// End of File diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/MProfilePresence.h --- a/profilesservices/ProfileEngine/EngInc/MProfilePresence.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +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 presence interface. -* -*/ - - - -#ifndef __MPROFILEPRESENCE_H -#define __MPROFILEPRESENCE_H - -// INCLUDES -#include - -// CLASS DECLARATION - -/** -* Profile presence interface. -* This interface offers methods to get status message and -* availability attribute. -* -* @lib N/A -* @since 2.0 -*/ -class MProfilePresence - { - protected: // Destructor - - virtual ~MProfilePresence() {}; - - public: // New functions - - /** - * Return status message of the profile. - * @since 2.1 - * @return Status message of the profile. - */ - virtual const TDesC& StatusMessage() const = 0; - - /** - * Return availability attribute of the profile. - * @since 2.1 - * @return Return availability attribute of the profile. - */ - virtual TUint32 AvailabilityAttribute() const = 0; - - }; - -#endif // __MPROFILEPRESENCE_H - -// End of File diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/MProfileSet3DToneSettings.h --- a/profilesservices/ProfileEngine/EngInc/MProfileSet3DToneSettings.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +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 set 3D tone settings interface. -* -*/ - - - -#ifndef MPROFILESET3DTONESETTINGS_H -#define MPROFILESET3DTONESETTINGS_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS - -// CLASS DECLARATION - -/** -* Profile set 3D tone settings interface. -* @since 3.1 -*/ -class MProfileSet3DToneSettings - { - protected: // Destructor - - virtual ~MProfileSet3DToneSettings() {}; - - public: // New functions - - /** - * Set 3D tone effect of the profile. - * @since 3.1 - */ - virtual void SetEffect( TProfile3DToneEffect aEffect ) = 0; - - /** - * Set 3D tone echo of the profile. - * @since 3.1 - */ - virtual void SetEcho( TProfile3DToneEcho aEcho ) = 0; - - }; - -#endif // MPROFILESET3DTONESETTINGS_H - -// End of File - - - diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/MProfileSetExtraSettings.h --- a/profilesservices/ProfileEngine/EngInc/MProfileSetExtraSettings.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +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 settings interface. -* -*/ - - - -#ifndef MPROFILESETEXTRASETTINGS_H -#define MPROFILESETEXTRASETTINGS_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class MProfileSetPttSettings; -class MProfileSetFeedbackSettings; -class MProfileSet3DToneSettings; - -// CLASS DECLARATION - -/** -* Interface for modifying Profiles extra settings. -* @since 3.1 -*/ -class MProfileSetExtraSettings - { - protected: // Destructor - - virtual ~MProfileSetExtraSettings() {}; - - public: // New functions - - /** - * Returns set profile ptt settings interface. - * @return set profile ptt settings interface. - * @since 3.1 - */ - virtual MProfileSetPttSettings& ProfileSetPttSettings() const = 0; - - /** - * Returns set profile feedback settings interface. - * @return set profile feedback settings interface. - * @since 5.0 - */ - virtual MProfileSetFeedbackSettings& ProfileSetFeedbackSettings() const = 0; - - /** - * Returns set profile 3D tone settings interface. - * @return set profile 3D tone settings interface. - * @since 3.1 - */ - virtual MProfileSet3DToneSettings& ProfileSet3DToneSettings() const = 0; - - }; - -#endif // MPROFILESETEXTRASETTINGS_H - -// End of File - - diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/MProfileSetExtraTones.h --- a/profilesservices/ProfileEngine/EngInc/MProfileSetExtraTones.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +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: Set profile extra tones interface. -* -*/ - - - -#ifndef __MPROFILESETEXTRATONES_H -#define __MPROFILESETEXTRATONES_H - -// INCLUDES -#include - -// CLASS DECLARATION - -/** -* Set profile extra tones interface. -* This interface offers methods to set IM message alert tone file name. -* -* @lib N/A -* @since 2.0 -*/ -class MProfileSetExtraTones - { - protected: // Destructor - - virtual ~MProfileSetExtraTones() {}; - - public: // New functions - - /** - * Set IM message alert tone file name. - * @since 2.0 - * @param aIMMessageAlertTone IM message alert tone. - */ - virtual void SetIMMessageAlertToneL( - const TDesC& aIMMessageAlertTone ) = 0; - - /** - * Set Email alert tone file name. - * @since 2.0 - * @param aEmailAlertTone Email alert tone. - */ - virtual void SetEmailAlertToneL( - const TDesC& aEmailAlertTone ) = 0; - - /** - * Set Video call ringing tone file name. - * @since 2.6 - * @param aRingingTone Video call ringing tone file name. - */ - virtual void SetVideoCallRingingToneL( - const TDesC& aRingingTone ) = 0; - - }; - - -#endif // __MPROFILESETEXTRATONES_H - -// End of File diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/MProfileSetFeedbackSettings.h --- a/profilesservices/ProfileEngine/EngInc/MProfileSetFeedbackSettings.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* 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: Profile set feedback settings interface. -* -*/ - - - -#ifndef MPROFILESETFEEDBACKSETTINGS_H -#define MPROFILESETFEEDBACKSETTINGS_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS - -// CLASS DECLARATION - -/** -* Profile set feedback settings interface. -* @since 5.0 -*/ -class MProfileSetFeedbackSettings - { - protected: // Destructor - - virtual ~MProfileSetFeedbackSettings() {}; - - public: // New functions - - /** - * Set tactile feedback of the profile. - * @since 5.0 - */ - virtual void SetTactileFeedback( TProfileTactileFeedback aTactileFeedback ) = 0; - - /** - * Set audio feedback of the profile. - * @since 5.0 - */ - virtual void SetAudioFeedback( TProfileAudioFeedback aAudioFeedback ) = 0; - - }; - -#endif // MPROFILESETFEEDBACKSETTINGS_H - -// End of File - - - diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/MProfileSetName.h --- a/profilesservices/ProfileEngine/EngInc/MProfileSetName.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +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: Set profile name interface. -* -*/ - - - -#ifndef __MPROFILESETNAME_H -#define __MPROFILESETNAME_H - -// INCLUDES -#include - -// CLASS DECLARATION - -/** -* Set profile name interface. -* This interface offers method to set profile name. -* -* @lib N/A -* @since 2.0 -*/ -class MProfileSetName - { - protected: // Destructor - - virtual ~MProfileSetName() {}; - - public: // New functions - - /** - * Set name of the profile. - * @since 2.0 - * @param aName Name of the profile. - */ - virtual void SetNameL( const TDesC& aName ) = 0; - - }; - -#endif // __MPROFILESETNAME_H - -// End of File diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/MProfileSetPresence.h --- a/profilesservices/ProfileEngine/EngInc/MProfileSetPresence.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +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: Set profile presence settings interface. -* -*/ - - - -#ifndef __MPROFILESETPRESENCE_H -#define __MPROFILESETPRESENCE_H - -// INCLUDES -#include - -// CLASS DECLARATION - -/** -* Set profile presence settings interface. -* This interface offers methods to set profile status message and -* availability attribute. -* -* @lib N/A -* @since 2.0 -*/ -class MProfileSetPresence - { - protected: // Destructor - - virtual ~MProfileSetPresence() {}; - - public: // New functions - - /** - * Set status message of the profile. - * @since 2.0 - * @param aStatusMessage status message of the profile. - */ - virtual void SetStatusMessageL( const TDesC& aStatusMessage ) = 0; - - /** - * Set availability attribute of the profile. - * @since 2.0 - * @param aAvailabilityAttribute Availability attribute of the profile. - */ - virtual void SetAvailabilityAttribute( - const TUint32 aAvailabilityAttribute ) = 0; - }; - -#endif // __MPROFILESETPRESENCE_H - -// End of File diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/MProfileSetPttSettings.h --- a/profilesservices/ProfileEngine/EngInc/MProfileSetPttSettings.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +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 set PTT settings interface. -* -*/ - - - -#ifndef MPROFILESETPTTSETTINGS_H -#define MPROFILESETPTTSETTINGS_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS - -// CLASS DECLARATION - -/** -* Profile set PTT settings interface. -* @since 3.1 -*/ -class MProfileSetPttSettings - { - protected: // Destructor - - virtual ~MProfileSetPttSettings() {}; - - public: // New functions - - /** - * Set PTT ringing tone file name. - * @since 3.1 - */ - virtual void SetPttRingingToneL( const TDesC& aPttRingingTone ) = 0; - - /** - * Set PTT status of the profile. - * @since 3.1 - */ - virtual void SetPttStatus( TProfilePttStatus aPttStatus ) = 0; - - }; - -#endif // MPROFILESETPTTSETTINGS_H - -// End of File - - diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/MProfileSetTones.h --- a/profilesservices/ProfileEngine/EngInc/MProfileSetTones.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +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: Set tone settings interface. -* -*/ - - - -#ifndef __MPROFILESETTONES_H -#define __MPROFILESETTONES_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -struct TProfileToneSettings; - -// CLASS DECLARATION - -/** -* Set tone settings interface. -* This interface offers methods to set line 1 and 2 ringing tone, -* message alert tone and tone settings. -* -* @lib N/A -* @since 2.0 -*/ -class MProfileSetTones - { - protected: // Destructor - - virtual ~MProfileSetTones() {}; - - public: // New functions - - /** - * Set line 1 ringing tone. - * @since 2.0 - * @param aRingingTone File name of the ringing tone. - */ - virtual void SetRingingTone1L( const TDesC& aRingingTone ) = 0; - - /** - * Set line 2 ringing tone. - * @since 2.0 - * @param aRingingTone File name of the ringing tone. - */ - virtual void SetRingingTone2L( const TDesC& aRingingTone ) = 0; - - /** - * Set message alert tone. - * @since 2.0 - * @param aMessageAlertTone File name of the message alert tone. - */ - virtual void SetMessageAlertToneL( - const TDesC& aMessageAlertTone ) = 0; - - /** - * Set tone settings of the profile. - * @since 2.0 - * @return Tone settings structure. - */ - virtual TProfileToneSettings& SetToneSettings() = 0; - - }; - -#endif // __MPROFILESETTONES_H - -// End of File diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/MProfileUtilitySingleton.h --- a/profilesservices/ProfileEngine/EngInc/MProfileUtilitySingleton.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +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 Utility interface. -* -*/ - - - -#ifndef __MPROFILEUTILITYSINGLETON_H__ -#define __MPROFILEUTILITYSINGLETON_H__ - -// INCLUDES - -// FORWARD DECLARATIONS -class MProfileUtilitySingleton; -class MProfilesLocalFeatures; - -// FUNCTION PROTOTYPES -/** -* Return reference to MProfileUtilitySingleton instance. Create it if -* necessary. For each succesful InstanceL() call there must be a corres- -* ponding Release() call, so that the internal reference counting works. -* @since 3.2 -* @return Reference to the only MProfileUtilitySingleton instance. -*/ -IMPORT_C MProfileUtilitySingleton& ProfileUtilityInstanceL(); - -/** -* Release the resources of MProfileUtilitySingleton (when there are no -* references to it anymore). For each succesful InstanceL() call there -* must be a corresponding Release() call, so that the internal -* reference counting works. -* @since 3.2 -*/ -IMPORT_C void ReleaseProfileUtility(); - - -// CLASS DECLARATION -/** -* Profile utility class. -* -* @lib profileeng.lib -* @since 3.2 -*/ -class MProfileUtilitySingleton - { - protected: // Destructor - - virtual ~MProfileUtilitySingleton() {}; - - public: // New functions - - /** - * Returns a reference to MProfilesLocalFeatures instance owned by - * this MProfileUtility instance. - * @since 3.2 - */ - virtual MProfilesLocalFeatures& ProfilesLocalFeatures() = 0; - - }; - -#endif // __MPROFILEUTILITYSINGLETON_H__ - -// End of File - diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/MProfilesLocalFeatures.h --- a/profilesservices/ProfileEngine/EngInc/MProfilesLocalFeatures.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +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: Interface for locally variated features of Profiles. -* -*/ - - - -#ifndef __MPROFILESLOCALFEATURES_H__ -#define __MPROFILESLOCALFEATURES_H__ - -// CLASS DECLARATION - -/** -* Profiles local feature variation interface. -* MProfilesLocalFeatures offers simple interface to get locally variated -* features of Profiles. -* How to use: -* Get local features object with MProfileEngineExtended::LocalFeaturesL(). -* MProfilesLocalFeatures& features = iProfileEngine->LocalFeatures(); -* Check whether a feature is supported (use the ID:s defined in -* ProfilesVariant.hrh): -* if( features.IsFeatureSupported( KFeatureIdSomeFeature ) ) -* { -* // do stuff -* } -* -* @lib N/A -* @since 2.6 -*/ -class MProfilesLocalFeatures - { - protected: // Destructor - - virtual ~MProfilesLocalFeatures() {}; - - public: // New functions - - /** - * Checks if the given feature is supported or not. - * @since 2.6 - * @return ETrue if the feature is supported, EFalse otherwise. - */ - virtual TBool IsFeatureSupported( TInt aFeatureId ) const = 0; - - /** - * Checks if the given MIME-type is explicitly blocked from using as - * an alert tone. - * @since 3.1 - * @param aMimeType the MIME-type to be checked. - * @return ETrue if the MIME-type is blocked, EFalse otherwise. - */ - virtual TBool IsBlockedType( const TDesC& aMimeType ) = 0; - - /** - * Checks if the given MIME-type is explicitly blocked from using as - * an alert tone if the alert tone file of the type is unprotected. - * @since 3.1 - * @param aMimeType the MIME-type to be checked. - * @return ETrue if the MIME-type is blocked if the alert tone file is - * unprotected, EFalse otherwise. - */ - virtual TBool IsBlockedUnprotectedType( const TDesC& aMimeType ) = 0; - - /** - * Checks if the given MIME-type is explicitly blocked from using as - * an alert tone if the alert tone file of the type is protected. - * @since 3.1 - * @param aMimeType the MIME-type to be checked. - * @return ETrue if the MIME-type is blocked if the alert tone file is - * protected, EFalse otherwise. - */ - virtual TBool IsBlockedProtectedType( const TDesC& aMimeType ) = 0; - - /** - * Checks if the given MIME-type is explicitly blocked from demo - * playing. - * @since 3.1 - * @param aMimeType the MIME-type to be checked. - * @return ETrue if the MIME-type is blocked from demo-playing, - * EFalse otherwise. - */ - virtual TBool IsBlockedDemoPlayType( const TDesC& aMimeType ) = 0; - - /** - * Checks if the given MIME-type is explicitly excluded from the tone - * selection list. Also when tried to be set as alert tones through - * other means, should behave as the tone would be in blocked type list. - * @since 3.1 - * @param aMimeType the MIME-type to be checked. - * @return ETrue if the MIME-type is excluded from the tone selection - * list, EFalse otherwise. - */ - virtual TBool IsExcludedType( const TDesC& aMimeType ) = 0; - }; - -#endif // __MPROFILESLOCALFEATURES_H__ - -// End of File diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/ProfileEng.hrh --- a/profilesservices/ProfileEngine/EngInc/ProfileEng.hrh Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +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: Profiles Engine enumeration TProfileSettingKeyType -* and TProfileSettingId. -* -*/ - - -#ifndef __PROFILEENG_HRH__ -#define __PROFILEENG_HRH__ - -#define PROFILES_ENGINE_RESOURCE_SIGNATURE 75 -#define PROFILES_MAX_NAME_LENGTH 64 -#define PROFILES_MAX_STATUS_MSG_LENGTH 40 -#define PROFILES_MAX_CALL_OBJECT_TEXT_LENGTH 1000 - -// DATA TYPES -enum TProfileSettingKeyType - { - EProfileSettingKeyTypeInt = 0, - EProfileSettingKeyTypeString = 1, - EProfileSettingKeyTypeBin = 2, - EProfileSettingKeyTypeReal = 3 - }; - -enum TProfileSettingId - { - EProfileSettingIdModifiableFlags = 0x00000000, - EProfileSettingIdVisibleFlags = 0x00000001, - EProfileSettingIdProfileName = 0x00000002, - EProfileSettingIdAlertForGroups = 0x00000003, - EProfileSettingIdRingingTone = 0x00000004, - EProfileSettingIdRingingTone2 = 0x00000005, - EProfileSettingIdMsgTone = 0x00000006, - EProfileSettingIdRingingType = 0x00000007, - EProfileSettingIdKeypadVolume = 0x00000008, - EProfileSettingIdRingingVolume = 0x00000009, - EProfileSettingIdVibra = 0x0000000A, - EProfileSettingIdWarnAndGameTones = 0x0000000B, - EProfileSettingIdImTone = 0x0000000C, - EProfileSettingIdEmailTone = 0x0000000D, - EProfileSettingIdVideoCallTone = 0x0000000E, - EProfileSettingIdStatusMsg = 0x0000000F, - EProfileSettingIdAvailAttribute = 0x00000010, - EProfileSettingIdMediaVolume = 0x00000011, - EProfileSettingIdTextToSpeechTone = 0x00000012, - EProfileSettingIdNameChanged = 0x00000013, - EProfileSettingIdCallObjectContent = 0x00000014, - EProfileSettingIdPttTone = 0x00000015, - EProfileSettingIdPttStatus = 0x00000016, - EProfileSettingId3DEffect = 0x00000017, - EProfileSettingId3DEcho = 0x00000018, - EProfileSettingIdTactileFeedback = 0x00000019, - EProfileSettingIdAudioFeedback = 0x0000001A, - EProfileSettingIdEmailVibra=0x0000001B - }; - -#endif // __PROFILEENG_HRH__ - -// End of File - diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/ProfileEng.rh --- a/profilesservices/ProfileEngine/EngInc/ProfileEng.rh Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +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: Profiles Engine resource structures. -* -*/ - - -// STRUCTURE DEFINITIONS - -// ----------------------------------------------------------------------------- -// DEFAULT_PROFILES -// Default profiles -// ----------------------------------------------------------------------------- -// -STRUCT DEFAULT_PROFILES - { - STRUCT items[]; - } - -// ----------------------------------------------------------------------------- -// PROFILE -// profile default name and ID -// ----------------------------------------------------------------------------- -// -STRUCT PROFILE - { - LONG id = 0; - LTEXT name = ""; - LTEXT shortname = ""; - LTEXT naviname = ""; - LTEXT titlename = ""; - } - -// ----------------------------------------------------------------------------- -// PROFILE_SETTINGS -// Profile settings -// ----------------------------------------------------------------------------- -// -STRUCT PROFILE_SETTINGS - { - STRUCT items[]; - } - -// ----------------------------------------------------------------------------- -// PROFILE SETTING -// profile setting for dynamic profiles -// ----------------------------------------------------------------------------- -// -STRUCT PROFILE_SETTING - { - LONG id = 0; - LONG key_type = 0; - } - -// End of File diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/ProfileEngineConstants.h --- a/profilesservices/ProfileEngine/EngInc/ProfileEngineConstants.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +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: Profiles engine constants -* -*/ - - - -#ifndef PROFILEENGINECONSTANTS_H -#define PROFILEENGINECONSTANTS_H - -// INCLUDES -#include -#include "ProfileEng.hrh" - -// CONSTANTS -const TInt KProfileFileEstimationSize( 400 ); -const TInt KProfilesMaxNumberOfDynamicProfiles( 20 ); -const TInt KProfilesMaxTIntLength( 11 ); -const TInt KProfileMaxNameLength( PROFILES_MAX_NAME_LENGTH ); -const TInt KProfileMaxCallObjectTextLength( 1000 ); -const TInt KProfileBaseDynamicProfileId( 30 ); // first dynamic profile ID -// Used for profile settings cenrep-keys - profile id is encoded in the MSB: -const TInt KProfileIdShift( 24 ); - -_LIT( KProfileDriveC, "c:" ); -_LIT( KProfileDriveZ, "z:" ); -_LIT( KProfileFilePrefix, "Profile" ); -_LIT( KProfileFileExtension, ".dat" ); -_LIT( KProfileFilePath, "\\System\\Data\\Profiles\\" ); -_LIT( KProfileEngineResourceDriveAndDir, "Z:ProfileEng.rsc" ); -_LIT( KProfileMutexName, "ProfileFileAccessMutexName" ); - -#endif // PROFILEENGINECONSTANTS_H - -// End of File diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/ProfileEngineInternalCRKeys.h --- a/profilesservices/ProfileEngine/EngInc/ProfileEngineInternalCRKeys.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +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: Profiles engine internal Central Repository keys. -* -*/ - - - -#ifndef PROFILEENGINEINTERNALCRKEYS_H -#define PROFILEENGINEINTERNALCRKEYS_H - -// INCLUDES -#include -#include - -// CONSTANTS - -/** - * Information about whether self recorded tones can be used as ringing tones - * or not. Integer value. - * - * Possible values: - * - * 0 (disabled) - * 1 (enabled) - */ -const TUint32 KProEngRecordedRingingTones = 0x80000100; - -/** - * If this is true, DRM protected MP4 tones are not allowed as ringing tones. - * - * Possible values: - * - * 0 (allowed, default) - * 1 (not allowed) - */ -const TUint32 KProEngNoDrmMP4RingingTones = 0x80000101; - -/** - * If this is true, WMA tones are not allowed as ringing tones. - * - * Possible values: - * - * 0 (allowed, default) - * 1 (not allowed) - */ -const TUint32 KProEngNoWmaRingingTones = 0x80000102; - -/** - * Tactile feedback setting for the currently active profile. - * THIS COULD BE MOVED TO THE SDK HEADER LATER? - * - * Possible values: - * - * 0 (Off) - * 1 (Level 1) - * 2 (Level 2) - * 3 (Level 3) - */ -const TUint32 KProEngActiveTactileFeedback = 0x7E000019; - -/** - * Audio feedback setting for the currently active profile. - * THIS COULD BE MOVED TO THE SDK HEADER LATER? - * - * Possible values: - * - * 0 (Off) - * 1 (Level 1) - * 2 (Level 2) - * 3 (Level 3) - */ -const TUint32 KProEngActiveAudioFeedback = 0x7E00001A; - - -#endif // PROFILEENGINEINTERNALCRKEYS_H - -// End of File diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/ProfileEngineInternalPSKeys.h --- a/profilesservices/ProfileEngine/EngInc/ProfileEngineInternalPSKeys.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +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: Profiles engine internal Publish & Subscribe keys. -* -*/ - - - -#ifndef PROFILEENGINEINTERNALPSKEYS_H -#define PROFILEENGINEINTERNALPSKEYS_H - -// INCLUDES -#include - -// CONSTANTS -const TUid KPSUidProfileEngine = {0x101F879F}; - -#endif // PROFILEENGINEINTERNALPSKEYS_H - -// End of File - diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/ProfileEnginePrivateCRKeys.h --- a/profilesservices/ProfileEngine/EngInc/ProfileEnginePrivateCRKeys.h Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngInc/ProfileEnginePrivateCRKeys.h Fri Mar 19 09:34:30 2010 +0200 @@ -23,7 +23,7 @@ // INCLUDES #include #include -#include "ProfileEng.hrh" +#include // CONSTANTS /** @@ -195,20 +195,6 @@ 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). * diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngInc/ProfileEnginePrivatePSKeys.h --- a/profilesservices/ProfileEngine/EngInc/ProfileEnginePrivatePSKeys.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +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: Profiles engine internal Publish & Subscribe keys. -* -*/ - - - -#ifndef PROFILEENGINEPRIVATEPSKEYS_H -#define PROFILEENGINEPRIVATEPSKEYS_H - -// INCLUDES -#include -#include "ProfileEngineInternalPSKeys.h" - -// CONSTANTS - -/** - * A setting in the current active profile was modified. This is used - * internally by Profiles Engine notification mechanism. - * Default value: 0. - */ -const TUint32 KProEngActiveProfileModified = 0x7D000001; - -/** - * The current active profile has changed (or the active profile has been - * reactivated). This is used internally by Profiles Engine notification - * mechanism. - * Default value: 0. - */ -const TUint32 KProEngActiveProfileChanged = 0x7D000002; - -/** - * Power save mode has changed. - * This is used internally by Profiles Engine. - * Default value: 0. - */ -const TUint32 KProEngPsmChanged = 0x7D000003; - -#endif // PROFILEENGINEPRIVATEPSKEYS_H - -// End of File diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfile3DToneSettingsImpl.h --- a/profilesservices/ProfileEngine/EngSrc/CProfile3DToneSettingsImpl.h Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfile3DToneSettingsImpl.h Fri Mar 19 09:34:30 2010 +0200 @@ -23,7 +23,7 @@ // INCLUDES #include #include -#include "MProfileSet3DToneSettings.h" +#include // FORWARD DECLARATIONS class CRepository; diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileChangeNotifyHandler.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileChangeNotifyHandler.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileChangeNotifyHandler.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -18,12 +18,12 @@ // INCLUDE FILES -#include "CProfileChangeNotifyHandler.h" -#include "MProfileChangeObserver.h" #include "ProfileEngPanic.h" -#include "ProfileEngineSDKCRKeys.h" -#include "ProfileEnginePrivatePSKeys.h" +#include +#include +#include #include +#include // ============================ MEMBER FUNCTIONS =============================== diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,6 +19,14 @@ // 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 @@ -29,28 +37,20 @@ #include #include #include -#include "CProfilesNamesArrayImpl.h" -#include "CProfileImpl.h" -#include "CProfileNameImpl.h" -#include "ProfileEngUtils.h" -#include "MProfileSetName.h" -#include "ProfileEng.hrh" -#include "ProfileEngineConstants.h" -#include "ProfileEngPanic.h" -#include "MProfileSetTones.h" -#include "MProfileSetExtraTones.h" -#include "MProfileExtraSettings.h" -#include "MProfileFeedbackSettings.h" -#include "MProfilesLocalFeatures.h" -#include "MProfileUtilitySingleton.h" -#include "ProfilesVariant.hrh" // KProEngFeatureIdVTRingingTone -#include "CProfileTiming.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // KProEngFeatureIdVTRingingTone #include -#include "ProfileEnginePrivateCRKeys.h" -#include "ProfileEnginePrivatePSKeys.h" +#include #include #include -#include "ProfilesDebug.h" #include #include diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.h --- a/profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.h Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.h Fri Mar 19 09:34:30 2010 +0200 @@ -24,8 +24,8 @@ #include #include // RFs #include // TProfileRingingVolume -#include "MProfileEngineExtended.h" // MProfileEngineExtended -#include "MProfileExtended.h" // MProfileExtended +#include // MProfileEngineExtended +#include // MProfileExtended // FORWARD DECLARATIONS class CProfileNameImpl; diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileEngineImplDynamicProfiles.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileEngineImplDynamicProfiles.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileEngineImplDynamicProfiles.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,6 +19,13 @@ // 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 @@ -29,15 +36,8 @@ #include #include #include -#include "CProfilesNamesArrayImpl.h" -#include "CProfileImpl.h" -#include "CProfileNameImpl.h" -#include "ProfileEngUtils.h" -#include "MProfileSetName.h" -#include "ProfileEng.hrh" -#include "ProfileEngPanic.h" -#include "ProfileEngineConstants.h" -#include "ProfileEnginePrivateCRKeys.h" +#include +#include namespace { diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileExtraSettingsImpl.h --- a/profilesservices/ProfileEngine/EngSrc/CProfileExtraSettingsImpl.h Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileExtraSettingsImpl.h Fri Mar 19 09:34:30 2010 +0200 @@ -23,7 +23,7 @@ // INCLUDES #include #include -#include "MProfileSetExtraSettings.h" +#include // FORWARD DECLARATIONS class CRepository; diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileExtraTonesImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileExtraTonesImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileExtraTonesImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,11 +19,11 @@ // INCLUDE FILES #include "CProfileExtraTonesImpl.h" -#include "ProfilesVariant.hrh" +#include "ProfileEngUtils.h" +#include "ProfileEnginePrivateCRKeys.h" +#include #include #include -#include "ProfileEngUtils.h" -#include "ProfileEnginePrivateCRKeys.h" // ============================ MEMBER FUNCTIONS =============================== diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileExtraTonesImpl.h --- a/profilesservices/ProfileEngine/EngSrc/CProfileExtraTonesImpl.h Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileExtraTonesImpl.h Fri Mar 19 09:34:30 2010 +0200 @@ -23,7 +23,7 @@ // INCLUDES #include #include -#include "MProfileSetExtraTones.h" +#include // FORWARD DECLARATIONS class RWriteStream; diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileFeedbackSettingsImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileFeedbackSettingsImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileFeedbackSettingsImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -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 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileFeedbackSettingsImpl.h --- a/profilesservices/ProfileEngine/EngSrc/CProfileFeedbackSettingsImpl.h Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileFeedbackSettingsImpl.h Fri Mar 19 09:34:30 2010 +0200 @@ -23,7 +23,7 @@ // INCLUDES #include #include -#include "MProfileSetFeedbackSettings.h" +#include // FORWARD DECLARATIONS class CRepository; diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,9 +19,15 @@ // 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 @@ -30,16 +36,9 @@ #include #include #include -#include "CProfileNameImpl.h" -#include "CProfileTonesImpl.h" -#include "CProfileExtraTonesImpl.h" -#include "CProfileExtraSettingsImpl.h" -#include "CProfilePresenceImpl.h" -#include "MProfilesLocalFeatures.h" -#include "MProfileUtilitySingleton.h" -#include "ProfilesVariant.hrh" -#include "ProfileEngUtils.h" -#include "ProfileEnginePrivateCRKeys.h" +#include +#include +#include #include // CONSTANTS @@ -216,39 +215,7 @@ 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(); } diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileImpl.h --- a/profilesservices/ProfileEngine/EngSrc/CProfileImpl.h Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileImpl.h Fri Mar 19 09:34:30 2010 +0200 @@ -22,7 +22,7 @@ // INCLUDES #include -#include "MProfileExtended.h" +#include #include // NCentralRepositoryConstants::KMaxBinaryLength // CONSTANTS diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileNameImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileNameImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileNameImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,12 +19,12 @@ // INCLUDE FILES #include "CProfileNameImpl.h" +#include "ProfileEnginePrivateCRKeys.h" +#include "ProfileEngUtils.h" #include #include -#include "ProfileEngineConstants.h" +#include #include -#include "ProfileEnginePrivateCRKeys.h" -#include "ProfileEngUtils.h" // ============================ MEMBER FUNCTIONS =============================== diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileNameImpl.h --- a/profilesservices/ProfileEngine/EngSrc/CProfileNameImpl.h Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileNameImpl.h Fri Mar 19 09:34:30 2010 +0200 @@ -23,7 +23,7 @@ // INCLUDES #include #include -#include "MProfileSetName.h" +#include // FORWARD DECLARATIONS class RWriteStream; diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfilePresenceImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfilePresenceImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfilePresenceImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -20,14 +20,14 @@ // INCLUDE FILES #include "CProfilePresenceImpl.h" +#include "ProfileEnginePrivateCRKeys.h" +#include "ProfileEngUtils.h" #include #include #include #include -#include "ProfileEng.hrh" -#include "ProfileEngineConstants.h" -#include "ProfileEnginePrivateCRKeys.h" -#include "ProfileEngUtils.h" +#include +#include // EXTERNAL DATA STRUCTURES // EXTERNAL FUNCTION PROTOTYPES diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfilePresenceImpl.h --- a/profilesservices/ProfileEngine/EngSrc/CProfilePresenceImpl.h Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfilePresenceImpl.h Fri Mar 19 09:34:30 2010 +0200 @@ -22,8 +22,8 @@ // INCLUDES #include -#include "MProfilePresence.h" -#include "MProfileSetPresence.h" +#include +#include // CONSTANTS // MACROS diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfilePttSettingsImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfilePttSettingsImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfilePttSettingsImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,9 +19,9 @@ // INCLUDE FILES #include "CProfilePttSettingsImpl.h" -#include #include "ProfileEngUtils.h" #include "ProfileEnginePrivateCRKeys.h" +#include // ============================ MEMBER FUNCTIONS =============================== diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfilePttSettingsImpl.h --- a/profilesservices/ProfileEngine/EngSrc/CProfilePttSettingsImpl.h Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfilePttSettingsImpl.h Fri Mar 19 09:34:30 2010 +0200 @@ -23,7 +23,7 @@ // INCLUDES #include #include -#include "MProfileSetPttSettings.h" +#include // FORWARD DECLARATIONS class CRepository; diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileTiming.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileTiming.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileTiming.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -18,14 +18,14 @@ // INCLUDE FILES -#include "CProfileTiming.h" +#include "CProfileTiming.h" +#include "ProfileEnginePrivateCRKeys.h" +#include "ProfilesDebug.h" #include #include // TParse #include -#include "MProfilesLocalFeatures.h" -#include "ProfileEngineConstants.h" -#include "ProfileEnginePrivateCRKeys.h" -#include "ProfilesDebug.h" +#include +#include // LOCAL CONSTANTS AND MACROS namespace diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileTonesImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileTonesImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileTonesImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,10 +19,11 @@ // INCLUDE FILES #include "CProfileTonesImpl.h" +#include "ProfileEngUtils.h" +#include "ProfileEnginePrivateCRKeys.h" + #include #include -#include "ProfileEngUtils.h" -#include "ProfileEnginePrivateCRKeys.h" #include #include @@ -150,9 +151,6 @@ aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngVibra, aProfileId ), iProfileToneSettings.iVibratingAlert ) ); User::LeaveIfError( - aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngEmailVibra, - aProfileId ), iProfileToneSettings.iEmailVibratingAlert ) ); - User::LeaveIfError( aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngWarnAndGameTones, aProfileId ), iProfileToneSettings.iWarningAndGameTones ) ); User::LeaveIfError( @@ -167,7 +165,6 @@ if ( iPowerSaveMode ) { iProfileToneSettings.iVibratingAlert = iPsmConfigVibra; - iProfileToneSettings.iEmailVibratingAlert = iPsmConfigVibra; iProfileToneSettings.iKeypadVolume = TProfileKeypadVolume( iPsmConfigKeypadVolume ); } @@ -215,11 +212,8 @@ 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 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileTonesImpl.h --- a/profilesservices/ProfileEngine/EngSrc/CProfileTonesImpl.h Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileTonesImpl.h Fri Mar 19 09:34:30 2010 +0200 @@ -24,7 +24,7 @@ #include #include #include -#include "MProfileSetTones.h" +#include // FORWARD DECLARATIONS class RWriteStream; diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileUtilitySingletonImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfileUtilitySingletonImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileUtilitySingletonImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,9 +19,9 @@ // INCLUDE FILES #include "CProfileUtilitySingletonImpl.h" -#include "MProfilesLocalFeatures.h" #include "CProfilesLocalFeatures.h" #include "ProfilesDebug.h" +#include // ============================ MEMBER FUNCTIONS =============================== diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfileUtilitySingletonImpl.h --- a/profilesservices/ProfileEngine/EngSrc/CProfileUtilitySingletonImpl.h Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfileUtilitySingletonImpl.h Fri Mar 19 09:34:30 2010 +0200 @@ -23,7 +23,7 @@ // INCLUDES #include -#include "MProfileUtilitySingleton.h" +#include // FORWARD DECLARATIONS class MProfilesLocalFeatures; diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfilesLocalFeatures.h --- a/profilesservices/ProfileEngine/EngSrc/CProfilesLocalFeatures.h Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfilesLocalFeatures.h Fri Mar 19 09:34:30 2010 +0200 @@ -23,7 +23,7 @@ // INCLUDES #include -#include "MProfilesLocalFeatures.h" +#include // FORWARD DECLARATIONS class CRepository; diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/CProfilesNamesArrayImpl.cpp --- a/profilesservices/ProfileEngine/EngSrc/CProfilesNamesArrayImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/CProfilesNamesArrayImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,12 +19,12 @@ // INCLUDE FILES #include "CProfilesNamesArrayImpl.h" +#include "CProfileNameImpl.h" +#include "ProfileEngPanic.h" #include #include -#include "CProfileNameImpl.h" -#include "ProfileEng.hrh" -#include "ProfileEngPanic.h" -#include "ProfileEngineConstants.h" +#include +#include // LOCAL CONSTANTS AND MACROS const TInt KProfileNamesGranularity( 5 ); diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/EngSrc/ProfileEngUtils.cpp --- a/profilesservices/ProfileEngine/EngSrc/ProfileEngUtils.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/EngSrc/ProfileEngUtils.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -20,7 +20,7 @@ // INCLUDE FILES #include "ProfileEngUtils.h" #include "CProfileEngineImpl.h" -#include "ProfileEngineConstants.h" +#include #include #include #include diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.cpp --- a/profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,23 +19,16 @@ // INCLUDE FILES #include "CProfileChangeEvent.h" +#include "ProfileEnginePrivateCRKeys.h" +#include "ProfilesDebug.h" #include #include -#include #include #include -#include -#include - -#include -#include -#include #include -#include "ProfileEnginePrivateCRKeys.h" -#include "ProfileEngineConstants.h" -#include "ProfilesDebug.h" +#include // CONSTANTS @@ -63,10 +56,6 @@ // void CProfileChangeEvent::ConstructL() { - FeatureManager::InitializeLibL(); - iCoverDisplay = FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ); - - User::LeaveIfError( iFs.Connect() ); // Open/Create mutex TInt error( KErrNotFound ); @@ -81,7 +70,6 @@ } User::LeaveIfError( error ); iProfileEngine = CreateProfileEngineL( &iFs ); - iGlobalNote = CAknGlobalNote::NewL(); ReadResourcesL(); } @@ -117,16 +105,12 @@ // Destructor CProfileChangeEvent::~CProfileChangeEvent() { - delete iNoteText; - delete iGlobalNote; if( iProfileEngine ) { iProfileEngine->Release(); } iFs.Close(); iMutex.Close(); - - FeatureManager::UnInitializeLib(); } @@ -202,15 +186,6 @@ // 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 ); } // ----------------------------------------------------------------------------- @@ -220,35 +195,6 @@ // 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 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.h --- a/profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.h Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.h Fri Mar 19 09:34:30 2010 +0200 @@ -27,7 +27,6 @@ // FORWARD DECLARATIONS class MProfileEngine; -class CAknGlobalNote; // CLASS DECLARATION @@ -111,26 +110,14 @@ // 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 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/WrapperSrc/CProEngActiveProfileDelegate.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngActiveProfileDelegate.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngActiveProfileDelegate.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,7 +19,7 @@ // INCLUDE FILES #include "CProEngActiveProfileDelegate.h" -#include "ProfileEnginePrivatePSKeys.h" // KProEngActiveProfileModified +#include // KProEngActiveProfileModified #include // ============================ MEMBER FUNCTIONS =============================== diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/WrapperSrc/CProEngAlertToneSeekerImpl.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngAlertToneSeekerImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngAlertToneSeekerImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,6 +19,7 @@ // INCLUDE FILES #include "CProEngAlertToneSeekerImpl.h" +#include "CProEngPostFilter.h" #include #include #include @@ -26,7 +27,6 @@ #include // RFs, TParse #include #include -#include "CProEngPostFilter.h" namespace { diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/WrapperSrc/CProEngCenRepObserverBase.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngCenRepObserverBase.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngCenRepObserverBase.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -20,8 +20,8 @@ // INCLUDE FILES #include "CProEngCenRepObserverBase.h" #include -#include "ProfileEnginePrivatePSKeys.h" -#include "ProfileEngineSDKCRKeys.h" +#include +#include // ============================ MEMBER FUNCTIONS =============================== diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/WrapperSrc/CProEngEngineImpl.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngEngineImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngEngineImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,14 +19,14 @@ // INCLUDE FILES #include "CProEngEngineImpl.h" +#include "CProEngProfileImpl.h" +#include "CProEngToneHandler.h" +#include "CProEngProfileNameArrayImpl.h" #include #include #include -#include "MProfileEngineExtended.h" -#include "ProfileEngineConstants.h" -#include "CProEngProfileImpl.h" -#include "CProEngToneHandler.h" -#include "CProEngProfileNameArrayImpl.h" +#include +#include // ============================ MEMBER FUNCTIONS =============================== diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/WrapperSrc/CProEngMediaVariation.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngMediaVariation.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngMediaVariation.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,12 +19,12 @@ // INCLUDE FILES #include "CProEngMediaVariation.h" +#include "ProEngMmfInfoUtility.h" #include #include // RApaLsSession -#include "ProfileEngineInternalCRKeys.h" -#include "ProEngMmfInfoUtility.h" -#include "MProfileUtilitySingleton.h" -#include "MProfilesLocalFeatures.h" +#include +#include +#include namespace { diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/WrapperSrc/CProEngNotifyHandlerImpl.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngNotifyHandlerImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngNotifyHandlerImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -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 "ProfileEngineConstants.h" -#include "ProfileEnginePrivateCRKeys.h" -#include "ProfileEnginePrivatePSKeys.h" -#include "CProEngProfileActivationDelegate.h" -#include "CProEngActiveProfileDelegate.h" -#include "CProEngProfileNameArrayEventDelegate.h" -#include "CProEngProfileEventDelegate.h" +#include +#include // ============================= LOCAL FUNCTIONS =============================== diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/WrapperSrc/CProEngProfileActivationDelegate.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileActivationDelegate.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileActivationDelegate.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -21,8 +21,8 @@ #include "CProEngProfileActivationDelegate.h" #include #include -#include "ProfileEnginePrivatePSKeys.h" // KProEngActiveProfileChanged -#include "ProfileEngineSDKCRKeys.h" // KCRUidProfileEngine etc. +#include // KProEngActiveProfileChanged +#include // KCRUidProfileEngine etc. // ============================ MEMBER FUNCTIONS =============================== diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/WrapperSrc/CProEngProfileImpl.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -23,10 +23,10 @@ #include "CProEngTonesImpl.h" #include "CProEngToneSettingsImpl.h" #include "CProEngEngineImpl.h" -#include "MProfileExtended.h" -#include "MProfileEngineExtended.h" -#include "MProfileSetTones.h" -#include "MProfileExtended.h" +#include +#include +#include +#include // ============================ MEMBER FUNCTIONS =============================== diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameImpl.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngProfileNameImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -21,7 +21,7 @@ #include "CProEngProfileNameImpl.h" #include #include -#include "MProfileSetName.h" +#include #include "CProEngEngineImpl.h" // ============================ MEMBER FUNCTIONS =============================== diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/WrapperSrc/CProEngPubSubObserverBase.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngPubSubObserverBase.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngPubSubObserverBase.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,7 +19,7 @@ // INCLUDE FILES #include "CProEngPubSubObserverBase.h" -#include "ProfileEnginePrivatePSKeys.h" +#include // ============================ MEMBER FUNCTIONS =============================== diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandler.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandler.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandler.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,12 +19,11 @@ // 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 @@ -210,29 +209,8 @@ // 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 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandler.h --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandler.h Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngToneHandler.h Fri Mar 19 09:34:30 2010 +0200 @@ -25,7 +25,7 @@ #include // CBase, RFs #include // KMaxDataTypeLength #include -#include "ProfileEng.hrh" // TProfileSettingId +#include // TProfileSettingId // FORWARD DECLARATIONS class DRMCommon; diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/WrapperSrc/CProEngToneSettingsImpl.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngToneSettingsImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngToneSettingsImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -21,9 +21,9 @@ #include "CProEngToneSettingsImpl.h" #include #include -#include "MProfileSetTones.h" -#include "MProfileSetExtraTones.h" -#include "MProfileExtended.h" +#include +#include +#include // ============================ MEMBER FUNCTIONS =============================== diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/WrapperSrc/CProEngTonesImpl.cpp --- a/profilesservices/ProfileEngine/WrapperSrc/CProEngTonesImpl.cpp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngTonesImpl.cpp Fri Mar 19 09:34:30 2010 +0200 @@ -19,13 +19,13 @@ // INCLUDE FILES #include "CProEngTonesImpl.h" +#include "CProEngToneHandler.h" #include #include -#include "MProfileSetTones.h" -#include "MProfileSetExtraTones.h" -#include "MProfileExtended.h" -#include "CProEngToneHandler.h" -#include "ProfileEng.hrh" // TProfileSettingId +#include +#include +#include +#include // TProfileSettingId #include #include diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/conf/profilesengine.confml Binary file profilesservices/ProfileEngine/conf/profilesengine.confml has changed diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/conf/profilesengine_101F8798.crml Binary file profilesservices/ProfileEngine/conf/profilesengine_101F8798.crml has changed diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/group/ProfileEng.mmp --- a/profilesservices/ProfileEngine/group/ProfileEng.mmp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/group/ProfileEng.mmp Fri Mar 19 09:34:30 2010 +0200 @@ -66,7 +66,6 @@ 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 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/group/ProfileEng.rss --- a/profilesservices/ProfileEngine/group/ProfileEng.rss Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/group/ProfileEng.rss Fri Mar 19 09:34:30 2010 +0200 @@ -187,11 +187,6 @@ }, PROFILE_SETTING { - id = EProfileSettingIdEmailVibra; - key_type = EProfileSettingKeyTypeInt; - }, - PROFILE_SETTING - { id = EProfileSettingIdTactileFeedback; key_type = EProfileSettingKeyTypeInt; }, diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/group/ProfileEngine.mmp --- a/profilesservices/ProfileEngine/group/ProfileEngine.mmp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/group/ProfileEngine.mmp Fri Mar 19 09:34:30 2010 +0200 @@ -61,8 +61,8 @@ USERINCLUDE . USERINCLUDE ../WrapperInc USERINCLUDE ../EngInc - APP_LAYER_SYSTEMINCLUDE +MW_LAYER_SYSTEMINCLUDE LIBRARY bafl.lib LIBRARY euser.lib @@ -71,7 +71,6 @@ 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 diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/ProfileEngine/group/ProfileScheduleEvent.mmp --- a/profilesservices/ProfileEngine/group/ProfileScheduleEvent.mmp Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/ProfileEngine/group/ProfileScheduleEvent.mmp Fri Mar 19 09:34:30 2010 +0200 @@ -48,8 +48,7 @@ LIBRARY profileeng.lib LIBRARY bafl.lib LIBRARY efsrv.lib -LIBRARY aknnotify.lib // CAknGlobalNote LIBRARY centralrepository.lib -LIBRARY featmgr.lib +LIBRARY featmgr.lib diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/data/cenrep/10208ADF.txt Binary file profilesservices/RingingTone3DPlugin/data/cenrep/10208ADF.txt has changed diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/data/patterns/1circular.xml --- a/profilesservices/RingingTone3DPlugin/data/patterns/1circular.xml Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,386 +0,0 @@ - - - - - - - - diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/data/patterns/2flyby.xml --- a/profilesservices/RingingTone3DPlugin/data/patterns/2flyby.xml Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1012 +0,0 @@ - - - - - - - - - diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/data/patterns/3zigzag.xml --- a/profilesservices/RingingTone3DPlugin/data/patterns/3zigzag.xml Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,479 +0,0 @@ - - - - - - - - diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/data/patterns/4meander.xml --- a/profilesservices/RingingTone3DPlugin/data/patterns/4meander.xml Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,731 +0,0 @@ - - - - - - - - diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/data/patterns/5random.xml --- a/profilesservices/RingingTone3DPlugin/data/patterns/5random.xml Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,191 +0,0 @@ - - - - - - - - diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/data/tone/3d_effect_01.aac Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_effect_01.aac has changed diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/data/tone/3d_effect_02.aac Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_effect_02.aac has changed diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/data/tone/3d_effect_03.aac Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_effect_03.aac has changed diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/data/tone/3d_effect_04.aac Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_effect_04.aac has changed diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/data/tone/3d_effect_05.aac Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_effect_05.aac has changed diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/data/tone/3d_motorway.aac Binary file profilesservices/RingingTone3DPlugin/data/tone/3d_motorway.aac has changed diff -r 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/group/RingingTone3DPluginExports.inc --- a/profilesservices/RingingTone3DPlugin/group/RingingTone3DPluginExports.inc Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* ============================================================================== -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/group/bld.inf --- a/profilesservices/RingingTone3DPlugin/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/group/ringingtone3dplugin.mmp --- a/profilesservices/RingingTone3DPlugin/group/ringingtone3dplugin.mmp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/inc/C3DAudioPattern.h --- a/profilesservices/RingingTone3DPlugin/inc/C3DAudioPattern.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,222 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/inc/C3DAudioTimeOutTimer.h --- a/profilesservices/RingingTone3DPlugin/inc/C3DAudioTimeOutTimer.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/inc/C3DAudioXMLParser.h --- a/profilesservices/RingingTone3DPlugin/inc/C3DAudioXMLParser.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,512 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/inc/CRingingTone3DPlugin.h --- a/profilesservices/RingingTone3DPlugin/inc/CRingingTone3DPlugin.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,356 +0,0 @@ -/* -* 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 ); - - /** - * Initializes player utility. - * @param aSamplePlayer Player utility. - */ - void Init( CVideoPlayerUtility* aSamplePlayer ); - - /** - * 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; - - // player utility - CVideoPlayerUtility* iVideoPlayerUtility; - - // 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 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/inc/RingingTone3DPluginDebug.h --- a/profilesservices/RingingTone3DPlugin/inc/RingingTone3DPluginDebug.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/inc/tdaudioconstants.h --- a/profilesservices/RingingTone3DPlugin/inc/tdaudioconstants.h Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/src/10208adf.rss --- a/profilesservices/RingingTone3DPlugin/src/10208adf.rss Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/src/C3DAudioPattern.cpp --- a/profilesservices/RingingTone3DPlugin/src/C3DAudioPattern.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,321 +0,0 @@ -/* -* 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.Append( 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.Append( 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 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/src/C3DAudioTimeOutTimer.cpp --- a/profilesservices/RingingTone3DPlugin/src/C3DAudioTimeOutTimer.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/src/C3DAudioXMLParser.cpp --- a/profilesservices/RingingTone3DPlugin/src/C3DAudioXMLParser.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2073 +0,0 @@ -/* -* 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") ); - } - - -// ----------------------------------------------------------------------------- -// 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") ); - } - - -// ----------------------------------------------------------------------------- -// 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; - } - case E3DRTIAttrVideoPlayerUtility: - { - Init( ( CVideoPlayerUtility* )aValue ); - break; - } - - 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; - } - case EVideoPlayerUtility: - { - ret = CEnvironmentalReverbUtility::NewL( *iVideoPlayerUtility ); - break; - } - 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; - } - case EVideoPlayerUtility: - { - ret = CSourceLocation::NewL( *iVideoPlayerUtility ); - break; - } - 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; - } - case EVideoPlayerUtility: - { - ret = CListenerLocation::NewL( *iVideoPlayerUtility ); - break; - } - 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; - } - case EVideoPlayerUtility: - { - ret = CSourceDoppler::NewL( *iVideoPlayerUtility ); - break; - } - 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; - } - case EVideoPlayerUtility: - { - iVideoPlayerUtility->Play(); - break; - } - 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; - } - case EVideoPlayerUtility: - { - iVideoPlayerUtility->Stop(); - break; - } - 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 3f8368f032cf -r e3554c9069b6 profilesservices/RingingTone3DPlugin/src/CRingingTone3DPluginImplementationTable.cpp --- a/profilesservices/RingingTone3DPlugin/src/CRingingTone3DPluginImplementationTable.cpp Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* 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 3f8368f032cf -r e3554c9069b6 profilesservices/group/bld.inf --- a/profilesservices/group/bld.inf Tue Feb 02 00:22:03 2010 +0200 +++ b/profilesservices/group/bld.inf Fri Mar 19 09:34:30 2010 +0200 @@ -23,7 +23,4 @@ //Components: //profilesservices -#include "../FileList/group/bld.inf" -#include "../MediaFileList/group/bld.inf" #include "../ProfileEngine/group/bld.inf" -#include "../RingingTone3DPlugin/group/bld.inf" diff -r 3f8368f032cf -r e3554c9069b6 sysdef_1_4_0.dtd --- a/sysdef_1_4_0.dtd Tue Feb 02 00:22:03 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 3f8368f032cf -r e3554c9069b6 sysdef_1_5_1.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sysdef_1_5_1.dtd Fri Mar 19 09:34:30 2010 +0200 @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +