# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1274955497 -10800 # Node ID 73f6c2762ffe57cad564a74ccd6bcc8ddaa21182 # Parent 4c4ed41530db9038cde1c368e961f1cefc907257 Revision: 201019 Kit: 2010121 diff -r 4c4ed41530db -r 73f6c2762ffe layers.sysdef.xml --- a/layers.sysdef.xml Fri May 14 16:17:02 2010 +0300 +++ b/layers.sysdef.xml Thu May 27 13:18:17 2010 +0300 @@ -1,9 +1,9 @@ - ]> - + @@ -12,13 +12,16 @@ + filter="dfs_build" name="lodo_locationsrv_supl_asnpluginimplementation" /> + filter="dfs_build" name="lodo_locationsrv_supl_asnpluginimplementationver2" /> + + + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/group/bld.inf --- a/locationsystemui/locationsysui/group/bld.inf Fri May 14 16:17:02 2010 +0300 +++ b/locationsystemui/locationsysui/group/bld.inf Thu May 27 13:18:17 2010 +0300 @@ -23,13 +23,14 @@ PRJ_PLATFORMS DEFAULT +PRJ_EXPORTS // Export Configuration Markup language and Central Repository Mark up language files ../conf/loclocalvariation.confml MW_LAYER_CONFML(loclocalvariation.confml) ../conf/loclocalvariation_20022D83.crml MW_LAYER_CRML(loclocalvariation_20022D83.crml) -PRJ_EXPORTS + // Query and Notification #include "../queryandnotification/group/bld.inf" diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/locsysui.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/locsysui.pro Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,23 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# Description: project file for Locsysui +# + + +TEMPLATE = subdirs + +SYMBIAN_PLATFORMS = WINSCW ARMV5 + +SUBDIRS += possettings/possettings.pro + + \ No newline at end of file diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/bwins/possettingsengineu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/bwins/possettingsengineu.def Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,26 @@ +EXPORTS ?trUtf8@PosSettingsAdvOp@@SA?AVQString@@PBD0@Z @ 1 NONAME ; class QString PosSettingsAdvOp::trUtf8(char const *, char const *) + ?staticMetaObject@PosSettingsAdvOp@@2UQMetaObject@@B @ 2 NONAME ; struct QMetaObject const PosSettingsAdvOp::staticMetaObject + ?setExpanded@PosSettingsAdvOp@@QAEXABVQModelIndex@@_N@Z @ 3 NONAME ; void PosSettingsAdvOp::setExpanded(class QModelIndex const &, bool) + ?addAction@PosSettingsAdvOp@@QAEXPAVHbAction@@W4ActionContainer@HbView@@@Z @ 4 NONAME ; void PosSettingsAdvOp::addAction(class HbAction *, enum HbView::ActionContainer) + ?qt_metacast@PosSettingsAdvOp@@UAEPAXPBD@Z @ 5 NONAME ; void * PosSettingsAdvOp::qt_metacast(char const *) + ??_EPosSettingsView@@UAE@I@Z @ 6 NONAME ; PosSettingsView::~PosSettingsView(unsigned int) + ?isExpanded@PosSettingsAdvOp@@QBE_NABVQModelIndex@@@Z @ 7 NONAME ; bool PosSettingsAdvOp::isExpanded(class QModelIndex const &) const + ?addConnection@PosSettingsAdvOp@@QAEXPAVHbDataFormModelItem@@PBDPAVQObject@@1@Z @ 8 NONAME ; void PosSettingsAdvOp::addConnection(class HbDataFormModelItem *, char const *, class QObject *, char const *) + ?tr@PosSettingsAdvOp@@SA?AVQString@@PBD0H@Z @ 9 NONAME ; class QString PosSettingsAdvOp::tr(char const *, char const *, int) + ?appendDataFormItem@PosSettingsAdvOp@@QAEXPAVHbDataFormModelItem@@0@Z @ 10 NONAME ; void PosSettingsAdvOp::appendDataFormItem(class HbDataFormModelItem *, class HbDataFormModelItem *) + ??1PosSettingsAdvOp@@UAE@XZ @ 11 NONAME ; PosSettingsAdvOp::~PosSettingsAdvOp(void) + ?qt_metacall@PosSettingsAdvOp@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 12 NONAME ; int PosSettingsAdvOp::qt_metacall(enum QMetaObject::Call, int, void * *) + ??0PosSettingsAdvOp@@QAE@PAVHbView@@@Z @ 13 NONAME ; PosSettingsAdvOp::PosSettingsAdvOp(class HbView *) + ??_EPosSettingsAdvOp@@UAE@I@Z @ 14 NONAME ; PosSettingsAdvOp::~PosSettingsAdvOp(unsigned int) + ??1PosSettingsView@@UAE@XZ @ 15 NONAME ; PosSettingsView::~PosSettingsView(void) + ?itemPrototypes@PosSettingsAdvOp@@QAEXAAV?$QList@PAVHbAbstractViewItem@@@@@Z @ 16 NONAME ; void PosSettingsAdvOp::itemPrototypes(class QList &) + ?removeConnection@PosSettingsAdvOp@@QAEXPAVHbDataFormModelItem@@PBDPAVQObject@@1@Z @ 17 NONAME ; void PosSettingsAdvOp::removeConnection(class HbDataFormModelItem *, char const *, class QObject *, char const *) + ?indexFromItem@PosSettingsAdvOp@@QAE?AVQModelIndex@@PBVHbDataFormModelItem@@@Z @ 18 NONAME ; class QModelIndex PosSettingsAdvOp::indexFromItem(class HbDataFormModelItem const *) + ?setItemPrototypes@PosSettingsAdvOp@@QAEXAAV?$QList@PAVHbAbstractViewItem@@@@@Z @ 19 NONAME ; void PosSettingsAdvOp::setItemPrototypes(class QList &) + ??0PosSettingsView@@QAE@PAVQGraphicsItem@@@Z @ 20 NONAME ; PosSettingsView::PosSettingsView(class QGraphicsItem *) + ?removeItem@PosSettingsAdvOp@@QAE_NPAVHbDataFormModelItem@@@Z @ 21 NONAME ; bool PosSettingsAdvOp::removeItem(class HbDataFormModelItem *) + ?trUtf8@PosSettingsAdvOp@@SA?AVQString@@PBD0H@Z @ 22 NONAME ; class QString PosSettingsAdvOp::trUtf8(char const *, char const *, int) + ?tr@PosSettingsAdvOp@@SA?AVQString@@PBD0@Z @ 23 NONAME ; class QString PosSettingsAdvOp::tr(char const *, char const *) + ?getStaticMetaObject@PosSettingsAdvOp@@SAABUQMetaObject@@XZ @ 24 NONAME ; struct QMetaObject const & PosSettingsAdvOp::getStaticMetaObject(void) + ?metaObject@PosSettingsAdvOp@@UBEPBUQMetaObject@@XZ @ 25 NONAME ; struct QMetaObject const * PosSettingsAdvOp::metaObject(void) const + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/conf/positioningsettings.confml Binary file locationsystemui/locationsysui/possettings/conf/positioningsettings.confml has changed diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/conf/positioningsettings_2002E685.crml Binary file locationsystemui/locationsysui/possettings/conf/positioningsettings_2002E685.crml has changed diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/eabi/possettingsengineu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/eabi/possettingsengineu.def Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,35 @@ +EXPORTS + _ZN15PosSettingsViewC1EP13QGraphicsItem @ 1 NONAME + _ZN15PosSettingsViewC2EP13QGraphicsItem @ 2 NONAME + _ZN15PosSettingsViewD0Ev @ 3 NONAME + _ZN15PosSettingsViewD1Ev @ 4 NONAME + _ZN15PosSettingsViewD2Ev @ 5 NONAME + _ZN16PosSettingsAdvOp10removeItemEP19HbDataFormModelItem @ 6 NONAME + _ZN16PosSettingsAdvOp11qt_metacallEN11QMetaObject4CallEiPPv @ 7 NONAME + _ZN16PosSettingsAdvOp11qt_metacastEPKc @ 8 NONAME + _ZN16PosSettingsAdvOp11setExpandedERK11QModelIndexb @ 9 NONAME + _ZN16PosSettingsAdvOp13addConnectionEP19HbDataFormModelItemPKcP7QObjectS3_ @ 10 NONAME + _ZN16PosSettingsAdvOp13indexFromItemEPK19HbDataFormModelItem @ 11 NONAME + _ZN16PosSettingsAdvOp14itemPrototypesER5QListIP18HbAbstractViewItemE @ 12 NONAME + _ZN16PosSettingsAdvOp16removeConnectionEP19HbDataFormModelItemPKcP7QObjectS3_ @ 13 NONAME + _ZN16PosSettingsAdvOp16staticMetaObjectE @ 14 NONAME DATA 16 + _ZN16PosSettingsAdvOp17setItemPrototypesER5QListIP18HbAbstractViewItemE @ 15 NONAME + _ZN16PosSettingsAdvOp18appendDataFormItemEP19HbDataFormModelItemS1_ @ 16 NONAME + _ZN16PosSettingsAdvOp19getStaticMetaObjectEv @ 17 NONAME + _ZN16PosSettingsAdvOp9addActionEP8HbActionN6HbView15ActionContainerE @ 18 NONAME + _ZN16PosSettingsAdvOpC1EP6HbView @ 19 NONAME + _ZN16PosSettingsAdvOpC2EP6HbView @ 20 NONAME + _ZN16PosSettingsAdvOpD0Ev @ 21 NONAME + _ZN16PosSettingsAdvOpD1Ev @ 22 NONAME + _ZN16PosSettingsAdvOpD2Ev @ 23 NONAME + _ZNK16PosSettingsAdvOp10isExpandedERK11QModelIndex @ 24 NONAME + _ZNK16PosSettingsAdvOp10metaObjectEv @ 25 NONAME + _ZTI15PosSettingsView @ 26 NONAME + _ZTI16PosSettingsAdvOp @ 27 NONAME + _ZTV15PosSettingsView @ 28 NONAME + _ZTV16PosSettingsAdvOp @ 29 NONAME + _ZThn16_N15PosSettingsViewD0Ev @ 30 NONAME + _ZThn16_N15PosSettingsViewD1Ev @ 31 NONAME + _ZThn8_N15PosSettingsViewD0Ev @ 32 NONAME + _ZThn8_N15PosSettingsViewD1Ev @ 33 NONAME + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/inc/possettingsadvinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/inc/possettingsadvinterface.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Positioning settings advanced interface class. +* +*/ + +#ifndef POSSETTINGSENGADVANCEDINTERFACE_H +#define POSSETTINGSENGADVANCEDINTERFACE_H + +#include "possettingsadvop.h" +#include + + + +//Provider id and version +static const char* KAdvancedInterfaceId = + "com.nokia.PosSettingsAdvInterface/1.0"; + + +/** + * Settings UI ECom plug-in interface + * + * PosSettingsAdvInterface class tdefines interface for Advanced + * positioning settings UI. Any Settings UI component should derive from this + * class and implement the abstract functions. + * + */ +class PosSettingsAdvInterface + { + +public: + /** + * Destructor + */ + virtual ~PosSettingsAdvInterface(){} + + + /** + * This method performs operations required to display advanced settings UI + * The operations would involve the following : + * - add data model items + * - add connections for the data model items + * - add actions for menu items ( if any ) + * - add connection to the view using the slot updateAdvancedView + * to update the view when the form is updated. + */ + virtual int initialise( PosSettingsAdvOp* operation ) = 0; + + }; + + +// MACROS +Q_DECLARE_INTERFACE( PosSettingsAdvInterface,KAdvancedInterfaceId ); + +#endif /* POSSETTINGSENGADVANCEDINTERFACE_H */ diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/inc/possettingsadvop.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/inc/possettingsadvop.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Positioning settings advanced operation class. +* +*/ + +#ifndef POSSETTINGSENGADVANCEDOPERATION_H +#define POSSETTINGSENGADVANCEDOPERATION_H + + +#include "possettingsglobal.h" +#include +#include +#include +#include +#include + +class POSSETTINGS_EXPORT PosSettingsAdvOp : public QObject + { + Q_OBJECT + +public: + /** + * Constructor + */ + PosSettingsAdvOp(HbView* view); + + /** + * Destructor + */ + ~PosSettingsAdvOp(); + + /** + * Appends dataform model item to the dataform model. + */ + void appendDataFormItem( HbDataFormModelItem *data, + HbDataFormModelItem *parent = 0 ); + + /*** + * Makes connections for the data form model items + */ + void addConnection( HbDataFormModelItem *item, const char* signal, + QObject *receiver, const char* slot ); + + /** + * Used to add menue items & actions + */ + void addAction( HbAction *action, HbView::ActionContainer + preferedActionContainer ); + /** + * Gets the index of a particular data form model item + * @param[in] item - data form model item whose index is required + * @return - index of the data form model item within the data form model + */ + QModelIndex indexFromItem(const HbDataFormModelItem * item ); + /** + * Removes connection that were already made + */ + void removeConnection(HbDataFormModelItem *item, const char *signal, QObject *receiver, const char *slot); + /** + * Sets the model item to be expanded/collapsed + */ + void setExpanded(const QModelIndex &index, bool expanded); + /** + * Checks if a particualr data model item is expanded + */ + bool isExpanded (const QModelIndex &index) const; + /** + * Removes a particualr data form model item from the model + */ + bool removeItem(HbDataFormModelItem* item); + /** + * set prototype for data form + */ + void setItemPrototypes(QList &protoTypeList); + + /** + * gets prototype list for the data form + */ + void itemPrototypes(QList &protoTypeList); +private: + + /** + * Pointer to view. + * Not own. + */ + HbView* mView; + + /** + * Pointer to data form + * Not own. + */ + HbDataForm* mDataForm; + + /** + * Pointer to data form model. + * Not own. + */ + HbDataFormModel* mDataFormModel; + }; + + +#endif /* POSSETTINGSENGADVANCEDOPERATION_H_ */ diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/inc/possettingscrkey.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/inc/possettingscrkey.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Central Repository Key definition for ordering of the +* positioning settings plugins displayed in the advaced +* settings view +* +*/ + +#ifndef POSSETTINGSCRKEY_H +#define POSSETTINGSCRKEY_H + +#include + +/* + * UID of the Positioning Settings Central Repository Key. + * This key defines the position of the positioning settings plugins that are shown + * in the advanced settings view of Positioning. + */ +const TUid KCRUidPositioningSettings = {0x2002E685}; + +/* + * Key for listing the positioning settings plugins in the advacned view of Positioning. + * This key is a Read only key and the default values for the Keys is configured by the device + * manufacturer while flashing the device. They cannot be dynamically configured. + * The keys contains a string which contains a list of Unique Identifers for the Positioning settings + * plugins in the order in which the device manufacturer wants these plugins to be displayed. + * The maximum length of this string is 1024 characters + * The format of this Key is defined as + * | Count | Length(1) | Dllname(1) | Length(2) | Dllname(2) | ... | Length( Count ) | Dllname( Count ) | + * where, + * Count ( 4 digits ) - The number of positioning Settings plugins which are predefined to be displayed in + * the Advanced Settings view, in the Decimal format. + * Length(n) ( 4 digits ) - Length of the plugin's dll name in the string format. This field contains the length + * in the in the Decimal format. + * String(n) - Dll name of the positioning settings plugins encoded as a string. + */ +const TUint32 KPositioningSettingsPlugins = 0x00000001; + +/* + * Key for storing old state of background positioning in main view. + * This key is a Read/Write key and the default value for the key is one [i.e. enabled] + * The key contains integer which can be either 0 [disabled] or 1 [enabled] + * The key value is modified only when user marks/unmarks background positioning checkbox in the main view + * The key value is NOT modified when background positioning checkbox is removed/inserted + */ +const TUint32 KPositioningSettingsBackgroundServicesStatus = 0x00000002; + +#endif //POSSETTINGSCRKEY_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/inc/possettingsglobal.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/inc/possettingsglobal.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef POSSETTINGS_GLOBAL_H +#define POSSETTINGS_GLOBAL_H + +#ifdef BUILD_POSSETTINGS + #define POSSETTINGS_EXPORT Q_DECL_EXPORT +#else + #define POSSETTINGS_EXPORT Q_DECL_IMPORT +#endif + +#endif diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/inc/possettingsview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/inc/possettingsview.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This is the first view for Positioning Settings plugin +* +*/ + +#ifndef POSSETTINGSVIEW_H +#define POSSETTINGSVIEW_H + +#include "possettingsglobal.h" + +#include +#include + +// Forward declaration +class PosSettingsEngine; +class PosSettingsForm; +class HbGroupBox; +class QGraphicsLinearLayout; + +class POSSETTINGS_EXPORT PosSettingsView: public CpBaseSettingView + { +public: + /** + * Constructor + */ + explicit PosSettingsView( QGraphicsItem *parent = 0 ); + + /** + * Destructor + */ + ~PosSettingsView(); + +private: // Data members + /** + * Pointer to settings engine object + * Own + */ + PosSettingsEngine* mSettingsEngine; + + /** + * Pointer to settings form object. + */ + PosSettingsForm* mSettingsForm; + }; + +#endif // POSSETTINGSVIEW_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/inc/locationservicescustomviewitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/inc/locationservicescustomviewitem.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This class to be used to create group items for location services + * + */ +#ifndef LOCATIONSERVICES_CUSTOMVIEWITEM_H +#define LOCATIONSERVICES_CUSTOMVIEWITEM_H + +#include +#include +#include + + +//dataItemType for Location services custom widget +const int LocationServicesCustomItem = HbDataFormModelItem::CustomItemBase + + 15; + +class LocationServicesCustomViewItem : public HbDataFormViewItem + { +Q_OBJECT +public: + /** + * Constructor + */ + explicit LocationServicesCustomViewItem(QGraphicsItem *parent = 0); + + /** + * Destructor + */ + ~LocationServicesCustomViewItem(); + +protected: + + /** + * This method is used to create the Custom widget for location services + * @returns - HbAbstractButton, instance of the custom widget + */ + virtual HbWidget* createCustomWidget(); + + /** + * + */ + virtual HbAbstractViewItem* createItem(); + + /** + * + */ + virtual bool canSetModelIndex(const QModelIndex &index) const; +public slots: + virtual void restore(); + //virtual void save(); +private: + /** + * instance of HbAbstractButton + */ + HbWidget *mPushWidget; + }; +#endif diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/inc/locationserviceswidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/inc/locationserviceswidget.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This header file is for creating the custom widget for location services + * for Advanced view of Positioning settings + * + */ + +#ifndef LOCATIONSERVICESWIDGET_H +#define LOCATIONSERVICESWIDGET_H + +#include +#include + +class HbTextItem; + +class LocationServicesWidget : public HbAbstractButton + { +Q_OBJECT + +// It is possible to set initial value to properties from the application designer. +Q_PROPERTY(QString primarytext READ primaryText WRITE setPrimaryText) +Q_PROPERTY(QString sectext READ secText WRITE setSecText) +Q_PROPERTY(QString sec2text READ sec2Text WRITE setSec2Text) + +public: + /** + * Constructor + */ + LocationServicesWidget(QGraphicsItem *parent = 0); + + /** + * Destructor + */ + ~LocationServicesWidget(); + +public: + + /** + * Sets the primary text for the widget + * @param [in] - primaryText, primary text for the widget + */ + void setPrimaryText(const QString &primaryText); + + /** + * Gets the primary text for the widget + * @returns - QString containing the primary text + */ + QString primaryText() const; + + /** + * Sets the primary text for the widget + * @param [in] - secText, secondry(second line) text for the widget + */ + void setSecText(const QString &secText); + + /** + * Gets the primary text for the widget + * @returns - QString containing the secondry text + */ + QString secText() const; + + /** + * Sets the primary text for the widget + * @param [in] - secText, secondry(third line) text for the widget + */ + void setSec2Text(const QString &secText); + + /** + * Gets the primary text for the widget + * @returns - QString containing the secondry2 text + */ + QString sec2Text() const; + +private: + + /** + * Primary Text item + * Does not own + */ + HbTextItem* mPrimaryTextItem; + + /** + * Secondry Text item + * Does not own + */ + HbTextItem* mSecondryTextItem; + + /** + * Secondry (third item) Text item + * Does not own + */ + HbTextItem* mSecondry2TextItem; + }; + +#endif // LOCATIONSERVICESWIDGET_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/inc/poslocationservices.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/inc/poslocationservices.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This is for Location Based Servies Settings plugin + * for Advanced View + * + */ + +#ifndef POSLOCATIONSERVICES_PLUGIN_H +#define POSLOCATIONSERVICES_PLUGIN_H + +#include "poslocationservicesengine.h" + +#include +#include +#include +#include +#include + + +//Forward Declaration +class PosSettingsAdvOp; +class PosSettingsSignalMapper; +class HbMessageBox; +class HbAction; + +class PosLocationServices : public QObject, public PosSettingsAdvInterface + { +Q_OBJECT + Q_INTERFACES( PosSettingsAdvInterface) +public: + /** + * Constructor + */ + PosLocationServices(); + + /** + * Destructor + */ + ~PosLocationServices(); +public: + /* + * Derived from PosSettingsAdvInterface + */ + virtual int initialise(PosSettingsAdvOp* operation); + +private: + /** + * This method is used to list all the location services that are running + */ + void listServices(); + + /** + * This method constructs the string for update interval to be displayed in + * the second line of the widget. + * @param [in]- updateInterval, update interval is seconds, gets from the engine + * @param [out]- updateIntervalString, string to be displayed, depending on the update + * interval is in day, hour, minute or second + */ + void getUpdateIntervalString(int updateInterval, QString& updateIntervalString); + +private slots: + /** + * This is slot, which is called when the user selects the + * service to be deleted + */ + void stopService(int serviceId); + + /** + * This is slot, which is called whenever there is a new location service added or + * a server in the list is stopped. This refreshes the view. + */ + void updateList(); + + /** + * This slot is used to stop sessions. + * @param[in] action - Button which is pressed on messagebox dialog + */ + void stopSession(HbAction* action); + +private: + + /** + * an object if the location services setting engine class + */ + PosLocationServicesEngine* mLocationServiceEngine; + + /** + * an object of data form model item class + */ + HbDataFormModelItem * mGroup; + + /** + * Holds the params of the list of location services + */ + QList mServiceList; + + /** + * Handle to PosSettingsAdvOp object + */ + PosSettingsAdvOp * mOperation; + + /** + * an object of QSignalMapper + */ + QSignalMapper * mSignalMapper; + + /** + * hold the signal mapper objects of PosPsySettingsSignalMapper + */ + QList mSignalMapperList; + + + + /** + * holds the stop service query dialog + * Owns + */ + HbMessageBox * mStopQuery; + + /** + * holds service id to be stop + */ + int mServiceId; + }; +#endif // POSLOCATIONSERVICES_PLUGIN_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/inc/poslocationservicescommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/inc/poslocationservicescommon.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This header defines set of data structures used in +* locaion services plugin. +* +*/ + +#ifndef POSLOCATIONSERVICESCOMMON_H +#define POSLOCATIONSERVICESCOMMON_H + +#include +#include + +struct PosLocationServiceInfo + { + /** + * Location service Id. + */ + int mServiceId; + /** + * Location service name. + */ + QString mServiceName; + + /** + * Update interval. + */ + int mUpdateInterval; + + /** + * Date and time on which service ends. + */ + QDateTime mEndDateTime; + }; + +#endif //POSLOCATIONSERVICESCOMMON_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/inc/poslocationservicesengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/inc/poslocationservicesengine.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class declaration of PosLocationServicesEngine. +* +*/ +#ifndef POSLOCATIONSERVICESENGINE_H +#define POSLOCATIONSERVICESENGINE_H + +#include "poslocationservicesengineprivate.h" +#include + + + +/** + * PosLocationServicesEngine class provides interface to location services. + * Using this interface. This interface provides services like list, delete + * etc.. + */ +class PosLocationServicesEngine : public QObject, + public PosLocationServiceUpdateObserver + { + Q_OBJECT +public: + /** + * Constructor + */ + PosLocationServicesEngine(); + + /** + * Destructor + */ + virtual ~PosLocationServicesEngine(); + + /** + * Retrieves all location services info. + * + * @param[out] locationServiceList List of location + * services info. + * @return - KErrNone if location services information retrieved successfully. + * - KErrNotFound if there are no location services. + * otherwise system wide error codes. + */ + int getLocationServices( QList& + locationServiceList ); + + /** + * Removes location service based on the service Id. + * + * @param [in] serviceId Location service Id. + * + * @return following error codes + * - KErrNone if successful + * - KErrNotFound if service is not found + * otherwise system wide error codes. + */ + int removeLocationService( int serviceId ); + +public:// From PosLocationServiceUpdateObserver + void handleLocationServiceUpdate(); + +signals: + /** + * This signal is emitted when there is update in the + * location services. + */ + void locationServiceUpdate(); + +private:// Data members + /** + * Pointer to PosLocationServicesEnginePrivate object. + * Own + */ + PosLocationServicesEnginePrivate* d_ptr; + }; + +#endif /* POSLOCATIONSERVICESENGINE_H */ diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/inc/poslocationservicesengineprivate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/inc/poslocationservicesengineprivate.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class declaration of PosLocationServicesEnginePrivate. +* +*/ +#ifndef POSLOCATIONSERVICESENGINEPRIVATE_H +#define POSLOCATIONSERVICESENGINEPRIVATE_H + +#include "poslocationservicescommon.h" +#include + +// Forward declaration +class CSuplSettings; + +/** + * The class defines the interface to get notification on location + * service update.The class interested in location service update + * should inherit from this class. + */ +class PosLocationServiceUpdateObserver + { +public: + virtual void handleLocationServiceUpdate() = 0; + }; + + +/** + * PosLocationServicesEnginePrivate class implements the engine logic.This + * provides wrapper over SUPL settings API + */ +class PosLocationServicesEnginePrivate : public MSuplSessionObserver + { +public: + /** + * Constructor + */ + PosLocationServicesEnginePrivate( PosLocationServiceUpdateObserver& + aObserver ); + + /** + * Destructor + */ + virtual ~PosLocationServicesEnginePrivate(); + + /** + * Retrieves all location services info. + * + * @param[out] locationServiceList List of location + * services info. + * @return - KErrNone if location services information retrieved successfully. + * - KErrNotFound if there are no location services. + * otherwise system wide error codes. + */ + int GetLocationServices( QList& + aLocationServiceList ); + + /** + * Retrieves all location services info. + * + * @param[out] locationServiceList List of location + * services info. + * @leaves - KErrNone if location services information retrieved successfully. + * - KErrNotFound if there are no location services. + * otherwise system wide error codes. + */ + void GetLocationServicesL( QList& + aLocationServiceList ); + /** + * Removes location service based on the service Id. + * + * @param [in] serviceId Location service Id. + * + * @return following error codes + * - KErrNone if successful + * - KErrNotFound if service is not found + * otherwise system wide error codes. + */ + int RemoveLocationService( int aServiceId ); + +public: // From MSuplSessionObserver + virtual void HandleSuplSessionChangeL( + TSuplSessionEventType aEvent,TInt64 aSessionId ); + +private:// Data members + + /** + * Reference to location service update observer. + */ + PosLocationServiceUpdateObserver& mObserver; + + /** + * Pointer to SUPL settings object. + * Own + */ + CSuplSettings* mSuplSettings; + }; + +#endif /* POSLOCATIONSERVICESENGINEPRIVATE_H */ diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/inc/possettingssignalmapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/inc/possettingssignalmapper.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Declaration of the Positioning Settings signal mapper + * used to map the signals of each check box item to the index + * + */ + +#ifndef POSSETTINGSSIGNALMAPPER_H +#define POSSETTINGSSIGNALMAPPER_H + +#include + +class PosSettingsSignalMapper : public QObject + { + Q_OBJECT +public: + /* + * constructor + */ + PosSettingsSignalMapper(); + /** + * destructor + */ + ~PosSettingsSignalMapper(); +public: +signals: + /** + * signal emitted by the slot of this class + */ + void signalmapped(); +public slots: + /** + * slot to be called on a change in state of checkbox. + * this in turn calls the signal signalmapped() + */ + void signalmap(); + }; + +#endif //POSSETTINGSSIGNALMAPPER_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/poslocationservices.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/poslocationservices.pro Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,71 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Location Based Services Plugin pro file +# + +TEMPLATE = lib +TARGET = poslocationservices +DEPENDPATH += . +INCLUDEPATH += ../inc +INCLUDEPATH += ../possettingsengine/inc +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE +CONFIG += hb \ + plugin +MOC_DIR = moc +OBJECTS_DIR = obj +RCC_DIR = rcc +RESOURCES = poslocationservices.qrc + +# Platforms +SYMBIAN_PLATFORMS = WINSCW \ + ARMV5 +LIBS += -lcpframework \ + -lpossettingsengine \ + -lepos_suplsettings \ + -lflogger + +# Input +SOURCES += src/poslocationservices.cpp +SOURCES += src/poslocationservicesengine.cpp +SOURCES += src/poslocationservicesengineprivate.cpp +SOURCES += src/locationservicescustomviewitem.cpp +SOURCES += src/locationserviceswidget.cpp +SOURCES += src/possettingssignalmapper.cpp + +HEADERS += inc/poslocationservices.h +HEADERS += inc/poslocationservicescommon.h +HEADERS += inc/poslocationservicesengine.h +HEADERS += inc/poslocationservicesengineprivate.h +HEADERS += inc/locationservicescustomviewitem.h +HEADERS += inc/locationserviceswidget.h +HEADERS += inc/possettingssignalmapper.h + +symbian: { + TARGET.EPOCALLOWDLLDATA = 1 + DEFINES += PLUGINUID3=0x2002DCEB + TARGET.UID3 = 0x2002DCEB +} +symbian { + deploy.path = C: + qtplugins.path = /resource/qt/plugins/positioningsettings + qtplugins.sources += qmakepluginstubs/poslocationservices.qtplugin + + # This is for new exporting system coming in garden + for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" +} +TARGET.CAPABILITY = All \ + -TCB +plugin.sources = poslocationservices.dll +plugin.path = \resource\qt\plugins\positioningsettings +DEPLOYMENT += plugin diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/poslocationservices.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/poslocationservices.qrc Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,10 @@ + + + resources/locationserviceswidget.widgetml + resources/locationserviceswidget.css + resources/locationservicesviewitemwidget.css + + + resources/qgn_note_warning.svg + + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/resources/locationservicesviewitemwidget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/resources/locationservicesviewitemwidget.css Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,5 @@ +LocationServicesCustomViewItem::dataItem_ContentWidget +{ + left: -var(hb-param-margin-gene-left); + right: var(hb-param-margin-gene-right); +} \ No newline at end of file diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/resources/locationserviceswidget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/resources/locationserviceswidget.css Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,36 @@ +LocationServicesWidget { + layout: default +} + +LocationServicesWidget::text_box1 { + left: -var(hb-param-margin-gene-left); + right: var(hb-param-margin-gene-right); + top: -var(hb-param-margin-gene-top); + bottom: var(hb-param-margin-gene-bottom); + pref-width: 36un; + pref-height: var(hb-param-text-height-secondary); + font-variant: primary; + text-height: var(hb-param-text-height-secondary); +} + +LocationServicesWidget::text_box2 { + left: -var(hb-param-margin-gene-left); + right: var(hb-param-margin-gene-right); + top: -var(hb-param-margin-gene-top); + bottom: var(hb-param-margin-gene-bottom); + pref-width: 36un; + pref-height: var(hb-param-text-height-secondary); + font-variant: secondary; + text-height: var(hb-param-text-height-secondary); +} + +LocationServicesWidget::text_box3 { + left: -var(hb-param-margin-gene-left); + right: var(hb-param-margin-gene-right); + top: -var(hb-param-margin-gene-top); + bottom: var(hb-param-margin-gene-bottom); + pref-width: 36un; + pref-height: var(hb-param-text-height-secondary); + font-variant: secondary; + text-height: var(hb-param-text-height-secondary); +} \ No newline at end of file diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/resources/locationserviceswidget.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/resources/locationserviceswidget.widgetml Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/resources/qgn_note_warning.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/resources/qgn_note_warning.svg Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/src/locationservicescustomviewitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/src/locationservicescustomviewitem.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This is extended as HbDataFormViewItem to be used to create + * group items for location services + * + */ + + +#include "locationservicescustomviewitem.h" +#include "locationserviceswidget.h" +#include +#include +#include + + +// --------------------------------------------------------------------------- +// LocationServicesCustomViewItem::LocationServicesCustomViewItem +// --------------------------------------------------------------------------- +// +LocationServicesCustomViewItem::LocationServicesCustomViewItem( + QGraphicsItem *parent) : + HbDataFormViewItem(parent) + { + } + +// --------------------------------------------------------------------------- +// LocationServicesCustomViewItem::~LocationServicesCustomViewItem +// --------------------------------------------------------------------------- +// +LocationServicesCustomViewItem::~LocationServicesCustomViewItem() + { + } + +// --------------------------------------------------------------------------- +// LocationServicesCustomViewItem::createItem +// --------------------------------------------------------------------------- +// +HbAbstractViewItem* LocationServicesCustomViewItem::createItem() +{ + return new LocationServicesCustomViewItem(*this); +} + +// --------------------------------------------------------------------------- +// LocationServicesCustomViewItem::canSetModelIndex +// --------------------------------------------------------------------------- +// +bool LocationServicesCustomViewItem::canSetModelIndex(const QModelIndex &index) const +{ + int type = index.data(HbDataFormModelItem::ItemTypeRole).toInt(); + if (type == LocationServicesCustomItem) { + return true; + } + else { + return false; + } +} + + +// --------------------------------------------------------------------------- +// LocationServicesCustomViewItem::createCustomWidget +// --------------------------------------------------------------------------- +// +HbWidget * LocationServicesCustomViewItem::createCustomWidget() + { + //get the type of the model + int type = modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt(); + if (type == LocationServicesCustomItem) + { + //create the instance of location widget + LocationServicesWidget* locationservicesWidget = + new LocationServicesWidget(); + mPushWidget = locationservicesWidget; + return mPushWidget; + } + else + { + //else return 0 + return 0; + } + } + +// --------------------------------------------------------------------------- +// LocationServicesCustomViewItem::restore +// --------------------------------------------------------------------------- +// +void LocationServicesCustomViewItem::restore() +{ + HbDataFormViewItem::restore(); + if (mPushWidget) { + HbDataFormModelItem::DataItemType itemType = static_cast( + modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); + + if(itemType == LocationServicesCustomItem) { + + QModelIndex itemIndex = modelIndex(); + HbDataFormModel *model = static_cast(itemView()->model());; + HbDataFormModelItem *modelItem = static_cast( + model->itemFromIndex(itemIndex)); + + const QMetaObject *metaObj = mPushWidget->metaObject(); + int count = metaObj->propertyCount(); + for (int i = 0; i < count; ++i) { + QMetaProperty metaProperty = metaObj->property(i); + if (metaProperty.isValid() && metaProperty.isWritable()) { + metaProperty.write(mPushWidget,modelItem->contentWidgetData(metaProperty.name())); + } + + } + } + } +} + +// --------------------------------------------------------------------------- +// LocationServicesCustomViewItem::save +// --------------------------------------------------------------------------- +// +/*void LocationServicesCustomViewItem::save() +{ + HbDataFormViewItem::save(); + if (mPushWidget) { + HbDataFormModelItem::DataItemType itemType = static_cast( + modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); + + if(itemType == LocationServicesCustomItem) { + + QModelIndex itemIndex = modelIndex(); + HbDataFormModel *model = static_cast(itemView()->model());; + HbDataFormModelItem *modelItem = static_cast( + model->itemFromIndex(itemIndex)); + if (LocationServicesWidget *locationservicesWidget = qobject_cast(mPushWidget)) { + modelItem->setContentWidgetData("primarytext",locationservicesWidget->primaryText()); + modelItem->setContentWidgetData("sectext",locationservicesWidget->secText()); + modelItem->setContentWidgetData("sec2text",locationservicesWidget->sec2Text()); + } + } + } +}*/ + +//-------------End of File-------------------------- diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/src/locationserviceswidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/src/locationserviceswidget.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This file is for creating the custom widget for location services + * for Advanced view of Positioning settings + * + */ + +#include "locationserviceswidget.h" + +#include +#include +#include +#include +#include + + +static const QString FILE_PATH_WIDGETML = + ":/data/locationserviceswidget.widgetml"; +static const QString FILE_PATH_CSS = ":/data/locationserviceswidget.css"; + +// --------------------------------------------------------------------------- +// LocationServicesWidget::LocationServicesWidget +// --------------------------------------------------------------------------- +// +LocationServicesWidget::LocationServicesWidget(QGraphicsItem *parent) : + HbAbstractButton(parent) + { + // Path for widgetml and css files. + HbStyleLoader::registerFilePath(FILE_PATH_WIDGETML); + HbStyleLoader::registerFilePath(FILE_PATH_CSS); + + //Create the primary and secondry text items + mPrimaryTextItem = new HbTextItem(QString("New"), this); + HbStyle::setItemName(mPrimaryTextItem, "text_box1"); + mPrimaryTextItem->setFontSpec(HbFontSpec(HbFontSpec::Primary)); + + mSecondryTextItem = new HbTextItem(QString("New"), this); + HbStyle::setItemName(mSecondryTextItem, "text_box2"); + mSecondryTextItem->setFontSpec(HbFontSpec(HbFontSpec::Secondary)); + + mSecondry2TextItem = new HbTextItem(QString("New"), this); + HbStyle::setItemName(mSecondry2TextItem, "text_box3"); + mSecondry2TextItem->setFontSpec(HbFontSpec(HbFontSpec::Secondary)); + } +// --------------------------------------------------------------------------- +// LocationServicesWidget::LocationServicesWidget +// --------------------------------------------------------------------------- +// +LocationServicesWidget::~LocationServicesWidget() + { + HbStyleLoader::unregisterFilePath(FILE_PATH_WIDGETML); + HbStyleLoader::unregisterFilePath(FILE_PATH_CSS); + } +// --------------------------------------------------------------------------- +// LocationServicesWidget::setPrimaryText +// --------------------------------------------------------------------------- +// +void LocationServicesWidget::setPrimaryText(const QString &primaryText) + { + mPrimaryTextItem->setText(primaryText); + } +// --------------------------------------------------------------------------- +// LocationServicesWidget::primaryText +// --------------------------------------------------------------------------- +// +QString LocationServicesWidget::primaryText() const + { + return mPrimaryTextItem->text(); + } +// --------------------------------------------------------------------------- +// LocationServicesWidget::setSecText +// --------------------------------------------------------------------------- +// +void LocationServicesWidget::setSecText(const QString& secText) + { + mSecondryTextItem->setText(secText); + } +// --------------------------------------------------------------------------- +// LocationServicesWidget::secText +// --------------------------------------------------------------------------- +// +QString LocationServicesWidget::secText() const + { + return mSecondryTextItem->text(); + } +// --------------------------------------------------------------------------- +// LocationServicesWidget::setSec2Text +// --------------------------------------------------------------------------- +// +void LocationServicesWidget::setSec2Text(const QString& secText) + { + mSecondry2TextItem->setText(secText); + } +// --------------------------------------------------------------------------- +// LocationServicesWidget::sec2Text +// --------------------------------------------------------------------------- +// +QString LocationServicesWidget::sec2Text() const + { + return mSecondry2TextItem->text(); + } + +// end of file diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/src/poslocationservices.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/src/poslocationservices.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,478 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This is for Location Services Settings plugin + * for Positioning Settings's Advanced view + * + */ + +#include "poslocationservices.h" +#include "possettingsadvop.h" +#include "locationservicescustomviewitem.h" +#include "possettingssignalmapper.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +// constants +const int KMinToSecs = 60; +const int KHourToSecs = 3600; +const int KOneDay = 24; + +// --------------------------------------------------------------------------- +// PosLocationServices::PosLocationServices +// --------------------------------------------------------------------------- +// +PosLocationServices::PosLocationServices() : + mLocationServiceEngine(0), mGroup(0), mOperation(0), mSignalMapper(0), + mStopQuery(0), mServiceId(0) + { + mLocationServiceEngine = new PosLocationServicesEngine(); + } + +// --------------------------------------------------------------------------- +// PosLocationServices::~PosLocationServices +// --------------------------------------------------------------------------- +// +PosLocationServices::~PosLocationServices() + { + qDebug() << "+PosLocationServices::~PosLocationServices()"; + + if (mLocationServiceEngine) + { + delete mLocationServiceEngine; + mLocationServiceEngine = 0; + } + + if (mGroup) + { + if (mOperation) + { + mOperation->removeItem(mGroup); + } + } + + if (mSignalMapper) + { + delete mSignalMapper; + mSignalMapper = 0; + } + + if (mStopQuery) + { + delete mStopQuery; + mStopQuery = 0; + } + + //Clear the list + mServiceList.clear(); + + //clear the signal mapper list + int count = mSignalMapperList.count(); + qDebug() << "mSignalMapperList.count() = " << count; + + for (int i = 0; i < count; ++i) + { + delete mSignalMapperList[i]; + mSignalMapperList[i] = 0; + } + mSignalMapperList.clear(); + + qDebug() << "-PosLocationServices::~PosLocationServices()"; + } + +// --------------------------------------------------------------------------- +// PosLocationServices::initialise +// --------------------------------------------------------------------------- +// +int PosLocationServices::initialise(PosSettingsAdvOp* operation) + { + qDebug() << "+PosLocationServices::initialise()"; + + int result = 0; + + // Assign to the member variable + mOperation = operation; + + //get the prototype list from the data form and append the custom control to the list + QList protoTypeList; + mOperation->itemPrototypes(protoTypeList); + + LocationServicesCustomViewItem* item = + new LocationServicesCustomViewItem(); + + protoTypeList.append(item); + + mOperation->setItemPrototypes(protoTypeList); + + // create the signal mapper + mSignalMapper = new QSignalMapper(); + + //get the list of location services + mServiceList.clear(); + if (mLocationServiceEngine) + { + result = mLocationServiceEngine->getLocationServices(mServiceList); + } + + qDebug() << "PosLocationServices::initialise(): result" << result; + + // if no error while getting the services list then add the group + // for Location based services + if (result == 0) + { + mGroup = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, + hbTrId("txt_loe_subtitle_background_positioning"), 0); + + //Add the group to the data form + mOperation->appendDataFormItem(mGroup); + + //list all the location services inside the group + listServices(); + } + QObject::connect(mLocationServiceEngine, SIGNAL(locationServiceUpdate()), + this, SLOT(updateList())); + + qDebug() << "-PosLocationServices::initialise()"; + return result; + } + +// --------------------------------------------------------------------------- +// PosLocationServices::listServices +// --------------------------------------------------------------------------- +// +void PosLocationServices::listServices() + { + qDebug() << "+PosLocationServices::listServices()"; + qDebug() << "No of Location Services = " << mServiceList.count(); + + QList::const_iterator serviceIterator; + + qDebug() << "Appending the services in group "; + + // Get the location services names and display + for (serviceIterator = mServiceList.begin(); serviceIterator + != mServiceList.end(); ++serviceIterator) + { + qDebug() << "serviceIterator->mServiceId = " + << serviceIterator->mServiceId; + + qDebug() << "serviceIterator->mServiceName = " + << serviceIterator->mServiceName; + + qDebug() << "serviceIterator->mEndDateTime = " + << serviceIterator->mEndDateTime.date().toString(); + + qDebug() << "serviceIterator->mEndDateTime.isValid() = " + << serviceIterator->mEndDateTime.date().isValid(); + + qDebug() << "serviceIterator->mUpdateInterval = " + << serviceIterator->mUpdateInterval; + + // if any of the fields are invalid then skip listing + if (serviceIterator->mUpdateInterval > 0) + { + qDebug() << "creating services"; + + //for each services create new custom item + HbDataFormModelItem + * service = + new HbDataFormModelItem( + static_cast (LocationServicesCustomItem)); + + if(!serviceIterator->mServiceName.isEmpty()) + //set the widget data to the server name + service->setContentWidgetData("primarytext", + serviceIterator->mServiceName); + else + service->setContentWidgetData("primarytext", + QString(hbTrId("txt_loe_info_unknown_requestor"))); + + QString updateIntervalString; + //get the update interval String + getUpdateIntervalString(serviceIterator->mUpdateInterval, + updateIntervalString); + service->setContentWidgetData("sectext", updateIntervalString); + + //get the validity end date from the engine and convert to string + QString validity(serviceIterator->mEndDateTime.date().toString( + Qt::ISODate)); + + service->setContentWidgetData("sec2text", QString(hbTrId( + "txt_loe_list_valid_until_2")).arg(validity)); + + qDebug() << "Adding service into the group"; + mOperation->appendDataFormItem(service, mGroup); + + //create an object of dummy signal mapper class + //this is done to send the index info to the slots + //since checkbox is not of QObject type and dummy class is + // created. + PosSettingsSignalMapper* signalMapper = + new PosSettingsSignalMapper(); + + qDebug() << "Adding the signalMapper into mSignalMapperList"; + mSignalMapperList.append(signalMapper); + + //add connection for clicked for the custom item, depending on which the + //add connections to launch the dialog for the stopping the service + mOperation->addConnection( + service, + SIGNAL(clicked(bool)), + mSignalMapperList[serviceIterator - mServiceList.begin()], + SLOT(signalmap())); + + QObject::connect(mSignalMapperList[serviceIterator + - mServiceList.begin()], SIGNAL(signalmapped()), + mSignalMapper, SLOT(map())); + + // set mapping of each check box item to its index + if (mSignalMapper) + { + qDebug() << "mSignalMapper->setMapping "; + mSignalMapper->setMapping(mSignalMapperList[serviceIterator + - mServiceList.begin()], (serviceIterator + - mServiceList.begin())); + } + } + } + + qDebug() << "mGroup->childCount() = " << mGroup->childCount(); + + if (mGroup->childCount() == 0) + { + qDebug() << "mOperation->removeItem mGroup"; + mOperation->removeItem(mGroup); + mGroup = NULL; + } + else + { + //use signal mapper to connect + qDebug() << "use signal mapper to use stop service"; + QObject::connect(mSignalMapper, SIGNAL(mapped(int)), this, + SLOT(stopService(int))); + } + qDebug() << "-PosLocationServices::listServices()"; + } + +// --------------------------------------------------------------------------- +// PosLocationServices::updateList +// --------------------------------------------------------------------------- +// +void PosLocationServices::updateList() + { + qDebug() << "+PosLocationServices::updateList()"; + int result = 0; + int oldChildCount = 0; + + //store the current state (expanded) of the group + if (mGroup) + { + qDebug() << "Store the group info"; + + oldChildCount = mGroup->childCount(); + + // remove all connections + int count = mSignalMapperList.count(); + qDebug() << "mSignalMapperList.count() = " << count; + + if (count > 0) + { + for (TInt i = 0; i < count; ++i) + { + QObject::disconnect(mSignalMapperList[i], + SIGNAL(signalmapped()), mSignalMapper, SLOT(map())); + } + QObject::disconnect(mSignalMapper, SIGNAL(mapped(int)), this, + SLOT(stopService(int))); + } + mSignalMapperList.clear(); + + qDebug() << " oldChildCount" << oldChildCount; + if (oldChildCount > 0) + { + qDebug() << "Removing the old children"; + //mGroup->removeChildren(0, oldChildCount); + //ToDo: Hack from HbDataForm team + for (int i = 0; i < oldChildCount; ++i) + { + qDebug() << "remove chile index " << i; + mGroup->removeChild(0); + } + } + + } + else + { + // this part of code is called when the services are added and + // Advanced view is in the background. Since there is no group + // a new group has to be created to add the services. + qDebug() << "Creating new group"; + mGroup = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, + hbTrId("txt_loe_subtitle_background_positioning"), 0); + mOperation->appendDataFormItem(mGroup); + } + + qDebug() << "oldChildCount = " << oldChildCount; + qDebug() << "mServiceList.count() before update = " + << mServiceList.count(); + + //clear the list and get the list of server present for positioning + mServiceList.clear(); + if (mLocationServiceEngine) + { + result = mLocationServiceEngine->getLocationServices(mServiceList); + } + + qDebug() << "PosLocationServices::listServices(): result" << result; + + //update the new list to the group + if (result == 0) + { + listServices(); + } + if (result == -1) + { + //remove the group + mOperation->removeItem(mGroup); + mGroup = NULL; + } + + qDebug() << "-PosLocationServices::updateList()"; + } + +// --------------------------------------------------------------------------- +// PosLocationServices::stopService +// --------------------------------------------------------------------------- +// +void PosLocationServices::stopService(int serviceId) + { + qDebug() << "+PosLocationServices::stopService() service Id" << serviceId; + + mServiceId = serviceId; + + //Construct the display string + QString displayString; + displayString.append(QString(hbTrId("txt_loe_info_stop_service_1")).arg( + mServiceList[serviceId].mServiceName)); + + //create the message mStopQuery dialog + //HbMessageBox * mStopQuery = new HbMessageBox(); + + if (mStopQuery == 0) + { + mStopQuery = new HbMessageBox(); + mStopQuery->setTimeout(HbDialog::NoTimeout); + + //the secondry action that will come in the SK2 of the Dialog box + mStopQuery->addAction(new HbAction(QString(hbTrId( + "txt_common_button_cancel")))); + + //To-Do: set the actual stop service icon after released in sdk + QIcon stopServiceIcon(":/resources/qgn_note_warning.svg"); + mStopQuery->setIcon(HbIcon(stopServiceIcon)); + } + + //set the mStopQuery text + mStopQuery->setText(displayString); + mStopQuery->open(this,SLOT(stopSession(HbAction*))); + + qDebug() << "-PosLocationServices::stopService()"; + } + +// --------------------------------------------------------------------------- +// PosLocationServices::stopSession +// --------------------------------------------------------------------------- +// +void PosLocationServices::stopSession(HbAction* action) + { + qDebug() << " + PosLocationServices::stopSession()"; + + //if LSK is pressed + if ((action == mStopQuery->actions().at(0)) && mLocationServiceEngine) + { + //stop the session + mLocationServiceEngine->removeLocationService( + mServiceList[mServiceId].mServiceId); + } + qDebug() << " - PosLocationServices::stopSession()"; + } + +// --------------------------------------------------------------------------- +// PosLocationServices::getUpdateIntervalString +// --------------------------------------------------------------------------- +// +void PosLocationServices::getUpdateIntervalString(int updateInterval, + QString& updateIntervalString) + { + qDebug() + << "+PosLocationServices::getUpdateIntervalString(): updateInterval" + << updateInterval; + + //To-Do: clarification needed from chelli + if (updateInterval / KMinToSecs < 1) + { + //seconds + QVariant var(updateInterval); + updateIntervalString = QString(hbTrId( + "txt_loe_list_updates_every_l1_seconds")).arg(var.toString()); + } + else if (updateInterval / KHourToSecs < 1) + { + //minutes + int minutes = (updateInterval / KMinToSecs); + int seconds = (updateInterval % KMinToSecs); + QVariant varMinutes(minutes); + QVariant varSeconds(seconds); + updateIntervalString = QString(hbTrId( + "txt_loe_list_updates_every_l1_minutes_and_l2_sec")).arg( + varMinutes.toString()).arg(varSeconds.toString()); + } + else if (updateInterval / (KHourToSecs * KOneDay) < 1) + { + //hour + int hours = (updateInterval / KHourToSecs); + int minutes = (updateInterval % KHourToSecs) / KMinToSecs; + QVariant varhour(hours); + QVariant varMinutes(minutes); + + updateIntervalString = QString(hbTrId( + "txt_loe_list_updates_every_l1_hours_and_l2_minut")).arg( + varhour.toString()).arg(varMinutes.toString()); + } + else + { + //days + int days = (updateInterval / (KHourToSecs * KOneDay)); + int hours = (updateInterval % (KHourToSecs * KOneDay)) / KMinToSecs; + QVariant varDays(days); + QVariant varHours(hours); + updateIntervalString = QString(hbTrId( + "txt_loe_list_updates_every_l1_days_and_l2_hours")).arg( + varDays.toString()).arg(varHours.toString()); + } + + qDebug() << "-PosLocationServices::updateInterval()"; + + } + +Q_EXPORT_PLUGIN2(poslocationservices, PosLocationServices) +; + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/src/poslocationservicesengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/src/poslocationservicesengine.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of PosLocationServicesEngine class. +* +*/ +#include "poslocationservicesengine.h" + + +//---------------------------------------------------------------------- +// PosLocationServicesEngine::PosLocationServicesEngine +//---------------------------------------------------------------------- +PosLocationServicesEngine::PosLocationServicesEngine() + { + d_ptr = new PosLocationServicesEnginePrivate( *this ); + } + +//---------------------------------------------------------------------- +// PosLocationServicesEngine::~PosLocationServicesEngine +//---------------------------------------------------------------------- +PosLocationServicesEngine::~PosLocationServicesEngine() + { + delete d_ptr; + d_ptr = NULL; + } + +//---------------------------------------------------------------------- +// PosLocationServicesEngine::getLocationServices +//---------------------------------------------------------------------- +int PosLocationServicesEngine::getLocationServices( + QList& + locationServiceList ) + { + return d_ptr->GetLocationServices( locationServiceList ); + } + +//---------------------------------------------------------------------- +// PosLocationServicesEngine::removeLocationService +//---------------------------------------------------------------------- +int PosLocationServicesEngine::removeLocationService( int serviceId ) + { + return d_ptr->RemoveLocationService( serviceId ); + } + +//---------------------------------------------------------------------- +// PosLocationServicesEngine::handleLocationServiceUpdate +//---------------------------------------------------------------------- +void PosLocationServicesEngine::handleLocationServiceUpdate() + { + emit locationServiceUpdate(); + } + +// End of file diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/src/poslocationservicesengineprivate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/src/poslocationservicesengineprivate.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Implementation of PosLocationServicesEnginePrivate class. + * + */ +#include "poslocationservicesengineprivate.h" + +#include +#include +#include + +//---------------------------------------------------------------------- +// PosLocationServicesEnginePrivate::PosLocationServicesEnginePrivate +//---------------------------------------------------------------------- +PosLocationServicesEnginePrivate::PosLocationServicesEnginePrivate( + PosLocationServiceUpdateObserver& aObserver) : + mObserver(aObserver) + { + QT_TRAP_THROWING( mSuplSettings = CSuplSettings::NewL(); + mSuplSettings->SetSessionObserverL( *this ) ); + } + +//---------------------------------------------------------------------- +// PosLocationServicesEnginePrivate::~PosLocationServicesEnginePrivate +//---------------------------------------------------------------------- +PosLocationServicesEnginePrivate::~PosLocationServicesEnginePrivate() + { + mSuplSettings->RemoveSessionObserver(); + delete mSuplSettings; + mSuplSettings = NULL; + } + +//---------------------------------------------------------------------- +// PosLocationServicesEnginePrivate::GetLocationServices +//---------------------------------------------------------------------- +int PosLocationServicesEnginePrivate::GetLocationServices(QList< + PosLocationServiceInfo>& aLocationServiceList) + { + int err = 0; + TRAP(err, GetLocationServicesL(aLocationServiceList)); + return err; + } +//---------------------------------------------------------------------- +// PosLocationServicesEnginePrivate::GetLocationServicesL +//---------------------------------------------------------------------- +void PosLocationServicesEnginePrivate::GetLocationServicesL(QList< + PosLocationServiceInfo>& aLocationServiceList) + { + RPointerArray triggerParams; + CleanupClosePushL(triggerParams); + int error = mSuplSettings->GetTriggerParams(triggerParams); + + int count = triggerParams.Count(); + + //if there are no trigger params then leave with KErrNotFound + if (count <= 0) + { + User::Leave(KErrNotFound); + } + + //for each entry in the paramlist populate the locationservice list + for (int i = 0; i < count; ++i) + { + + TInt64 sessionId; + TUint64 outstandingTrigger; + TUint64 interval; + TTime endTime; + TBool notificationPresent; + TBool triggerNotificationStatus; + CTriggerParams::TTriggerType triggerType; + CTriggerParams::TRequestType requestType; + HBufC* sessionName = HBufC::NewLC( + KMaxTriggerSessionNameLen); + + error = triggerParams[i]->Get(sessionId, sessionName->Des(), + notificationPresent, triggerNotificationStatus, triggerType, + requestType, outstandingTrigger, interval); + triggerParams[i]->GetTriggerEndTime(endTime); + + if (error == KErrNone) + { + PosLocationServiceInfo serviceInfo; + serviceInfo.mServiceId = sessionId; + QString sName((QChar*) (sessionName->Ptr()), + sessionName->Length()); + + serviceInfo.mServiceName.append(sName); + serviceInfo.mUpdateInterval = interval; + serviceInfo.mEndDateTime.setDate(QDate(endTime.DateTime().Year(), + endTime.DateTime().Month() + 1, endTime.DateTime().Day() + + 1)); + serviceInfo.mEndDateTime.setTime(QTime(endTime.DateTime().Hour(), + endTime.DateTime().Minute(), endTime.DateTime().Second(), + endTime.DateTime().MicroSecond())); + + aLocationServiceList.append(serviceInfo); + } + CleanupStack::PopAndDestroy(sessionName); + } + CleanupStack::Pop(&triggerParams); + triggerParams.ResetAndDestroy(); + + //leave if there is an error + User::LeaveIfError(error); + } + +//---------------------------------------------------------------------- +// PosLocationServicesEnginePrivate::RemoveLocationService +//---------------------------------------------------------------------- +int PosLocationServicesEnginePrivate::RemoveLocationService(int aServiceId) + { + return mSuplSettings->CancelTriggerSession(aServiceId); + } + +//---------------------------------------------------------------------- +// PosLocationServicesEnginePrivate::HandleSuplSessionChangeL +//---------------------------------------------------------------------- +void PosLocationServicesEnginePrivate::HandleSuplSessionChangeL( + TSuplSessionEventType /*aEvent*/, TInt64 /*aSessionId*/) + { + mObserver.handleLocationServiceUpdate(); + } + +// End of file diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/poslocationservices/src/possettingssignalmapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/poslocationservices/src/possettingssignalmapper.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Implementation of Positioning settings signal mapper class + * + */ + + +#include "possettingssignalmapper.h" + + +//--------------------------------------------------------------------- +// PosSettingsSignalMapper::PosSettingsSignalMapper() +// Constructor +//--------------------------------------------------------------------- +PosSettingsSignalMapper::PosSettingsSignalMapper() + { + + } + +//--------------------------------------------------------------------- +// PosSettingsSignalMapper::PosSettingsSignalMapper() +// destructor +//--------------------------------------------------------------------- +PosSettingsSignalMapper::~PosSettingsSignalMapper() + { + + } + +//--------------------------------------------------------------------- +// PosSettingsSignalMapper::PosSettingsSignalMapper() +// +//--------------------------------------------------------------------- +void PosSettingsSignalMapper::signalmap() + { + emit signalmapped(); + } + + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/posmethodsplugin/inc/pospsysettingscommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/posmethodsplugin/inc/pospsysettingscommon.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Contains the common data structures & Enum + * + */ + +#ifndef POSPSYSETTINGSCOMMON_H +#define POSPSYSETTINGSCOMMON_H + +#include +#include + +/** + * Enumeration to indicate the state of the Psy + */ +enum PosPsyState + { + PsyEnable, + + PsyDisable + }; +/** + * Struct that contains all the info related to each Psy + * - uid of Psy + * - name + * - state of the Psy whether enabled/disabled + */ +struct PosPsyInfo + { + TUid mPsyModuelId; + + QString mPsyName; + + PosPsyState mPsyState; + }; + +#endif /* POSPSYSETTINGSCOMMON_H */ + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/posmethodsplugin/inc/pospsysettingsengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/posmethodsplugin/inc/pospsysettingsengine.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Declaration of the Positioning Methods engine class + * used to get the list of available Psy & to manipulate + * the state of the Psy. + * + * + */ + +#ifndef POSPSYSETTINGSENGINE_H +#define POSPSYSETTINGSENGINE_H + +#include "pospsysettingsengineprivate.h" + +#include +#include + +class PosPsySettingsEngine : public QObject, + public PositionTechnologyChangeObserver + { +Q_OBJECT + +public: + /** + * Constructor + */ + PosPsySettingsEngine(); + + /** + * Destructor + */ + + ~PosPsySettingsEngine(); + + /** + * This method lists all the PSY that are available + * @param[out] psyList - Contains the list of psys that are available + * @return - KErrNone - if successfully finds any Psy + * KErrNotFound - if no Psy available. + */ + int listPsys(QList& psyList); + + /** + * This method is used to change the state of the Psy based on the user's + * action of either enabling/disabling the Psy. + * @param[in] psyModuleId - the uid of the Psy whose state is to be changed. + * @param[in] psyState - The value of state to which the Psy has to be changed. + */ + + int changePsyState(TUid psyModuleId, PosPsyState psyState); + +public: // from PositionTechnologyChangeObserver + void handlePositionTechnologyChange(); + +private: +signals: + /** + * This signal is emitted when there is change in PSY wrt to + * its availabilty, state etc.. + */ + void PSYChange(); +private: + Q_DECLARE_PRIVATE_D(d_ptr, PosPsySettingsEngine) +private: + /** + * POinter to the PosPsySettingsEnginePrivate + * Owns + */ + PosPsySettingsEnginePrivate* d_ptr; + }; + +#endif /* POSPSYSETTINGSENGINE_H */ diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/posmethodsplugin/inc/pospsysettingsengineprivate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/posmethodsplugin/inc/pospsysettingsengineprivate.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Declaration of the Positioning Methods private engine class + * used to get the list of available Psy & to manipulate + * the state of the Psy by using the location framework apis. + * + * + */ + +#ifndef POSPSYSETTINGSENGINEPRIVATE_H +#define POSPSYSETTINGSENGINEPRIVATE_H + +#include "pospsysettingscommon.h" + +#include +#include +#include + +/** + * The class defines the interface for receiving position + * technology change event.The class interested in position + * technology change should inherit from this class. + */ +class PositionTechnologyChangeObserver + { +public: + virtual void handlePositionTechnologyChange() = 0; + }; + + +// Forward declarations +class CPosModules; +class PosPsySettingsEngine; + +class PosPsySettingsEnginePrivate : public MPosModulesObserver + { +public: + /** + * Constructor + */ + PosPsySettingsEnginePrivate( PositionTechnologyChangeObserver& + posTechChangeObserver); + + /** + * Destructor + */ + + ~PosPsySettingsEnginePrivate(); + + /** + * This method lists all the PSY that are available + * @param[out] psyList - Contains the list of psys that are available + * @return - KErrNone - if successfully finds any Psy + * KErrNotFound - if no Psy available. + */ + int listPsys( QList& psyList ); + + /** + * This method is used to change the state of the Psy based on the user's + * action of either enabling/disabling the Psy. + * @param[in] psyModuleId - the uid of the Psy whose state is to be changed. + * @param[in] psyState - The value of state to which the Psy has to be changed. + */ + + int changePsyState( TUid psyModuleId, PosPsyState psyState ); + +public: // from MPosModulesObserver + virtual void HandleSettingsChangeL( TPosModulesEvent aEvent ); + +private: + /** + * This method uses the location framework apis to get the list of available psy + */ + void listPsysL(); + /** + * This method uses the location framework apis to manipulate the state of the Psy + */ + void changePsyStateL( TUid psyModuleId, PosPsyState psyState ); +private : + /** + * Pointer to CPosModules + * Owns + */ + CPosModules* mPosModules; + + /** + * Contains list of PSY info + * Own + */ + RArray mPsyInfoList; + /** + * Reference to position technology change observer. + */ + PositionTechnologyChangeObserver& mPosTechChangeObserver; + /* + * POinter to the name of the psy + * ToDo: Should be removed + */ + QList mNameList; + + friend class PosPsySettingsEngine; + }; + +#endif /* POSPSYSETTINGSENGINEPRIVATE_H */ diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/posmethodsplugin/inc/pospsysettingsplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/posmethodsplugin/inc/pospsysettingsplugin.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Declaration of the Positioning Methods plugin to the + * Avanced settings view + * + */ + +#ifndef POSPSYSETTINGSPLUGIN_H +#define POSPSYSETTINGSPLUGIN_H + + +#include "possettingsadvinterface.h" +#include "pospsysettingscommon.h" +#include "possettingssignalmapper.h" + +#include +#include +#include + +// Forward Declaration +class PosPsySettingsEngine; +class PosSettingsAdvOp; +class PosSettingsSignalMapper; + +class PosPsySettingsPlugin : public QObject, public PosSettingsAdvInterface +{ +Q_OBJECT + Q_INTERFACES( PosSettingsAdvInterface ) +public: + /** + * Constructor + */ + PosPsySettingsPlugin(); + /** + * Destructor + */ + ~PosPsySettingsPlugin(); +public: + /** + * Derived from PosSettingsAdvInterface + */ + int initialise( PosSettingsAdvOp* operation ); + +private slots: + /** + * This will be called when any of the positioning methods checkbox is clicked. + * @param[in] state - indicates the state of the checkbox,whether enabled/disabled + * @param[in] psyUid - indicates the Uid of the Psy that has been clciked. + */ + void onPsyPressed(int index); + /** + * This method will be called on a change in any of the psy info. + * It willbe used to update the positioning methods group to reflect + * the latest available info of psys. + */ + void updateGroup(); + +private: + /** + * adds items to the group & make connections + */ + void addItems(); + + +private: + /** + * Pointer to the PosPsySettingsEngine + * Owns + */ + PosPsySettingsEngine* mEngine; + /** + * List of available Positioning methods + */ + QList mPsyList; + /** + * pointer to the HbDataFormModelItem + * Does not own + */ + HbDataFormModelItem* mGroup; + /** + * Signal mapper used to map the signal emitted from + * each of the psy check box to the slot + * Owns + */ + QSignalMapper *mSignalMapper; + /** + * List of psy signal mapper class + */ + QList mPsySignalMapperList; + /** + * reference to PosSettingsAdvOp + */ + PosSettingsAdvOp* mOperation; + +}; +#endif // POSPSYSETTINGSPLUGIN_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/posmethodsplugin/inc/possettingssignalmapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/posmethodsplugin/inc/possettingssignalmapper.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Declaration of the Positioning Methods plugin signal mapper + * used to map the signals of each check box item to the index + * + */ + +#ifndef PosSettingsSignalMapper_H +#define PosSettingsSignalMapper_H + +#include + +class PosSettingsSignalMapper : public QObject + { + Q_OBJECT +public: + /* + * constructor + */ + PosSettingsSignalMapper(); + /** + * destructor + */ + ~PosSettingsSignalMapper(); +private: +signals: + /** + * signal emitted by the slot of this class + */ + void signalmapped(); +public slots: + /** + * slot to be called on a change in state of checkbox. + * this in turn calls the signal signalmapped() + */ + void signalmap(); + }; + +#endif //PosSettingsSignalMapper_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/posmethodsplugin/pospsysettings.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/posmethodsplugin/pospsysettings.pro Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,65 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: PosPsySetting pro file +# + +TEMPLATE = lib +TARGET = pospsysettings +DEPENDPATH += . +INCLUDEPATH += ../inc +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE +CONFIG += hb \ + plugin + +#Uncomment following line to disable logging +#DEFINES += QT_NO_DEBUG_OUTPUT +MOC_DIR = moc +OBJECTS_DIR = obj +RCC_DIR = rcc + +# Platforms +SYMBIAN_PLATFORMS = WINSCW \ + ARMV5 +LIBS += -lcpframework \ + -llbs \ + -leposmodset \ + -lpossettingsengine + +# Input +SOURCES += src/possettingssignalmapper.cpp \ + src/pospsysettingsplugin.cpp \ + src/pospsysettingsengine.cpp \ + src/pospsysettingsengineprivate.cpp +HEADERS += inc/possettingssignalmapper.h \ + inc/pospsysettingsplugin.h \ + inc/pospsysettingsengine.h \ + inc/pospsysettingsengineprivate.h \ + inc/pospsysettingscommon.h +symbian: { + TARGET.EPOCALLOWDLLDATA = 1 + DEFINES += PLUGINUID3=0x2002C31A + TARGET.UID3 = 0x2002C31A +} +symbian { + deploy.path = C: + qtplugins.path = /resource/qt/plugins/positioningsettings + qtplugins.sources += qmakepluginstubs/pospsysettings.qtplugin + + # This is for new exporting system coming in garden + for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" +} +TARGET.CAPABILITY = All -TCB +plugin.sources = pospsysettings.dll +plugin.path = \resource\qt\plugins\positioningsettings +DEPLOYMENT += plugin diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/posmethodsplugin/src/pospsysettingsengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/posmethodsplugin/src/pospsysettingsengine.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Implementation of psy settings engine class. + * + */ + +#include "pospsysettingsengine.h" +#include + +//--------------------------------------------------------------------- +// PosPsySettingsEngine::PosPsySettingsEngine() +// Constructor +//--------------------------------------------------------------------- +PosPsySettingsEngine::PosPsySettingsEngine() + { + qDebug() << "+ PosSettingsEngine::PosPsySettingsEngine()"; + d_ptr = new PosPsySettingsEnginePrivate(*this); + qDebug() << "- PosSettingsEngine::PosPsySettingsEngine()"; + } + +//--------------------------------------------------------------------- +// PosPsySettingsEngine::~PosPsySettingsEngine() +// Destructor +//--------------------------------------------------------------------- +PosPsySettingsEngine::~PosPsySettingsEngine() + { + qDebug() << "+ PosSettingsEngine::~PosPsySettingsEngine()"; + delete d_ptr; + d_ptr = NULL; + qDebug() << "- PosSettingsEngine::~PosPsySettingsEngine()"; + } + +//--------------------------------------------------------------------- +// PosPsySettingsEngine::listPsys( QList& psyList ) +// +//--------------------------------------------------------------------- +int PosPsySettingsEngine::listPsys(QList& psyList) + { + qDebug() << "+ PosSettingsEngine::listPsys()"; + int ret = d_ptr->listPsys(psyList); + qDebug() << "- PosSettingsEngine::listPsys()" << ret; + return ret; + } + +//--------------------------------------------------------------------- +// PosPsySettingsEngine::changePsyState( TUid psyModuleId, PosPsyState psyState ) +// +//--------------------------------------------------------------------- +int PosPsySettingsEngine::changePsyState(TUid psyModuleId, + PosPsyState psyState) + { + qDebug() << "+ PosSettingsEngine::changePsyState()"; + qDebug() << "psystate = " << psyState; + int ret = d_ptr->changePsyState(psyModuleId, psyState); + qDebug() << "- PosSettingsEngine::changePsyState()" << ret; + return ret; + } + +//--------------------------------------------------------------------- +// PosPsySettingsEngine::handlePositionTechnologyChange +// +//--------------------------------------------------------------------- +void PosPsySettingsEngine::handlePositionTechnologyChange() + { + qDebug() << "+ PosSettingsEngine::handlePositionTechnologyChange()"; + // emit the signal when there is a change in the list of available psys + emit PSYChange(); + qDebug() << "- PosSettingsEngine::handlePositionTechnologyChange()"; + } + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/posmethodsplugin/src/pospsysettingsengineprivate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/posmethodsplugin/src/pospsysettingsengineprivate.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Implementation of psy settings engine private class. + * + */ + + +#include "pospsysettingsengineprivate.h" +#include "pospsysettingsengine.h" + +#include +#include +#include +#include + +// constants +const TInt KNameLength = 50; + +//--------------------------------------------------------------------- +// PosPsySettingsEnginePrivate::PosPsySettingsEnginePrivate() +// Constructor +//--------------------------------------------------------------------- +PosPsySettingsEnginePrivate::PosPsySettingsEnginePrivate( + PositionTechnologyChangeObserver& posTechChangeObserver) : + mPosTechChangeObserver(posTechChangeObserver) + { + + // initialize the CPosModules pointer + QT_TRAP_THROWING ( mPosModules = CPosModules::OpenL(); + // Register for settings change. + mPosModules->SetObserverL( *this )); + } + +//--------------------------------------------------------------------- +// PosPsySettingsEnginePrivate::~PosPsySettingsEnginePrivate() +// Destructor +//--------------------------------------------------------------------- +PosPsySettingsEnginePrivate::~PosPsySettingsEnginePrivate() + { + // delete mPosModules + if (mPosModules) + { + // remove the observer + mPosModules->RemoveObserver(); + delete mPosModules; + mPosModules = NULL; + } + // delete the psyname + TInt cnt = mNameList.count(); + for(TInt i=0;i& psyList ) +// +//--------------------------------------------------------------------- +int PosPsySettingsEnginePrivate::listPsys(QList& psyList) + { + // Get the list of available psy + TRAPD( error, listPsysL() ); + + if (error == KErrNone) + { + // copy the psy from RArray to the Qlist + TInt cnt = mPsyInfoList.Count(); + for (TInt i = 0; i < cnt; ++i) + { + psyList.append(mPsyInfoList[i]); + } + return KErrNone; + } + else + { + return error; + } + + } + +//--------------------------------------------------------------------- +// PosPsySettingsEnginePrivate::changePsyState( TUid psyModuleId, PosPsyState psyState ) +// +//--------------------------------------------------------------------- +int PosPsySettingsEnginePrivate::changePsyState(TUid psyModuleId, + PosPsyState psyState) + { + // update the psy state + TRAPD( error, changePsyStateL( psyModuleId, psyState ) ); + return error; + } + +//--------------------------------------------------------------------- +// PosPsySettingsEnginePrivate::listPsysL( ) +// +//--------------------------------------------------------------------- +void PosPsySettingsEnginePrivate::listPsysL() + { + // reset the list of psyinfo + mPsyInfoList.Reset(); + + // get the list of psy module ids + CPosModuleIdList* idList = mPosModules->ModuleIdListLC(); + // for each psy in the list,do the following : + // - get module info + // - check visibility of psy,if true then do the following : + // -> store the uid,name, state of psy in the PosPsyInfo structure + // -> append to the list of psys. + TInt cnt = idList->Count(); + for (TInt i = 0; i < cnt; ++i) + { + TPositionModuleInfo moduleInfo; + mPosModules->GetModuleInfoL((*idList)[i], moduleInfo); + + // check visibility + if (mPosModules->IsModuleVisibleL((*idList)[i])) + { + + PosPsyInfo psyInfo; + // Set the module Id. + psyInfo.mPsyModuelId = moduleInfo.ModuleId(); + + // Set module name + TBuf moduleName; + moduleInfo.GetModuleName(moduleName); + // converting Tbuf to qstring + QString* name = new QString((QChar*) moduleName.Ptr(), + moduleName.Length()); + mNameList.append( name ); + psyInfo.mPsyName = *name; + + // Set the state of the psy + if (moduleInfo.IsAvailable()) + { + psyInfo.mPsyState = PsyEnable; + } + else + { + psyInfo.mPsyState = PsyDisable; + } + + // append the psyinfo to the list + mPsyInfoList.AppendL(psyInfo); + } + } + + CleanupStack::PopAndDestroy(idList); + } + +//--------------------------------------------------------------------- +// PosPsySettingsEnginePrivate::changePsyStateL( TUid psyModuleId, PosPsyState psyState ) +// +//--------------------------------------------------------------------- +void PosPsySettingsEnginePrivate::changePsyStateL(TUid psyModuleId, + PosPsyState psyState) + { + // create an instance of CPosModuleUpdate to help in updating the attributes + // of Psy + CPosModuleUpdate* updateParams = CPosModuleUpdate::NewLC(); + // Depending on the changed state update the availability of the psy + // i.e enable/disable + if (psyState == PsyEnable) + { + updateParams->SetUpdateAvailability(ETrue); + } + else + { + updateParams->SetUpdateAvailability(EFalse); + } + // update the state of the psy whose id is mentioned + mPosModules->UpdateModuleL(psyModuleId, *updateParams); + + CleanupStack::PopAndDestroy(updateParams); + + } + +//--------------------------------------------------------------------- +// PosPsySettingsEnginePrivate::changePsyStateL( TUid psyModuleId, PosPsyState psyState ) +// +//--------------------------------------------------------------------- +void PosPsySettingsEnginePrivate::HandleSettingsChangeL( + TPosModulesEvent aEvent) + { + // Check the event type,only for installation,removal, + // change in visibility, + // get the newly available list of psy + if (aEvent.iType == EPosModulesEventModuleInstalled || + aEvent.iType == EPosModulesEventModuleRemoved || + aEvent.iType == EPosModulesEventVisibilityChanged) + { + listPsysL(); + // call the engine's handlePositionTechnologyChange + mPosTechChangeObserver.handlePositionTechnologyChange(); + } + } + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/posmethodsplugin/src/pospsysettingsplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/posmethodsplugin/src/pospsysettingsplugin.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,276 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Implementation of psy settings plugin class. + * + */ +#include "pospsysettingsplugin.h" +#include "pospsysettingsengine.h" + +#include + +//--------------------------------------------------------------------- +// PosPsySettingsPlugin::PosPsySettingsPlugin() +// Constructor +//--------------------------------------------------------------------- +PosPsySettingsPlugin::PosPsySettingsPlugin(): +mGroup(NULL), +mSignalMapper(NULL), +mOperation(NULL) + { + qDebug() << "================ PSY Plug-in loaded =============================="; + qDebug() << "+ PosPsySettingsPlugin::PosPsySettingsPlugin()"; + mEngine = new PosPsySettingsEngine(); + qDebug() << "- PosPsySettingsPlugin::PosPsySettingsPlugin()"; + } + +//--------------------------------------------------------------------- +// PosPsySettingsPlugin::~PosPsySettingsPlugin() +// Destructor +//--------------------------------------------------------------------- +PosPsySettingsPlugin::~PosPsySettingsPlugin() + { + qDebug() << "- PosPsySettingsPlugin::~PosPsySettingsPlugin()"; + //Note: no need to call mOperation->removeConnection() as it is already handled in advview's destructor + if (mEngine) + { + delete mEngine; + mEngine = NULL; + } + + // delete the group + if(mGroup) + { + mOperation->removeItem( mGroup ); + } + + // clear the list of available psys + mPsyList.clear(); + + QObject::disconnect(mSignalMapper, SIGNAL(mapped(int)), this, + SLOT(onPsyPressed(int))); + // delete the QSignalMapper instance + if (mSignalMapper) + { + delete mSignalMapper; + mSignalMapper = NULL; + } + + // delete the signal mapper instances + int cnt = mPsySignalMapperList.count(); + for (int i = 0; i < cnt ; ++i) + { + QObject::disconnect(mPsySignalMapperList[i], SIGNAL(signalmapped()), + mSignalMapper, SLOT(map())); + delete mPsySignalMapperList[i]; + mPsySignalMapperList[i] = NULL; + } + // clear the list of signal mapper + mPsySignalMapperList.clear(); + + qDebug() << "- PosPsySettingsPlugin::~PosPsySettingsPlugin()"; + qDebug() << "================ PSY Plug-in unloaded =============================="; + } + +//--------------------------------------------------------------------- +// PosPsySettingsPlugin::initialise( PosSettingsAdvOp* operation ) +// +//--------------------------------------------------------------------- +int PosPsySettingsPlugin::initialise(PosSettingsAdvOp* operation) + { + qDebug() << "+ PosPsySettingsPlugin::initialise()"; + mOperation = operation; + mPsyList.clear(); + // get the list of psys + int error = mEngine->listPsys(mPsyList); + // if the list is not available return error + if (error == KErrNone) + { + // create group + mGroup = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, tr( + "Positioning methods"), 0); + // append the group to data form using operation + operation->appendDataFormItem(mGroup); + + // add group items + addItems(); + + // make connection to update the group inase of change in availbale list of psy + QObject::connect(mEngine, SIGNAL(PSYChange()), this, + SLOT(updateGroup())); + qDebug() << "- PosPsySettingsPlugin::initialise()"; + return KErrNone; + } + qDebug() << "- PosPsySettingsPlugin::initialise()"; + return error; + } + +//--------------------------------------------------------------------- +// PosPsySettingsPlugin::onPsyPressed( int state, int psyUid ) +// +//--------------------------------------------------------------------- +void PosPsySettingsPlugin::onPsyPressed(int index) + { + qDebug() << "+ PosPsySettingsPlugin::onPsyPressed()"; + // get the check box item using the index + HbDataFormModelItem *checkBox = mGroup->childAt(index); + // get the psy name for the check box + QVariant name(checkBox->contentWidgetData("text")); + QString psyName = name.toString(); + qDebug() << "Psy to be changed:" << psyName; + + // get the psyuid for the psy + TUid psyUid = mPsyList.at(index).mPsyModuelId; + + // get the state of the check box + QVariant state(checkBox->contentWidgetData(("checkState"))); + int psyState = state.toInt(); + + // change the psy state based on check box state + if (psyState == Qt::Checked) + { + qDebug() << "Psy value:true"; + int error = mEngine->changePsyState(psyUid, PsyEnable); + } + else + { + qDebug() << "Psy value:false"; + int error = mEngine->changePsyState(psyUid, PsyDisable); + } + qDebug() << "- PosPsySettingsPlugin::onPsyPressed()"; + } + +//--------------------------------------------------------------------- +// PosPsySettingsPlugin::updateGroup +// +//--------------------------------------------------------------------- +void PosPsySettingsPlugin::updateGroup() + { + qDebug() << "+ PosPsySettingsPlugin::updateGroup()"; + // remove all connections + int cnt= mGroup->childCount(); + for (int i = 0; i < cnt; ++i) + { + mOperation->removeConnection(mGroup->childAt(i), + SIGNAL(stateChanged(int)), mPsySignalMapperList[i], + SLOT(signalmap())); + } + cnt = mPsySignalMapperList.count(); + for (int i = 0; i < cnt; ++i) + { + QObject::disconnect(mPsySignalMapperList[i], SIGNAL(signalmapped()), + mSignalMapper, SLOT(map())); + delete mPsySignalMapperList[i]; + mPsySignalMapperList[i] = NULL; + } + mPsySignalMapperList.clear(); + + QObject::disconnect(mSignalMapper, SIGNAL(mapped(int)), this, + SLOT(onPsyPressed(int))); + + // delete the QSignalMapper instance + if (mSignalMapper) + { + delete mSignalMapper; + mSignalMapper = NULL; + } + + // clear list of psys + mPsyList.clear(); + // get the list of psys + int error = mEngine->listPsys(mPsyList); + // if the list is not available return error + if (error == KErrNone ) + { + // remove all group's children + //mGroup->removeChildren(0, oldChildCount); + //ToDo: Hack from HbDataForm team + int cnt = mGroup->childCount(); + for(int i=0;iremoveChild(0); + } + // add the group items + addItems(); + if (mOperation->isExpanded(mOperation->indexFromItem(mGroup))) + { + // set as expanded since group was already expanded + mOperation->setExpanded(mOperation->indexFromItem(mGroup), true); + } + } + qDebug() << "- PosPsySettingsPlugin::updateGroup()"; + } + +//--------------------------------------------------------------------- +// PosPsySettingsPlugin::addItems +// +//--------------------------------------------------------------------- +void PosPsySettingsPlugin::addItems() + { + qDebug() << "+ PosPsySettingsPlugin::addItems()"; + // create the signal mapper + if(mSignalMapper) + { + delete mSignalMapper; + mSignalMapper = NULL; + } + mSignalMapper = new QSignalMapper(); + + // for each of the psys in the list + // - add a check box item with name + // - set the checkbox state according to the psy's current state + // - make connections + // foreach( PosPsyInfo psy, mPsyList ) + int cnt = mPsyList.count(); + qDebug() << "No of Psys: " << cnt; + for (int i = 0; i < cnt; ++i) + { + // create the check box item + HbDataFormModelItem* checkBox = new HbDataFormModelItem( + HbDataFormModelItem::CheckBoxItem, QString(), mGroup); + QString psyName = mPsyList.at(i).mPsyName; + qDebug() << "Psy Name: " << psyName; + checkBox->setContentWidgetData("text", psyName); + + // set the state of checkbox + if (mPsyList.at(i).mPsyState == PsyEnable) + { + checkBox->setContentWidgetData("checkState", Qt::Checked); + } + else + { + checkBox->setContentWidgetData("checkState", Qt::Unchecked); + } + // append the check box item to the group + mGroup->appendChild(checkBox); + + // create a new psySignalMapper for each checkbox created + PosSettingsSignalMapper* psySignalMapper = + new PosSettingsSignalMapper(); + mPsySignalMapperList.append(psySignalMapper); + + // add connections on change of check box state + mOperation->addConnection(checkBox, SIGNAL(stateChanged(int)), + mPsySignalMapperList[i], SLOT(signalmap())); + QObject::connect(mPsySignalMapperList[i], SIGNAL(signalmapped()), + mSignalMapper, SLOT(map())); + // set mapping of each check box item to its index + mSignalMapper->setMapping(mPsySignalMapperList[i], i); + + } + QObject::connect(mSignalMapper, SIGNAL(mapped(int)), this, + SLOT(onPsyPressed(int))); + qDebug() << "- PosPsySettingsPlugin::addItems()"; + } + +Q_EXPORT_PLUGIN2(pospsysettings, PosPsySettingsPlugin) +; diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/posmethodsplugin/src/possettingssignalmapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/posmethodsplugin/src/possettingssignalmapper.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Implementation of psy settings signal mapper class + * + */ + + +#include "PosSettingsSignalMapper.h" + + +//--------------------------------------------------------------------- +// PosSettingsSignalMapper::PosSettingsSignalMapper() +// Constructor +//--------------------------------------------------------------------- +PosSettingsSignalMapper::PosSettingsSignalMapper() + { + + } + +//--------------------------------------------------------------------- +// PosSettingsSignalMapper::PosSettingsSignalMapper() +// destructor +//--------------------------------------------------------------------- +PosSettingsSignalMapper::~PosSettingsSignalMapper() + { + + } + +//--------------------------------------------------------------------- +// PosSettingsSignalMapper::PosSettingsSignalMapper() +// +//--------------------------------------------------------------------- +void PosSettingsSignalMapper::signalmap() + { + emit signalmapped(); + } + + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettings.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettings.pro Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,37 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# Description: project file for positioing settings in control panel +# + + +TEMPLATE = subdirs + +SYMBIAN_PLATFORMS = WINSCW ARMV5 + +SUBDIRS += possettingsengine/possettingsengine.pro +SUBDIRS += possettingsplugin/possettingsplugin.pro +SUBDIRS += posmethodsplugin/pospsysettings.pro +SUBDIRS += possuplsettingsplugin/possuplsettings.pro +SUBDIRS += poslocationservices/poslocationservices.pro + +DEFINES += BUILD_POSSETTINGS + +# Build.inf rules +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ + "possettings_stub.sis /epoc32/data/z/system/install/possettings_stub.sis" \ + "rom/possettings.iby CORE_MW_LAYER_IBY_EXPORT_PATH(possettings.iby)" \ + "rom/possettings_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(possettings_resources.iby)" \ + "conf/positioningsettings.confml MW_LAYER_CONFML(positioningsettings.confml)" \ + "conf/positioningsettings_2002E685.crml MW_LAYER_CRML(positioningsettings_2002E685.crml)" + + \ No newline at end of file diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettings_stub.sis Binary file locationsystemui/locationsysui/possettings/possettings_stub.sis has changed diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/inc/checkcustomviewitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/inc/checkcustomviewitem.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#ifndef CHECK_CUSTOMVIEWITEM_H +#define CHECK_CUSTOMVIEWITEM_H + +#include +#include + +class HbWidget; + +class CheckCustomViewItem: public HbDataFormViewItem +{ + Q_OBJECT + +public: + explicit CheckCustomViewItem(QGraphicsItem *parent = 0); + ~CheckCustomViewItem(); + virtual HbAbstractViewItem* createItem(); + virtual bool canSetModelIndex(const QModelIndex &index) const; +}; +#endif // CHECK_CUSTOMVIEWITEM_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/inc/possettingsadvview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/inc/possettingsadvview.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description:Declaration of the Positioning Settings Advanced View class + * + */ + +#ifndef POSSETTINGSENG_ADVANCEDVIEW_H +#define POSSETTINGSENG_ADVANCEDVIEW_H + +#include "possettingsadvop.h" + +#include +#include + +//class PosSettingsAdvancedDataForm; +class HbDataForm; +class HbDataFormModel; +class HbDataFormModelItem; +class PosSettingsAdvOp; +class PosSettingsAdvInterface; +class PosSettingsPluginsLoader; +class QFileSystemWatcher; + +class PosSettingsAdvView : public CpBaseSettingView + { +Q_OBJECT + +public: + /* + * Constructor + */ + PosSettingsAdvView(QGraphicsItem *parent = 0); + /* + * Destructor + */ + ~PosSettingsAdvView(); + +private slots: + /** + * Updates the advanced view in case of change in any of the plugins, + * this slot needs to be called + */ + void updateAdvView(); + +private: + + /** + * Handle to Heading groupbox + * Not Own + */ + HbDataFormModelItem *mHeading; + + + /* + * Pointer to the HbDataForm + * Owns + */ + HbDataForm* mAdvancedDataForm; + /* + * Pointer to the PosSettingsAdvOp + * owns + */ + PosSettingsAdvOp* mAdvancedOperation; + /** + * List containing the plugins + */ + QList mPluginsList; + /** + * Pointer to the PosSettingsPluginsLoader + */ + PosSettingsPluginsLoader* mPluginsLoader; + /** + * Pointer to the QFileSystemWatcher + * Owns + */ + QFileSystemWatcher* mWatcher; + + }; + +#endif //POSSETTINGSENG_ADVANCEDVIEW_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/inc/possettingscommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/inc/possettingscommon.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This header exposes common data structues and enums. +* +*/ + +#ifndef POSSETTINGSCOMMON_H +#define POSSETTINGSCOMMON_H + +#include + +/** + * This enum defines type of position technology. + */ +enum PositionTechnology + { + /** + * Bit mask used to specify GPS technology. + */ + PositionTechnologyGps = 0x01, + + /** + * Bit mask used to specify network technology. + */ + PositionTechnologyNetwork = 0x02, + + }; + +/** + * This enum defines different state. + */ +enum State + { + StateEnable, + + StateDisable + }; + +/** + * PSY module information + */ +struct PsyModuleInfo + { + /** + * Module id of Psy + */ + TUid mPsyModuleId; + + /** + * Position technology. + */ + PositionTechnology mPosTech; + + /** + * State of Psy + */ + State mState; + }; + + +#endif /* PosSettingsCOMMON_H */ diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/inc/possettingsengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/inc/possettingsengine.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of positioning settings engine class. +* +*/ + +#ifndef POSITIONINGSETTINGS_ENGINE_H +#define POSITIONINGSETTINGS_ENGINE_H + + +#include "possettingscommon.h" +#include "possettingsengineprivate.h" +#include +#include + +/** + * PositioningSettingsEngine class provides an interface that abstracts client + * from different GPS and wireless positioning techniques. This exposes methods + * to perform operations on the positioning techniques. + */ + +class PosSettingsEngine : public QObject, + public PositionTechnologyChangeObserver + { + Q_OBJECT +public: + /** + * Default constructor + * This throws an error if construction fails. + */ + PosSettingsEngine(); + + /** + * Destructor + */ + ~PosSettingsEngine(); + + /** + * Returns whether specified position technology is available. + * @param[in] posTechnology Position technology of interest. + * @return true if specified position technology is available, + * false if it is not available. + */ + bool isPositionTechnologyAvailable( PositionTechnology posTechnology ); + + /** + * Sets the state of position technology. + * @param[in] posTechnologyState Resultant state of the position technology + * after this operation. + * @param[in] posTechnology State of position technology to be changed. + * @return KErrNone if successful, + * KErrNotFound if specified position technology is not available + * Otherwise, standard error code is returned, + * KErrServerBusy, etc.. + */ + int setPositionTechnologyState( State posTechnologyState, + PositionTechnology posTechnology ); + + /** + * Returns whether specified position technology is enabled. It is recemonded + * to use this method after checking the availability of the position technology + * using isPositionTechnologyAvailable method. + * @param[in] posTechnology Position technology of interest. + * @return true if specified position technology is enabled, + * false if it is disabled. + */ + bool isPositionTechnologyEnabled( PositionTechnology posTechnology ); + + /** + * Sets the state of back ground positioning. + * @param[in] backGroundPosState Resultant state of back ground positioning. + * @return KErrNone if successful, + * KErrNotSupported if none of the position type are available, + * KErrArgument if none of the position type are enabled + * otherwise, standard error code is returned, + * KErrServerBusy, etc.. + */ + int setBackGroundPositioningState( State backGroundPosState ); + + /** + * Returns whether back ground positioning is enabled. It is recemonded + * to use this method after checking the availability of the position type + * using isPositionTypeAvailable method. + * @return true if back ground positioning is enabled, + * false if it is disabled. + */ + bool isBackGroundPositioningEnabled(); + + /** + * It will set status of background positioning in CR key + * It is required to retain old status when checkbox is inserted/removed + * + * status [in] - The status of the background positioning in CR key + */ + void setCRBackgroundPositioningStatus(State backGroundPosState); + + /** + * It will return status of background positioning in CR key + * It is required to retain old status when checkbox is inserted/removed. + * + * returns true if enabled or false if disabled + */ + bool cRBackgroundPositioningStatus(); + +public: // from PositionTechnologyChangeObserver + void handlePositionTechnologyChange(); + +private: + signals: + /** + * This signal is emitted when there is change in any of position + * technology wrt to its availabilty, state etc.. + */ + void positionTechnologyChange(); + +private: + Q_DECLARE_PRIVATE_D(d_ptr, PosSettingsEngine) +private: // data member + /** + * Pointer to private implementation. + * Own + */ + PosSettingsEnginePrivate* d_ptr; + }; + +#endif /* POSITIONINGSETTINGS_ENGINE_H */ diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/inc/possettingsengineprivate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/inc/possettingsengineprivate.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,190 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Positioning settings engine private class. +* +*/ + +#ifndef POSITIONINGSETTINGSENGINE_PRIVATE_H +#define POSITIONINGSETTINGSENGINE_PRIVATE_H + +#include "possettingscommon.h" + +#include +#include +#include + +// Forward declarations + +class PosSettingsEngine; +class CPosModules; +class CSuplSettings; +struct TPosModulesEvent; + +/** + * The class defines the interface for receiving position + * technology change event.The class interested in position + * technology change should inherit from this class. + */ +class PositionTechnologyChangeObserver + { +public: + virtual void handlePositionTechnologyChange() = 0; + }; + +/** + * PositioningSettingsEnginePrivate is a class that provides implementation + * for PositionSettingsEngine class. + */ +class PosSettingsEnginePrivate : public MPosModulesObserver + { +public: + /** + * Default constructor + */ + PosSettingsEnginePrivate( PositionTechnologyChangeObserver& + posTechChangeObserver ); + + /** + * Destructor + */ + ~PosSettingsEnginePrivate(); + + /** + * Returns whether specified position technology is available. + * @param[in] posTechnology Position technology of interest. + * @return true if specified position technology is available, + * false if it is not available. + */ + bool isPositionTechnologyAvailable( PositionTechnology posTechnology ); + + /** + * Sets the state of position technology. + * @param[in] posTechnologyState Resultant state of the position technology + * after this operation. + * @param[in] posTechnology State of position technology to be changed. + * @return KErrNone if successful, + * KErrNotFound if specified position technology is not available + * Otherwise, standard error code is returned, + * KErrServerBusy, etc.. + */ + int setPositionTechnologyState( State posTechnologyState, + PositionTechnology posTechnology ); + + /** + * Returns whether specified position technology is enabled. It is recemonded + * to use this method after checking the availability of the position technology + * using isPositionTechnologyAvailable method. + * @param[in] posTechnology Position technology of interest. + * @return true if specified position technology is enabled, + * false if it is disabled. + */ + bool isPositionTechnologyEnabled( PositionTechnology posTechnology ); + + + /** + * Sets the state of back ground positioning. + * @param[in] backGroundPosState Resultant state of back ground positioning. + * @return KErrNone if successful, + * KErrNotSupported if none of the position type are available, + * KErrArgument if none of the position type are enabled + * otherwise, standard error code is returned, + * KErrServerBusy, etc.. + */ + int setBackGroundPositioningState( State backGroundPosState ); + + /** + * Returns whether back ground positioning is enabled. It is recemonded + * to use this method after checking the availability of the position type + * using isPositionTypeAvailable method. + * @return true if back ground positioning is enabled, + * false if it is disabled. + */ + bool isBackGroundPositioningEnabled(); + +public: // from MPosModulesObserver + virtual void HandleSettingsChangeL( TPosModulesEvent aEvent ); + +private: + /** + * Sets the state of given positioning technology. + * @param[in] posTechnologyState Resultant State of Positioning Technology + * StateEnable/StateDisable. + * @param[in] posTechnology Positioning Technology Name + * PositionTechnologyGps/PositionTechnologyNetwork. + */ + void setPositionTechnologyStateL( State posTechnologyState, + PositionTechnology posTechnology ); + /** + * Sets the state of back ground positioning. + * @param[in] backGroundPosState Resultant state of back ground positioning. + */ + void setBackGroundPositioningStateL( State backGroundPosState ); + + /** + * Populates the PSY module information list. + */ + void populatePsyModuleInfoListL(); + + /** + * Gets the state of back ground positioning. + */ + void GetBackGroundPositioingStateL(); + +private: //Data members + + /** + * Reference to position technology change observer. + */ + PositionTechnologyChangeObserver& mPosTechChangeObserver; + + /** + * Pointer to Supl settings object + * Own + */ + CSuplSettings* mSuplSettings; + + /** + * Pointer to lbt server + * Own + */ + RLbtServer mLbtServer; + + /** + * Pointer to lbt manager + * Own + */ + RLbtManager mLbtManager; + + /** + * Pointer to Pos module; + * Own + */ + CPosModules* mPosModules; + + /** + * List of PSY module info + * Own + */ + RArray mPsyModuleInfoList; + + /** + * State of back ground positioning + */ + State mBackGroundPositioningState; + + friend class PosSettingsEngine; + }; + + +#endif /* POSITIONINGSETTINGSENGINE_PRIVATE_H */ diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/inc/possettingsform.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/inc/possettingsform.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,192 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Positioning settings view class. +* +*/ + +#ifndef POSSETTINGSFORM_H +#define POSSETTINGSFORM_H + +#include + +class HbDataFormModelItem; +class PosSettingsEngine; +class PosSettingsAdvView; +class HbAction; + +class PosSettingsForm : public HbDataForm + { + Q_OBJECT +private: + /* + * Enumarator for the positioning category type + */ + enum PosTypeIndex + { + /* + * The position of GPS in HbDataForm + */ + PosTypeIndexGps = 1, + + /* + * The position of Wireless in HbDataForm + */ + PosTypeIndexWireless = 2 , + + /* + * The position of Background in HbDataForm + */ + PosTypeIndexBackground = 3 + }; +public: + /** + * Constructor. + */ + explicit PosSettingsForm( PosSettingsEngine& settingsEngine, + QGraphicsItem *parent = 0 ); + + /** + * Destructor + */ + ~PosSettingsForm(); + +private: + /** + * It will initiate the basic setting view + */ + void initSettingModel(); + + /** + * It will validate visibility of Positioning type + * + * posTypeModelItemIndex[in] - The position at which control should be placed + */ + void validatePosTypeVisibility(PosTypeIndex posTypeModelItemIndex); + + /** + * It will insert/remove Positioning type control in HbDataForm + * + * insert[in] - if true insert control else remove it + * posTypeModelItem[in] - HbDataFormModelItem handle for position type + * posTypeModelItemIndex[in] - The position at which control should be placed + * posIndex[in] - The absolute poisition index at which control should be placed. + * It will different from posTypeModelItemIndex for Wireless and Background + * depending on GPS, Wireless are visible. + */ + void insertOrRemovePosTypeModelItem(bool insert, HbDataFormModelItem* posTypeModelItem, + PosTypeIndex posTypeModelItemIndex, int posIndex); + /* + * It will create HbDataFormModelItem based on the position specified + * + * posTypeModelItemIndex [in] - The position at which control should be placed + */ + void createPosTypeModelItem(PosTypeIndex posTypeModelItemIndex); + + /** + * It will mark/unmark positioning category checkbox + * + * posTypeModelItemIndex [in] - The position at which control should be placed + */ + void setPosTypeState(PosTypeIndex posTypeModelItemIndex); + + /** + * It will add connection for the given model item + * + * posTypeModelItem [in] - HbDataFormModelItem handle for position type + */ + void addPosTypeConnection(HbDataFormModelItem* posTypeModelItem); + +private slots: + /** + * It will be called when 'Advanced' push button is pressed + */ + void onPressedAdvanced(); + + /** + * It will be called when 'GPS' checkbox is clicked + */ + void onPressedGps(); + + /** + * It will be called when 'Wirelss' checkbox is clicked + */ + void onPressedWireless(); + + /* + * It will be called when 'Background' checkbox is clicked + */ + void onPressedBackground(); + /* + * It will be called when the Back Button is pressed to dismiss the + * advanced view + */ + void closeAdvancedView(); + + /** + * It will validate visibility of all positioning type controls + * It will also be called when new positioning technology is + * added at runtime + */ + void validateVisibility(); + +private: // Data memebers + /** + * Handle to engine + * Not Own + */ + PosSettingsEngine& mSettingsEngine; + + /** + * Handle to 'GPS' checkbox + * Not Own + */ + HbDataFormModelItem *mGpsPosType; + + /** + * Handle to 'Wireless' checkbox + * Not Own + */ + HbDataFormModelItem *mWirelessPosType; + + /** + * Handle to 'Background' checkbox + * Not Own + */ + HbDataFormModelItem *mBgPosType; + + /** + * Handle to 'Advanced' push button + * Not Own + */ + HbDataFormModelItem *mAdvancedSettings; + + /** + * Handle to Heading groupbox + * Not Own + */ + HbDataFormModelItem *mHeading; + + /** + * Pointer to Advanced view class + * Owns this pointer. + */ + PosSettingsAdvView* mAdvancedView; + + /** + * handle to the Back Action + */ + HbAction* mBackAction; + + }; +#endif // POSSETTINGSFORM_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/inc/possettingsgroupboxitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/inc/possettingsgroupboxitem.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This class provides custom list item +* for the groupbox on the DataForm +*/ + +#ifndef POSSETTINGS_GROUPBOXITEM_H +#define POSSETTINGS_GROUPBOXITEM_H + +#include + +#include +#include + +const int GroupboxItem = HbDataFormModelItem::CustomItemBase+12; + +class PosSettingsGroupboxItem : public HbDataFormViewItem +{ +Q_OBJECT + +public: //constructor and destructor + PosSettingsGroupboxItem(QGraphicsItem *parent); + ~PosSettingsGroupboxItem(); +public: //from HbDataFormViewItem + /* + * It will return custom control item + */ + virtual HbAbstractViewItem* createItem(); + virtual bool canSetModelIndex(const QModelIndex &index) const; + virtual void restore(); +protected: + /* + * It will define the custom control item + */ + virtual HbWidget* createCustomWidget(); + +private: + /* + * Does not own + */ + HbWidget* mWidget; +}; + +#endif // POSSETTINGS_GROUPBOXITEM_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/inc/possettingspluginsloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/inc/possettingspluginsloader.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description:Declaration of the Positioning Settings PLugins loader + * + */ + +#ifndef PosSettingsPluginsLoader_H +#define PosSettingsPluginsLoader_H + +#include "PosSettingsadvinterface.h" + +#include +#include + +class PosSettingsPluginsLoader + { + +public: + /** + * Constructor + */ + PosSettingsPluginsLoader(); + /** + * Destructor + */ + ~PosSettingsPluginsLoader(); + /* + * Detects & loads the plugins that implement the + * PosSettingsAdvInterface class + */ + QList loadPlugins(); +private: + /** + * Reads the cenrep key value to obtain the default order in which + * the positioning settings plugins need to be loaded. + */ + void ParseCenRepKey(); + +private: + /** + * Contains list of plugin's dll name in the order in which it + * is supposed to be displayed in the advanced view + */ + QList mDllNameList; + + + }; + +#endif //PosSettingsPluginsLoader_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/inc/possettingspushbuttonitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/inc/possettingspushbuttonitem.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This class provides custom list item +* for the push button on the DataForm +*/ + +#ifndef POSSETTINGS_PUSHBUTTONITEM_H +#define POSSETTINGS_PUSHBUTTONITEM_H + +#include + +#include +#include + +const int PushButtonItem = HbDataFormModelItem::CustomItemBase+11; + +class PosSettingsPushButtonItem : public HbDataFormViewItem +{ +Q_OBJECT + +public: //constructor and destructor + PosSettingsPushButtonItem(QGraphicsItem *parent); + ~PosSettingsPushButtonItem(); +public: //from HbDataFormViewItem + /* + * It will return custom control item + */ + virtual HbAbstractViewItem* createItem(); + virtual bool canSetModelIndex(const QModelIndex &index) const; + virtual void restore(); +protected: + /* + * It will define the custom control item + */ + virtual HbWidget* createCustomWidget(); + +private: + /* + * Does not own + */ + HbWidget* mWidget; +}; + +#endif // POSSETTINGS_PUSHBUTTONITEM_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/possettings.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/possettings.qrc Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,7 @@ + + + resources/pushbuttoncustomviewitem.css + resources/groupboxcustomviewitem.css + resources/checkcustomviewitem.css + + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/possettingsengine.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/possettingsengine.pro Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,74 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: PosSettingsEngine pro file +# + +TEMPLATE = lib +TARGET = possettingsengine +DEPENDPATH += . +INCLUDEPATH += ../inc +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE +CONFIG += hb + + + +MOC_DIR = moc +OBJECTS_DIR = obj +RCC_DIR = rcc +RESOURCES = possettings.qrc + +# Platforms +SYMBIAN_PLATFORMS = WINSCW \ + ARMV5 +LIBS += -lcpframework \ + -llbt \ + -llbs \ + -llbtmanager \ + -leposmodset \ + -lepos_suplsettings \ + -lxqsettingsmanager + +# Input +SOURCES += src/possettingspluginsloader.cpp \ + src/possettingspushbuttonitem.cpp \ + src/possettingsgroupboxitem.cpp \ + src/possettingsform.cpp \ + src/possettingsview.cpp \ + src/possettingsengineprivate.cpp \ + src/possettingsengine.cpp \ + src/possettingsadvview.cpp \ + src/possettingsadvop.cpp \ + src/checkcustomviewitem.cpp +HEADERS += inc/possettingspluginsloader.h \ + inc/possettingspushbuttonitem.h \ + inc/possettingsgroupboxitem.h \ + inc/possettingsform.h \ + inc/possettingsengineprivate.h \ + inc/possettingsengine.h \ + inc/possettingscommon.h \ + inc/possettingsadvview.h \ + ../inc/possettingsadvop.h \ + inc/checkcustomviewitem.h +symbian: { + TARGET.EPOCALLOWDLLDATA = 1 + DEFINES += BUILD_POSSETTINGS + DEFINES += PLUGINUID3=0x2002C319 + TARGET.UID3 = 0x2002C319 +} + +# Build.inf rules +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " + +TARGET.CAPABILITY = All -TCB + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/resources/checkcustomviewitem.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/resources/checkcustomviewitem.css Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,5 @@ +CheckCustomViewItem::dataItem_ContentWidget +{ + left: 0.0un; + right: var(hb-param-margin-gene-right); +} \ No newline at end of file diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/resources/groupboxcustomviewitem.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/resources/groupboxcustomviewitem.css Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,6 @@ +PosSettingsGroupboxItem::dataItem_ContentWidget +{ + left: 0.0un; + right: var(hb-param-margin-gene-right); + top: 0.0un; +} \ No newline at end of file diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/resources/pushbuttoncustomviewitem.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/resources/pushbuttoncustomviewitem.css Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,5 @@ +PosSettingsPushButtonItem::dataItem_ContentWidget +{ + left: -var(hb-param-margin-gene-left); + right: var(hb-param-margin-gene-right); +} \ No newline at end of file diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/src/checkcustomviewitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/src/checkcustomviewitem.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include "checkcustomviewitem.h" +#include +#include +#include +#include + + +CheckCustomViewItem::CheckCustomViewItem(QGraphicsItem *parent ) + : HbDataFormViewItem(parent) + +{ +} +CheckCustomViewItem::~CheckCustomViewItem() +{ +} +HbAbstractViewItem* CheckCustomViewItem::createItem() +{ + return new CheckCustomViewItem(*this); +} +bool CheckCustomViewItem::canSetModelIndex(const QModelIndex &index) const +{ + int type = index.data(HbDataFormModelItem::ItemTypeRole).toInt(); + if ( type == HbDataFormModelItem::CheckBoxItem ) { + return true; + } + else { + return false; + } +} diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsadvop.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsadvop.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Implementation of Positioning settings advanced + * operation class. + * + */ + +#include "possettingsadvop.h" +#include "possettingsadvview.h" +#include +#include + +//--------------------------------------------------------------------- +// PosSettingsAdvOp::PosSettingsAdvOp() +// Constructor +//--------------------------------------------------------------------- +PosSettingsAdvOp::PosSettingsAdvOp(HbView* view) : mView(view) + { + qDebug() << "+ PosSettingsAdvOp::PosSettingsAdvOp()"; + mDataForm = qobject_cast(mView->widget()); + mDataFormModel = static_cast(mDataForm->model()); + qDebug() << "- PosSettingsAdvOp::PosSettingsAdvOp()"; + } + +//--------------------------------------------------------------------- +// PosSettingsAdvOp::~PosSettingsAdvOp() +// Destructor +//--------------------------------------------------------------------- +PosSettingsAdvOp::~PosSettingsAdvOp() + { + qDebug() << "+ PosSettingsAdvOp::~PosSettingsAdvOp()"; + qDebug() << "- PosSettingsAdvOp::~PosSettingsAdvOp()"; + } + +//--------------------------------------------------------------------- +// PosSettingsAdvOp::appendDataFormItem +// +//--------------------------------------------------------------------- +void PosSettingsAdvOp::appendDataFormItem(HbDataFormModelItem *data, + HbDataFormModelItem *parent) + { + qDebug() << "+ PosSettingsAdvOp::appendDataFormItem()"; + mDataFormModel->appendDataFormItem(data, parent); + qDebug() << "- PosSettingsAdvOp::appendDataFormItem()"; + } + +//--------------------------------------------------------------------- +// PosSettingsAdvOp::addConnection +// +//--------------------------------------------------------------------- +void PosSettingsAdvOp::addConnection(HbDataFormModelItem *item, + const char* signal, QObject *receiver, const char* slot) + { + qDebug() << "+ PosSettingsAdvOp::addConnection()"; + mDataForm->addConnection(item, signal, receiver, slot); + qDebug() << "- PosSettingsAdvOp::addConnection()"; + } + +//--------------------------------------------------------------------- +// PosSettingsAdvOp::addAction +// +//--------------------------------------------------------------------- +void PosSettingsAdvOp::addAction(HbAction *action, + HbView::ActionContainer preferedActionContainer) + { + qDebug() << "+ PosSettingsAdvOp::addAction()"; + mView->addAction(action, preferedActionContainer); + qDebug() << "- PosSettingsAdvOp::addAction()"; + } + + +//--------------------------------------------------------------------- +// PosSettingsAdvOp::indexFromItem +// +//--------------------------------------------------------------------- +QModelIndex PosSettingsAdvOp::indexFromItem(const HbDataFormModelItem * item) + { + qDebug() << "+ PosSettingsAdvOp::indexFromItem()"; + qDebug() << "- PosSettingsAdvOp::indexFromItem()"; + return mDataFormModel->indexFromItem(item); + } + +//--------------------------------------------------------------------- +// PosSettingsAdvOp::removeConnection +// +//--------------------------------------------------------------------- +void PosSettingsAdvOp::removeConnection(HbDataFormModelItem *item, + const char* signal, QObject *receiver, const char* slot) + { + qDebug() << "+ PosSettingsAdvOp::removeConnection()"; + mDataForm->removeConnection(item, signal, receiver, slot); + qDebug() << "- PosSettingsAdvOp::removeConnection()"; + } + +//--------------------------------------------------------------------- +// PosSettingsAdvOp::setExpanded +// +//--------------------------------------------------------------------- +void PosSettingsAdvOp::setExpanded(const QModelIndex &index, bool expanded) + { + qDebug() << "+ PosSettingsAdvOp::setExpanded()"; + mDataForm->setExpanded( index,expanded); + qDebug() << "- PosSettingsAdvOp::setExpanded()"; + } + +//--------------------------------------------------------------------- +// PosSettingsAdvOp::isExpanded +// +//--------------------------------------------------------------------- +bool PosSettingsAdvOp::isExpanded(const QModelIndex &index)const + { + qDebug() << "+ PosSettingsAdvOp::isExpanded()"; + qDebug() << "- PosSettingsAdvOp::isExpanded()"; + return mDataForm->isExpanded(index); + } + +//--------------------------------------------------------------------- +// PosSettingsAdvOp::removeItem +// +//--------------------------------------------------------------------- +bool PosSettingsAdvOp::removeItem(HbDataFormModelItem* item) + { + qDebug() << "+ PosSettingsAdvOp::removeItem()"; + qDebug() << "- PosSettingsAdvOp::removeItem()"; + return mDataFormModel->removeItem(item); + } + +//--------------------------------------------------------------------- +// PosSettingsAdvOp::removeItem +// +//--------------------------------------------------------------------- +void PosSettingsAdvOp::setItemPrototypes( + QList &protoTypeList) + { + qDebug() << "+ PosSettingsAdvOp::setItemPrototypes()"; + QList oldProtoTypeList = mDataForm->itemPrototypes(); + oldProtoTypeList.append(protoTypeList); + mDataForm->setItemPrototypes(oldProtoTypeList); + qDebug() << "- PosSettingsAdvOp::setItemPrototypes()"; + } + +//--------------------------------------------------------------------- +// PosSettingsAdvOp::itemPrototypes +// +//--------------------------------------------------------------------- +void PosSettingsAdvOp::itemPrototypes( + QList &protoTypeList) + { + qDebug() << "+ PosSettingsAdvOp::itemPrototypes()"; + protoTypeList = mDataForm->itemPrototypes(); + qDebug() << "- PosSettingsAdvOp::itemPrototypes()"; + } + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsadvview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsadvview.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description:Implementation of the Positioning Settings Advanced View class + * + */ + +#include "possettingsadvview.h" +#include "possettingspluginsloader.h" +#include "possettingsgroupboxitem.h" +#include +#include + +#ifdef Q_OS_SYMBIAN +#define PLUGIN_PATH QString("\\resource\\qt\\plugins\\positioningsettings") + +#else +#define PLUGIN_PATH QString("C:\\qt\\plugins\\positioningsettings") +#endif + +//--------------------------------------------------------------------- +// PosSettingsAdvView::PosSettingsAdvView() +// Constructor +//--------------------------------------------------------------------- +PosSettingsAdvView::PosSettingsAdvView( QGraphicsItem *parent ): +CpBaseSettingView(0,parent) + { + qDebug() << "+ PosSettingsAdvView::PosSettingsAdvView()"; + // create instance of HbDataForm + mAdvancedDataForm = new HbDataForm(); + + // Create an instance of HbDataFormModel + HbDataFormModel* advancedDataFormModel = new HbDataFormModel(); + + // set the model + mAdvancedDataForm->setModel( advancedDataFormModel ); + + // set the Advanced settings form for this view + this->setWidget( mAdvancedDataForm ); + + //set prototype for custom controls + QList protoTypeList = mAdvancedDataForm->itemPrototypes(); + protoTypeList.append(new PosSettingsGroupboxItem(this)); + mAdvancedDataForm->setItemPrototypes(protoTypeList); + + //Heading + mHeading = advancedDataFormModel->appendDataFormItem(static_cast(GroupboxItem), + QString(), + advancedDataFormModel->invisibleRootItem()); + mHeading->setContentWidgetData("heading", + hbTrId("txt_loe_subtitle_advanced_positioning_settings")); + + + + // Create an instance of PosSettingsAdvancedOperation + mAdvancedOperation = new PosSettingsAdvOp(this); + + + mPluginsLoader = new PosSettingsPluginsLoader(); + // load the plugins + mPluginsList = mPluginsLoader->loadPlugins(); + + // for each plugin detected call the plugin's initialize method + + int cnt = mPluginsList.count(); + int error = 0; + for(int i=0;iinitialise(mAdvancedOperation ); + //pluging is unloaded if the there is an error, with exception for not found. + if (error != 0 && error != -1) + { + delete mPluginsList[i]; + mPluginsList[i] = 0; + mPluginsList.removeAt(i); + --cnt; + --i; + } + } + // create a QFileSystemWatcher instance + mWatcher = new QFileSystemWatcher(); + mWatcher->addPath(PLUGIN_PATH); + + // make connection to update the advanced view on change in the plugins + QObject::connect(mWatcher,SIGNAL(fileChanged ( const QString & path )), + this,SLOT(updateAdvView())); + qDebug() << "- PosSettingsAdvView::PosSettingsAdvView()"; + } + +//--------------------------------------------------------------------- +// PosSettingsAdvView::~PosSettingsAdvView() +// Destructor +//--------------------------------------------------------------------- +PosSettingsAdvView::~PosSettingsAdvView() + { + qDebug() << "+ PosSettingsAdvView::~PosSettingsAdvView()"; + // mAdvancedDataForm->removeAllConnection(); + delete mAdvancedDataForm; + mAdvancedDataForm = NULL; + + + delete mAdvancedOperation; + mAdvancedOperation = NULL; + + delete mPluginsLoader; + mPluginsLoader = NULL; + + // delete the list of plugins + foreach( PosSettingsAdvInterface *plugin, mPluginsList ) + { + delete plugin; + plugin = 0; + } + mPluginsList.clear(); + + //ToDo: disconnect mWatcher'signal + delete mWatcher; + mWatcher = NULL; + qDebug() << "- PosSettingsAdvView::~PosSettingsAdvView()"; + } + +//--------------------------------------------------------------------- +// PosSettingsAdvView::updateAdvView() +// +//--------------------------------------------------------------------- +void PosSettingsAdvView::updateAdvView() + { + qDebug() << "+ PosSettingsAdvView::updateAdvView()"; + // clear the plugins list + foreach( PosSettingsAdvInterface *plugin, mPluginsList ) + { + delete plugin; + plugin= NULL; + } + mPluginsList.clear(); + + // reload the plugins again + mPluginsList = mPluginsLoader->loadPlugins(); + + int count = mPluginsList.count(); + + // for each plugin detected call the plugin's initialize method + for( int i=0;iinitialise( mAdvancedOperation ); + if( error != KErrNone ) + { + delete mPluginsList[i]; + mPluginsList[i] =NULL; + } + } + qDebug() << "- PosSettingsAdvView::updateAdvView()"; + } diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsengine.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,174 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of positioning settings engine class. +* +*/ + + +#include "possettingsengine.h" +#include "possettingscrkey.h" +#include +#include +#include + + +//--------------------------------------------------------------------- +// PosSettingsEngine::PosSettingsEngine() +// (other items were commented in a header). +//--------------------------------------------------------------------- +PosSettingsEngine::PosSettingsEngine() + { + qDebug() << "+ PosSettingsEngine::PosSettingsEngine()"; + d_ptr = new PosSettingsEnginePrivate( *this ); + qDebug() << "- PosSettingsEngine::PosSettingsEngine()"; + } + +//--------------------------------------------------------------------- +// PosSettingsEngine::~PosSettingsEngine() +// (other items were commented in a header). +//--------------------------------------------------------------------- +PosSettingsEngine::~PosSettingsEngine() + { + qDebug() << "+ PosSettingsEngine::~PosSettingsEngine()"; + delete d_ptr; + d_ptr = NULL; + qDebug() << "- PosSettingsEngine::~PosSettingsEngine()"; + } + +//--------------------------------------------------------------------- +// PosSettingsEngine::isPositionTechnologyAvailable() +// (other items were commented in a header). +//--------------------------------------------------------------------- +bool PosSettingsEngine::isPositionTechnologyAvailable( + PositionTechnology posTechnology ) + { + qDebug() << "+ PosSettingsEngine::isPositionTechnologyAvailable()"; + bool err = d_ptr->isPositionTechnologyAvailable( posTechnology ); + qDebug() << "- PosSettingsEngine::isPositionTechnologyAvailable() retvat: " << err; + return err; + } + +//--------------------------------------------------------------------- +// PosSettingsEngine::setPositionTechnologyState() +// (other items were commented in a header). +//--------------------------------------------------------------------- +int PosSettingsEngine::setPositionTechnologyState( + State posTechnologyState, + PositionTechnology posTechnology ) + { + qDebug() << "+ PosSettingsEngine::setPositionTechnologyState()"; + qDebug() << "posTechnologyState: " << posTechnologyState; + int ret = d_ptr->setPositionTechnologyState( posTechnologyState, + posTechnology ); + qDebug() << "- PosSettingsEngine::setPositionTechnologyState()" << ret; + return ret; + } + + +//--------------------------------------------------------------------- +// PosSettingsEngine::isPositionTechnologyEnabled() +// (other items were commented in a header). +//--------------------------------------------------------------------- +bool PosSettingsEngine::isPositionTechnologyEnabled( + PositionTechnology posTechnology ) + { + qDebug() << "+ PosSettingsEngine::isPositionTechnologyEnabled()"; + bool ret = d_ptr->isPositionTechnologyEnabled( posTechnology ); + qDebug() << "- PosSettingsEngine::isPositionTechnologyEnabled() retval= " << ret; + return ret; + } + +//--------------------------------------------------------------------- +// PosSettingsEngine::setBackGroundPositioningState() +// (other items were commented in a header). +//--------------------------------------------------------------------- +int PosSettingsEngine::setBackGroundPositioningState( + State backGroundPosState ) + { + qDebug() << "+ PosSettingsEngine::setBackGroundPositioningState()"; + qDebug() << "backGroundPosState: " << backGroundPosState; + int ret = d_ptr->setBackGroundPositioningState( backGroundPosState ); + qDebug() << "- PosSettingsEngine::setBackGroundPositioningState() retval= " << ret; + return ret; + } + +//--------------------------------------------------------------------- +// PosSettingsEngine::isPositionTechnologyEnabled() +// (other items were commented in a header). +//--------------------------------------------------------------------- +bool PosSettingsEngine::isBackGroundPositioningEnabled() + { + qDebug() << "+ PosSettingsEngine::isBackGroundPositioningEnabled()"; + bool ret = d_ptr->isBackGroundPositioningEnabled(); + qDebug() << "- PosSettingsEngine::isBackGroundPositioningEnabled() retval= " << ret; + return ret; + } + +// --------------------------------------------------------------------------- +// PosSettingsEngine::backgroundPositioningStatus +// --------------------------------------------------------------------------- +bool PosSettingsEngine::cRBackgroundPositioningStatus() + { + qDebug() << "+ PosSettingsEngine::isBackGroundPositioningEnabled()"; + // create a XQSettingsManager instance + XQSettingsManager* manager = new XQSettingsManager(); + // create a XQSettingsKey object to read the cenrep key value + XQSettingsKey cenrepKey(XQSettingsKey::TargetCentralRepository, + KCRUidPositioningSettings.iUid, KPositioningSettingsBackgroundServicesStatus); + // read the cenrep key value + QVariant key(manager->readItemValue(cenrepKey,XQSettingsManager::TypeInt)); + // convert the key value to string + int keyIntValue = key.toInt(); + + delete manager; + manager = 0; + + qDebug() << "- PosSettingsEngine::cRBackgroundPositioningStatus()"; + return keyIntValue; + } + +// --------------------------------------------------------------------------- +// PosSettingsEngine::setCRBackgroundPositioningStatus +// --------------------------------------------------------------------------- +void PosSettingsEngine::setCRBackgroundPositioningStatus(State backGroundPosState) + { + qDebug() << "+ PosSettingsEngine::isBackGroundPositioningEnabled()"; + // create a XQSettingsManager instance + XQSettingsManager* manager = new XQSettingsManager(); + // create a XQSettingsKey object to read the cenrep key value + XQSettingsKey cenrepKey(XQSettingsKey::TargetCentralRepository, + KCRUidPositioningSettings.iUid, KPositioningSettingsBackgroundServicesStatus); + + // write the cenrep key value + if(backGroundPosState == StateEnable) + QVariant key(manager->writeItemValue(cenrepKey,QVariant(1))); + else + QVariant key(manager->writeItemValue(cenrepKey,QVariant(0))); + + delete manager; + manager = 0; + qDebug() << "- PosSettingsEngine::setCRBackgroundPositioningStatus()"; + } + +//--------------------------------------------------------------------- +// PosSettingsEngine::handlePositionTechnologyChange() +// (other items were commented in a header). +//--------------------------------------------------------------------- +void PosSettingsEngine::handlePositionTechnologyChange() + { + qDebug() << "+ PosSettingsEngine::handlePositionTechnologyChange()"; + emit positionTechnologyChange(); + qDebug() << "- PosSettingsEngine::handlePositionTechnologyChange()"; + } +// End of file. diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsengineprivate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsengineprivate.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,329 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of positioning settings engine private class. +* +*/ + +#include "possettingsengineprivate.h" +#include "possettingsengine.h" +#include +#include +#include +#include +#include +#include + +//--------------------------------------------------------------------- +// PosSettingsEnginePrivate::PosSettingsEnginePrivate() +// (other items were commented in a header). +//--------------------------------------------------------------------- +PosSettingsEnginePrivate::PosSettingsEnginePrivate( + PositionTechnologyChangeObserver& + posTechChangeObserver): + mPosTechChangeObserver( + posTechChangeObserver ) + { + // Open session to LBT server. + int error = mLbtServer.Connect(); + if( error != KErrNone ) + { + throw( error ); + } + //Open subsession to LBT server. + error = mLbtManager.Open( mLbtServer ); + if( error != KErrNone ) + { + throw( error ); + } + QT_TRAP_THROWING( mSuplSettings = CSuplSettings::NewL(); + mPosModules = CPosModules::OpenL(); + + populatePsyModuleInfoListL(); + // Get back ground position status + GetBackGroundPositioingStateL(); + // Register for settings change. + mPosModules->SetObserverL( *this ) + ); + } + + +//--------------------------------------------------------------------- +// PosSettingsEnginePrivate::~PosSettingsEnginePrivate() +// (other items were commented in a header). +//--------------------------------------------------------------------- +PosSettingsEnginePrivate::~PosSettingsEnginePrivate() + { + mLbtManager.Close(); + mLbtServer.Close(); + delete mSuplSettings; + mSuplSettings = NULL; + // remove observer + mPosModules->RemoveObserver(); + delete mPosModules; + mPosModules = NULL; + + mPsyModuleInfoList.Close(); + } + + +//--------------------------------------------------------------------- +// PosSettingsEnginePrivate::isPositionTechnologyAvailable() +// (other items were commented in a header). +//--------------------------------------------------------------------- +bool PosSettingsEnginePrivate::isPositionTechnologyAvailable( + PositionTechnology posTechnology ) + { + // Iterate through the PSY list to find the specified position + // technology. + TInt cnt = mPsyModuleInfoList.Count(); + for( TInt i=0;iSetUpdateAvailability( ETrue ); + } + else + { + updateParams->SetUpdateAvailability( EFalse ); + } + TInt cnt = mPsyModuleInfoList.Count(); + for( TInt i=0;iUpdateModuleL( mPsyModuleInfoList[i].mPsyModuleId, + *updateParams ); + mPsyModuleInfoList[i].mState = posTechnologyState; + } + } + CleanupStack::PopAndDestroy( updateParams ); + } + +//--------------------------------------------------------------------- +// PosSettingsEnginePrivate::setBackGroundPositioningStateL() +// (other items were commented in a header). +//--------------------------------------------------------------------- +void PosSettingsEnginePrivate::setBackGroundPositioningStateL( + State backGroundPosState ) + { + if( backGroundPosState == StateEnable ) + { + mLbtManager.SetTriggeringMechanismStateL( + ETriggeringMechanismOn ); + User::LeaveIfError( mSuplSettings->SetSuplTriggeredServiceStatus( + CSuplSettings::ESuplTriggerOn ) ); + mBackGroundPositioningState = StateEnable; + } + else + { + mLbtManager.SetTriggeringMechanismStateL( + ETriggeringMechanismOff ); + User::LeaveIfError( mSuplSettings->SetSuplTriggeredServiceStatus( + CSuplSettings::ESuplTriggerOff ) ); + mBackGroundPositioningState = StateDisable; + } + } + +//--------------------------------------------------------------------- +// PosSettingsEnginePrivate::populatePsyModuleInfoListL() +// (other items were commented in a header). +//--------------------------------------------------------------------- +void PosSettingsEnginePrivate::populatePsyModuleInfoListL() + { + CPosModuleIdList* idList = mPosModules->ModuleIdListLC(); + TInt cnt = idList->Count(); + for ( TInt i = 0; i < cnt; ++i ) + { + TPositionModuleInfo moduleInfo; + mPosModules->GetModuleInfoL( (*idList)[i], moduleInfo ); + + // Psy module info hold the information regarding PSY that are + // essential for our operation. + PsyModuleInfo psyModuleInfo; + + // Set the module Id. + psyModuleInfo.mPsyModuleId = moduleInfo.ModuleId(); + + // Set position technology type. + if( moduleInfo.TechnologyType() == TPositionModuleInfo::ETechnologyTerminal || + moduleInfo.TechnologyType() == TPositionModuleInfo::ETechnologyAssisted ) + { + psyModuleInfo.mPosTech = PositionTechnologyGps; + } + else if ( moduleInfo.TechnologyType() == TPositionModuleInfo::ETechnologyNetwork ) + { + psyModuleInfo.mPosTech = PositionTechnologyNetwork; + } + + // Set state of Psy. + if( moduleInfo.IsAvailable() ) + { + psyModuleInfo.mState = StateEnable; + } + else + { + psyModuleInfo.mState = StateDisable; + } + + mPsyModuleInfoList.Append( psyModuleInfo ); + } + CleanupStack::PopAndDestroy( idList ); + } + + +//--------------------------------------------------------------------- +// PosSettingsEnginePrivate::GetBackGroundPositioingStateL() +// (other items were commented in a header). +//--------------------------------------------------------------------- +void PosSettingsEnginePrivate::GetBackGroundPositioingStateL() + { + // Get the SUPL service status. + CSuplSettings::TSuplTriggerStatus suplTriggerStatus; + User::LeaveIfError( mSuplSettings->GetSuplTriggeredServiceStatus( + suplTriggerStatus ) ); + + // Get LBT service status. + TLbtTriggeringSystemManagementSettings triggeringSystemSettings; + mLbtManager.GetTriggeringSystemSettingsL( triggeringSystemSettings ); + + // Back ground positioning state is considered to be enabled only + // if both LBT and SUPL services are enabled. + if( suplTriggerStatus == CSuplSettings::ESuplTriggerOn && + triggeringSystemSettings.TriggeringMechanismState() == + ETriggeringMechanismOn ) + { + mBackGroundPositioningState = StateEnable; + } + else + { + mBackGroundPositioningState = StateDisable; + } + } + +// End of file diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsform.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsform.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,465 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This class is for first basic view for positioning settings +* +*/ + + +#include "possettingsform.h" +#include "possettingspushbuttonitem.h" +#include "possettingsgroupboxitem.h" +#include "checkcustomviewitem.h" +#include "possettingsengine.h" +#include "possettingsadvview.h" +#include +#include +#include +#include +#include +#include + +static const QString FILE_PATH_CSS = ":/data"; + +// --------------------------------------------------------------------------- +// PosSettingsForm::PosSettingsForm +// Constructor +// --------------------------------------------------------------------------- +PosSettingsForm::PosSettingsForm( + PosSettingsEngine& settingsEngine, + QGraphicsItem *parent ): + HbDataForm( parent ),mSettingsEngine( settingsEngine ) + { + qDebug() << "+ PosSettingsForm::PosSettingsForm()"; + //initialize the form model + initSettingModel(); + + // slots for required signals on required controls + addConnection( mGpsPosType, SIGNAL(released()), + this, SLOT(onPressedGps()) ); + addConnection( mWirelessPosType, SIGNAL(released()), + this, SLOT(onPressedWireless()) ); + addConnection( mBgPosType, SIGNAL(released()), + this, SLOT(onPressedBackground()) ); + addConnection( mAdvancedSettings, SIGNAL(clicked()), + this, SLOT(onPressedAdvanced()) ); + + //to check runtime if any positioning technology installed/removed or if its visibility is changed. + connect(&mSettingsEngine, SIGNAL(positionTechnologyChange()),this, SLOT(validateVisibility()) ); + + //validate visibility of controls based on visibility of positioning technology + validateVisibility(); + qDebug() << "- PosSettingsForm::PosSettingsForm()"; + } + +// --------------------------------------------------------------------------- +// PosSettingsForm::~PosSettingsForm +// Destructor +// --------------------------------------------------------------------------- +PosSettingsForm::~PosSettingsForm() + { + qDebug() << "+ PosSettingsForm::PosSettingsForm()"; + // Remove custom layouts + HbStyleLoader::unregisterFilePath(FILE_PATH_CSS); + + //TODO Disconnect of mSettingsEngine positionTechnologyChange + + removeConnection( mAdvancedSettings, SIGNAL(clicked()), + this, SLOT(onPressedAdvanced()) ); + removeConnection( mGpsPosType, SIGNAL(released), + this, SLOT(onPressedGps()) ); + removeConnection( mWirelessPosType, SIGNAL(released), + this, SLOT(onPressedWireless()) ); + removeConnection( mBgPosType, SIGNAL(released), + this, SLOT(onPressedBackground()) ); + + //ToDo: removeAllConnection crashes with Kern-Exec3 error + //removeAllConnection(); + qDebug() << "- PosSettingsForm::PosSettingsForm()"; + } + +// --------------------------------------------------------------------------- +// PosSettingsForm::initSettingModel +// --------------------------------------------------------------------------- +void PosSettingsForm::initSettingModel() + { + qDebug() << "+ PosSettingsForm::initSettingModel()"; + HbDataFormModel *model = new HbDataFormModel(0); + this->setModel(model); + + //set prototype for custom controls + QList protoTypeList = this->itemPrototypes(); + protoTypeList.append(new PosSettingsPushButtonItem(this) ); + protoTypeList.append(new CheckCustomViewItem()); + protoTypeList.append(new PosSettingsGroupboxItem(this)); + this->setItemPrototypes(protoTypeList); + + // Set custom layouts + HbStyleLoader::registerFilePath(FILE_PATH_CSS); + + //Heading + mHeading = model->appendDataFormItem(static_cast(GroupboxItem), + QString(), + model->invisibleRootItem()); + mHeading->setContentWidgetData("heading", + hbTrId("txt_loe_subtitle_positioning_settings")); + + + + //GPS + createPosTypeModelItem(PosTypeIndexGps); + model->appendDataFormItem(mGpsPosType, model->invisibleRootItem()); + //Wireless + createPosTypeModelItem(PosTypeIndexWireless); + model->appendDataFormItem(mWirelessPosType, model->invisibleRootItem()); + //Background + createPosTypeModelItem(PosTypeIndexBackground); + model->appendDataFormItem(mBgPosType, model->invisibleRootItem()); + + //Advance + mAdvancedSettings = model->appendDataFormItem(static_cast(PushButtonItem), + QString(), + model->invisibleRootItem()); + mAdvancedSettings->setContentWidgetData("text", + hbTrId("txt_loe_button_advanced")); + + + setPosTypeState(PosTypeIndexGps); + setPosTypeState(PosTypeIndexWireless); + setPosTypeState(PosTypeIndexBackground); + qDebug() << "- PosSettingsForm::initSettingModel()"; + } + +// --------------------------------------------------------------------------- +// PosSettingsForm::onPressedAdvanced +// --------------------------------------------------------------------------- +void PosSettingsForm::onPressedAdvanced() +{ + qDebug() << "+ PosSettingsForm::onPressedAdvanced()"; + mAdvancedView = new PosSettingsAdvView(); + HbMainWindow* mainWindow = hbInstance->allMainWindows().at(0); + + mainWindow->addView(mAdvancedView); + mainWindow->setCurrentView(mAdvancedView); + + //take back action from controlpanel main window. + mBackAction = new HbAction(Hb::BackNaviAction ,mAdvancedView); + mAdvancedView->setNavigationAction(mBackAction); + + connect(mBackAction, SIGNAL(triggered()), this, SLOT(closeAdvancedView())); + mAdvancedView->show(); + qDebug() << "- PosSettingsForm::onPressedAdvanced()"; +} +// --------------------------------------------------------------------------- +// PosSettingsForm::closeAdvancedView +// --------------------------------------------------------------------------- +// +void PosSettingsForm::closeAdvancedView() + { + qDebug() << "+ PosSettingsForm::closeAdvancedView()"; + disconnect(mBackAction, SIGNAL(triggered()), this, SLOT(closeAdvancedView())); + + HbMainWindow* mainWindow = hbInstance->allMainWindows().at(0); + mainWindow->removeView(mAdvancedView); + + mAdvancedView->setParent(NULL); + + delete mAdvancedView; + mAdvancedView = NULL; + + // refresh first view + setPosTypeState( PosTypeIndexGps); + setPosTypeState( PosTypeIndexWireless); + setPosTypeState( PosTypeIndexBackground); + validatePosTypeVisibility(PosTypeIndexBackground); + qDebug() << "- PosSettingsForm::closeAdvancedView()"; + } + +// --------------------------------------------------------------------------- +// PosSettingsForm::onPressedGps +// --------------------------------------------------------------------------- +void PosSettingsForm::onPressedGps() + { + qDebug() << "+ PosSettingsForm::onPressedGps()"; + validatePosTypeVisibility(PosTypeIndexBackground); + + int state = mGpsPosType->contentWidgetData("checkState").toInt(); + if(state == Qt::Checked) + { //if Gps enable + mSettingsEngine.setPositionTechnologyState(StateEnable, PositionTechnologyGps); + } + else + { //if Gps disable + mSettingsEngine.setPositionTechnologyState(StateDisable, PositionTechnologyGps); + } + qDebug() << "- PosSettingsForm::onPressedGps()"; + } + +// --------------------------------------------------------------------------- +// PosSettingsForm::onPressedWireless +// --------------------------------------------------------------------------- +void PosSettingsForm::onPressedWireless() + { + qDebug() << "+ PosSettingsForm::onPressedWireless()"; + validatePosTypeVisibility(PosTypeIndexBackground); + int state = mWirelessPosType->contentWidgetData("checkState").toInt(); + if(state == Qt::Checked) + { + //if Wireless enable + mSettingsEngine.setPositionTechnologyState(StateEnable, PositionTechnologyNetwork); + } + else + { //if Wireless disable + mSettingsEngine.setPositionTechnologyState(StateDisable, PositionTechnologyNetwork); + } + qDebug() << "- PosSettingsForm::onPressedWireless()"; + } + +// --------------------------------------------------------------------------- +// PosSettingsForm::onPressedBackground +// --------------------------------------------------------------------------- +void PosSettingsForm::onPressedBackground() + { + qDebug() << "+ PosSettingsForm::onPressedBackground()"; + int state = mBgPosType->contentWidgetData("checkState").toInt(); + if(state == Qt::Checked) + { + //if Bg enable + mSettingsEngine.setBackGroundPositioningState(StateEnable); + mSettingsEngine.setCRBackgroundPositioningStatus(StateEnable); + } + else + { //if Bg disable; + mSettingsEngine.setBackGroundPositioningState(StateDisable); + mSettingsEngine.setCRBackgroundPositioningStatus(StateDisable); + } + qDebug() << "- PosSettingsForm::onPressedBackground()"; + } + +// --------------------------------------------------------------------------- +// PosSettingsForm::validatePosTypeVisibility +// --------------------------------------------------------------------------- +// +void PosSettingsForm::validatePosTypeVisibility(PosTypeIndex posTypeModelItemIndex) + { + qDebug() << "+ PosSettingsForm::validatePosTypeVisibility()"; + bool valid = false; + HbDataFormModelItem* posTypeModelItem = NULL; //does not own + int posIndex = posTypeModelItemIndex; + switch(posTypeModelItemIndex) { + case PosTypeIndexGps: { + valid = mSettingsEngine.isPositionTechnologyAvailable(PositionTechnologyGps); + posTypeModelItem = mGpsPosType; + break; + } + case PosTypeIndexWireless: { + valid = mSettingsEngine.isPositionTechnologyAvailable(PositionTechnologyNetwork); + posTypeModelItem = mWirelessPosType; + HbDataFormModel* model = static_cast(this->model()); + //if GPS is not there, it will be at position 1 + if(!model->indexFromItem(mGpsPosType).isValid()) { + --posIndex ; + } + break; + } + case PosTypeIndexBackground: { + //if Gps and Wireless are not marked, then make Background invisible + valid = (mGpsPosType->contentWidgetData("checkState").toInt() == Qt::Checked || + mWirelessPosType->contentWidgetData("checkState").toInt() == Qt::Checked); + posTypeModelItem = mBgPosType; + HbDataFormModel* model = static_cast(this->model()); + + //if GPS is not there, decremenet position + if(!model->indexFromItem(mGpsPosType).isValid()) { + --posIndex; + } + //if Wireless is not there, decremenet position + if(!model->indexFromItem(mWirelessPosType).isValid()) { + --posIndex; + } + //if no gps no wireless, quit control-panel application + if(posIndex == PosTypeIndexGps-1) { + qApp->quit(); + } + break; + } + default:{ + break; + } + + } + qDebug() << "valid =" << valid; + insertOrRemovePosTypeModelItem(valid, posTypeModelItem, posTypeModelItemIndex, posIndex); + qDebug() << "- PosSettingsForm::validatePosTypeVisibility()"; + } + +// --------------------------------------------------------------------------- +// PosSettingsForm::InsertOrRemovePosTypeModelItem +// --------------------------------------------------------------------------- +// +void PosSettingsForm::insertOrRemovePosTypeModelItem(bool insert, HbDataFormModelItem* posTypeModelItem, + PosTypeIndex posTypeModelItemIndex, int posIndex) + { + qDebug() << "+ PosSettingsForm::insertOrRemovePosTypeModelItem()"; + HbDataFormModel* model = static_cast(this->model()); + if(!insert) { + if(model->indexFromItem(posTypeModelItem).isValid()) { + if(model->removeItem(posTypeModelItem)) { + //Note: In removeItem, modelitem is removed and then deleted too. + // So next time when we want to check if it is present, we have to create dummy modelitem + // else with existing handle, we will get kern exec 3 error + createPosTypeModelItem(posTypeModelItemIndex); + if(posTypeModelItem == mBgPosType) { + mSettingsEngine.setBackGroundPositioningState(StateDisable); + } + } + } + } + else { + if(!model->indexFromItem(posTypeModelItem).isValid()) { + model->insertDataFormItem(posIndex,posTypeModelItem); + addPosTypeConnection(posTypeModelItem); + + if(posTypeModelItem == mBgPosType) { + //Restore to old state in case of background positioning. + if(mSettingsEngine.cRBackgroundPositioningStatus()) { + mSettingsEngine.setBackGroundPositioningState(StateEnable); + } + else { + mSettingsEngine.setBackGroundPositioningState(StateDisable); + } + setPosTypeState(PosTypeIndexBackground); + } + else //Restore old state of GPS/Wireless + setPosTypeState(posTypeModelItemIndex); + } + } + qDebug() << "- PosSettingsForm::insertOrRemovePosTypeModelItem()"; + } + +// --------------------------------------------------------------------------- +// PosSettingsForm::createPosTypeModelItem +// --------------------------------------------------------------------------- +// +void PosSettingsForm::createPosTypeModelItem(PosTypeIndex posTypeModelItemIndex) + { + qDebug() << "+ PosSettingsForm::createPosTypeModelItem()"; + HbDataFormModel* model = static_cast(this->model()); + switch(posTypeModelItemIndex) { + case PosTypeIndexGps: { + mGpsPosType = new HbDataFormModelItem(HbDataFormModelItem::CheckBoxItem, + QString(), + model->invisibleRootItem()); + mGpsPosType->setData(HbDataFormModelItem::DescriptionRole, hbTrId("txt_loe_info_enable_for_most_accurate_positioning")); + mGpsPosType->setContentWidgetData("text", hbTrId("txt_loe_list_gps")); + break; + } + case PosTypeIndexWireless: { + mWirelessPosType = new HbDataFormModelItem(HbDataFormModelItem::CheckBoxItem, + QString(), + model->invisibleRootItem()); + mWirelessPosType->setData(HbDataFormModelItem::DescriptionRole, hbTrId("txt_loe_info_use_wifi_and_mobile_networks_to_get")); + mWirelessPosType->setContentWidgetData("text", hbTrId("txt_loe_list_wireless_networks")); + break; + } + case PosTypeIndexBackground:{ + mBgPosType = new HbDataFormModelItem(HbDataFormModelItem::CheckBoxItem, + QString(), + model->invisibleRootItem()); + mBgPosType->setData(HbDataFormModelItem::DescriptionRole, hbTrId("txt_loe_info_enable_applications_and_services_upda")); + mBgPosType->setContentWidgetData("text", hbTrId("txt_loe_list_background_positioning")); + break; + } + default: { + break; + } + } + qDebug() << "- PosSettingsForm::createPosTypeModelItem()"; + } + +// --------------------------------------------------------------------------- +// PosSettingsForm::validateVisibility +// --------------------------------------------------------------------------- +// +void PosSettingsForm::validateVisibility() + { + qDebug() << "+ PosSettingsForm::validateVisibility()"; + validatePosTypeVisibility(PosTypeIndexGps); + validatePosTypeVisibility(PosTypeIndexWireless); + validatePosTypeVisibility(PosTypeIndexBackground); + qDebug() << "- PosSettingsForm::validateVisibility()"; + } + +// --------------------------------------------------------------------------- +// PosSettingsForm::setPosTypeState +// --------------------------------------------------------------------------- +void PosSettingsForm::setPosTypeState(PosTypeIndex posTypeModelItemIndex) + { + qDebug() << "+ PosSettingsForm::setPosTypeState()"; + int state = Qt::Unchecked; + switch(posTypeModelItemIndex){ + case PosTypeIndexGps: { + if(mSettingsEngine.isPositionTechnologyEnabled(PositionTechnologyGps)) + state = Qt::Checked; + mGpsPosType->setContentWidgetData("checkState", state); + break; + } + case PosTypeIndexWireless: { + if(mSettingsEngine.isPositionTechnologyEnabled(PositionTechnologyNetwork)) + state = Qt::Checked; + mWirelessPosType->setContentWidgetData("checkState",state); + break; + } + case PosTypeIndexBackground: { + if(mSettingsEngine.isBackGroundPositioningEnabled()) + state = Qt::Checked; + mBgPosType->setContentWidgetData("checkState",state); + break; + } + default : { + break; + } + } + qDebug() << "- PosSettingsForm::setPosTypeState()"; + } + +// --------------------------------------------------------------------------- +// PosSettingsForm::addPosTypeConnection +// --------------------------------------------------------------------------- +void PosSettingsForm::addPosTypeConnection(HbDataFormModelItem* posTypeModelItem) + { + qDebug() << "+ PosSettingsForm::addPosTypeConnection()"; + if(posTypeModelItem == mGpsPosType) + { + addConnection( mGpsPosType, SIGNAL(released()), + this, SLOT(onPressedGps()) ); + qDebug() << "- PosSettingsForm::addPosTypeConnection()"; + return; + } + + if(posTypeModelItem == mWirelessPosType) + { + addConnection( mWirelessPosType, SIGNAL(released()), + this, SLOT(onPressedWireless()) ); + qDebug() << "- PosSettingsForm::addPosTypeConnection()"; + return; + } + if(posTypeModelItem == mBgPosType) + { + addConnection( mBgPosType, SIGNAL(released()), + this, SLOT(onPressedBackground()) ); + qDebug() << "- PosSettingsForm::addPosTypeConnection()"; + return; + } + } +//EOF diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsgroupboxitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsgroupboxitem.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This class provides custom list item for the +* DataForm +* +*/ + +#include +#include +#include +#include +#include +#include + +// --------------------------------------------------------------------------- +// PosSettingsGroupboxItem:::PosSettingsGroupboxItem +// --------------------------------------------------------------------------- +// +PosSettingsGroupboxItem::PosSettingsGroupboxItem(QGraphicsItem *parent) : +HbDataFormViewItem(parent) +{ +} + +// --------------------------------------------------------------------------- +// PosSettingsGroupboxItem:::~PosSettingsGroupboxItem +// --------------------------------------------------------------------------- +// +PosSettingsGroupboxItem::~PosSettingsGroupboxItem() +{ +} + +// --------------------------------------------------------------------------- +// PosSettingsGroupboxItem:::createItem +// --------------------------------------------------------------------------- +// +HbAbstractViewItem* PosSettingsGroupboxItem::createItem() +{ + return new PosSettingsGroupboxItem(*this); +} + +// --------------------------------------------------------------------------- +// PosSettingsGroupboxItem:::canSetModelIndex +// --------------------------------------------------------------------------- + +bool PosSettingsGroupboxItem::canSetModelIndex(const QModelIndex &index) const +{ + int type = index.data(HbDataFormModelItem::ItemTypeRole).toInt(); + if (type == GroupboxItem ) { + return true; + } + else { + return false; + } +} + +// --------------------------------------------------------------------------- +// PosSettingsGroupboxItem:::createCustomWidget +// --------------------------------------------------------------------------- +// +HbWidget* PosSettingsGroupboxItem::createCustomWidget() +{ + HbDataFormModelItem::DataItemType itemType = + static_cast + ( modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt() ); + + switch (itemType) { + case GroupboxItem: + { + //custom button + QString str = + modelIndex().data(HbDataFormModelItem::PropertyRole).toString(); + HbGroupBox* groupbox = new HbGroupBox(this); + // Use the Groupbox widget for heading + groupbox->setHeading(str); + mWidget = groupbox; + return mWidget; + } + default: + return 0; + } +} + +// --------------------------------------------------------------------------- +// PosSettingsGroupboxItem:::restore +// --------------------------------------------------------------------------- +// +void PosSettingsGroupboxItem::restore() +{ + HbDataFormViewItem::restore(); + if (mWidget) { + HbDataFormModelItem::DataItemType itemType = static_cast( + modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); + + if(itemType == GroupboxItem) { + + QModelIndex itemIndex = modelIndex(); + HbDataFormModel *model = static_cast(itemView()->model());; + HbDataFormModelItem *modelItem = static_cast( + model->itemFromIndex(itemIndex)); + + const QMetaObject *metaObj = 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(mWidget,modelItem->contentWidgetData(metaProperty.name())); + } + } + } + } +} + +//EOF diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/src/possettingspluginsloader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/src/possettingspluginsloader.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Implementation of the Positioning Settings Plugins Loader class + * + */ + + +#include "possettingspluginsloader.h" +#include "possettingscrkey.h" +#include +#include +#include +#include +#include +#include +#include + + +#ifdef Q_OS_SYMBIAN +#define PLUGIN_PATH QString("\\resource\\qt\\plugins\\positioningsettings") + +#else +#define PLUGIN_PATH QString("C:\\qt\\plugins\\positioningsettings") +#endif + +// constants +const int KNoOfDigits = 4; + +//--------------------------------------------------------------------- +// PosSettingsPluginsLoader::PosSettingsPluginsLoader +// +//--------------------------------------------------------------------- +PosSettingsPluginsLoader::PosSettingsPluginsLoader() + { + qDebug() << "+ PosSettingsPluginsLoader::PosSettingsPluginsLoader()"; + qDebug() << "- PosSettingsPluginsLoader::PosSettingsPluginsLoader()"; + } + +//--------------------------------------------------------------------- +// PosSettingsPluginsLoader::~PosSettingsPluginsLoader +// +//--------------------------------------------------------------------- +PosSettingsPluginsLoader::~PosSettingsPluginsLoader() + { + qDebug() << "+ PosSettingsPluginsLoader::~PosSettingsPluginsLoader()"; + mDllNameList.clear(); + qDebug() << "- PosSettingsPluginsLoader::~PosSettingsPluginsLoader()"; + } +//--------------------------------------------------------------------- +// PosSettingsPluginsLoader::loadPlugins +// +//--------------------------------------------------------------------- +QList PosSettingsPluginsLoader::loadPlugins() + { + qDebug() << "+ PosSettingsPluginsLoader::loadPlugins()"; + // parse the default cen rep key value which is used to determine + // the order of loading the default positioning settings plugins + ParseCenRepKey(); + // List containing the plugins implementing the PositioningSettingsAdvancedInterface + QList pluginsList; + // Check for the files under the positioningsettings directory + QDir pluginsDir(PLUGIN_PATH + QDir::separator()); + QFileInfoList fileInfoList = pluginsDir.entryInfoList(); + // check each file in this directory,only if its a dll give it to the + // plugin loader + foreach ( const QFileInfo &fileInfo, fileInfoList ) + { + QString fileName = fileInfo.absoluteFilePath(); + qDebug() << "Filename: " << fileName; + + if (!QLibrary::isLibrary(fileName)) + { + continue; + } + // load the dlls using QPluginLoader + QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(fileName)); + qDebug() << "Plugin Filename: " << pluginsDir.absoluteFilePath(fileName); + QObject *plugin = pluginLoader.instance(); + // Check if the plugin found is an implementation of the + // PosSettingsAdvInterface,if yes add it to the plugins list + + if (plugin) + { + PosSettingsAdvInterface* advancedInterface = qobject_cast< + PosSettingsAdvInterface *> (plugin); + + if (advancedInterface) + { + + QString dllName = fileInfo.baseName(); + // check the position into which the plugin needs to be + // inserted if it is one of the default plugins + for (int i = 0; i < mDllNameList.count(); i++) + { + if (dllName.compare(mDllNameList[i],Qt::CaseInsensitive) == KErrNone) + { + pluginsList.insert(i, advancedInterface); + break; + } + } + } + } + } + qDebug() << "- PosSettingsPluginsLoader::loadPlugins()"; + return pluginsList; + } + +//--------------------------------------------------------------------- +// PosSettingsPluginsLoader::ParseCenRepKey +// +//--------------------------------------------------------------------- +void PosSettingsPluginsLoader::ParseCenRepKey() + { + qDebug() << "+ PosSettingsPluginsLoader::ParseCenRepKey()"; + // create a XQSettingsManager instance + XQSettingsManager* manager = new XQSettingsManager(); + // create a XQSettingsKey object to read the cenrep key value + XQSettingsKey cenrepKey(XQSettingsKey::TargetCentralRepository, + KCRUidPositioningSettings.iUid, KPositioningSettingsPlugins); + // read the cenrep key value + QVariant key(manager->readItemValue(cenrepKey,XQSettingsManager::TypeString)); + // convert the key value to string + QString keyStringValue = key.toString(); + // if the length of default value is less than 4 digits then return + if (keyStringValue.size() < KNoOfDigits) + { + qDebug() << "- PosSettingsPluginsLoader::ParseCenRepKey()"; + return; + } + // get the count of the number of plugin dlls + int dllCount = keyStringValue.left(KNoOfDigits).toInt(); + // initialise current index to 4 + int currentIndex = KNoOfDigits; + // extract the name of each of the dll from the cenrep key value + for (int i = 0; i < dllCount; i++) + { + // extract length of dll name + int length = keyStringValue.mid(currentIndex, KNoOfDigits).toInt(); + // increment the current index value + currentIndex += KNoOfDigits; + // get the dll name + QString dllName = keyStringValue.mid(currentIndex, length); + // append to list of dll names + mDllNameList.append(dllName); + // increment the value of currentIndex by length of name + currentIndex += length; + } + qDebug() << "- PosSettingsPluginsLoader::ParseCenRepKey()"; + } + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/src/possettingspushbuttonitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/src/possettingspushbuttonitem.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This class provides custom list item for the +* DataForm +* +*/ + +#include +#include +#include +#include +#include +#include + +// --------------------------------------------------------------------------- +// PosSettingsPushButtonItem:::PosSettingsPushButtonItem +// --------------------------------------------------------------------------- +// +PosSettingsPushButtonItem::PosSettingsPushButtonItem(QGraphicsItem *parent) : +HbDataFormViewItem(parent) +{ +} + +// --------------------------------------------------------------------------- +// PosSettingsPushButtonItem:::~PosSettingsPushButtonItem +// --------------------------------------------------------------------------- +// +PosSettingsPushButtonItem::~PosSettingsPushButtonItem() +{ +} + +// --------------------------------------------------------------------------- +// PosSettingsPushButtonItem:::createItem +// --------------------------------------------------------------------------- +// +HbAbstractViewItem* PosSettingsPushButtonItem::createItem() +{ + return new PosSettingsPushButtonItem(*this); +} + +// --------------------------------------------------------------------------- +// PosSettingsPushButtonItem:::canSetModelIndex +// --------------------------------------------------------------------------- + +bool PosSettingsPushButtonItem::canSetModelIndex(const QModelIndex &index) const +{ + int type = index.data(HbDataFormModelItem::ItemTypeRole).toInt(); + if (type == PushButtonItem ) { + return true; + } + else { + return false; + } +} + +// --------------------------------------------------------------------------- +// PosSettingsPushButtonItem:::createCustomWidget +// --------------------------------------------------------------------------- +// +HbWidget* PosSettingsPushButtonItem::createCustomWidget() +{ + HbDataFormModelItem::DataItemType itemType = + static_cast + ( modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt() ); + + switch (itemType) { + case PushButtonItem: + { + //custom button + QString str = + modelIndex().data(HbDataFormModelItem::PropertyRole).toString(); + HbPushButton *button = new HbPushButton(str); + mWidget = button; + return mWidget; + } + default: + return 0; + } +} + +// --------------------------------------------------------------------------- +// PosSettingsPushButtonItem:::restore +// --------------------------------------------------------------------------- +// +void PosSettingsPushButtonItem::restore() +{ + HbDataFormViewItem::restore(); + if (mWidget) { + HbDataFormModelItem::DataItemType itemType = static_cast( + modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); + + if(itemType == PushButtonItem) { + + QModelIndex itemIndex = modelIndex(); + HbDataFormModel *model = static_cast(itemView()->model());; + HbDataFormModelItem *modelItem = static_cast( + model->itemFromIndex(itemIndex)); + + const QMetaObject *metaObj = 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(mWidget,modelItem->contentWidgetData(metaProperty.name())); + } + } + } + } +} + +//EOF diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsview.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This is the first view for Positioning Settings plugin +* +*/ + +#include "possettingsview.h" +#include "possettingsengine.h" +#include "possettingsform.h" +#include "possettingspushbuttonitem.h" +#include + +// --------------------------------------------------------------------------- +// PosSettingsView::PosSettingsView +// --------------------------------------------------------------------------- +// +PosSettingsView::PosSettingsView(QGraphicsItem + *parent):CpBaseSettingView(0,parent) + { + qDebug() << "================ Positiong settings is launched =============================="; + qDebug() << "+ PosSettingsView::PosSettingsView()"; + mSettingsEngine = new PosSettingsEngine; + if(!mSettingsEngine){ + qDebug() << "- PosSettingsView::PosSettingsView()"; + return; + } + + mSettingsForm = new PosSettingsForm( *mSettingsEngine, this ); + if(mSettingsForm) + this->setWidget( mSettingsForm ); + qDebug() << "- PosSettingsView::PosSettingsView()"; + } + +// --------------------------------------------------------------------------- +// PosSettingsView::~PosSettingsViewl +// --------------------------------------------------------------------------- +// +PosSettingsView::~PosSettingsView() + { + qDebug() << "+ PosSettingsView::~PosSettingsView()"; + delete mSettingsEngine; + mSettingsEngine = NULL; + + delete mSettingsForm; + mSettingsForm = NULL; + + qDebug() << "- PosSettingsView::~PosSettingsView()"; + qDebug() << "================ Positiong settings is closed =============================="; + } + +//EOF + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsplugin/inc/apilogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsplugin/inc/apilogger.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This class provides function that help in logging entry and exit of APIs of classes +* +*/ + +#ifndef APILOGGER_H +#define APILOGGER_H + +#include +#include +#include +#include +#include + +using namespace std; + + +class ApiLogger + { + public: + static void OpenLogFile(); + static void CloseLogFile(); + static void MyOutputHandler(QtMsgType type, const char *msg); + }; + +#endif // APILOGGER_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsplugin/inc/possettingsplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsplugin/inc/possettingsplugin.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This is for Positioning Settings plugin in ControlPanel +* +*/ + +#ifndef POSSETTINGS_PLUGIN_H +#define POSSETTINGS_PLUGIN_H + +class QTranslator; +#include + +class PosSettingsPlugin : public QObject, public CpPluginInterface +{ +Q_OBJECT + Q_INTERFACES(CpPluginInterface) +public: //constructor and destructor + PosSettingsPlugin(); + virtual ~PosSettingsPlugin(); +public: + /* + * Derived from CpPluginPlatInterface + */ + virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; +private: + /** + * Holds localization translator handle + */ + QTranslator* mTranslator; +}; +#endif // POSSETTINGS_PLUGIN_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsplugin/inc/possettingspluginhelper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsplugin/inc/possettingspluginhelper.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Positioning settings plugin helper class. +* +*/ + +#ifndef POSITIONINGSETTINGSPLUGIN_HELPER_H +#define POSITIONINGSETTINGSPLUGIN_HELPER_H + +#include + +class PosSettingsPluginHelperPrivate; +/** + * PosSettingsPluginHelper is a class that provides helper functions: + * To check if feature flag is On/Of + * To check if any positioning PSY is visible + */ +class PosSettingsPluginHelper + { +public: + + + /** + * Constructor + */ + PosSettingsPluginHelper(); + + /** + * Destructor + */ + ~PosSettingsPluginHelper(); + + /** + * Returns whether any position psy is available. + * @return true if any position psy is available, + * false if it is not available. + */ + bool isPositionPsyAvailable(); + + /** + * Returns whether feature flag is enabled. + * @return true if feature flag is enabled, + * false if it is not enabled. + */ + bool isFeatureFlagEnabled(); + +private: + Q_DECLARE_PRIVATE(PosSettingsPluginHelper) +protected: + PosSettingsPluginHelperPrivate* const d_ptr; + }; + + +#endif /* POSITIONINGSETTINGSPLUGIN_HELPER_H */ diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsplugin/inc/possettingspluginhelper_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsplugin/inc/possettingspluginhelper_p.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Positioning settings plugin helper private class. +* +*/ + +#ifndef POSITIONINGSETTINGSPLUGIN_HELPERPRIVATE_H +#define POSITIONINGSETTINGSPLUGIN_HELPERPRIVATE_H + +class PosSettingsPluginHelper; +/** + * PosSettingsPluginHelperPrivate is a class that provides helper functions: + * To check if feature flag is On/Of + * To check if any positioning PSY is visible + */ +class PosSettingsPluginHelperPrivate + { +private: + + /** + * Returns whether any position psy is available. + * @return true if any position psy is available, + * false if it is not available. + */ + bool isPositionPsyAvailable(); + + /** + * Returns whether feature flag is enabled. + * @return true if feature flag is enabled, + * false if it is not enabled. + */ + bool isFeatureFlagEnabled(); + + friend class PosSettingsPluginHelper; + }; + + +#endif /* POSITIONINGSETTINGSPLUGIN_HELPERPRIVATE_H_ */ diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsplugin/possettingsplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsplugin/possettingsplugin.pro Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,77 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# Description: project file for positioing settings plugin +# + +TEMPLATE = lib +TARGET = possettingsplugin +DEPENDPATH += . +INCLUDEPATH += ../inc +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + +CONFIG += hb\ + plugin + +#Uncomment following line to disable logging +#DEFINES += QT_NO_DEBUG_OUTPUT + +MOC_DIR = moc +OBJECTS_DIR = obj +RCC_DIR = rcc +RESOURCES += possettingsplugin.qrc +#TRANSLATIONS = lilocationmw.ts + +# Platforms +SYMBIAN_PLATFORMS = WINSCW \ + ARMV5 + +LIBS += -lcpframework \ + -lpossettingsengine \ + -leposmodset \ + -lfeatmgr + +# Input +SOURCES += src/possettingsplugin.cpp \ + src/possettingspluginhelper.cpp \ + src/possettingspluginhelper_p.cpp \ + src/apilogger.cpp + +HEADERS += inc/possettingsplugin.h \ + inc/possettingspluginhelper.h \ + inc/possettingspluginhelper_p.h \ + inc/apilogger.h + +symbian { + TARGET.EPOCALLOWDLLDATA = 1 + DEFINES += PLUGINUID3=0x2002C318 + TARGET.UID3 = 0x2002C318 + + # Add translation files + addFiles.sources = translations/possettings.qm + addFiles.path = . + #DEPLOYMENT += addFiles + + deploy.path = C: + qtplugins.path = /resource/qt/plugins/controlpanel + qtplugins.sources += qmakepluginstubs/possettingsplugin.qtplugin + # This is for new exporting system coming in garden + for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" +} + +TARGET.CAPABILITY = All -TCB +plugin.sources = possettingsplugin.dll +plugin.path = \resource\qt\plugins\controlpanel +DEPLOYMENT += plugin + + + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsplugin/possettingsplugin.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsplugin/possettingsplugin.qrc Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,5 @@ + + + translations/possettings.qm + + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsplugin/src/apilogger.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsplugin/src/apilogger.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This class provides function that help in logging entry and exit of APIs of classes +* +*/ + + +#include "apilogger.h" +#include + +const char* debugFileName("c://logs//lbs//posSettingsEngineLog.txt"); +ofstream logfile; + +void ApiLogger::OpenLogFile() +{ + logfile.open(debugFileName, ios::app); +} + +void ApiLogger::CloseLogFile() +{ + logfile.flush(); + logfile.close(); +} + +void ApiLogger::MyOutputHandler(QtMsgType type, const char *msg) +{ + switch (type) { + case QtDebugMsg: + logfile << QTime::currentTime().toString().toAscii().data() << " Debug: " << msg << "\n"; + break; + case QtCriticalMsg: + logfile << QTime::currentTime().toString().toAscii().data() << " Critical: " << msg << "\n"; + break; + case QtWarningMsg: + // logfile << QTime::currentTime().toString().toAscii().data() << " Warning: " << msg << "\n"; + break; + case QtFatalMsg: + logfile << QTime::currentTime().toString().toAscii().data() << " Fatal: " << msg << "\n"; + default: + break; + } + logfile.flush(); +} diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsplugin/src/possettingsplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsplugin/src/possettingsplugin.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This is for Positioning Settings plugin in ControlPanel + * + */ + +#include "possettingsplugin.h" +#include "possettingsview.h" +#include "possettingspluginhelper.h" +#include "apilogger.h" + +#include +#include +#include +#include + + + +// --------------------------------------------------------------------------- +// PosSettingsPlugin::PosSettingsPlugin +// --------------------------------------------------------------------------- +// +PosSettingsPlugin::PosSettingsPlugin():mTranslator(0) + { +#ifndef QT_NO_DEBUG_OUTPUT + ApiLogger::OpenLogFile(); + qInstallMsgHandler(ApiLogger::MyOutputHandler); +#endif + + qDebug() << "+ PosSettingsPluginHelper::PosSettingsPlugin()"; + mTranslator = new QTranslator(); + + QString lang = QLocale::system().name(); + QString path = "z:/resource/qt/translations/"; + bool loaded = false; + loaded = mTranslator->load(path + QString("lilocationmw_") + lang); + if (loaded == false) + { + loaded = mTranslator->load("possettings", ":/translations"); + } + if (loaded) + { + qApp->installTranslator(mTranslator); + } + qDebug() << "- PosSettingsPluginHelper::PosSettingsPlugin()"; + } + +// --------------------------------------------------------------------------- +// PosSettingsPlugin::~PosSettingsPlugin +// --------------------------------------------------------------------------- +// +PosSettingsPlugin::~PosSettingsPlugin() + { + qDebug() << "+ PosSettingsPluginHelper::~PosSettingsPlugin()"; + if (mTranslator) + { + if (mTranslator->isEmpty() == false) + qApp->removeTranslator(mTranslator); + delete mTranslator; + } + qDebug() << "- PosSettingsPluginHelper::~PosSettingsPlugin()"; + #ifndef QT_NO_DEBUG_OUTPUT + qInstallMsgHandler(0); + ApiLogger::CloseLogFile(); + #endif + } + +// --------------------------------------------------------------------------- +// PosSettingsPlugin::createSettingFormItemData +// --------------------------------------------------------------------------- +// +QList PosSettingsPlugin::createSettingFormItemData( + CpItemDataHelper &itemDataHelper) const + { + qDebug() << "+ PosSettingsPluginHelper::createSettingFormItemData()"; + PosSettingsPluginHelper helper; + QList formItemDataList; + if (!helper.isFeatureFlagEnabled() && helper.isPositionPsyAvailable()) + { + CpSettingFormItemData *itemData = new CpSettingFormEntryItemDataImpl< + PosSettingsView> (itemDataHelper, hbTrId( + "txt_cp_dblist_positioning"), hbTrId( + "txt_cp_dblist_positioning_val_change_positioning_s")); + formItemDataList.append(itemData); + } + qDebug() << "- PosSettingsPluginHelper::createSettingFormItemData()"; + return formItemDataList; + } + +Q_EXPORT_PLUGIN2(possettingsplugin, PosSettingsPlugin) + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsplugin/src/possettingspluginhelper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsplugin/src/possettingspluginhelper.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of positioning settings plugin helper class. +* +*/ + +#include "possettingspluginhelper.h" +#include "possettingspluginhelper_p.h" +#include + +//----------------------------------------------------------------- +//PosSettingsPluginHelper::PosSettingsPluginHelper() +//----------------------------------------------------------------- +PosSettingsPluginHelper::PosSettingsPluginHelper() : + d_ptr(new PosSettingsPluginHelperPrivate()) + { + qDebug() << "+ PosSettingsPluginHelper::PosSettingsPluginHelper()"; + qDebug() << "- PosSettingsPluginHelper::PosSettingsPluginHelper()"; + } + +//----------------------------------------------------------------- +//PosSettingsPluginHelper::~PosSettingsPluginHelper() +//----------------------------------------------------------------- +PosSettingsPluginHelper::~PosSettingsPluginHelper() + { + qDebug() << "+ PosSettingsPluginHelper::~PosSettingsPluginHelper()"; + if (d_ptr) + { + delete d_ptr; + } + qDebug() << "- PosSettingsPluginHelper::~PosSettingsPluginHelper()"; + } + +//--------------------------------------------------------------------- +// PosSettingsPluginHelper::populatePsyModuleInfoListL() +// (other items were commented in a header). +//--------------------------------------------------------------------- +bool PosSettingsPluginHelper::isPositionPsyAvailable() + { + qDebug() << "+ PosSettingsPluginHelper::isPositionPsyAvailable()"; + bool ret = d_ptr->isPositionPsyAvailable(); + qDebug() << "- PosSettingsPluginHelper::isPositionPsyAvailable() ret =" << ret; + return ret; + } + +//--------------------------------------------------------------------- +// PosSettingsPluginHelperPrivate::isFeatureFlagEnabledL() +// (other items were commented in a header). +//--------------------------------------------------------------------- +bool PosSettingsPluginHelper::isFeatureFlagEnabled() + { + qDebug() << "+ PosSettingsPluginHelper::isFeatureFlagEnabled()"; + bool ret = d_ptr->isFeatureFlagEnabled(); + qDebug() << "- PosSettingsPluginHelper::isFeatureFlagEnabled() ret =" << ret; + return ret; + } + +// End of file diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsplugin/src/possettingspluginhelper_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsplugin/src/possettingspluginhelper_p.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of positioning settings plugin helper private class. +* +*/ + + +#include "possettingspluginhelper_p.h" +#include "possettingspluginhelper.h" +#include +#include +#include + +//--------------------------------------------------------------------- +// PosSettingsPluginHelperPrivate::isPositionPsyAvailable() +// (other items were commented in a header). +//--------------------------------------------------------------------- +bool PosSettingsPluginHelperPrivate::isPositionPsyAvailable() + { + TInt cnt = 0; + TInt err2 = KErrGeneral; + CPosModules* posModules; + TRAPD(err1, posModules = CPosModules::OpenL();); + if(!posModules) + { + User::Leave( KErrGeneral ); + } + else + { + TRAP(err2, + CPosModuleIdList* idList = posModules->ModuleIdListLC(); + cnt = idList->Count(); + CleanupStack::PopAndDestroy( idList );); + } + if(err1==KErrNone && err2 ==KErrNone && cnt) //if no error and there + return true; + else + return false; + } + +//--------------------------------------------------------------------- +// PosSettingsPluginHelperPrivate::isFeatureFlagEnabled() +// (other items were commented in a header). +//--------------------------------------------------------------------- +bool PosSettingsPluginHelperPrivate::isFeatureFlagEnabled() + { + TBool flag = EFalse; + TRAPD(err, + FeatureManager::InitializeLibL(); + if ( FeatureManager::FeatureSupported( KFeatureIdFfLocationsysuiHidePositioningMenu ) ) + { + flag = ETrue; + } + FeatureManager::UnInitializeLib(); + ); + if(err==KErrNone && flag) + return true; + else + return false; + } + +// End of file diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsplugin/translations/possettings.qm Binary file locationsystemui/locationsysui/possettings/possettingsplugin/translations/possettings.qm has changed diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possettingsplugin/translations/possettings.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possettingsplugin/translations/possettings.ts Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,599 @@ + + + + + + Info text for periodic location request query (Default policy - Reject) + Your location will not be shared periodically by default if you don't respond + Your location will not be shared periodically by default if you don't respond + qtl_dialog_pri5 + Location notifications_03 + info + Lo + False + + + Name of the positioning server + Use %1 + Use %1 + qtl_checkbox_sec + loe_008 + list + lo + False + + + 2G/3G/etc network settings for positionin use + Cellular network + Cellular network + qtl_checkbox_sec + loe_008 + list + lo + False + + + Option menu item + Delete server + Delete server + qtl_menu_pri + loe_008 + opt + lo + False + + + Button - takes to advanced positioning settings + Advanced + Advanced + qtl_dataform_button_sec + loe_007 + button + lo + False + + + Button for accessing settings in control palel + Settings + Settings + txt_lint_button_settings + loe_002 + button + lo + False + + + Update interval value when update happens in seconds (59s or less) + Updates every %L1 seconds + Updates every %L1 seconds + qtl_list_sec + loe_008 + list + lo + False + + + Coordinates + L1%?L2%'L3%.L4%"E + L1%?L2%'L3%.L4%"E + txt_loe_list_l1l2l3l4e + loe_002 + list + lo + False + + + Location request query dialog - Softkey button. Allows the user to reject the suggested operation. + Reject + Reject + qtl_dialog_softkey + common + button + co + False + + + Control panel item in CP main view + Change positioning settings + Change positioning settings + qtl_list_sec_large_graphic + cp_001 + dblist_1_val + cp + False + + + Update interval value when interval is in days + Updates every %L1 days and %L2 hours + Updates every %L1 days and %L2 hours + qtl_list_sec + loe_008 + list + lo + False + + + Accuracy information in meters. Displayed when value is 999 meters or less + Accuracy: %L1 meters + Accuracy: %L1 meters + txt_lint_accuracy_1_meters + loe_002 + list + lo + False + + + Group heading for positioning methods + Positioning methods + Positioning methods + qtl_groupbox_expand_pri + loe_008 + subtitle + lo + False + + + Button. Note! Use this text ID only if there are max. two buttons in the dialog. Allows the user to cancel the action or process. + Cancel + Cancel + None + common + button + co + False + + + Accuracy information in kilometers. Displayed when over 999 meters + Accuracy: %L1 kilometers + Accuracy: %L1 kilometers + txt_lint_list_accuracy_1_kilometers + loe_002 + list + lo + False + + + Primary text in list widget. Notification recieved time + <Time> + <Time> + qtl_list_pri + Location notifications_06 + list + Lo + False + + + Internal GPS chipset - enabling or disabling that + Internal GPS + Internal GPS + qtl_checkbox_sec + loe_008 + list + lo + False + + + Wi-FI - enable/disable wifi usage in positioning context + Wi-Fi + Wi-Fi + qtl_checkbox_sec + loe_008 + list + lo + False + + + Location notification heading text + Your location not sent to : + Your location not sent to : + qtl_notifdialog_pri + Location notifications_04 + dpophead + Lo + False + + + Description text for GPS under the checkbox item + Enable for most accurate positioning + Enable for most accurate positioning + qtl_dataform_description_sec + loe_007 + info + lo + False + + + Group heading positioning servers + Positioning servers + Positioning servers + qtl_groupbox_expand_pri + loe_008 + subtitle + lo + False + + + Description text for wireless networks under the checkbox item + Use WI-FI and mobile networks to get position information + Use WI-FI and mobile networks to get position information + qtl_dataform_description_sec + loe_007 + info + lo + False + + + Single toolbar item to clear logs in Location notification log view + Clear logs + Clear logs + qtl_toolbar_tiny1_1 + Location notifications_06 + button + Lo + False + + + Sub heading text for Location notification logs view + Logs + Logs + qtl_groupbox_simple_sec + Location notifications_06 + subhead + Lo + False + + + Save button for saving current position + Save + Save + txt_loe_button_save + loe_002 + button + lo + False + + + Dialog text for server deletion + Select server to delete + Select server to delete + qtl_dialog_pri3 + loe_011 + info + lo + False + + + Button. Note! Use this text ID only if there are max. two buttons in the dialog. Allows the user to delete an item. Note that deleting removes the item permanently from memory. + Delete + Delete + None + common + button + co + False + + + value that tells the date until service will be active + Valid until %2 + Valid until %2 + qtl_list_sec + loe_008 + list + lo + False + + + Heading for the positioning info dialog + Positioning + Positioning + qtl_dialog_pri_heading + loe_001 + title + lo + False + + + Location notification primarry text in Universal Indicator Menu + %Ln Location notifications + + (s)%Ln Location notifications + (p)%Ln Location notifications + + qtl_indimenu_pri_medium_graphic + Location notifications_05 + dblist_1 + Lo + False + + + Assisted GPS - enabling or disabling + Assisted GPS + Assisted GPS + qtl_checkbox_sec + loe_008 + list + lo + False + + + Group heading for location based services + Background positioning + Background positioning + qtl_groupbox_expand_pri + loe_008 + subtitle + lo + False + + + subtitle for positioning settings main view + Positioning settings + Positioning settings + qtl_groupbox_simple_sec + loe_007 + subtitle + lo + False + + + Requestor info text in Location request query dialog + Location was requested by : + Location was requested by : + qtl_dialog_pri5 + Location notifications_01 + info + Lo + False + + + Button - takes to advanced positioning settings + Advanced positioning settings + Advanced positioning settings + qtl_groupbox_simple_sec + loe_008 + subtitle + lo + False + + + Title text in Location request query dialog + Location request + Location request + qtl_dialog_pri_heading + Location notifications_01 + title + Lo + False + + + Checkbox item for enabling/disabling Background positioning + Background positioning + Background positioning + qtl_checkbox_sec + loe_007 + list + lo + False + + + Update interval value when interval is hours (not days or months etc) + Updates every %L1 hours and %L2 minutes + Updates every %L1 hours and %L2 minutes + qtl_list_sec + loe_008 + list + lo + False + + + Update interval value when interval is in minutes + Updates every %L1 minutes and %L2 seconds + Updates every %L1 minutes and %L2 seconds + qtl_list_sec + loe_008 + list + lo + False + + + Checkbox item for enabling/disabling GPS + GPS + GPS + qtl_checkbox_sec + loe_007 + list + lo + False + + + Info text for periodic location request query - No default policy + You location will be shared periodically with : + You location will be shared periodically with : + qtl_dialog_pri5 + Location notifications_02 + info + Lo + False + + + Coordinates + L1%?L2%'L3%.L4%"W + L1%?L2%'L3%.L4%"W + txt_loe_list_l1l2l3l4w + loe_002 + list + lo + False + + + Coordinates + L1%?L2%'L3%.L4%"N + L1%?L2%'L3%.L4%"N + txt_loe_list_l1l2l3l4n + loe_002 + list + lo + False + + + Query header for save dialog + Save as + Save as + qtl_dialog_pri_heading + loe_005 + title + lo + False + + + Update interval value when interval is months + Updates every %L1 months and %L2 days + Updates every %L1 months and %L2 days + qtl_list_sec + loe_008 + list + lo + False + + + Bluetooth GPS - enabling/disabling external BT GPS device usage + Bluetooth GPS + Bluetooth GPS + qtl_checkbox_sec + loe_008 + list + lo + False + + + Checkbox item for enabling/disabling Wireless positioning + Wireless networks + Wireless networks + qtl_checkbox_sec + loe_007 + list + lo + False + + + Primary text in list widget. Notification received time and ate + <Time><Date> + <Time><Date> + qtl_list_pri + Location notifications_06 + list + Lo + False + + + Control panel item in CP main view + Positioning + Positioning + qtl_list_pri_large_graphic + cp_001 + dblist_1 + cp + False + + + Multiline secondary text in a list item + Your location sent to : + Your location sent to : + qtl_list_sec + Location notifications_06 + list + Lo + False + + + Location request query dialog - Softkey button. Allows the user to accept the location request + Accept + Accept + qtl_dialog_softkey + Location notifications_01 + button + Lo + False + + + Coordinates + L1%?L2%'L3%.L4%"S + L1%?L2%'L3%.L4%"S + txt_loe_list_l1l2l3l4s + loe_002 + list + lo + False + + + UniversalIndicatorMenu item text. + Positioning + Positioning + qtl_indimenu_pri_medium_graphic + loe_001 + dblist_1 + lo + False + + + Button in dialog for closing the Positioning info dialog + Done + Done + qtl_dialog_softkey_1 + loe_002 + button + lo + False + + + Confirmation about stopping service + Stop service %1 + Stop service %1 + qtl_dialog_pri3_large_graphic + loe_010 + info + lo + False + + + Description text for Location based services & background applications + Enable applications and services update and retrieve location information + Enable applications and services update and retrieve location information + qtl_dataform_description_sec + loe_007 + info + lo + False + + + Multiline secondary text in a list item + Your location not sent to: + Your location not sent to: + qtl_list_sec + Location notifications_06 + list + Lo + False + + + Title text for Location notifications log view + Location notifications + Location notifications + qtl_chrome_title + Location notifications_06 + title + Lo + False + + + Button. Note! Use this text ID only if there are max. two buttons in the dialog. When this button is pressed, the focused item or operation will be selected or accepted. + OK + OK + qtl_dialog_softkey_2 + common + button + co + False + + + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possuplsettingsplugin/inc/possettingssignalmapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possuplsettingsplugin/inc/possettingssignalmapper.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Declaration of the Positioning Settings signal mapper + * used to map the signals of each check box item to the index + * + */ + +#ifndef POSSETTINGSSIGNALMAPPER_H +#define POSSETTINGSSIGNALMAPPER_H + +#include + +class PosSettingsSignalMapper : public QObject + { + Q_OBJECT +public: + /* + * constructor + */ + PosSettingsSignalMapper(); + /** + * destructor + */ + ~PosSettingsSignalMapper(); +public: +signals: + /** + * signal emitted by the slot of this class + */ + void signalmapped(); +public slots: + /** + * slot to be called on a change in state of checkbox. + * this in turn calls the signal signalmapped() + */ + void signalmap(); + }; + +#endif //POSSETTINGSSIGNALMAPPER_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possuplsettingsplugin/inc/possuplsettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possuplsettingsplugin/inc/possuplsettings.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This is for SUPL Positioning Settings plugin + * for Advanced View + * + */ + +#ifndef POSSUPLSETTINGS_PLUGIN_H +#define POSSUPLSETTINGS_PLUGIN_H + +//User Includes +#include "possuplsettingscommon.h" +#include "possettingssignalmapper.h" + +#include +#include +#include +#include +#include + +//Forward Declaration +class PosSettingsAdvOp; +class PosSuplSettingsEngine; +class QModelIndex; +class HbRadioButtonList; +class HbDialog; + +class PosSuplSettingsPlugin : public QObject, public PosSettingsAdvInterface + + { +Q_OBJECT + Q_INTERFACES( PosSettingsAdvInterface ) +public: + /** + * Constructor + */ + PosSuplSettingsPlugin(); + + /** + * Destructor + */ + ~PosSuplSettingsPlugin(); +public: + /* + * Derived from PosSettingsAdvInterface + */ + virtual int initialise(PosSettingsAdvOp* operation); + +private: + /** + * This method is used to list all the server that are present for + * positioing. Depending on whether the server is enabled/disabled for positioning + * the corresponding checkboxes are marked. + */ + void listServers(); + + /** + * This method creates menu to delete the servers + */ + void createMenu(); + +private slots: + /** + * This is used as a slot whenever the checkbox is marked/unmarked. + * On changing the state of the checkbox the corresponding positioning + * server is enabled/disabled + * @param [in] - slpid for the server to be enababled/disabled + */ + void changeServerUsage(int slpid); + + /** + * This is slot, which is called whenever there is a new server added or + * a server in the list is deleted. This refreshes the view. + */ + void updateList(); + + /** + * This is slot, which is called when the user selects the + * server to be deleted + */ + void onDeleteServer(); + + /** + * This slot is used to enable the primary Action wheneven + * a server is selected from the list of servers to be deleted + * @param [in] - index of the server to be deleted + */ + void setPrimaryAction(int itemSelected); + + /** + * This slot is used to delete the server whenever + * a server is selected from the list of servers to be deleted + */ + void deleteServer(); + +private: + + /** + * an object if the supl setting engine class + * Owns + */ + PosSuplSettingsEngine* mSuplSettingsEngine; + + /** + * an object of data form model item class + * Owns + */ + HbDataFormModelItem * mGroup; + + /** + * Holds the params of the list of servers + * Owns + */ + QList mServerList; + + /** + * hold the signal mapper objects of PosPsySettingsSignalMapper + * Owns + */ + QList mSignalMapperList; + + /** + * Handle to PosSettingsAdvOp object + * Does not own + */ + PosSettingsAdvOp * mOperation; + + /** + * an object of QSignalMapper + * Owns + */ + QSignalMapper * mSignalMapper; + + /** + * an object on HbMenu + * Owns + */ + HbMenu* mMainMenu; + + /** + * list of servers that can be deleted + * Owns + */ + QList mDeleteableServerList; + + /** + * an instance of HBAction, used for SK1 in + * the delete server Dialog box + * Owns + */ + HbAction* mPrimaryAction; + + /** + * an instance of HbRadioButtonList, used to add server + * in the delete server selection Dialog box + * Owns + */ + HbRadioButtonList *mRadioButtonList; + + /** + * holds the server delete query dialog + * Owns + */ + HbDialog *mDeleteQuery; + }; +#endif // POSSUPLSETTINGS_PLUGIN_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possuplsettingsplugin/inc/possuplsettingscommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possuplsettingsplugin/inc/possuplsettingscommon.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This is a common header for SUPL Positioning Settings plugin + * for Advanced View + * + */ + +#ifndef POSSUPLSETTINGS_COMMON_H +#define POSSUPLSETTINGS_COMMON_H + +#include + +/** + * Contains info related to each SUPL Servers + * - SLP id + * - Server Address + * - Access Point + * - Server Usage State(enabled/disabled) + * - Sim Change Remove (Yes/No) + * - Usage is Home Network(Yes/No) + * - editable (Yes/No) + */ +class PosServerParams + { +public: + long slpId; + QString serverAdd; + QString iap; + bool serverEnabled; + }; + +#endif //POSSUPLSETTINGS_COMMON_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possuplsettingsplugin/inc/possuplsettingsengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possuplsettingsplugin/inc/possuplsettingsengine.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This is the engine header for SUPL Positioning Settings plugin + * + */ + +#ifndef POSSUPLSETTINGS_ENGINE_H +#define POSSUPLSETTINGS_ENGINE_H + + +//User Includes +#include "possuplsettingsengineprivate.h" +#include "possuplsettingscommon.h" + +#include +#include +#include +#include + +//Forward Declarations +class PosSuplSettingsEnginePrivate; +class MSuplSettingsObserver; + +class PosSuplSettingsEngine : public QObject, public PosSuplSettingsChangeObserver + { +Q_OBJECT + +public: + + /** + * Constructor + */ + PosSuplSettingsEngine(); + + /** + * Destructor + */ + ~PosSuplSettingsEngine(); + + /** + * This method Lists all the Server that are present for Positioning. + * @param [out] - aServerList. Contains the servers that are present. + * @returns - KErrNone if successful + * - KErrNotfound is no servers are present + */ + + int suplServerList(QList& serverList); + + /** + * This method Lists all the Server that are present for Positioning. + * @param [out] - aServerList. Contains the servers that are present. + * @returns - KErrNone if successful + * - KErrNotfound is no servers are present + */ + + int deletableServerList(QList& serverList); + + + /** + * This method enables/disables the server in use for postioning. + * If the server is disabled, it will not be used for positioning unless enabled. + * @param [in] - aServerIndex. The server index which has to be enabled/disabled. + * @param [in] - aValue. true/false. + * @returns - KErrNone if enabling/disabling is successful + * - KErrArgument if the SLP ID passed is not valid/out of bounds + * - KErrGeneral if changing SUPL settings has failed + */ + int enableServer(int aServerIndex, bool aValue); + + /** + * This method is used to delete the server. + * @param [in] - aServerIndex. The server index which has to be deleted. + * @returns - KErrNone if the deletion is successful + * - KErrNotFound if the server at the index in missing/out of bounds. + * - KErrPermissionDenied if the sever cannot be deleted + * - KErrGeneral is other cases + */ + int deleteServer(int aServerIndex); + + +public: + + /** + * Inherited from PosSuplSettingsChangeObserver + */ + void handleSuplSettingsChange( MSuplSettingsObserver::TSuplSettingsEventType event,int slpId); +signals: + /** + * This signal is emitted when the server is deleted/added. + */ + void serverListUpdated(); + +private: + /** + * pointer to private implementation class + */ + Q_DECLARE_PRIVATE_D(d_ptr, PosSuplSettingsEngine) + PosSuplSettingsEnginePrivate * d_ptr; + }; +#endif // POSSUPLSETTINGS_ENGINE_H diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possuplsettingsplugin/inc/possuplsettingsengineprivate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possuplsettingsplugin/inc/possuplsettingsengineprivate.h Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,142 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Positioning settings engine private class header. +* +*/ + +#ifndef POSSUPLSETTINGSENGINEPRIVATE_H +#define POSSUPLSETTINGSENGINEPRIVATE_H + +#include "possuplsettingscommon.h" +#include +#include + +class CServerParams; +class CSuplSettings; + +//Constants +const int KMaxHSLPAddrLen = 256; +const int KMaxIAPLen = 256; +/** + * The class defines the interface for receiving SUPL settings + * change event. + */ +class PosSuplSettingsChangeObserver + { +public: + virtual void handleSuplSettingsChange( MSuplSettingsObserver::TSuplSettingsEventType aEvent,int aSlpId) = 0; + }; + + +/** + * The class defines the interface for listing,enabling\disabling and deleting + * SLP servers. + */ +class PosSuplSettingsEnginePrivate : public MSuplSettingsObserver + { +public: + /** + * Default constructor + */ + PosSuplSettingsEnginePrivate(); + + /** + * Destructor + */ + ~PosSuplSettingsEnginePrivate(); + + /** + * Returns properties of all servers from SUPL settings storage.. + * @[OUT] paramValues Array of retrieved server entries + * - KErrNone if SUPL settings are retrieved successfully. + * - KErrNotFound if the settings does not have any server entry + */ + int GetServerList( QList& aParamValues ); + + /** + * This method is used to change parameter which indicates whether server + * can be used for SUPL session or not. + * + * @param [IN] slpId SLP ID for which the parameter needs to be changed + * @param [IN] enableFlag Flag to indicate whether server can be enabled or not + * @return one of the following error codes: + * - KErrNone if SUPL settings are changed successfully. + * - KErrArgument if the SLP ID passed is not valid + * - KErrGeneral if changing SUPL settings has failed + */ + int SetServerStatus( int aSlpId, + bool aEnableFlg + ); + + + /** + * This method is deletes server entry from SUPL settings storage. + * + * @param [IN] slpId Server identity for which the entery needs to be deleted from the SUPL settings storage + * + * @return one of the following error codes: + * - KErrNone if entry is deleted successfully + * - KErrNotFound if the specified server identity does not exists in settings storage + * - KErrGeneral if changing SUPL settings has failed + * + */ + int RemoveServer( int aSlpId); + + /** + * Returns list all servers from SUPL settings storage that can be deleted.Operator configured servers will be omitted from + * this list. + * @[OUT] paramValues Array of retrieved server entries + * - KErrNone if SUPL settings are retrieved successfully. + * - KErrNotFound if the list does not have any server entry + */ + int GetRemovableServerList( QList& aParamValues ); + + /* @param [IN] observer The observing object. + * @return one of the following values + * - KErrNone if setting observer is successful + * - KErrAlreadyExists if observer is already set + * + */ + int SetObserver( PosSuplSettingsChangeObserver* aObserver ); + + +public: + void HandleSuplSettingsChangeL( TSuplSettingsEventType aEvent,TInt aSlpId ); + void HandleSuplTriggerStatusChangeL( CSuplSettings::TSuplTriggerStatus aSuplTriggerStatus ); + + +private: //Data members + + /** + * Reference to position technology change observer. + * Does not own + */ + PosSuplSettingsChangeObserver* mPosSuplSettingsObserver; + + /** + * Pointer to Supl settings object + * Owns + */ + CSuplSettings* mSuplSettings; + + /** + * Pointer to Supl Server List + * Owns + */ + RPointerArray mServerList; + }; + + + +#endif /* POSSUPLSETTINGSENGINEPRIVATE_H */ diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possuplsettingsplugin/possuplsettings.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possuplsettingsplugin/possuplsettings.pro Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,63 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Positioning Servers Plugin pro file +# +TEMPLATE = lib +TARGET = possuplsettings +DEPENDPATH += . +INCLUDEPATH += ../inc +INCLUDEPATH += ../possettingsengine/inc +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE +CONFIG += hb \ + plugin +MOC_DIR = moc +OBJECTS_DIR = obj +RCC_DIR = rcc + +# Platforms +SYMBIAN_PLATFORMS = WINSCW \ + ARMV5 +LIBS += -lcpframework \ + -lpossettingsengine \ + -lepos_suplsettings + +# Input +SOURCES += src/possuplsettings.cpp +SOURCES += src/possuplsettingsengine.cpp +SOURCES += src/possuplsettingsengineprivate.cpp +SOURCES += src/possettingssignalmapper.cpp + +HEADERS += inc/possuplsettingscommon.h \ + inc/possuplsettings.h +HEADERS += inc/possuplsettingsengine.h +HEADERS += inc/possuplsettingsengineprivate.h +HEADERS += inc/possettingssignalmapper.h +symbian: { + TARGET.EPOCALLOWDLLDATA = 1 + DEFINES += PLUGINUID3=0x2002C31B + TARGET.UID3 = 0x2002C31B +} +symbian { + deploy.path = C: + qtplugins.path = /resource/qt/plugins/positioningsettings + qtplugins.sources += qmakepluginstubs/possuplsettings.qtplugin + + # This is for new exporting system coming in garden + for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" +} +TARGET.CAPABILITY = All \ + -TCB +plugin.sources = possuplsettings.dll +plugin.path = \resource\qt\plugins\positioningsettings +DEPLOYMENT += plugin diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possuplsettingsplugin/src/possettingssignalmapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possuplsettingsplugin/src/possettingssignalmapper.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Implementation of positioning settings signal mapper class + * + */ + + +#include "possettingssignalmapper.h" + + +//--------------------------------------------------------------------- +// PosSettingsSignalMapper::PosSettingsSignalMapper() +// Constructor +//--------------------------------------------------------------------- +PosSettingsSignalMapper::PosSettingsSignalMapper() + { + + } + +//--------------------------------------------------------------------- +// PosSettingsSignalMapper::PosSettingsSignalMapper() +// destructor +//--------------------------------------------------------------------- +PosSettingsSignalMapper::~PosSettingsSignalMapper() + { + + } + +//--------------------------------------------------------------------- +// PosSettingsSignalMapper::PosSettingsSignalMapper() +// +//--------------------------------------------------------------------- +void PosSettingsSignalMapper::signalmap() + { + emit signalmapped(); + } + + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possuplsettingsplugin/src/possuplsettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possuplsettingsplugin/src/possuplsettings.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,516 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This is for Positioning Supl Settings plugin + * for Positioning Settings's Advanced view + * + */ +#include "possuplsettings.h" +#include "possuplsettingsengine.h" +#include "possettingsadvop.h" + +#include +#include +#include +#include +#include +#include +#include +#include + + +// --------------------------------------------------------------------------- +// PosSuplSettingsPlugin::PosSuplSettingsPlugin +// --------------------------------------------------------------------------- +// +PosSuplSettingsPlugin::PosSuplSettingsPlugin() : + mSuplSettingsEngine(0), mGroup(0), mOperation(0), mSignalMapper(0), + mMainMenu(0), mPrimaryAction(0), mRadioButtonList(0), + mDeleteQuery(0) + { + qDebug() << "+ PosSuplSettingsPlugin::PosSuplSettingsPlugin()"; + mSuplSettingsEngine = new PosSuplSettingsEngine(); + qDebug() << "- PosSuplSettingsPlugin::PosSuplSettingsPlugin()"; + } + +// --------------------------------------------------------------------------- +// PosSuplSettingsPlugin::~PosSuplSettingsPlugin +// --------------------------------------------------------------------------- +// +PosSuplSettingsPlugin::~PosSuplSettingsPlugin() + { + qDebug() << "+ PosSuplSettingsPlugin::~PosSuplSettingsPlugin()"; + + if (mSuplSettingsEngine) + { + delete mSuplSettingsEngine; + mSuplSettingsEngine = 0; + } + + if (mGroup && mOperation) + { + mOperation->removeItem(mGroup); + mGroup = 0; + } + + if (mMainMenu) + { + delete mMainMenu; + mMainMenu = 0; + } + ///// + QObject::disconnect(mSignalMapper, SIGNAL(mapped(int)), this, + SLOT(changeServerUsage(int))); + + if (mSignalMapper) + { + delete mSignalMapper; + mSignalMapper = NULL; + } + + if (mPrimaryAction) + { + delete mPrimaryAction; + mPrimaryAction = 0; + } + + if (mRadioButtonList) + { + mRadioButtonList->reset(); + delete mRadioButtonList; + } + + if (mDeleteQuery) + { + delete mDeleteQuery; + } + /// + + // delete the signal mapper instances + int cnt = mSignalMapperList.count(); + for (int i = 0; i < cnt ; ++i) + { + QObject::disconnect(mSignalMapperList[i], SIGNAL(signalmapped()), + mSignalMapper, SLOT(map())); + delete mSignalMapperList[i]; + mSignalMapperList[i] = NULL; + } + + /// + + mServerList.clear(); + mSignalMapperList.clear(); + mDeleteableServerList.clear(); + qDebug() << "- PosSuplSettingsPlugin::~PosSuplSettingsPlugin()"; + } + +// --------------------------------------------------------------------------- +// PosSuplSettingsPlugin::initialise +// --------------------------------------------------------------------------- +// +int PosSuplSettingsPlugin::initialise(PosSettingsAdvOp* operation) + { + qDebug() << "+ PosSuplSettingsPlugin::initialise()"; + + int result = 0; + // Assign to the member variable + mOperation = operation; + + // create the signal mapper + mSignalMapper = new QSignalMapper(); + + //get the list of server present for positioning + if (mSuplSettingsEngine) + { + result = mSuplSettingsEngine->suplServerList(mServerList); + } + + // if no error while getting the server list then add the group + // for Positioning servers + if (result == 0) + { + mGroup = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, + hbTrId("txt_loe_subtitle_positioning_servers"), 0); + //Add the group to the data form + operation->appendDataFormItem(mGroup); + //list all the server inside the group + listServers(); + } + QObject::connect(mSuplSettingsEngine, SIGNAL(serverListUpdated()), this, + SLOT(updateList())); + + qDebug() << "- PosSuplSettingsPlugin::initialise()" << "result = " + << result; + + return result; + } + +// --------------------------------------------------------------------------- +// PosSuplSettingsPlugin::ChangeServerUsage +// --------------------------------------------------------------------------- +// +void PosSuplSettingsPlugin::changeServerUsage(int value) + { + qDebug() << "+ PosSuplSettingsPlugin::changeServerUsage()"; + //toggle the value based on the slpid + if (!mServerList[value].serverEnabled) + { + mSuplSettingsEngine->enableServer(mServerList[value].slpId, true); + } + else + { + mSuplSettingsEngine->enableServer(mServerList[value].slpId, false); + } + qDebug() << "- PosSuplSettingsPlugin::changeServerUsage()"; + } + +// --------------------------------------------------------------------------- +// PosSuplSettingsPlugin::listServers +// --------------------------------------------------------------------------- +// +void PosSuplSettingsPlugin::listServers() + { + qDebug() << "+ PosSuplSettingsPlugin::listServers()"; + + qDebug() << "mServerList.count = " << mServerList.count(); + + //create a serverlist iterator + QList::const_iterator serveriterator; + + // Get the server names and display + for (serveriterator = mServerList.begin(); serveriterator + != mServerList.end(); ++serveriterator) + { + qDebug() << "server name = " << serveriterator->serverAdd; + if (serveriterator->serverAdd.length() > 0) + { + //for each server create new checkbox item + HbDataFormModelItem* checkBox = new HbDataFormModelItem( + HbDataFormModelItem::CheckBoxItem, QString(), 0); + + //set the widget data to the server name + checkBox->setContentWidgetData("text", QString(hbTrId( + "txt_loe_list_use_1")).arg(serveriterator->serverAdd)); + + //if the server is enabled set the initial state of the checkbox + if (serveriterator->serverEnabled) + { + checkBox->setContentWidgetData("checkState", Qt::Checked); + } + else + { + checkBox->setContentWidgetData("checkState", Qt::Unchecked); + } + + qDebug() << "Adding checkbox in the group"; + + //this part of code is called when the servers are added and + //Advanced view is in the background. Since there is no group + // a new group has to be created to add the servers + mOperation->appendDataFormItem(checkBox, mGroup); + + //create an object of dummy signal mapper class + //this is done to send the index info to the slots + //since checkbox is not of QObject type and dummy class is + // created. + PosSettingsSignalMapper* signalMapper = + new PosSettingsSignalMapper(); + mSignalMapperList.append(signalMapper); + + //add connection for statechanged of the checkbox, depending on which the + // add connections on change of check box state + mOperation->addConnection(checkBox, SIGNAL(stateChanged(int)), + mSignalMapperList[serveriterator - mServerList.begin()], + SLOT(signalmap())); + + QObject::connect(mSignalMapperList[serveriterator + - mServerList.begin()], SIGNAL(signalmapped()), + mSignalMapper, SLOT(map())); + + // set mapping of each check box item to its index + if (mSignalMapper) + { + mSignalMapper->setMapping(mSignalMapperList[serveriterator + - mServerList.begin()], (serveriterator + - mServerList.begin())); + } + } + } + + //use signal mapper to connect + QObject::connect(mSignalMapper, SIGNAL(mapped(int)), this, + SLOT(changeServerUsage(int))); + + qDebug() << "mDeleteableServerList.count before reset = " + << mDeleteableServerList.count(); + + //refresh the list of deleteable servers in case any deleteable server is added + mDeleteableServerList.clear(); + + if (mSuplSettingsEngine) + { + mSuplSettingsEngine->deletableServerList(mDeleteableServerList); + } + + qDebug() << "mDeleteableServerList.count after fetch = " + << mDeleteableServerList.count(); + + //if the server list is <=1 while updating the list the menu is destroyed + if (mDeleteableServerList.count() == 0) + { + if (mMainMenu) + { + delete mMainMenu; + mMainMenu = 0; + } + } + else + { + delete mMainMenu; + mMainMenu = 0; + createMenu(); + } + qDebug() << "- PosSuplSettingsPlugin::listServers()"; + } + +// --------------------------------------------------------------------------- +// PosSuplSettingsPlugin::updateList +// --------------------------------------------------------------------------- +// +void PosSuplSettingsPlugin::updateList() + { + qDebug() << "+ PosSuplSettingsPlugin::updateList()"; + int result = 0; + int oldChildCount = 0; + + if (mGroup) + { + qDebug() << "Store the group info"; + + oldChildCount = mGroup->childCount(); + + // remove all connections + int count = mSignalMapperList.count(); + qDebug() << "mSignalMapperList.count() = " << count; + + for (int i = 0; i < count; ++i) + { + QObject::disconnect(mSignalMapperList[i], SIGNAL(signalmapped()), + mSignalMapper, SLOT(map())); + } + QObject::disconnect(mSignalMapper, SIGNAL(mapped(int)), this, + SLOT(changeServerUsage(int))); + + qDebug() << "oldChildCount = " << oldChildCount; + + //remove the children in the group + if (oldChildCount > 0) + { + qDebug() << "removing the children"; + //mGroup->removeChildren(0, oldChildCount); + //ToDo: Hack from HbDataForm team + for (int i = 0; i < oldChildCount; ++i) + { + mGroup->removeChild(0); + } + } + } + else + { + qDebug() << "Creating new group "; + + mGroup = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, + hbTrId("txt_loe_subtitle_positioning_servers"), 0); + mOperation->appendDataFormItem(mGroup); + } + + qDebug() << "mServerList.count() before clean = " << mServerList.count(); + + //clear the list and get the list of server present for positioning + mServerList.clear(); + if (mSuplSettingsEngine) + { + result = mSuplSettingsEngine->suplServerList(mServerList); + } + qDebug() << "result = " << result; + + //update the new list to the group + if (result == 0) + { + listServers(); + } + if (result == -1) + { + qDebug() << "Removing the group from form"; + //remove the group + mOperation->removeItem(mGroup); + mGroup = 0; + // delete the menu + if (mMainMenu) + { + delete mMainMenu; + mMainMenu = 0; + } + } + qDebug() << "- PosSuplSettingsPlugin::updateList()"; + } + +// --------------------------------------------------------------------------- +// PosSuplSettingsPlugin::onDeleteServer +// --------------------------------------------------------------------------- +// +void PosSuplSettingsPlugin::onDeleteServer() + { + qDebug() << "+ PosSuplSettingsPlugin::onDeleteServer()"; + //list that will contain the deleteable servers names + QStringList contentList; + + //get the deleteable server list from the engine + QList::const_iterator iterator; + + qDebug() << "mDeleteableServerList.count = " + << mDeleteableServerList.count(); + + //add the server names to the string list + for (iterator = mDeleteableServerList.constBegin(); iterator + != mDeleteableServerList.constEnd(); ++iterator) + { + //Copy the address to Qstring object + qDebug() << "deletable server = " << iterator->serverAdd; + contentList << iterator->serverAdd; + } + + // delete the mRadioButtonList before creating it,each time the delete + // query needs to be popped up + if (mRadioButtonList != 0) + { + delete mRadioButtonList; + mRadioButtonList = 0; + } + //create a radion button list of the deletable servers + mRadioButtonList = new HbRadioButtonList(); + mRadioButtonList->setItems(contentList); + QObject::connect(mRadioButtonList, SIGNAL(itemSelected(int)), this, + SLOT(setPrimaryAction(int))); + + // delete the mDeleteQuery before creating it,each time the delete + // query needs to be popped up + + if (mDeleteQuery != 0) + { + delete mDeleteQuery; + mDeleteQuery = 0; + } + //create the query dialog and attach the radio button to the dialog + mDeleteQuery = new HbDialog(); + + mDeleteQuery->setTimeout(HbDialog::NoTimeout); + + //set the proper layout for the mDeleteQuery dialog + qreal lMargin = 0; + qreal rMargin = 0; + qreal tMargin = 0; + + if (mDeleteQuery->style()->parameter("hb-param-margin-gene-left", + lMargin) && mDeleteQuery->style()->parameter( + "hb-param-margin-gene-right", rMargin) + && mDeleteQuery->style()->parameter( + "hb-param-margin-gene-top", tMargin)) + { + HbLabel * heading = new HbLabel(QString(hbTrId( + "txt_loe_info_select_server_to_delete"))); + heading->setContentsMargins(lMargin, tMargin, rMargin, 0); + mDeleteQuery->setHeadingWidget(heading); + } + + // delete the mPrimaryAction before creating it,each time the delete + // query needs to be popped up + if (mPrimaryAction != 0) + { + delete mPrimaryAction; + mPrimaryAction = 0; + } + //the primary action that will come in the SK1 of the Dialog box + mPrimaryAction + = new HbAction(QString(hbTrId("txt_common_button_delete"))); + + mDeleteQuery->addAction(mPrimaryAction); + mDeleteQuery->addAction(new HbAction(QString(hbTrId( + "txt_common_button_cancel")))); + QObject::connect(mPrimaryAction, SIGNAL(triggered()), this, + SLOT(deleteServer())); + + //set the content Widget + mDeleteQuery->setContentWidget(mRadioButtonList); + + //the Primary action is disabled since no server from the list is selected + mPrimaryAction->setDisabled(true); + + mDeleteQuery->show(); + + qDebug() << "- PosSuplSettingsPlugin::onDeleteServer()"; + } + +// --------------------------------------------------------------------------- +// PosSuplSettingsPlugin::createMenu +// --------------------------------------------------------------------------- +// +void PosSuplSettingsPlugin::createMenu() + { + qDebug() << "+ PosSuplSettingsPlugin::createMenu()"; + mMainMenu = new HbMenu(); + HbAction* action = mMainMenu->addAction(hbTrId( + "txt_loe_opt_delete_server")); + + QObject::connect(action, SIGNAL(triggered()), this, + SLOT(onDeleteServer())); + + mOperation->addAction(action, HbView::OptionsMenu); + qDebug() << "- PosSuplSettingsPlugin::createMenu()"; + } + +// --------------------------------------------------------------------------- +// PosSuplSettingsPlugin::setPrimaryAction +// --------------------------------------------------------------------------- +// +void PosSuplSettingsPlugin::setPrimaryAction(int /*itemSelected*/) + { + //enable the primary Action + if (mPrimaryAction) + { + mPrimaryAction->setEnabled(true); + } + } + +// --------------------------------------------------------------------------- +// PosSuplSettingsPlugin::deleteServer +// --------------------------------------------------------------------------- +// +void PosSuplSettingsPlugin::deleteServer() + { + //get the index of the selected servers + int serverIndex = mRadioButtonList->selected(); + + if( serverIndex != -1 ) + { + if (mSuplSettingsEngine) + { + //delete the server + mSuplSettingsEngine->deleteServer( + mDeleteableServerList[serverIndex].slpId); + } + } + } +Q_EXPORT_PLUGIN2(possuplsettings, PosSuplSettingsPlugin) +; + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possuplsettingsplugin/src/possuplsettingsengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possuplsettingsplugin/src/possuplsettingsengine.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: This is the engine for Positioning Supl Settings plugin + * for Positioning Settings's Advanced view + * + */ +#include "possuplsettingsengine.h" +#include "possuplsettingsengineprivate.h" + +#include + +//----------------------------------------------------------------- +//PosSuplSettingsEngine::PosSuplSettingsEngine() +//----------------------------------------------------------------- +PosSuplSettingsEngine::PosSuplSettingsEngine() : + d_ptr(0) + { + qDebug() << "+ PosSuplSettingsEngine::PosSuplSettingsEngine()"; + d_ptr = new PosSuplSettingsEnginePrivate(); + //Set the PosSuplSettingsChangeObserver + if (d_ptr) + { + d_ptr->SetObserver(this); + } + qDebug() << "- PosSuplSettingsEngine::PosSuplSettingsEngine()"; + } + +//----------------------------------------------------------------- +//PosSuplSettingsEngine::~PosSuplSettingsEngine() +//----------------------------------------------------------------- +PosSuplSettingsEngine::~PosSuplSettingsEngine() + { + qDebug() << "+ PosSuplSettingsEngine::~PosSuplSettingsEngine()"; + if (d_ptr) + { + delete d_ptr; + d_ptr = 0; + } + qDebug() << "- PosSuplSettingsEngine::~PosSuplSettingsEngine()"; + } +//----------------------------------------------------------------- +//PosSuplSettingsEngine::suplServerList +//----------------------------------------------------------------- +int PosSuplSettingsEngine::suplServerList(QList& serverList) + { + qDebug() << "+ PosSuplSettingsEngine::suplServerList()"; + int result = 0; + //Clear the server list to remove any junk + //serverList.clear(); + if (d_ptr) + { + result = d_ptr->GetServerList(serverList); + } + qDebug() << "- PosSuplSettingsEngine::suplServerList() result = %d" << result; + return result; + } + +//----------------------------------------------------------------- +//PosSuplSettingsEngine::deletableServerList +//----------------------------------------------------------------- +int PosSuplSettingsEngine::deletableServerList( + QList& serverList) + { + qDebug() << "+ PosSuplSettingsEngine::deletableServerList()"; + int result = 0; + //Clear the server list to remove any junk + serverList.clear(); + if (d_ptr) + { + result = d_ptr->GetRemovableServerList(serverList); + } + qDebug() << "- PosSuplSettingsEngine::deletableServerList() result =%d" << result; + return result; + } +//----------------------------------------------------------------- +//PosSuplSettingsEngine::enableServer +//----------------------------------------------------------------- +int PosSuplSettingsEngine::enableServer(int serverIndex, bool value) + { + qDebug() << "+ PosSuplSettingsEngine::enableServer()"; + int result = 0; + if (d_ptr) + { + result = d_ptr->SetServerStatus(serverIndex, value); + } + qDebug() << "- PosSuplSettingsEngine::enableServer() result =%d" << result; + return result; + } +//----------------------------------------------------------------- +//PosSuplSettingsEngine::deleteServer +//----------------------------------------------------------------- +int PosSuplSettingsEngine::deleteServer(int serverIndex) + { + qDebug() << "+ PosSuplSettingsEngine::deleteServer()"; + int result = 0; + if (d_ptr) + { + result = d_ptr->RemoveServer(serverIndex); + } + qDebug() << "- PosSuplSettingsEngine::deleteServer() result =%d" << result; + //Check where to return KErrPermissionDenied + return result; + } +//----------------------------------------------------------------- +//PosSuplSettingsEngine::handleSuplSettingsChange +//----------------------------------------------------------------- +void PosSuplSettingsEngine::handleSuplSettingsChange( + MSuplSettingsObserver::TSuplSettingsEventType /*event*/, int /**slpId*/) + { + qDebug() << "+ PosSuplSettingsEngine::handleSuplSettingsChange()"; + emit serverListUpdated(); + qDebug() << "- PosSuplSettingsEngine::handleSuplSettingsChange()"; + } + diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/possuplsettingsplugin/src/possuplsettingsengineprivate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/possuplsettingsplugin/src/possuplsettingsengineprivate.cpp Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,259 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Implementation of positioning settings engine private class. + * + */ +#include "possuplsettingsengineprivate.h" + +#include +#include +#include + +//--------------------------------------------------------------------- +// PosSuplSettingsEnginePrivate::PosSuplSettingsEnginePrivate() +// (other items were commented in a header). +//--------------------------------------------------------------------- +PosSuplSettingsEnginePrivate::PosSuplSettingsEnginePrivate() : + mPosSuplSettingsObserver(NULL), mSuplSettings(NULL) + { + QT_TRAP_THROWING( mSuplSettings = CSuplSettings::NewL(); + mSuplSettings->SetObserverL(*this); + ); + } + +//--------------------------------------------------------------------- +// PosSuplSettingsEnginePrivate::~PosSuplSettingsEnginePrivate() +// (other items were commented in a header). +//--------------------------------------------------------------------- +PosSuplSettingsEnginePrivate::~PosSuplSettingsEnginePrivate() + { + + + mServerList.ResetAndDestroy(); + + if (mSuplSettings) + { + mSuplSettings->RemoveObserver(); + delete mSuplSettings; + mSuplSettings = NULL; + } + } + +//--------------------------------------------------------------------- +// PosSuplSettingsEnginePrivate::GetServerList() +// (other items were commented in a header). +//--------------------------------------------------------------------- +int PosSuplSettingsEnginePrivate::GetServerList( + QList & aParamValues) + { + TInt64 slpId; + HBufC* serverAddress = HBufC::New(KMaxHSLPAddrLen); + HBufC* iapName = HBufC::New(KMaxIAPLen); + TBool serverEnabled; + TBool simChangeRemove; + TBool usageInHomeNw; + TBool editable; + + if (!serverAddress || !iapName) + { + delete serverAddress; + delete iapName; + return KErrNoMemory; + } + + mServerList.ResetAndDestroy(); + + TInt error = mSuplSettings->GetAllSlp(mServerList); //handle return value... + if (error!=KErrNone) + { + delete serverAddress; + delete iapName; + mServerList.Close(); + mServerList.ResetAndDestroy(); + return error; + } + + TInt count = mServerList.Count(); + for(TInt i = 0; i < count; ++i ) + { + PosServerParams params; + error = mServerList[i]->Get( + slpId, + serverAddress->Des(), + iapName->Des(), + serverEnabled, + simChangeRemove, + usageInHomeNw, + editable); + + if (error == 0) + { +// QString sName((QChar*) (serverAddress->Ptr()), +// serverAddress->Length()); + + QString sName = QString::fromUtf16(serverAddress->Ptr(), serverAddress->Length()); + + params.slpId = slpId; + params.serverAdd = sName; + params.serverEnabled = serverEnabled; + + aParamValues.append(params); + } + } + + delete serverAddress; + delete iapName; + + return KErrNone; + } + +//--------------------------------------------------------------------- +// PosSuplSettingsEnginePrivate::SetServerStatus() +// (other items were commented in a header). +//--------------------------------------------------------------------- +int PosSuplSettingsEnginePrivate::SetServerStatus(int aSlpId, bool aEnableFlg) + { + return (mSuplSettings->SetServerEnabledFlag(aSlpId, aEnableFlg)); + } + + +//--------------------------------------------------------------------- +// PosSuplSettingsEnginePrivate::RemoveServer() +// (other items were commented in a header). +//--------------------------------------------------------------------- +int PosSuplSettingsEnginePrivate::RemoveServer(int aSlpId) + { + return (mSuplSettings->RemoveServer(aSlpId)); + } + +//--------------------------------------------------------------------- +// PosSuplSettingsEnginePrivate::GetRemovableServerList() +// (other items were commented in a header). +//--------------------------------------------------------------------- +int PosSuplSettingsEnginePrivate::GetRemovableServerList(QList< + PosServerParams>& aParamValues) + { + qDebug() << "+ PosSuplSettingsEnginePrivate::getRemovableServerList()"; + TInt64 slpId; + HBufC* serverAddress = HBufC::New(KMaxHSLPAddrLen); + HBufC* iapName = HBufC::New(KMaxIAPLen); + TBool serverEnabled; + TBool simChangeRemove; + TBool usageInHomeNw; + TBool editable; + TBool productConfigured; + + if (!serverAddress || !iapName) + { + delete serverAddress; + delete iapName; + return KErrNoMemory; + } + + mServerList.ResetAndDestroy(); + + TInt error = mSuplSettings->GetAllSlp(mServerList); //handle return value... + if (error!=KErrNone) + { + delete serverAddress; + delete iapName; + mServerList.Close(); + mServerList.ResetAndDestroy(); + return error; + } + + TInt count = mServerList.Count(); + qDebug() << "Deleteable server list count = " << count; + for(TInt i = 0; i < count; ++i ) + { + + PosServerParams params; + error = mServerList[i]->Get(slpId, + serverAddress->Des(), + iapName->Des(), + serverEnabled, + simChangeRemove, + usageInHomeNw, + editable); + TInt err = mServerList[i]->GetServerConfigurationType(productConfigured); + qDebug()<< "GetServerConfigurationType returns error = "<< err; + if (error == 0) + { + QString sName = QString::fromUtf16(serverAddress->Ptr(), serverAddress->Length()); + + params.slpId = slpId; + params.serverAdd = sName; + params.serverEnabled = serverEnabled; + + if (!productConfigured) + { + aParamValues.append(params); + } + } + } + + delete serverAddress; + delete iapName; + qDebug() << "- PosSuplSettingsEnginePrivate::getRemovableServerList()"; + return KErrNone; + + } + +//--------------------------------------------------------------------- +// PosSuplSettingsEnginePrivate::SetObserver() +// (other items were commented in a header). +//--------------------------------------------------------------------- +int PosSuplSettingsEnginePrivate::SetObserver( + PosSuplSettingsChangeObserver* aObserver) + { + TInt ret; + if (!mPosSuplSettingsObserver) + { + mPosSuplSettingsObserver = aObserver; + ret = KErrNone; + } + else + { + ret = KErrAlreadyExists; + } + return ret; + } + +//--------------------------------------------------------------------- +// PosSuplSettingsEnginePrivate::HandleSuplSettingsChangeL() +// (other items were commented in a header). +//--------------------------------------------------------------------- +void PosSuplSettingsEnginePrivate::HandleSuplSettingsChangeL( + MSuplSettingsObserver::TSuplSettingsEventType aEvent, TInt aSlpId) + { + if (aEvent == MSuplSettingsObserver::ESuplSettingsDBAddEvent || aEvent + == MSuplSettingsObserver::ESuplSettingsDBDeleteEvent) + { + if (mPosSuplSettingsObserver) + { + mPosSuplSettingsObserver->handleSuplSettingsChange(aEvent, aSlpId); + } + } + } + +//--------------------------------------------------------------------- +// PosSuplSettingsEnginePrivate::HandleSuplTriggerStatusChangeL() +// (other items were commented in a header). +//--------------------------------------------------------------------- +void PosSuplSettingsEnginePrivate::HandleSuplTriggerStatusChangeL( + CSuplSettings::TSuplTriggerStatus /*aSuplTriggerStatus*/) + { + } + +// End of file diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/rom/possettings.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/rom/possettings.iby Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __POSSETTINGS_IBY__ +#define __POSSETTINGS_IBY__ + +#ifdef __LOCATIONSYSUI + +#include +file=ABI_DIR\BUILD_DIR\possettingsengine.dll SHARED_LIB_DIR\possettingsengine.dll +file=ABI_DIR\BUILD_DIR\possettingsplugin.dll SHARED_LIB_DIR\possettingsplugin.dll +file=ABI_DIR\BUILD_DIR\pospsysettings.dll SHARED_LIB_DIR\pospsysettings.dll +file=ABI_DIR\BUILD_DIR\possuplsettings.dll SHARED_LIB_DIR\possuplsettings.dll +file=ABI_DIR\BUILD_DIR\poslocationservices.dll SHARED_LIB_DIR\poslocationservices.dll +data=DATAZ_\system\install\possettings_stub.sis system\install\possettings_stub.sis +data=\epoc32\data\c\resource\qt\plugins\controlpanel\possettingsplugin.qtplugin resource\qt\plugins\controlpanel\possettingsplugin.qtplugin +data=\epoc32\data\c\resource\qt\plugins\positioningsettings\pospsysettings.qtplugin resource\qt\plugins\positioningsettings\pospsysettings.qtplugin +data=\epoc32\data\c\resource\qt\plugins\positioningsettings\possuplsettings.qtplugin resource\qt\plugins\positioningsettings\possuplsettings.qtplugin +data=\epoc32\data\c\resource\qt\plugins\positioningsettings\poslocationservices.qtplugin resource\qt\plugins\positioningsettings\poslocationservices.qtplugin + +#endif // (__LOCATIONSYSUI) + +#endif diff -r 4c4ed41530db -r 73f6c2762ffe locationsystemui/locationsysui/possettings/rom/possettings_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/possettings/rom/possettings_resources.iby Thu May 27 13:18:17 2010 +0300 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Positioning Settings Resources iby file +* +*/ + + +#ifndef __POSSETTINGSPLUGIN_RESOURCES_IBY__ +#define __POSSETTINGSPLUGIN_RESOURCES_IBY__ + +#ifdef __LOCATIONSYSUI + +#include + +// <-- QT POSSETTINGS START --> +data=DATAZ_\QT_TRANSLATIONS_DIR\lilocationmw.qm QT_TRANSLATIONS_DIR\lilocationmw.qm +// <-- QT POSSETTINGS END --> + +#endif // (__LOCATIONSYSUI) + +#endif diff -r 4c4ed41530db -r 73f6c2762ffe supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplconnrequestor.cpp --- a/supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplconnrequestor.cpp Fri May 14 16:17:02 2010 +0300 +++ b/supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplconnrequestor.cpp Thu May 27 13:18:17 2010 +0300 @@ -115,7 +115,14 @@ // void COMASuplConnRequestor::CreateConnectionL() { - TBuf<100> iapName; + if(!iIsSettingInitilized) + { + iState = EInitialState; + InitilizeSetting(); + } + else + { + TBuf<100> iapName; TBuf<128> buffer; iState = EConnecting; TBool isIapDialogShown = EFalse; @@ -150,6 +157,7 @@ iObserver.OperationCompleteL(errorCode); } } + } // ----------------------------------------------------------------------------- // COMASuplConnRequestor::OpenConnection @@ -206,6 +214,7 @@ } else { + iState = EInitilizeSetting; InitilizeSetting(); } } @@ -253,6 +262,15 @@ switch(iState) { + + case EInitialState: + { + iIsSettingInitilized = ETrue; + iTrace->Trace(_L("Setting API Initilizing Completed..."), KTraceFileName, __LINE__); + CreateConnectionL(); + + break; + } case EConnecting: { @@ -355,7 +373,7 @@ void COMASuplConnRequestor::InitilizeSetting() { iTrace->Trace(_L("Intilizing Setting API..."), KTraceFileName, __LINE__); - iState = EInitilizeSetting; + iSuplSettings->Initialize(iStatus); SetActive(); } diff -r 4c4ed41530db -r 73f6c2762ffe supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplfallbackhandler.cpp --- a/supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplfallbackhandler.cpp Fri May 14 16:17:02 2010 +0300 +++ b/supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplfallbackhandler.cpp Thu May 27 13:18:17 2010 +0300 @@ -136,6 +136,47 @@ aTls = ETrue; aPskTls = EFalse; aIsIapDialogShown = ETrue; + + CServerParams* param = CServerParams::NewL(); + CleanupStack::PushL(param); + + //Find out if this alternative generated SUPL server is in the SUPL Settings list + TInt err = iSuplSettings.GetSlpInfoAddress(iGenratedHslpAddress, param); + if(err == KErrNotFound) + { + //Server does not exist + iTrace->Trace(_L("Server does not exist in list so adding it in."),KTraceFileName, __LINE__); + CServerParams* newParam=CServerParams::NewL(); + CleanupStack::PushL(newParam); + User::LeaveIfError(newParam->Set( iGenratedHslpAddress,iDefaultIAPName,ETrue,ETrue,ETrue,EFalse )); + + err = iSuplSettings.AddNewServer( newParam, aSLPId ); //Ignore error + LogBuffer.Copy(_L("AddNewServer() completed with err: ")); + LogBuffer.AppendNum(err); + iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); + + CleanupStack::PopAndDestroy(&newParam); + } + else + { + //Server exists, get the SLP ID and the IAP Access point for this server + HBufC* hslpAddress = HBufC::NewL(KHSLPAddressLength); + HBufC* iapName = HBufC::NewL(KMaxIapNameLength); + TBool serverEnabled; + TBool simChangeRemove; + TBool usageInHomeNw; + TBool editable; + + iTrace->Trace(_L("Server already exists, getting the SLP ID and Access Point."),KTraceFileName, __LINE__); + + param->Get(aSLPId,hslpAddress->Des(),iapName->Des(),serverEnabled,simChangeRemove,usageInHomeNw,editable); + aIAPName.Copy(iapName->Des()); + + delete hslpAddress; + delete iapName; + } + + CleanupStack::PopAndDestroy(¶m); iTrace->Trace(_L("Fallback allowed & TLSAuth failed"),KTraceFileName, __LINE__); iTrace->Trace(_L("Server being used:"),KTraceFileName, __LINE__); @@ -163,8 +204,8 @@ { return KErrNotFound; } - } - + } + //Check to see if the server list is empty. If it is create the HSLP Address from the IMSI and use that // as the server address. This does not add the server to the list and this functionality should only // be tried once @@ -192,10 +233,22 @@ iTrace->Trace(_L("iap being used:"),KTraceFileName, __LINE__); LogBuffer.Copy(aIAPName); iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); + + //Add the server to the list for future connections + CServerParams* param=CServerParams::NewL(); + CleanupStack::PushL(param); + User::LeaveIfError(param->Set( iGenratedHslpAddress,iDefaultIAPName,ETrue,ETrue,ETrue,EFalse )); + + TInt err = iSuplSettings.AddNewServer( param, aSLPId ); //Ignore error + LogBuffer.Copy(_L("AddNewServer() completed with err: ")); + LogBuffer.AppendNum(err); + iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); + + CleanupStack::PopAndDestroy(¶m); return KErrNone; } - + if( iSLPList->Count() <= 0 || iCurrentServerCounter >= iSLPList->Count() ) { LogBuffer.Copy(_L("No more servers available...")); diff -r 4c4ed41530db -r 73f6c2762ffe supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplprotocolmanager1.cpp --- a/supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplprotocolmanager1.cpp Fri May 14 16:17:02 2010 +0300 +++ b/supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplprotocolmanager1.cpp Thu May 27 13:18:17 2010 +0300 @@ -106,13 +106,21 @@ { iSettingsLauncher->CancelLaunch(); }*/ - iSuplSettings->SetUIActive( EFalse ); + + if(iSuplSettings) + { + iSuplSettings->SetUIActive( EFalse ); + } DeleteAllSessions(); iSuplSessions.Reset(); iSuplSessions.Close(); - iTelServer.UnloadPhoneModule(iTsyName); + //Only attempt to unload the phone if the TSY has actually been initialised + if(iTsyName.Length() > 0) + { + iTelServer.UnloadPhoneModule(iTsyName); + } iQueuedPacket.Close(); diff -r 4c4ed41530db -r 73f6c2762ffe supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplsession.cpp --- a/supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplsession.cpp Fri May 14 16:17:02 2010 +0300 +++ b/supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplsession.cpp Thu May 27 13:18:17 2010 +0300 @@ -4170,7 +4170,16 @@ HandleSuplInitErrorL(iNwInitCompletionCode); } else - InitializeL(iRequestID); + { + if (iRoaming) + HandleRoamingCheckCompleteL(KErrNone, EFalse); + else + { + iEtelRoamingCheck = ETrue; + iProtocolManager.CheckForRoaming(); + } + //InitializeL(iRequestID); + } /*} else if (usage == CSuplSettings::ESuplUsageHomeAutomatic || usage == CSuplSettings::ESuplUsageAlwaysAsk) @@ -4268,85 +4277,10 @@ { iUsageHomeNW = aHomeNw; iConnRequestor->UpdateSLPListForHomeUsage(iUsageHomeNW); - //CSuplSettings::TSuplSettingsUsage usage = iSuplSettings->SUPLUsage(); - - /*if (usage == CSuplSettings::ESuplUsageAlwaysAsk) - { - TInt err = KErrNone; - if (!aHomeNw) - { - //iTrace->Trace(_L("Invoking LaunchSuplUsageSettingsUI, user is roaming"), KTraceFileName, __LINE__); - //err = iProtocolManager.LaunchSuplUsageSettingsUI(this, ETrue); - } - else - { - //iTrace->Trace(_L("Invoking LaunchSuplUsageSettingsUI, user is not roaming"), KTraceFileName, __LINE__); - //err = iProtocolManager.LaunchSuplUsageSettingsUI(this, EFalse); - } - - if(KErrNone != err && KErrInUse == err) - { - iTrace->Trace(_L("Dialog in use, setting flag"), KTraceFileName, __LINE__); - SetSuplUsageFlag(); - } - if( KErrNone == err && iRequestType == ESUPL_NETWORK ) - { - iTrace->Trace(_L("Network Session , starting timer"), KTraceFileName, __LINE__); - COMASuplInit* suplInit = static_cast (iDecodedAsnMessage); - TOMASuplQop qop; - TInt retVal = suplInit->Qop(qop); - TInt delay; - qop.Delay(delay); - //if delay is > 7, it is not valid - if (delay > 7) - delay = 0; - if(retVal == KErrNone && delay > 0) - { - TReal delayReal; - Math::Pow(delayReal, 2, (TReal)delay); - delay = (TInt) delayReal; - TBuf<128> msg(_L("Delay present in message, value is = ")); - msg.AppendNum(delay); - iTrace->Trace(msg, KTraceFileName, __LINE__); - isTimeoutDialogTimerStarted = ETrue; - iDialogTimer->StartTimer(delay); - } - else - { - if (iSuplInitTimeOut > 0) - { - TBuf<256> msg(_L("Delay value in CR is")); - msg.AppendNum(iSuplInitTimeOut); - iTrace->Trace(msg, KTraceFileName, __LINE__); - iDialogTimer->StartTimer(iSuplInitTimeOut * KSecond); - isTimeoutDialogTimerStarted = ETrue; - } - else - iTrace->Trace(_L("Timeout is <= 0"), KTraceFileName, __LINE__); - } - iDlgStartTime.HomeTime(); - } - else if (KErrNone != err) - { - iTrace->Trace(_L("Invoking HandleSuplErrorL"), KTraceFileName, __LINE__); - HandleSuplErrorL(err); - } - - }*/ - //else if (usage == CSuplSettings::ESuplUsageHomeAutomatic) - //{ - //if (!aHomeNw) - // { - //TInt err = KErrNone; - //if (!iSuplSettings->IsUIActive() ) - { - //iTrace->Trace(_L("Invoking LaunchSuplUsageSettingsUI, user is roaming"), KTraceFileName, __LINE__); - //err = iProtocolManager.LaunchSuplUsageSettingsUI(this, ETrue); if(iSuplMsgType == ESUPL_INIT) { iTrace->Trace(_L("Dialog timer started"), KTraceFileName, __LINE__); - COMASuplInit* suplInit = static_cast (iDecodedAsnMessage); TOMASuplQop qop; TInt retVal = suplInit->Qop(qop); @@ -4377,19 +4311,6 @@ iTrace->Trace(_L("Timeout is <= 0"), KTraceFileName, __LINE__); } } - } - - /* if(!iSuplSettings->IsUIActive() && KErrNone != err) - { - SetSuplUsageFlag(); - } - else - { - iTrace->Trace(_L("Invoking HandleSuplErrorL"), KTraceFileName, __LINE__); - HandleSuplErrorL(err); - }*/ - - if (iNwInitError) { @@ -4397,13 +4318,15 @@ HandleSuplInitErrorL(iNwInitCompletionCode); } else - InitializeL(iRequestID); - + { + iTrace->Trace(_L("COMASuplSession::InitializeL called after roaming check"), KTraceFileName, __LINE__); + InitializeL(iRequestID); + } } - else - { - iSessionObserver.TerminateSession(this, KErrGeneral); - } + else + { + iSessionObserver.TerminateSession(this, KErrGeneral); + } } TInt COMASuplSession::SuplIpcSessionID() { diff -r 4c4ed41530db -r 73f6c2762ffe supl/locationomasuplprotocolhandler/protocolhandlerver2/inc/epos_comasuplconnrequestor.h --- a/supl/locationomasuplprotocolhandler/protocolhandlerver2/inc/epos_comasuplconnrequestor.h Fri May 14 16:17:02 2010 +0300 +++ b/supl/locationomasuplprotocolhandler/protocolhandlerver2/inc/epos_comasuplconnrequestor.h Thu May 27 13:18:17 2010 +0300 @@ -289,6 +289,8 @@ TBool iIsSettingInitilized; TInt64 iCurrentSLPId; + + TBool iTriggerSession; }; diff -r 4c4ed41530db -r 73f6c2762ffe supl/locationomasuplprotocolhandler/protocolhandlerver2/inc/epos_comasuplfallbackhandler.h --- a/supl/locationomasuplprotocolhandler/protocolhandlerver2/inc/epos_comasuplfallbackhandler.h Fri May 14 16:17:02 2010 +0300 +++ b/supl/locationomasuplprotocolhandler/protocolhandlerver2/inc/epos_comasuplfallbackhandler.h Thu May 27 13:18:17 2010 +0300 @@ -153,7 +153,6 @@ TTime iFallBackStartTime; TInt iAllowedFallBackTimerValue; - TBool iAttemptedBackupServer; }; diff -r 4c4ed41530db -r 73f6c2762ffe supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplconnrequestor.cpp --- a/supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplconnrequestor.cpp Fri May 14 16:17:02 2010 +0300 +++ b/supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplconnrequestor.cpp Thu May 27 13:18:17 2010 +0300 @@ -47,7 +47,8 @@ iCommMgr(aCommMgr), iProtocolManager(aProtoMgr), iPort(aPort), - iObserver( aObserver) + iObserver( aObserver), + iTriggerSession(EFalse) { } @@ -116,6 +117,14 @@ // void COMASuplConnRequestor::CreateConnectionL(TBool aTriggerSession) { + if(!iIsSettingInitilized) + { + iTriggerSession = aTriggerSession; + iState = EInitialState; + InitilizeSetting(); + } + else + { TBuf<100> iapName; TBuf<128> buffer; iState = EConnecting; @@ -159,6 +168,7 @@ iObserver.OperationCompleteL(errorCode); } } + } // ----------------------------------------------------------------------------- // COMASuplConnRequestor::OpenConnection @@ -215,6 +225,7 @@ } else { + iState = EInitilizeSetting; InitilizeSetting(); } } @@ -261,6 +272,14 @@ switch(iState) { + case EInitialState: + { + iIsSettingInitilized = ETrue; + iTrace->Trace(_L("Setting API Initilizing Completed..."), KTraceFileName, __LINE__); + CreateConnectionL(iTriggerSession); + + break; + } case EConnecting: { if(iLastConnectionError < 0) @@ -362,7 +381,7 @@ void COMASuplConnRequestor::InitilizeSetting() { iTrace->Trace(_L("Intilizing Setting API..."), KTraceFileName, __LINE__); - iState = EInitilizeSetting; + iSuplSettings->Initialize(iStatus); SetActive(); } diff -r 4c4ed41530db -r 73f6c2762ffe supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplfallbackhandler.cpp --- a/supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplfallbackhandler.cpp Fri May 14 16:17:02 2010 +0300 +++ b/supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplfallbackhandler.cpp Thu May 27 13:18:17 2010 +0300 @@ -115,11 +115,11 @@ { iTrace->Trace(_L("COMASuplFallBackHandler::GetNextSLPAddressL"),KTraceFileName, __LINE__); - _LIT(KFormatTxt,"%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B"); - - TBuf<256> LogBuffer; - - if( aLastErrorCode != KErrNone)// If its KErrNone then its means server name is asked first time and no need for Tls failure check + _LIT(KFormatTxt,"%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B"); + + TBuf<256> LogBuffer; + + if( aLastErrorCode != KErrNone)// If its KErrNone then its means server name is asked first time and no need for Tls failure check { if( CheckErrorCodeL(aLastErrorCode) ) @@ -135,6 +135,47 @@ aTls = ETrue; aPskTls = EFalse; aIsIapDialogShown = ETrue; + + CServerParams* param = CServerParams::NewL(); + CleanupStack::PushL(param); + + //Find out if this alternative generated SUPL server is in the SUPL Settings list + TInt err = iSuplSettings.GetSlpInfoAddress(iGenratedHslpAddress, param); + if(err == KErrNotFound) + { + //Server does not exist + iTrace->Trace(_L("Server does not exist in list so adding it in."),KTraceFileName, __LINE__); + CServerParams* newParam=CServerParams::NewL(); + CleanupStack::PushL(newParam); + User::LeaveIfError(newParam->Set( iGenratedHslpAddress,iDefaultIAPName,ETrue,ETrue,ETrue,EFalse )); + + err = iSuplSettings.AddNewServer( newParam, aSLPId ); //Ignore error + LogBuffer.Copy(_L("AddNewServer() completed with err: ")); + LogBuffer.AppendNum(err); + iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); + + CleanupStack::PopAndDestroy(&newParam); + } + else + { + //Server exists, get the SLP ID and the IAP Access point for this server + HBufC* hslpAddress = HBufC::NewL(KHSLPAddressLength); + HBufC* iapName = HBufC::NewL(KMaxIapNameLength); + TBool serverEnabled; + TBool simChangeRemove; + TBool usageInHomeNw; + TBool editable; + + iTrace->Trace(_L("Server already exists, getting the SLP ID and Access Point."),KTraceFileName, __LINE__); + + param->Get(aSLPId,hslpAddress->Des(),iapName->Des(),serverEnabled,simChangeRemove,usageInHomeNw,editable); + aIAPName.Copy(iapName->Des()); + + delete hslpAddress; + delete iapName; + } + + CleanupStack::PopAndDestroy(¶m); iTrace->Trace(_L("Fallback allowed & TLSAuth failed"),KTraceFileName, __LINE__); iTrace->Trace(_L("Server being used:"),KTraceFileName, __LINE__); @@ -162,138 +203,151 @@ { return KErrNotFound; } - } - - //Check to see if the server list is empty. If it is create the HSLP Address from the IMSI and use that - // as the server address. This does not add the server to the list and this functionality should only - // be tried once - if(iSLPList->Count() <= 0 && (!iAttemptedBackupServer)) - { - iTrace->Trace(_L("Going to create and use alternative HSLP Address from IMSI"),KTraceFileName, __LINE__); + } + + //Check to see if the server list is empty. If it is create the HSLP Address from the IMSI and use that + // as the server address. This does not add the server to the list and this functionality should only + // be tried once + if(iSLPList->Count() <= 0 && (!iAttemptedBackupServer)) + { + iTrace->Trace(_L("Going to create and use alternative HSLP Address from IMSI"),KTraceFileName, __LINE__); + + iAttemptedBackupServer = ETrue; + + //Generate the HSLP Address + GenerateHslpAddressFromIMSIL(); - iAttemptedBackupServer = ETrue; + //Copy the generated address into the supplied function arguments + aHslpToBeUsedAddress.Copy(iGenratedHslpAddress); + aIAPName.Zero(); + aIAPName.Copy(iDefaultIAPName); + aTls = ETrue; + aPskTls = EFalse; + aIsIapDialogShown = ETrue; + + iTrace->Trace(_L("Server being used:"),KTraceFileName, __LINE__); + LogBuffer.Copy(aHslpToBeUsedAddress); + iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); - //Generate the HSLP Address - GenerateHslpAddressFromIMSIL(); + iTrace->Trace(_L("iap being used:"),KTraceFileName, __LINE__); + LogBuffer.Copy(aIAPName); + iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); + + //Add the server to the list for future connections + CServerParams* param=CServerParams::NewL(); + CleanupStack::PushL(param); + User::LeaveIfError(param->Set( iGenratedHslpAddress,iDefaultIAPName,ETrue,ETrue,ETrue,EFalse )); + + TInt err = iSuplSettings.AddNewServer( param, aSLPId ); //Ignore error + LogBuffer.Copy(_L("AddNewServer() completed with err: ")); + LogBuffer.AppendNum(err); + iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); + + CleanupStack::PopAndDestroy(¶m); - //Copy the generated address into the supplied function arguments - aHslpToBeUsedAddress.Copy(iGenratedHslpAddress); - aIAPName.Zero(); - aIAPName.Copy(iDefaultIAPName); - aTls = ETrue; - aPskTls = EFalse; - aIsIapDialogShown = ETrue; - - iTrace->Trace(_L("Server being used:"),KTraceFileName, __LINE__); - LogBuffer.Copy(aHslpToBeUsedAddress); - iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); - - iTrace->Trace(_L("iap being used:"),KTraceFileName, __LINE__); - LogBuffer.Copy(aIAPName); - iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); - - return KErrNone; - } - - if( iSLPList->Count() <= 0 || iCurrentServerCounter >= iSLPList->Count() ) + return KErrNone; + } + + if( iSLPList->Count() <= 0 || iCurrentServerCounter >= iSLPList->Count() ) + { + LogBuffer.Copy(_L("No more servers available...")); + iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); + return KErrNotFound; + } + + iTrace->Trace(_L("Trying next server..."),KTraceFileName, __LINE__); + + //Fallback Timer... + if(aLastErrorCode == KErrNone) //This means, server name is asked for first time only... + { + iTrace->Trace(_L("Start Time: "),KTraceFileName, __LINE__); + iFallBackStartTime.HomeTime(); + LogBuffer.Zero(); + iFallBackStartTime.FormatL(LogBuffer,KFormatTxt); + iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); + } + else + { + TTime currentTime; + currentTime.HomeTime(); + TTimeIntervalMicroSeconds diff = currentTime.MicroSecondsFrom(iFallBackStartTime); + + + iTrace->Trace(_L("Current Time: "),KTraceFileName, __LINE__); + LogBuffer.Zero(); + currentTime.FormatL(LogBuffer,KFormatTxt); + iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); + + LogBuffer.Copy(_L("Difference between time: ")); + LogBuffer.AppendNum(diff.Int64()); + iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); + + if( diff.Int64() > iAllowedFallBackTimerValue) { - LogBuffer.Copy(_L("No more servers available...")); - iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); - return KErrNotFound; + LogBuffer.Copy(_L("Timeout happened...")); + iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); + + return KErrTimedOut; } - - iTrace->Trace(_L("Trying next server..."),KTraceFileName, __LINE__); - - //Fallback Timer... - if(aLastErrorCode == KErrNone) //This means, server name is asked for first time only... - { - iTrace->Trace(_L("Start Time: "),KTraceFileName, __LINE__); - iFallBackStartTime.HomeTime(); - LogBuffer.Zero(); - iFallBackStartTime.FormatL(LogBuffer,KFormatTxt); - iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); - } - else + } + + if(aLastErrorCode == KErrNone) //This will be called only once...for first time only + { + aSLPId = (*iSLPList)[0].iSLPId; + aHslpToBeUsedAddress.Copy((*iSLPList)[0].iHSLPAddress); + aIAPName.Copy((*iSLPList)[0].iIapName); + aTls = (*iSLPList)[0].iTls; + aPskTls = (*iSLPList)[0].iPskTls; + aIsIapDialogShown = (*iSLPList)[0].iIsIAPDialgShown; + iCurrentServerCounter++; + + iTrace->Trace(_L("Server being used:"),KTraceFileName, __LINE__); + LogBuffer.Copy(aHslpToBeUsedAddress); + iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); + + iTrace->Trace(_L("iap being used:"),KTraceFileName, __LINE__); + LogBuffer.Copy(aIAPName); + iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); + + iTrace->Trace(_L("iap dlg configuration:"),KTraceFileName, __LINE__); + LogBuffer.Delete(0,256); + LogBuffer.AppendNum(aIsIapDialogShown); + iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); + + return KErrNone; + } + else + { + if(iIsFallBackAllowed && CheckErrorCodeL(aLastErrorCode))// Do not fallback in case if IMSI generated address failed for previous try. { - TTime currentTime; - currentTime.HomeTime(); - TTimeIntervalMicroSeconds diff = currentTime.MicroSecondsFrom(iFallBackStartTime); - - - iTrace->Trace(_L("Current Time: "),KTraceFileName, __LINE__); - LogBuffer.Zero(); - currentTime.FormatL(LogBuffer,KFormatTxt); - iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); - - LogBuffer.Copy(_L("Difference between time: ")); - LogBuffer.AppendNum(diff.Int64()); - iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); - - if( diff.Int64() > iAllowedFallBackTimerValue) - { - LogBuffer.Copy(_L("Timeout happened...")); - iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); - - return KErrTimedOut; - } - } - - if(aLastErrorCode == KErrNone) //This will be called only once...for first time only - { - aSLPId = (*iSLPList)[0].iSLPId; - aHslpToBeUsedAddress.Copy((*iSLPList)[0].iHSLPAddress); - aIAPName.Copy((*iSLPList)[0].iIapName); - aTls = (*iSLPList)[0].iTls; - aPskTls = (*iSLPList)[0].iPskTls; - aIsIapDialogShown = (*iSLPList)[0].iIsIAPDialgShown; - iCurrentServerCounter++; - + aSLPId = (*iSLPList)[iCurrentServerCounter].iSLPId; + aHslpToBeUsedAddress.Copy((*iSLPList)[iCurrentServerCounter].iHSLPAddress); + aIAPName.Copy((*iSLPList)[iCurrentServerCounter].iIapName); + aTls = (*iSLPList)[iCurrentServerCounter].iTls; + aPskTls = (*iSLPList)[iCurrentServerCounter].iPskTls; + aIsIapDialogShown = (*iSLPList)[iCurrentServerCounter].iIsIAPDialgShown; + iCurrentServerCounter++; + iTrace->Trace(_L("Fallback allowed & TLSAuth passed"),KTraceFileName, __LINE__); iTrace->Trace(_L("Server being used:"),KTraceFileName, __LINE__); LogBuffer.Copy(aHslpToBeUsedAddress); iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); - + iTrace->Trace(_L("iap being used:"),KTraceFileName, __LINE__); LogBuffer.Copy(aIAPName); iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); - + iTrace->Trace(_L("iap dlg configuration:"),KTraceFileName, __LINE__); LogBuffer.Delete(0,256); LogBuffer.AppendNum(aIsIapDialogShown); iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); - return KErrNone; } else { - if(iIsFallBackAllowed && CheckErrorCodeL(aLastErrorCode))// Do not fallback in case if IMSI generated address failed for previous try. - { - aSLPId = (*iSLPList)[iCurrentServerCounter].iSLPId; - aHslpToBeUsedAddress.Copy((*iSLPList)[iCurrentServerCounter].iHSLPAddress); - aIAPName.Copy((*iSLPList)[iCurrentServerCounter].iIapName); - aTls = (*iSLPList)[iCurrentServerCounter].iTls; - aPskTls = (*iSLPList)[iCurrentServerCounter].iPskTls; - aIsIapDialogShown = (*iSLPList)[iCurrentServerCounter].iIsIAPDialgShown; - iCurrentServerCounter++; - iTrace->Trace(_L("Fallback allowed & TLSAuth passed"),KTraceFileName, __LINE__); - iTrace->Trace(_L("Server being used:"),KTraceFileName, __LINE__); - LogBuffer.Copy(aHslpToBeUsedAddress); - iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); - - iTrace->Trace(_L("iap being used:"),KTraceFileName, __LINE__); - LogBuffer.Copy(aIAPName); - iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); - - iTrace->Trace(_L("iap dlg configuration:"),KTraceFileName, __LINE__); - LogBuffer.Delete(0,256); - LogBuffer.AppendNum(aIsIapDialogShown); - iTrace->Trace(LogBuffer,KTraceFileName, __LINE__); - return KErrNone; - } - else - { - return KErrNotFound; - } + return KErrNotFound; } + } + } // ----------------------------------------------------------------------------- diff -r 4c4ed41530db -r 73f6c2762ffe supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplprotocolmanager2.cpp --- a/supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplprotocolmanager2.cpp Fri May 14 16:17:02 2010 +0300 +++ b/supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplprotocolmanager2.cpp Thu May 27 13:18:17 2010 +0300 @@ -108,13 +108,21 @@ { iSettingsLauncher->CancelLaunch(); }*/ - iSuplSettings->SetUIActive( EFalse ); + + if(iSuplSettings) + { + iSuplSettings->SetUIActive( EFalse ); + } DeleteAllSessions(); iSuplSessions.Reset(); iSuplSessions.Close(); + //Only attempt to unload the phone if the TSY has actually been initialised + if(iTsyName.Length() > 0) + { iTelServer.UnloadPhoneModule(iTsyName); + } iQueuedPacket.Close(); diff -r 4c4ed41530db -r 73f6c2762ffe supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplsession2.cpp --- a/supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplsession2.cpp Fri May 14 16:17:02 2010 +0300 +++ b/supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplsession2.cpp Thu May 27 13:18:17 2010 +0300 @@ -4767,10 +4767,16 @@ HandleSuplInitErrorL(iNwInitCompletionCode); } else - { - iTrace->Trace(_L("CheckForSuplUsageL, Initializing"), KTraceFileName, __LINE__); - InitializeL(iRequestID); - } + { + if (iRoaming) + HandleRoamingCheckCompleteL(KErrNone, EFalse); + else + { + iEtelRoamingCheck = ETrue; + iProtocolManager.CheckForRoaming(); + } + //InitializeL(iRequestID); + } /*} else if (usage == CSuplSettings::ESuplUsageHomeAutomatic || usage == CSuplSettings::ESuplUsageAlwaysAsk) diff -r 4c4ed41530db -r 73f6c2762ffe supl/locationomasuplprotocolhandler/provisioninghandler/group/epos_omasuplprovhandler.mmp --- a/supl/locationomasuplprotocolhandler/provisioninghandler/group/epos_omasuplprovhandler.mmp Fri May 14 16:17:02 2010 +0300 +++ b/supl/locationomasuplprotocolhandler/provisioninghandler/group/epos_omasuplprovhandler.mmp Thu May 27 13:18:17 2010 +0300 @@ -60,8 +60,9 @@ LIBRARY euser.lib LIBRARY provisioningengine.lib LIBRARY bafl.lib -LIBRARY apengine.lib + LIBRARY commdb.lib LIBRARY centralrepository.lib LIBRARY epos_csuplutils.lib LIBRARY epos_suplsettings.lib +LIBRARY cmmanager.lib \ No newline at end of file diff -r 4c4ed41530db -r 73f6c2762ffe supl/locationomasuplprotocolhandler/provisioninghandler/src/epos_comasuplsettings.cpp --- a/supl/locationomasuplprotocolhandler/provisioninghandler/src/epos_comasuplsettings.cpp Fri May 14 16:17:02 2010 +0300 +++ b/supl/locationomasuplprotocolhandler/provisioninghandler/src/epos_comasuplsettings.cpp Thu May 27 13:18:17 2010 +0300 @@ -30,6 +30,11 @@ #include "epos_omasuplprovhandler.hrh" #include +#include +#include +#include +#include + _LIT( KTraceSuplSettings, "epos_comasuplsettings.cpp" ); @@ -146,12 +151,59 @@ // TUint32 COMASuplSettings::IapIdFromWapIdL( TUint32 aWapId ) const { - CApUtils* apUtils = CApUtils::NewLC( *iCommsDb ); + /*CApUtils* apUtils = CApUtils::NewLC( *iCommsDb ); TUint32 iapId = NULL; iapId = apUtils->IapIdFromWapIdL( aWapId ); __ASSERT_ALWAYS( iapId, Panic( SuplAdapterInvalidId ) ); CleanupStack::PopAndDestroy( apUtils ); return iapId; + return ;*/ + + RCmManagerExt cmManager; + cmManager.OpenLC(); // CS:1 + RArray iapIds; + TUint32 iapId( 0 ); + + // First get all free IAP ID's. + cmManager.ConnectionMethodL( iapIds ); + CleanupClosePushL( iapIds ); // CS:2 + + // Then get IAP ID's from all destinations. + RArray destIds; + cmManager.AllDestinationsL( destIds ); + CleanupClosePushL( destIds ); // CS:3 + TInt destCount = destIds.Count(); + for ( TInt destIndex = 0; destIndex < destCount; destIndex++ ) + { + RCmDestinationExt dest = cmManager.DestinationL( + destIds[destIndex] ); + CleanupClosePushL( dest ); // CS:4 + TInt cmCount = dest.ConnectionMethodCount(); + for ( TInt cmIndex = 0; cmIndex < cmCount; cmIndex++ ) + { + TUint32 apId = dest.ConnectionMethodL( + cmIndex ).GetIntAttributeL( CMManager::ECmIapId ); + iapIds.AppendL( apId ); + } + CleanupStack::PopAndDestroy( &dest ); // CS:3 + } + // Finally, go through all connection methods and find correct IAP ID. + const TInt cmCount = iapIds.Count(); + for ( TInt counter = 0; counter < cmCount; counter++ ) + { + TUint32 id = cmManager.GetConnectionMethodInfoIntL( + iapIds[counter], CMManager::ECmWapId ); + if ( id == aWapId ) + { + iapId = iapIds[counter]; + // No need to go through rest of IAPs. + break; + } + } + // PopAndDestroy destIds, iapIds, cmManager. + CleanupStack::PopAndDestroy( 3, &cmManager ); // CS:0 + return iapId; + } diff -r 4c4ed41530db -r 73f6c2762ffe supl/locationomasuplprotocolhandler/rom/omasuplprotocolhandler.iby --- a/supl/locationomasuplprotocolhandler/rom/omasuplprotocolhandler.iby Fri May 14 16:17:02 2010 +0300 +++ b/supl/locationomasuplprotocolhandler/rom/omasuplprotocolhandler.iby Thu May 27 13:18:17 2010 +0300 @@ -65,8 +65,8 @@ #endif // __SYNCML_DM // Notifier -ECOM_PLUGIN(epos_omasuplnotifierplugin.dll,epos_omasuplnotifierplugin.rsc) -file=ABI_DIR\BUILD_DIR\epos_omasuplnotifier.dll SHARED_LIB_DIR\epos_omasuplnotifier.dll +//ECOM_PLUGIN(epos_omasuplnotifierplugin.dll,epos_omasuplnotifierplugin.rsc) +//file=ABI_DIR\BUILD_DIR\epos_omasuplnotifier.dll SHARED_LIB_DIR\epos_omasuplnotifier.dll // Storage Db Backup Registration File data=DATAZ_\private\1027509E\backup_registration.xml \private\1027509E\backup_registration.xml #endif //__OMA_SUPL_PLUGINS diff -r 4c4ed41530db -r 73f6c2762ffe supl/locationomasuplprotocolhandler/rom/omasuplprotocolhandler_resource.iby --- a/supl/locationomasuplprotocolhandler/rom/omasuplprotocolhandler_resource.iby Fri May 14 16:17:02 2010 +0300 +++ b/supl/locationomasuplprotocolhandler/rom/omasuplprotocolhandler_resource.iby Thu May 27 13:18:17 2010 +0300 @@ -29,7 +29,7 @@ #ifdef __OMA_SUPL_PLUGINS //Resource file for notifier -data=DATAZ_\resource\epos_omasuplnotifier.rsc resource\epos_omasuplnotifier.rsc +//data=DATAZ_\resource\epos_omasuplnotifier.rsc resource\epos_omasuplnotifier.rsc #endif //__OMA_SUPL_PLUGINS #endif // OMASUPLPROTOCOLHANDLER_RESOURCE_IBY